Code Monkey home page Code Monkey logo

Comments (24)

fracpete avatar fracpete commented on August 13, 2024

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.

viswanathareddy04 avatar viswanathareddy04 commented on August 13, 2024

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.

fracpete avatar fracpete commented on August 13, 2024

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.

viswanathareddy04 avatar viswanathareddy04 commented on August 13, 2024

they are being copied but with 0-byte size.Yeah after copying them manually, I can execute the rsync.exe.

from rsync4j.

fracpete avatar fracpete commented on August 13, 2024

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.

fracpete avatar fracpete commented on August 13, 2024

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.

viswanathareddy04 avatar viswanathareddy04 commented on August 13, 2024

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.

fracpete avatar fracpete commented on August 13, 2024

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.

fracpete avatar fracpete commented on August 13, 2024

BTW Are you using Oracle's Java 1.8?

from rsync4j.

viswanathareddy04 avatar viswanathareddy04 commented on August 13, 2024

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.

fracpete avatar fracpete commented on August 13, 2024

What are the effective permissions on that directory?

from rsync4j.

viswanathareddy04 avatar viswanathareddy04 commented on August 13, 2024

The user has Admin Access with full control over the system.

from rsync4j.

fracpete avatar fracpete commented on August 13, 2024

Do you have the same permissions like this:
security

from rsync4j.

viswanathareddy04 avatar viswanathareddy04 commented on August 13, 2024

Yeah , Correct. I have the same permission. Have you tried this Rsync running from a Jar file?

from rsync4j.

fracpete avatar fracpete commented on August 13, 2024

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.

viswanathareddy04 avatar viswanathareddy04 commented on August 13, 2024

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.

fracpete avatar fracpete commented on August 13, 2024

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.

viswanathareddy04 avatar viswanathareddy04 commented on August 13, 2024

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.

fracpete avatar fracpete commented on August 13, 2024

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.

viswanathareddy04 avatar viswanathareddy04 commented on August 13, 2024

My final jar contains all dependencies as a nested jar.

from rsync4j.

fracpete avatar fracpete commented on August 13, 2024

That being the only difference, this must the issue then.

from rsync4j.

fracpete avatar fracpete commented on August 13, 2024

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.

viswanathareddy04 avatar viswanathareddy04 commented on August 13, 2024

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.

fracpete avatar fracpete commented on August 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.