10

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?

Elrond_EGLDer
  • 47,430
  • 25
  • 189
  • 180
user2783755
  • 568
  • 2
  • 9
  • 25
  • Possible duplicate of [Cannot deploy an application to Glassfish 4.1 in Eclipse](https://stackoverflow.com/questions/27904617/cannot-deploy-an-application-to-glassfish-4-1-in-eclipse) – Ruslan López Aug 01 '17 at 00:01

4 Answers4

16

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

Rxxxx
  • 686
  • 7
  • 6
  • i remove the application from glassfish server using eclipse, and redeploy, it's wormink fine. – Hazim Apr 09 '18 at 07:15
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://stackoverflow.com/a/30507834/1934673

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.

Community
  • 1
  • 1
M.Paunov
  • 977
  • 9
  • 14
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).

Olivier Cailloux
  • 730
  • 7
  • 21
  • 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 :) – Christoph Bimminger Jan 29 '17 at 13:24
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. :)

Justin Albano
  • 3,267
  • 2
  • 19
  • 44
R K Sinha
  • 11
  • 1