【问题标题】:Glassfish 4.0 won't start from EclipseGlassfish 4.0 不会从 Eclipse 启动
【发布时间】:2015-10-02 07:19:53
【问题描述】:

IDE:Eclipse Luna、JDK 和 JRE:1.8.0_25、Glassfish:Glassfish 4.0

我可以从外部启动 Glassfish 服务器。但是当我部署我的项目时,Glassfish 无法从 Eclipse 开始运行或调试。

这是日志:

!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)

顺便说一句,我正在使用 vaadin 7.3.3。我尝试使用 JDK 合规性 1.7 和 1.8 部署项目 我做错了什么?

这是我手动启动 Glassfish 时的 server.log(当我从 Eclipse 重新启动 Glassfish 服务器时日志不会改变):

[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:我也用 Glassfish 4.1 尝试过,但仍然存在同样的问题。

【问题讨论】:

  • 如果您可以在尝试使用 Eclipse 启动 GlassFish 服务器时共享它的日志,将会有所帮助。
  • 如果在您尝试通过 Eclipse 启动时 GlassFish 日志完全没有变化,我们可以确定 Eclipse 工具存在配置错误或错误。
  • 您能确定非管理员可以访问您的 GlassFish 吗?

标签: java server glassfish-4 eclipse-luna


【解决方案1】:

GlassFish 4.0 无法在 Java 8 上运行,但 GlassFish 4.1 可以。错误不是 GlassFish,而是启动它的 Eclipse 工具说它已尝试启动 GlassFish,但从未得到响应。

可能的原因是 Eclipse 中的 GlassFish 服务器配置错误。在 Eclipse 中删除服务器并使用默认设置重新创建它可能是值得的。

【讨论】:

  • 感谢您的回复。我也用 Glassfish 4.1 尝试过,但 Eclipse 中的问题仍然存在。现在我将检查 Eclipse 中 GF 的配置(现在是默认配置),如果它没有帮助;也许较旧的 Eclipse 用法(Juno - 1.7)会导致问题,所以我认为更改工作区位置可能会有所帮助。
  • 我刚刚在 Ubuntu 上使用全新的 Eclipse Luna 和 GF 4 自己完成了这项工作。我接受了所有默认配置,所以如果这是一个错误,我会感到惊讶。
【解决方案2】:

是的,一天后我终于在朋友的帮助下解决了这个问题。 在全新安装 Glassfish 4.0(不是 web,完整版)和 Eclipse Juno 之后; GF 现在使用 Ecipe Juno 在 JDK 1.7_u67 上运行。我可以在内部从 Eclipse 启动和调试 Glassfish。 顺便说一下 NullPointerException 是无关紧要的。

这里是解决方案:

将该行添加到 domain.xml

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

那一行到 eclipse.ini

-Duser.language=en

解决了问题。

谢谢大家!

【讨论】:

  • 它在我的情况下不起作用。我正在使用jdk1.7.0_21
  • jdk1.7.0.x升级到1.8.0.x后出现的问题。后来我们了解到,降级根本不重要。你的情况是什么?
【解决方案3】:

我遇到了同样的问题(配置:glassfish 4.1 Java 8 eclipse kepler,OSX 10.10.3)。至少在我的情况下,这个问题似乎与启动 glassfish 服务器所需的权限有关。我没有一个简洁的解决方案(还),但有一个解决方法(在 Mac 上)

问题似乎是 glassfish 需要主管(sudo 或 root)权限( sudo )才能启动它。并且假设您从没有 root 权限的帐户启动 Eclipse,启动 glassfish 服务器的命令将会失败。

解决方法: 从具有超级用户权限的帐户启动 eclipse。在 Mac 或 linus 上,使用“sudo”在命令行上启动 eclispe 就可以了。

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

一旦 eclispe 启动并运行,如果您尝试从服务器窗口停止和启动 glassfish 服务器,它应该可以工作。在我的系统上成功验证了解决方法。

这里是一个可能更简洁的解决方案的链接:注意:由于时间原因,我没有尝试过。 http://www.eclipse.org/forums/index.php/mv/msg/87353/724852/#msg_724852

...我的一分钱值得。祝你好运

【讨论】:

    【解决方案4】:

    我遇到了同样的问题,我在 Eclipse 控制台上右键单击服务器,单击其属性,然后从域路径中删除 /domain/domain1,使路径以 /glassfish 结尾,然后我运行再次打开服务器,它工作了。

    当我再次检查域路径时,它再次生成了自己的 /domain/domain1 部分,但服务器随后继续运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-10
      • 1970-01-01
      相关资源
      最近更新 更多