Comments (24)
Not sure why this if failing in your case.
Just tried successfully the following command-line as admin and regular user on Windows 10 64bit:
C:\Users\rsync-test\Downloads\rsync4j-3.1.2-5\lib>java -cp ".\*" com.github.fracpete.rsync4j.RSync -r C:\Users\rsync-test\Downloads\weka-3-8-2 C:\Users\rsync-test\Downloads\weka-3-8-2-test\
NB: I downloaded a Weka release zip file and extracted it only to have something to copy recursively.
More details about user, command-line, java-version?
from rsync4j.
We are getting this error while copying the dlls to home directory
Tried both as admin and non-admin user, Java version is 1.8 and I have added your maven dependency and tried using Rsync class
from rsync4j.
Are any DLLs/executables copied into the C:\Users\XXXXXXXXX\rsync4j\bin
directory at all? I'm on Linux and don't access to Windows Server, to see whether there is something funny going on with the permissions in your home directories. Are group policies prohibiting copying files in there? If you copy all the DLLs/executables (see here) manually into a directory in your home directory, can you then execute the rsync.exe
executable?
from rsync4j.
they are being copied but with 0-byte size.Yeah after copying them manually, I can execute the rsync.exe.
from rsync4j.
Seems odd that you can copy them manually, but it fails when the process launched by your user can't. What are the permissions for that directory?
from rsync4j.
Managed to get access to a Windows Server 2012 R2 machine. Worked just fine. So not just sure what the problem is on your machine.
However, I've made a new release which allows you to specify on Windows the rsync4j home directory via the RSYNC4J_HOME
environment variable. That way, you should be able to set up a directory with correct permissions and then just use rsync4j as is, without manual copying of files.
from rsync4j.
Thank you, But this didn't help too. Same issue not able to copy the binaries.
Copying failed!
java.io.IOException: Stream closed
at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:159) ~[na:1.8.0_144]
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) ~[na:1.8.0_144]
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286) ~[na:1.8.0_144]
at java.io.BufferedInputStream.read(BufferedInputStream.java:345) ~[na:1.8.0_144]
at java.io.FilterInputStream.read(FilterInputStream.java:107) ~[na:1.8.0_144]
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1719) ~[commons-io-2.3.jar!/:2.3]
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1696) ~[commons-io-2.3.jar!/:2.3]
at org.apache.commons.io.IOUtils.copy(IOUtils.java:1671) ~[commons-io-2.3.jar!/:2.3]
at com.github.fracpete.rsync4j.Binaries.copyResourceTo(Binaries.java:117) [rsync4j-3.1.2-6.jar!/:na]
at com.github.fracpete.rsync4j.Binaries.extractBinaries(Binaries.java:200) [rsync4j-3.1.2-6.jar!/:na]
at com.github.fracpete.rsync4j.Binaries.rsyncBinary(Binaries.java:237) [rsync4j-3.1.2-6.jar!/:na]
at com.github.fracpete.rsync4j.RSync.commandLineArgs(RSync.java:1752) [rsync4j-3.1.2-6.jar!/:na]
from rsync4j.
Did you create the directory beforehand? What are the permissions of the generated directory? Since I cannot replicate this issue on the Windows installations that I have access to, there isn't much I can do.
from rsync4j.
BTW Are you using Oracle's Java 1.8?
from rsync4j.
I have tried both ways, creating directory beforehand and running the rsync. and let rsync create the folder.both ways it failed. Yeah I'm using Oracles Java 1.8 .
I'm running this from a Jar file. I have your Maven dependency in my pom . from the jar file I'm getting this error when its trying to copy. Sorry if I didn't mention this earlier.
from rsync4j.
What are the effective permissions on that directory?
from rsync4j.
The user has Admin Access with full control over the system.
from rsync4j.
Do you have the same permissions like this:
from rsync4j.
Yeah , Correct. I have the same permission. Have you tried this Rsync running from a Jar file?
from rsync4j.
I used the rsync4j artifact successfully in a Windows 64bit production machine without any problems (as part of a larger project). On the Windows 2012 Server machine, used the command-line that I posted earlier.
from rsync4j.
Great, I'm not sure what the issue is. I have forked your project and I'll try making changes to it. I'll update you if that works. Thanks for your help.
from rsync4j.
Yes, it's really bizarre... Did the command-line that I posted actually work for you? Also, how do you build your final jar: are you using a shader plugin or something similar to create just a single jar?
from rsync4j.
When I run your project as standalone with the main method, It worked fine. I'm building jar using Jenkins. Which isn't working.
from rsync4j.
Jenkins won't be the issues as I use that as well. Does your final jar contain all dependencies as nested jars or do you unzip all dependencies into the final jar?
from rsync4j.
My final jar contains all dependencies as a nested jar.
from rsync4j.
That being the only difference, this must the issue then.
from rsync4j.
In the Binaries
class, change line 112 to this:
is = Binaries.class.getClassLoader().getResourceAsStream(resource);
Does that fix your problem?
Based on this answer on stackoverflow.
from rsync4j.
Can you make a release of the above change? I have tested locally (not from jar) it works as like the old one. If you can update it, I can directly include the above maven dependency
from rsync4j.
Also successfully tested it from a jar generated by spring-boot-maven-plugin
, which includes all its dependencies within an executable jar. Just made a new release: 3.1.2-7
Thanks for your help in sorting this out.
from rsync4j.
Related Issues (20)
- rsync 3.2.7 HOT 2
- rsync4j in Apache Karaf HOT 2
- Update OpenSSH to 9.0 HOT 1
- Run rsync command using runtime in java HOT 2
- Apostrophe in username - Rsync fails HOT 2
- Spaces in the users username on a Windows machine HOT 4
- OpenSSH 9.1 HOT 1
- Make rsync path customizable HOT 8
- add support to parallel transfer HOT 1
- How to Use Rsync4j with Non-Standard Port HOT 17
- OpenSSH 9.4 HOT 1
- Is rsync copy only updated block of a file OR the whole file when file is exist on destination ? (Java jar) HOT 3
- Maven Release HOT 3
- Cannot use path like 'rsync://...' on Windows Machines HOT 7
- How to detect whether the rsync server can connect? HOT 10
- Can I use the MkPath command to create the directory of the rsync receiver? HOT 5
- Upgrade to OpenSSH 9.6 HOT 1
- OpenSSH 9.7 support HOT 1
- add support for rsync 3.3.0 HOT 1
- setTimeout(x) value doesn't work intermittently HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rsync4j.