Java 使用 GlassFish Server 时如何纠正模块部署错误?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24536907/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 12:47:26  来源:igfitidea点击:

How to rectify module deployment error while using GlassFish Server?

javajsfglassfish

提问by emm

How to rectify module deployment error while using GlassFish Server?

使用 GlassFish Server 时如何纠正模块部署错误?

While trying to run jsf web-application in Netbeans8 I am getting the following error:

尝试在 Netbeans8 中运行 jsf web 应用程序时,出现以下错误:

ant -f C:\Users\admin\Desktop\WebTime -Dnb.internal.action.name=run -Ddirectory.deployment.supported=true -DforceRedeploy=false -Dnb.wait.for.caches=true -Dbrowser.context=C:\Users\admin\Desktop\WebTime run
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
Starting GlassFish Server
GlassFish Server is running.
In-place deployment at C:\Users\admin\Desktop\WebTime\build\web
GlassFish Server, deploy, Connection refused: connect, false
C:\Users\admin\Desktop\WebTime\nbproject\build-impl.xml:1045: The module has not been deployed. See the server log for details.

Being new to programming, I need hint to rectify this error. Kindly help me to rectify it.

作为编程新手,我需要提示来纠正这个错误。请帮助我纠正它。

回答by emm

Being new to programming, I need hint to rectify this error. Kindly help me to rectify it.

作为编程新手,我需要提示来纠正这个错误。请帮助我纠正它。

If you look carefully, the hint is given in the output itself.

如果您仔细查看,提示会在输出本身中给出。

See the server log for details.

In NetBeans IDE output's sub-window, you should see another tab called "GlassFish Server", you can look there for logs from the server.

在 NetBeans IDE 输出的子窗口中,您应该会看到另一个名为“GlassFish Server”的选项卡,您可以在那里查看来自服务器的日志。

Alternatively , you can use GlassFish's Administration GUI to see some more detailed logs, it is accessible in a browser and by default from localhost:4848.

或者,您可以使用 GlassFish 的管理 GUI 查看一些更详细的日志,它可以在浏览器中访问,默认情况下从 localhost:4848 访问。

While trying to run jsf web-application in Netbeans8 I am getting the following error:

尝试在 Netbeans8 中运行 jsf web 应用程序时,出现以下错误:

Looking at what you have posted (project's deployment log), I can say your GlassFish instance is running fine , but your project contains errors, so it couldn't be deployed.

查看您发布的内容(项目的部署日志),我可以说您的 GlassFish 实例运行良好,但您的项目包含错误,因此无法部署。

I doubt anyone here can concretely solve your problem because we need more details from GlassFish's logs.

我怀疑这里的任何人都可以具体解决您的问题,因为我们需要 GlassFish 日志中的更多详细信息。

Suggestion : Edit your question by appending GlassFish's logs.

建议:通过附加 GlassFish 的日志来编辑您的问题。

回答by Patricio Bonilla

The line:

线路:

GlassFish Server, deploy, Connection refused: connect, false

GlassFish Server, deploy, Connection refused: connect, false

... is a clue.

……是线索。

I had the same error, but I solved it. The steps:

我有同样的错误,但我解决了。步骤:

1) Grant privileges to write on the glassfish server installation folder. If you use Windows the path is: C:\Program Files\glassfish-xx

1) 授予在 glassfish 服务器安装文件夹上写入的权限。如果您使用 Windows,则路径为: C:\Program Files\glassfish-xx

2) Run C:\Program Files\glassfish-xx\bin\asadmin.batas Administrator. Then in the console type: start-domain

2)以管理员身份运行C:\Program Files\glassfish-xx\bin\asadmin.bat。然后在控制台输入:start-domain

3) Clean and Build the project

3)清理并构建项目

4) Deploy

4) 部署

5) Run

5)运行

PD: I recommend use JDK7

PD:我推荐使用JDK7

回答by michondr

after a whole day solving this problem on my own, because nobody's answer was usefull for me on internet, I found following:

在我自己解决了这个问题一整天之后,因为没有人的答案在互联网上对我有用,我发现以下内容:

  1. don't try to use different web server (I tried wildfly), it wont help.

  2. give glassfish folder permission to write (I mean the folder with version in name)

  3. restart pc to shut down all (or the) running server

  4. after my restart, I got still the same error during developing build-impl.xml:1045: The module has not been deployed., but now there was different error in server log - java.lang.IllegalArgumentException: Invalid URL Pattern: [{0}].

  5. Then I realised that my problem was in web.xml file, where I tried to set different welcome page. All other projects with this file untouched were working (developing, running) properly

  1. 不要尝试使用不同的 Web 服务器(我尝试过wildfly),它无济于事。

  2. 授予 glassfish 文件夹写入权限(我的意思是名称中带有版本的文件夹)

  3. 重新启动电脑以关闭所有(或)正在运行的服务器

  4. 重新启动后,我在开发过程中仍然出现相同的错误 build-impl.xml:1045: The module has not been deployed.,但现在服务器日志中有不同的错误 - java.lang.IllegalArgumentException: Invalid URL Pattern: [{0}]

  5. 然后我意识到我的问题出在 web.xml 文件中,我试图在其中设置不同的欢迎页面。未触及此文件的所有其他项目都正常工作(开发、运行)

so this was my story of waisting whole day - check your web.xml file

所以这就是我整天瘦腰的故事 -检查你的 web.xml 文件