问题
Glassfish 4.0 final gives a timeout everytime I try to start it in Debug mode.
The normal run on server (from Eclipse) does work without a timeout.
I've tried running Glassfish 4.0 from Eclipse Juno and Eclipse Kepler, both have the correct port configuration for debugging (9009), both are failing to start Glassfish in debug.
Is this a known problem? How do I fix this?
回答1:
Yes, this is a known issue with the Glassfish 4.0 adapter in Eclipse.
Here is a workaround:
Shut down Eclipse, open a command line in the Glassfish server home directory and stop the domain:
asadmin stop-domain domain1
Start Eclipse, select 'Run \ Debug Configurations...' from the menu and bring up the 'Debug Configurations' dialog
Find the GlassFish 4.0 application server
Click on the 'Arguments' tab and change the VM argument to:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9009
Click 'Debug' to start Glassfish in debug mode, or use 'Debug On Server' from the servers view
回答2:
After installing the last update of Glassfish tools for Kepler I got some meanfull message which actually help me solve the problem and now I can run Glassfish in debug mode.
Here is my workaround:
Go to your .\glassfish4\glassfish\domains\domain1\config
folder.
Open domain.xml
file in any desired editor.
Navigate to ./domain/configs/config[name=server-config]/java-config
node.
You should have an attribute debug-options
as below:
debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,address=9009,server=y,suspend=n"
Remove " -Xrun" and it should look like:
debug-options="-Xdebugjdwp:transport=dt_socket,address=9009,server=y,suspend=n"
Save. Restart/start Eclipse Kepler and should be able to run Glassfish in debug mode again, if you had similar problem like mine.
Hope this helps.
回答3:
This issue has been fixed. The bug was reported here: http://java.net/jira/browse/GLASSFISHPLUGINS-370. You can update the plugin from update sites http://download.java.net/glassfish/eclipse/juno (or kepler). I think you have to remove all old run and debug configurations and maybe to re-register the GF runtime and server again.
来源:https://stackoverflow.com/questions/17083811/eclipse-glassfish-4-debugging-startup-timeout