0

IDE : Eclipse Luna, JDK & JRE : 1.8.0_25, Glassfish : Glassfish 4.0

I can start Glassfish Server externally. But when I deploy my project, Glassfish cannot start running or debugging from Eclipse.

Here is the log :

!ENTRY org.eclipse.ant.launching 4 120 2014-12-24 10:42:28.715
!MESSAGE Error logged from Ant UI: 
!STACK 0
java.net.SocketTimeoutException: Accept timed out
    at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
    at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
    at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
    at java.net.PlainSocketImpl.accept(Unknown Source)
    at java.net.ServerSocket.implAccept(Unknown Source)
    at java.net.ServerSocket.accept(Unknown Source)
    at org.eclipse.ant.internal.launching.launchConfigurations.RemoteAntBuildListener$ServerConnection.run(RemoteAntBuildListener.java:89)

!ENTRY oracle.eclipse.tools.glassfish 4 1 2014-12-24 10:59:44.187
!MESSAGE GlassFish: in SunAppServerBehaviour restart
!STACK 1
org.eclipse.core.runtime.CoreException: Unable to start server due following issues:
    at oracle.eclipse.tools.glassfish.GlassfishServerLaunchDelegate.abort(GlassfishServerLaunchDelegate.java:75)
    at oracle.eclipse.tools.glassfish.GlassfishServerLaunchDelegate.startDASAndTarget(GlassfishServerLaunchDelegate.java:233)
    at oracle.eclipse.tools.glassfish.GlassfishServerLaunchDelegate.launch(GlassfishServerLaunchDelegate.java:133)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:731)
    at oracle.eclipse.tools.glassfish.GlassfishServerBehaviourDelegate$3.run(GlassfishServerBehaviourDelegate.java:366)
Caused by: java.lang.NullPointerException
    at oracle.eclipse.tools.glassfish.GlassfishServerBehaviourDelegate$StartJob.call(GlassfishServerBehaviourDelegate.java:801)
    at oracle.eclipse.tools.glassfish.GlassfishServerBehaviourDelegate$StartJob.call(GlassfishServerBehaviourDelegate.java:1)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
!SUBENTRY 1 oracle.eclipse.tools.glassfish 4 150 2014-12-24 10:59:44.187
!MESSAGE Unable to start server due following issues:
!STACK 0
java.lang.NullPointerException
    at oracle.eclipse.tools.glassfish.GlassfishServerBehaviourDelegate$StartJob.call(GlassfishServerBehaviourDelegate.java:801)
    at oracle.eclipse.tools.glassfish.GlassfishServerBehaviourDelegate$StartJob.call(GlassfishServerBehaviourDelegate.java:1)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

By the way, i'm using vaadin 7.3.3. I've tried to deploy the project with both JDK compliances 1.7 and 1.8 What I'm doing wrong?

Here is the server.log when i start Glassfish manually (the log doesn't change when i restart Glassfish server from Eclipse):

[2014-12-24T14:47:27.336+0200] [] [INFO] [NCLS-GFLAUNCHER-00005] [javax.enterprise.launcher] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425247336] [levelValue: 800] [[
  JVM invocation command line:
C:\Program Files\Java\jdk1.8.0_25\bin\java.exe
-cp
D:/glassfish4/glassfish/modules/glassfish.jar
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9009
-XX:+UnlockDiagnosticVMOptions
-XX:NewRatio=2
-XX:MaxPermSize=192m
-Xmx512m
-javaagent:D:/glassfish4/glassfish/lib/monitor/flashlight-agent.jar
-client
-Djavax.xml.accessExternalSchema=all
-Djavax.net.ssl.trustStore=D:\glassfish4\glassfish\domains\domain1/config/cacerts.jks
-Djdk.corba.allowOutputStreamSubclass=true
-Dfelix.fileinstall.dir=D:\glassfish4\glassfish/modules/autostart/
-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command,org.apache.felix.shell.remote,org.apache.felix.fileinstall
-Dcom.sun.aas.installRoot=D:\glassfish4\glassfish
-Dfelix.fileinstall.poll=5000
-Djava.endorsed.dirs=D:\glassfish4\glassfish/modules/endorsed;D:\glassfish4\glassfish/lib/endorsed
-Djava.security.policy=D:\glassfish4\glassfish\domains\domain1/config/server.policy
-Dosgi.shell.telnet.maxconn=1
-Dfelix.fileinstall.bundles.startTransient=true
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dfelix.fileinstall.log.level=2
-Djavax.net.ssl.keyStore=D:\glassfish4\glassfish\domains\domain1/config/keystore.jks
-Djava.security.auth.login.config=D:\glassfish4\glassfish\domains\domain1/config/login.conf
-Dfelix.fileinstall.disableConfigSave=false
-Dfelix.fileinstall.bundles.new.start=true
-Dcom.sun.aas.instanceRoot=D:\glassfish4\glassfish\domains\domain1
-Dosgi.shell.telnet.port=6666
-Dgosh.args=--nointeractive
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-Dosgi.shell.telnet.ip=127.0.0.1
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Djava.awt.headless=true
-Dcom.ctc.wstx.returnNullForDefaultNamespace=true
-Djava.ext.dirs=C:\Program Files\Java\jdk1.8.0_25/lib/ext;C:\Program Files\Java\jdk1.8.0_25/jre/lib/ext;D:\glassfish4\glassfish\domains\domain1/lib/ext
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djava.library.path=D:/glassfish4/glassfish/lib;C:/Program Files/Java/jdk1.8.0_25/bin;C:/Windows/Sun/Java/bin;C:/Windows/System32;C:/Windows;C:/ProgramData/Oracle/Java/javapath;C:/Program Files/Common Files/Microsoft Shared/Windows Live;C:/Program Files (x86)/Common Files/microsoft shared/Windows Live;C:/oracle/product/10.2.0/client_1;C:/Windows/System32/wbem;C:/Windows/System32/WindowsPowerShell/v1.0;C:/Program Files/Java/jdk1.6.0_32/bin;C:/Program Files/TortoiseSVN/bin;C:/Program Files/Java/jdk1.6.0_32;D:/glassfish4/bin;C:/Program Files (x86)/Windows Live/Shared;C:/Program Files (x86)/QuickTime/QTSystem;C:/Users/User
com.sun.enterprise.glassfish.bootstrap.ASMain
-upgrade
false
-domaindir
D:/glassfish4/glassfish/domains/domain1
-read-stdin
true
-asadmin-args
--host,,,localhost,,,--port,,,4848,,,--secure=false,,,--terse=false,,,--echo=false,,,--interactive=true,,,start-domain,,,--verbose=false,,,--watchdog=false,,,--debug=true,,,--domaindir,,,D:\glassfish4\glassfish\domains,,,domain1
-domainname
domain1
-instancename
server
-type
DAS
-verbose
false
-asadmin-classpath
D:/glassfish4/glassfish/lib/client/appserver-cli.jar
-debug
true
-asadmin-classname
com.sun.enterprise.admin.cli.AdminMain]]

[2014-12-24T14:47:29.505+0200] [glassfish 4.0] [INFO] [NCLS-LOGGING-00009] [javax.enterprise.logging] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425249505] [levelValue: 800] [[
  Running GlassFish Version: GlassFish Server Open Source Edition  4.0  (build 89)]]

[2014-12-24T14:47:29.508+0200] [glassfish 4.0] [INFO] [NCLS-LOGGING-00010] [javax.enterprise.logging] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425249508] [levelValue: 800] [[
  Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter]]

[2014-12-24T14:47:29.627+0200] [glassfish 4.0] [INFO] [realm.loaded.successfully] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425249627] [levelValue: 800] [[
  SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.]]

[2014-12-24T14:47:29.627+0200] [glassfish 4.0] [INFO] [realm.loaded.successfully] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425249627] [levelValue: 800] [[
  SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.]]

[2014-12-24T14:47:29.627+0200] [glassfish 4.0] [INFO] [realm.loaded.successfully] [javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425249627] [levelValue: 800] [[
  SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.]]

[2014-12-24T14:47:29.982+0200] [glassfish 4.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425249982] [levelValue: 800] [[
  Grizzly Framework 2.3.1 started in: 65ms - bound to [/0.0.0.0:8,080]]]

[2014-12-24T14:47:29.999+0200] [glassfish 4.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425249999] [levelValue: 800] [[
  Grizzly Framework 2.3.1 started in: 0ms - bound to [/0.0.0.0:8,181]]]

[2014-12-24T14:47:29.999+0200] [glassfish 4.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425249999] [levelValue: 800] [[
  Grizzly Framework 2.3.1 started in: 0ms - bound to [/0.0.0.0:4,848]]]

[2014-12-24T14:47:30.191+0200] [glassfish 4.0] [INFO] [] [javax.enterprise.system.core.security.org.glassfish.security.services.impl.authorization] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425250191] [levelValue: 800] [[
  Authorization Service has successfully initialized.]]

[2014-12-24T14:47:30.221+0200] [glassfish 4.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425250221] [levelValue: 800] [[
  Grizzly Framework 2.3.1 started in: 0ms - bound to [/0.0.0.0:3,700]]]

[2014-12-24T14:47:32.124+0200] [glassfish 4.0] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425252124] [levelValue: 800] [[
  visiting unvisited references]]

[2014-12-24T14:47:32.189+0200] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425252189] [levelValue: 1000] [[
  Exception while visiting javax.swing.JTable]]

[2014-12-24T14:47:32.653+0200] [glassfish 4.0] [INFO] [security.secmgroff] [javax.enterprise.system.core.security.com.sun.enterprise.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425252653] [levelValue: 800] [[
  SEC1002: Security Manager is OFF.]]

[2014-12-24T14:47:32.653+0200] [glassfish 4.0] [INFO] [sec.service.startup.enter] [javax.enterprise.system.core.security.com.sun.enterprise.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425252653] [levelValue: 800] [[
  SEC1010: Entering Security Startup Service]]

[2014-12-24T14:47:32.663+0200] [glassfish 4.0] [INFO] [policy.loading] [javax.enterprise.system.core.security.com.sun.enterprise.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425252663] [levelValue: 800] [[
  SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.]]

[2014-12-24T14:47:32.693+0200] [glassfish 4.0] [INFO] [sec.service.startup.exit] [javax.enterprise.system.core.security.com.sun.enterprise.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425252693] [levelValue: 800] [[
  SEC1011: Security Service(s) Started Successfully]]

[2014-12-24T14:47:33.027+0200] [glassfish 4.0] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425253027] [levelValue: 800] [[
  visiting unvisited references]]

[2014-12-24T14:47:34.179+0200] [glassfish 4.0] [INFO] [] [javax.enterprise.system.tools.deployment.dol] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425254179] [levelValue: 800] [[
  visiting unvisited references]]

[2014-12-24T14:47:34.583+0200] [glassfish 4.0] [INFO] [] [org.hibernate.validator.internal.util.Version] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425254583] [levelValue: 800] [[
  HV000001: Hibernate Validator 5.0.0.Final]]

[2014-12-24T14:47:35.015+0200] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=1 _ThreadName=Thread-4] [timeMillis: 1419425255015] [levelValue: 1000] [[
  log4j:WARN No appenders could be found for logger (org.jboss.logging).]]

[2014-12-24T14:47:35.015+0200] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=1 _ThreadName=Thread-4] [timeMillis: 1419425255015] [levelValue: 1000] [[
  log4j:WARN Please initialize the log4j system properly.]]

[2014-12-24T14:47:35.015+0200] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=1 _ThreadName=Thread-4] [timeMillis: 1419425255015] [levelValue: 1000] [[
  log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.]]

[2014-12-24T14:47:47.565+0200] [glassfish 4.0] [INFO] [jts.startup_msg] [javax.enterprise.system.core.transaction.com.sun.jts.CosTransactions] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1419425267565] [levelValue: 800] [[
  JTS5014: Recoverable JTS instance, serverId = [3700]]]

ps: I also tried it with Glassfish 4.1 but still the same problem exists.

aozan88
  • 101
  • 2
  • 8
  • It would help if you could share GlassFish server logs from when you try to start it with Eclipse. – Mike Dec 24 '14 at 11:28
  • 1
    If the GlassFish logs don't change at all when you try to start through Eclipse, we can be sure that there's a misconfiguration or bug with the Eclipse tooling. – Mike Dec 24 '14 at 14:11
  • Can you be sure that your GlassFish is accessible by non-administrators? – Mike Dec 24 '14 at 14:11

4 Answers4

0

GlassFish 4.0 won't work on Java 8, but GlassFish 4.1 will. The errors aren't GlassFish, but the Eclipse tools which start it saying that it's tried to start GlassFish, but never gets a response.

The likely cause is that there is some misconfiguration with the GlassFish server in Eclipse. It might be worth deleting the server in Eclipse and recreating it with default settings.

Mike
  • 4,852
  • 1
  • 29
  • 48
  • Thanks for your response. I also tried it with Glassfish 4.1 but the problem in Eclipse still exists. Now I will check the configuration of GF in Eclipse (Now it's default) and if it doesn't help; Maybe the older eclipse usages (Juno - 1.7) causes the problem so i think changing workspace location might be helpful. – aozan88 Dec 24 '14 at 14:06
  • I did this myself just now with a fresh Eclipse Luna and GF 4 on Ubuntu. I accepted all the default configurations, so I'd be surprised if it's a bug. – Mike Dec 24 '14 at 14:13
0

Yes, finally I solved the problem by helps of a friend after a day. After fresh installations of Glassfish 4.0 (not web, the full one) and Eclipse Juno; GF is now running on JDK 1.7_u67 with Eclipe Juno. I can start and debug the Glassfish from Eclipse internally. By the way NullPointerException is irrelevant.

Here is the solution :

Adding that line to domain.xml

<jvm-options>-Duser.language=en</jvm-options>

and that line to eclipse.ini

-Duser.language=en

solved the problem.

Thank you for all!

Community
  • 1
  • 1
aozan88
  • 101
  • 2
  • 8
0

I had the same issue ( configuration: glassfish 4.1 Java 8 eclipse kepler , OSX 10.10.3 ). The issue, in my case at least , seems to be associated with permissions required to start the glassfish server. I do not have a neat solution( yet)but do have a workaround( on Mac)

The problem seems to be that glassfish requires supervisor(sudo or root) permission ( sudo ) to start it. And assuming you are starting Eclipse from an account without root permissions, the commands to start the glassfish server will fail.

WORKAROUND : Start eclipse from an account with supervisor privileges. On Mac or linus , starting eclispe on the command line with "sudo" will do the trick.

eg $cml_prompt> <location_of_eclipse_application>/eclipse/Eclipse.app/Contents/MacOS/eclipse &

Once eclispe is up and running, if you try to stop and start the glassfish server from the server window it should work . Successfully verified the workaround on my system.

here is a link to a probably neater solution: NOTE: I have not tried it, due to time. http://www.eclipse.org/forums/index.php/mv/msg/87353/724852/#msg_724852

...my penny's worth. good luck

young chisango
  • 103
  • 1
  • 6
0

I had this same problem, I right-clicked on the server on the console from Eclipse, clicked on its properties, and deleted the /domain/domain1 from the Domain path, making the path end with /glassfish and then I ran the server again and it worked.

When I checked the domain path again, it had generated the /domain/domain1 part of itself again, but the server kept running afterwards.