Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Windows client appears mute #13

Closed
jmkgreen opened this issue Oct 13, 2013 · 19 comments
Closed

Windows client appears mute #13

jmkgreen opened this issue Oct 13, 2013 · 19 comments

Comments

@jmkgreen
Copy link

We built clients for both Linux and Windows. The Linux one behaves as expected, the Windows one does not print the results of commands at all.

The Windows client happily prints the help content and that of version, but does not print things like classpath contents.

Stepping through the server we can see both clients executing code as expected and both clients receive network traffic so we're a little puzzled why one prints the returned value but the other does not. Continuing to investigate this...

@jmkgreen
Copy link
Author

Incidentally we also tried the Windows binary as shipped by JRuby - again mute.

@martylamb
Copy link
Contributor

Thanks for looking into it! Please let me know what else you find.

@jmkgreen
Copy link
Author

I doubt you meant to close an issue that is current? Could you reopen please (I have no such button)?

@martylamb
Copy link
Contributor

Oops, your right. I did not mean to close it. Thanks.

@martylamb martylamb reopened this Oct 14, 2013
@azhuchkov
Copy link

Guys, any update on this issue?
I faced with this problem on Windows 7 x64 (I also tried it on Ubuntu 13.04 x64 and it works fine!). HelloWorld example doesn't print anything. It seems that client returns immediately and doesn't output stdout and stderr.
By the way I'm using 32-bit ng.exe (which was built by myself). Also tried to build x64 version but compiled executable doesn't work (particulary it just does nothing).

@azhuchkov
Copy link

I tried to debug C-source a little bit and it seems that inside processnailgunstream() socket returns only 1 byte instead of 5 (CHUNK_HEADER_LEN). And this byte is zero. To be continued...

@bouteill
Copy link

I am also having this issue (win7 64bits). Please help.... (thanks!)

@jimpurbrick
Copy link
Contributor

I've recently checked in a number of win32 fixes, do you have these problems with the current tip of master?

@jimpurbrick
Copy link
Contributor

Also, do the examples work for you? I tested the Heartbeat, Echo and HelloWorld examples on a 64 bit windows 7 box.

@bouteill
Copy link

When I launch the examples, nothing happens. Here is how I do this (to make sure I am doing this right):
In CMD line: I type:
java -jar nailgun-server-0.9.2-SNAPSHOT.jar
It then says: NGServer 0.9.2-SNAPSHOT started on all interfaces, port 2113.
So the server seems to start properly.
To launch the examples, I type (in a directory where the compiled examples JAR file is located):
ng nailgun-examples-0.9.2-SNAPSHOT.jar
And nothing happens.....
I also tried:
ng com.martiansoftware.nailgun.examples.HelloWorld.class
And nothing happens either. (I get a command prompt back, as if nothing had happened)

@azhuchkov
Copy link

It appears to work with latest changes from @jimpurbrick. Great job!!! Thanks!!! Tested on Echo and HelloWorld.
@bouteill Don't you forget to recompile ng.exe? AFAIK it was changed since then. I'm using GCC bundled with MsysGit - just add Msys's bin folder into your PATH and fire gcc -o ng.exe ng.c -lwsock32 -O3 -Wall -pedantic -s -O3.

By the way, the correct way to test is:
ng com.martiansoftware.nailgun.examples.HelloWorld (without .class)

@bouteill
Copy link

I downloaded the latest sources from github, recompiled using "mvn clean install" as stated in the startup manual.
I launched the server (new jar)
java -jar nailgun-server-0.9.2-SNAPSHOT.jar
It then says: NGServer 0.9.2-SNAPSHOT started on all interfaces, port 2113.
So the server seems to start properly.

I recompiled the ng.exe using the command above ( gcc -o ng.exe ng.c -lwsock32 -O3 -Wall -pedantic -s -O3 )
I used the recompiled examples as well and tried to launch the example HelloWorld
ng com.martiansoftware.nailgun.examples.HelloWorld (in the directory where nailgun-examples-0.9.2-SNAPSHOT.jar is located) and now get the following error message on the client side when attempting to launch the example:

java.lang.ClassNotFoundException: com.martiansoftware.nailgun.examples.HelloWorld
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.martiansoftware.nailgun.NGSession.run(NGSession.java:254)

And the server side says:
NGSession 1: (idle) disconnected

I am getting closer, I guess... Would anyone know what I am missing here?
Thank you for your help!!!

@bouteill
Copy link

PS: I also tried to run the client using the command:
ng ng-cp nailgun-examples-0.9.2-SNAPSHOT.jar com.martiansoftware.nailgun.examples.HelloWorld , but this time, I get no output...

@bouteill
Copy link

PS2: Nevermind, I think I got my solution. The proper way to launch the client on the examples is using the following command:
ng com.martiansoftware.nailgun.examples.HelloWorld -ng-cp nailgun-examples-0.9.2-SNAPSHOT.jar
Using this command, I get my "Hello, World" back ;)
(I am a novice, but I think this should be specified a little more clearly in the startup guide). Nevertheless, great job, and thank you for your help!)

@azhuchkov
Copy link

@bouteill you could avoid all that stuff with -ng-cp by running mvn exec:java -Dexec.mainClass=com.martiansoftware.nailgun.NGServer from nailgun-examples directory. It described at quickstart guide. Probably you missed it.
Anyway glad to hear that you found a proper solution.

@bouteill
Copy link

Well, I kind of like the idea to be able to separate:
(1) the initialization of the server, and
(2) running the examples on the client.
It is helpful in my opinion to give you an idea of how to run your own programs later on (which is not the case when one runs the mvn command)...

@jimpurbrick
Copy link
Contributor

Everyone happy with me closing this now?

@jmkgreen
Copy link
Author

Has there been a release? Or are you asking if you can mark this as fixed
rather than closed?

I've not had time to download and test yet.

On 13 November 2013 12:40, Jim Purbrick notifications@github.com wrote:

Everyone happy with me closing this now?


Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-28391093
.

@sbalabanov-zz
Copy link
Contributor

Closing all issues older than 6 months; please reopen if it is still relevant

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants