Deploying app from Eclipse to GlassFish
Asked Answered
G

4

11

I’m trying to deploy application to GlassFish 4 server from Eclipse, but I get this error:

cannot Deploy elearning
deploy is failing=Application with name [elearning] is not deployed

In glassfish log file no errors and no information about deploying. But in eclipse log, there are these errors:

!ENTRY oracle.eclipse.tools.glassfish 1 1 2014-11-17 16:30:51.474
!MESSAGE GlassFish: Deploy direcotry C:\glassfish4\glassfish\domains\domain1\eclipseApps\elearning

!ENTRY oracle.eclipse.tools.glassfish 4 1 2014-11-17 16:30:51.599
!MESSAGE GlassFish: deploy is failing=
!STACK 0
java.lang.Exception: deploy is failing=Application with name [elearning] is not deployed
    at oracle.eclipse.tools.glassfish.GlassfishServerBehaviourDelegate.publishDeployedDirectory(GlassfishServerBehaviourDelegate.java:612)
    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)

!ENTRY oracle.eclipse.tools.glassfish 4 0 2014-11-17 16:30:51.599
!MESSAGE cannot Deploy elearning
!STACK 0
java.lang.Exception: deploy is failing=Application with name [elearning] is not deployed
    at oracle.eclipse.tools.glassfish.GlassfishServerBehaviourDelegate.publishDeployedDirectory(GlassfishServerBehaviourDelegate.java:612)
    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)

Where can be problem?

Gonium answered 17/11, 2014 at 14:35 Comment(1)
Possible duplicate of Cannot deploy an application to Glassfish 4.1 in EclipseJaredjarek
L
16

I had the same problem, and searched a lot on line, solved just by delete the Glass fish server and reset another, voila...

Link answered 19/1, 2015 at 16:0 Comment(1)
i remove the application from glassfish server using eclipse, and redeploy, it's wormink fine.Maduro
P
6

While the accepted answer will probably work, it is not the best solution for me. The problem will most likely occur again and then we need to repeat.

The following answer worked for me: https://mcmap.net/q/841534/-cannot-deploy-an-application-to-glassfish-4-1-in-eclipse

I don't know exactly why it works with jars and sometimes fails if the checkbox is not checked. The good news is that this way we work around the bug and we don't need to remove server - create server every time the bug happens. The bad news is that using jars is working way slower.

Puissant answered 11/8, 2015 at 7:59 Comment(0)
R
2

For me this bug occurs as follows. Deploy a war application with eclipse using Glassfish tools integration. Then, using the administration console, undeploy the application (not going through eclipse, thus). Then modify anything in the eclipse application (so that it gets dirty), and ask eclipse to re-publish it. Eclipse says: “cannot Deploy dukes-age, deploy is failing=Application with name [dukes-age] is not deployed.” (And indeed the application is not deployed.) Same thing after restarting eclipse and glassfish.

Workaround: rename the eclipse project, deploy it: it gets deployed. Then rename it back to its original name, deploy: it gets deployed.

I reported it to glassfish JIRA (please confirm or comment there if you also see this bug).

Rademacher answered 4/8, 2015 at 14:34 Comment(1)
thought a while what you mean with "rename the application", thus chainging the name in web.xml didn't solve it. Found out that you mean "rename the eclipse project" - it worked :)Vanda
H
1

Well I faced it and for me it worked with two ways:

  1. I deleted the server and added the new server (as mentioned in the previous comments)
  2. Just right click on GlassFish Server -> Click Add and Remove -> Remove All -> Add All -> click Finish.

So try any of them. :)

Herron answered 6/1, 2019 at 13:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.