GlassFish 4.1部署在使用JDK 8的eclipse Luna上失败

时间:2014-11-06 17:55:45

标签: java eclipse glassfish

无法使用JDK 8,glassfish 4.1在eclipse Luna上部署Glassfish.jsp。

异常堆栈跟踪:

    org.glassfish.tools.ide.admin.CommandException: Cannot initialize Runner class
        at org.glassfish.tools.ide.admin.AdminFactory.newRunner(AdminFactory.java:180)
        at org.glassfish.tools.ide.admin.AdminFactoryHttp.getRunner(AdminFactoryHttp.java:110)
        at org.glassfish.tools.ide.admin.ServerAdmin.exec(ServerAdmin.java:75)
        at oracle.eclipse.tools.glassfish.GlassfishServerBehaviourDelegate.publishDeployedDirectory(GlassfishServerBehaviourDelegate.java:608)
        at oracle.eclipse.tools.glassfish.GlassfishV4ServerBehavior.publishModuleForGlassFishV3(GlassfishV4ServerBehavior.java:96)
        at oracle.eclipse.tools.glassfish.GlassfishV4ServerBehavior.publishModule(GlassfishV4ServerBehavior.java:56)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1091)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1183)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:987)
        at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
        at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3157)
        at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

会话数据:

eclipse.buildId=4.4.1.M20140925-0400
java.version=1.8.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=es_MX
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

2 个答案:

答案 0 :(得分:5)

在Eclipse中添加Glassfish服务器时,可以选择“在重新部署期间保留会话”。 Glassfish工具插件中存在一个错误(至少截至2015年1月22日)。违规代码位于oracle.eclipse.tools.glassfish.AbstractGlassfishServer方法的computePreserveSessions()中。如果UNCHECK该选项,该方法返回null,该键被插入到调用堆栈下方的Map中,并且其他人检查空键,并且繁荣:“无法初始化Runner类”。

基本上,选中“跨重新部署保留会话”,取消部署任何以前失败的部署,然后重新部署。

适合我。

答案 1 :(得分:2)

是的,看来Glassfish for Eclipse Luna已经坏了。 见:https://github.com/spring-projects/spring-boot/issues/1355

解决方法: 1)通过eclipse导出为WAR文件。 2)使用

  

http://localhost:4848/common/index.jsf

通过“应用程序”标签进行部署。