IDE: Eclipse Luna ,JDK& JRE: 1.8.0_25 ,Glassfish: Glassfish 4.0
我可以在外部启动Glassfish Server。但是当我部署我的项目时,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,但仍然存在同样的问题。
答案 0 :(得分:0)
GlassFish 4.0不会在Java 8上工作,但GlassFish 4.1会。错误不是GlassFish,但Eclipse工具开始说它试图启动GlassFish,但从未得到响应。
可能的原因是Eclipse中的GlassFish服务器存在一些配置错误。可能值得删除Eclipse中的服务器并使用默认设置重新创建它。
答案 1 :(得分:0)
是的,最后我在一天之后通过朋友的帮助解决了这个问题。 全新安装Glassfish 4.0(不是网络,完整版)和Eclipse Juno; GF现在与Eclipe Juno在JDK 1.7_u67上运行。我可以在内部从Eclipse启动和调试Glassfish。 顺便说一下,NullPointerException无关紧要。
将该行添加到 domain.xml
<jvm-options>-Duser.language=en</jvm-options>
该行到 eclipse.ini
-Duser.language=en
解决了这个问题。
谢谢大家!
答案 2 :(得分:0)
我有同样的问题(配置:glassfish 4.1 Java 8 eclipse kepler,OSX 10.10.3)。至少在我的情况下,这个问题似乎与启动glassfish服务器所需的权限有关。我还没有一个简洁的解决方案,但确实有解决方法(在Mac上)
问题似乎是glassfish需要supervisor(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
......我的便士价值。祝你好运
答案 3 :(得分:0)
我有同样的问题,我在Eclipse上右键单击控制台上的服务器,点击其属性,从域路径中删除/ domain / domain1,使路径以/ glassfish结束然后我运行服务器再次运行。
当我再次检查域路径时,它再次生成了/ domain / domain1部分,但服务器后来继续运行。