Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GlassFish 4.1 deploy is failing on eclipse Luna with JDK 8

Cannot deploy Glassfish.jsp on eclipse Luna, with JDK 8, glassfish 4.1.

Exception Stack Trace:

    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)

Session Data:

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
like image 218
Carlos Montoya Avatar asked Dec 14 '25 06:12

Carlos Montoya


2 Answers

When you add your Glassfish server in Eclipse, there is an option to "Preserve sessions across redeployment". There is a bug in the Glassfish tools plugin (as of January 22, 2015 at least). The offending code is in oracle.eclipse.tools.glassfish.AbstractGlassfishServer in the computePreserveSessions() method. If you UNCHECK the option, the method returns null, that key is inserted into a Map further down the call stack, and someone else checks for null keys, and boom: "Cannot initialize Runner class".

Basically, check "Preserve sessions across redeployment", undeploy any previously failed deployments, and redeploy.

Works for me.

like image 111
Ahmed Avatar answered Dec 16 '25 22:12

Ahmed


Yes, it seems Glassfish for Eclipse Luna is broken. see: https://github.com/spring-projects/spring-boot/issues/1355

Workaround: 1) export as a WAR file via eclipse. 2) use

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

to deploy via the "Applications" tab.

like image 28
JDOaktown Avatar answered Dec 16 '25 23:12

JDOaktown



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!