将应用程序从 Eclipse 部署到 GlassFish
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26975024/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Deploying app from Eclipse to GlassFish
提问by user2783755
I'm trying to deploy application to GlassFish 4 server from Eclipse, but I get this error:
我正在尝试从 Eclipse 将应用程序部署到 GlassFish 4 服务器,但出现此错误:
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:
在 glassfish 日志文件中没有错误,也没有关于部署的信息。但是在eclipse日志中,有这些错误:
!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?
哪里会出问题?
回答by Rxxxx
I had the same problem, and searched a lot on line, solved just by delete the Glass fish server and reset another, voila...
我遇到了同样的问题,并在网上搜索了很多,只需删除 Glass Fish 服务器并重新设置另一个即可解决,瞧...
回答by M.Paunov
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
以下答案对我有用: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.
我不知道为什么它可以与 jars 一起使用,如果未选中该复选框,有时会失败。好消息是,通过这种方式我们可以解决错误,并且我们不需要删除服务器 - 每次发生错误时都创建服务器。坏消息是使用 jars 的工作速度要慢得多。
回答by Olivier Cailloux
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.
对我来说,这个错误发生如下。使用 Glassfish 工具集成通过 Eclipse 部署War应用程序。然后,使用管理控制台取消部署应用程序(因此不通过 eclipse)。然后修改 eclipse 应用程序中的任何内容(使其变脏),并要求 eclipse 重新发布它。Eclipse 说:“无法部署 dukes-age,部署失败=名称为 [dukes-age] 的应用程序未部署。” (而且确实没有部署应用程序。)重新启动 eclipse 和 glassfish 后,同样的事情。
Workaround: rename the eclipse project, deploy it: it gets deployed. Then rename it back to its original name, deploy: it gets deployed.
解决方法:重命名 eclipse 项目,部署它:它被部署。然后将它重命名回原来的名称,部署:它被部署。
I reported it to glassfish JIRA(please confirm or comment there if you also see this bug).
我将其报告给glassfish JIRA(如果您也看到此错误,请在那里确认或评论)。
回答by R K Sinha
Well I faced it and for me it worked with two ways:
好吧,我面对它,对我来说,它以两种方式起作用:
- I deleted the server and added the new server (as mentioned in the previous comments)
- Just right click on GlassFish Server -> Click Add and Remove -> Remove All -> Add All -> click Finish.
- 我删除了服务器并添加了新服务器(如之前的评论中所述)
- 只需右键单击 GlassFish Server -> 单击添加和删除 -> 全部删除 -> 全部添加 -> 单击完成。
So try any of them. :)
所以尝试其中任何一个。:)