当前位置: 首页 > 知识库问答 >
问题:

通过netbeans将maven EAR应用程序部署到glassfish失败

萧飞
2023-03-14
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 0.977 s
Finished at: 2017-10-02T21:00:19+03:00
Final Memory: 9M/393M
------------------------------------------------------------------------
Deploying on GlassFish Server
profile mode: false
debug mode: false
force redeploy: true

Distributing /path/to/ear.ear
GlassFish Server, deploy, Error writing request body to server, false

Netbeans IDE日志包含以下内容:

INFO [glassfish]: Requested Entity: public id = -//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN, system id = http://glassfish.org/dtds/glassfish-resources_1_5.dtd
INFO [null]: Last record repeated again.
WARNING [glassfish-eecommon]: Deployment plan not supported in GlassfishConfiguration.save()
INFO [org.netbeans.modules.glassfish.tooling.admin.RunnerHttpDeploy]: IO exception caught in handleSend() method:
java.io.IOException: Error writing request body to server
    at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3518)
    at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3501)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126)
    at java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:253)
    at java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:255)
    at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:360)
    at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:238)
    at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:377)
[catch] at org.netbeans.modules.glassfish.tooling.admin.RunnerHttpDeploy.handleSend(RunnerHttpDeploy.java:267)
    at org.netbeans.modules.glassfish.tooling.admin.Runner.handleHTTPConnection(Runner.java:828)
    at org.netbeans.modules.glassfish.tooling.admin.Runner.call(Runner.java:939)
    at org.netbeans.modules.glassfish.tooling.admin.Runner.call(Runner.java:73)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
INFO [org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment]
The module has not been deployed.
See the server log for details.
[catch] at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:259)
    at org.netbeans.modules.maven.j2ee.execution.DeploymentHelper.perform(DeploymentHelper.java:208)
    at org.netbeans.modules.maven.j2ee.execution.CoSAlternativeExecutorImpl.execute(CoSAlternativeExecutorImpl.java:90)
    at org.netbeans.modules.maven.cos.CoSAlternativeExecutor.execute(CoSAlternativeExecutor.java:87)
    at org.netbeans.modules.maven.cos.CosChecker.checkRunMainClass(CosChecker.java:209)
    at org.netbeans.modules.maven.cos.CosChecker.checkRunConfig(CosChecker.java:163)
    at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:225)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
INFO [glassfish]: Requested Entity: public id = -//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN, system id = http://glassfish.org/dtds/glassfish-resources_1_5.dtd
INFO [null]: Last record repeated again.
WARNING [glassfish-eecommon]: Deployment plan not supported in GlassfishConfiguration.save()
INFO [org.netbeans.modules.glassfish.tooling.admin.RunnerHttpDeploy]: IO exception caught in handleSend() method:
java.io.IOException: Error writing request body to server
    at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3518)
    at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3501)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126)
    at java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:253)
    at java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:255)
    at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:360)
    at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:238)
    at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:377)
[catch] at org.netbeans.modules.glassfish.tooling.admin.RunnerHttpDeploy.handleSend(RunnerHttpDeploy.java:267)
    at org.netbeans.modules.glassfish.tooling.admin.Runner.handleHTTPConnection(Runner.java:828)
    at org.netbeans.modules.glassfish.tooling.admin.Runner.call(Runner.java:939)
    at org.netbeans.modules.glassfish.tooling.admin.Runner.call(Runner.java:73)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
INFO [org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment]
The module has not been deployed.
See the server log for details.
[catch] at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:259)
    at org.netbeans.modules.maven.j2ee.execution.DeploymentHelper.perform(DeploymentHelper.java:208)
    at org.netbeans.modules.maven.j2ee.execution.ExecutionChecker.executionResult(ExecutionChecker.java:93)
    at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:315)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Netbeans version: 8.2
Glassfish version: 3.1.2.2 (build 5)
Platform: reproducible on both Windows10 + Debian9
Maven version: 3.3.9
JDK: 1.7.0_80
Glassfish secure admin is enabled

生成的EAR通常可以使用asadmin命令部署到Glassfish。只有当试图通过Netbeans部署它时,它才会失败。

似乎当禁用secure admin时,我可以通过NetBeans执行部署。我遇到了一些安全管理和SSL的问题。

>

  • 我已经对其他EAR项目进行了实验(从netbeans生成了一个新的maven EAR),它将OK部署到GlassFish。

    我遇到过一篇文章,其中提到Netbeans中的一个bug,无法编写特定大小的存档。我试图生成一个具有较大最终EAR大小的新maven项目,但它部署良好。这个bug已经很老了,现在已经修复:https://netbeans.org/bugzilla/show_bug.cgi?id=206946

    在对POM文件进行实验并删除所有依赖项并尝试一个接一个地添加回来之后,这个问题似乎是由EJB依赖项的包含触发的。

    在maven ear plugin modules部分中包含ejb类型的depencency并将其声明为ejbModule似乎引发了这个问题。

    <dependency>
        <groupId>com.foo</groupId>
        <artifactId>BAR</artifactId>
        <version>1.0</version>
        <type>ejb</type>
    </dependency>
    .
    .
    .
    .
    <ejbModule>
        <groupId>com.foo</groupId>
        <artifactId>BAR</artifactId>
        <altDeploymentDescriptor>AltDD.xml</altDeploymentDescriptor>
    </ejbModule>
    

    我仍然不知道为什么会引发这个问题。我在网上读到文件大小可能有问题,但我无法复制它。

  • 共有1个答案

    裴俊雅
    2023-03-14

    当在断点上停止时,这可能会在Netbeans上发生,然后一些部署可能会立即失败。

    BUG-253630提到了一个可复制的场景,例如用例:-

    1. Run app with DoS off (DoS state MODULE_NOT_DEPLOYED)
    2. Debug it
    3. App stopped at breakpoint
    4. Change source (DoS state SERVER_STATE_UNSUPPORTED)
    5. Continue with the app (release breakpoint, detach JPDA)
    6. Change source (DoS state MODULE_UPDATED)
    

    此外,请确保对于远程管理,在执行实际启用之前必须设置管理密码:

    asadmin change-admin-password --domain_name [DOMAIN_NAME]
    asadmin enable-secure-admin --port [PORT_NAME]
    
     类似资料:
    • 所以这是我的问题。我正在努力将一个简单的maven应用程序部署到Glassfish服务器中,只是为了检查我的配置是否正确,以便进一步开发。我使用的是NetBeans IDE,但由于它提供的控制台日志很小,几乎无法读取,所以我尝试使用系统终端(我使用的是Fedora)。 我试图部署的应用程序由一个无状态EJB bean(名为DziekanatBean,当前不执行任何操作)和一个Maven POM项目

    • 选中“启用JDBC驱动程序部署”和“在重新部署期间保留会话”

    • PS:这是一个由另一个开发人员开始的项目,我一直在工作中没有问题,在过去的6个坐骑。我现在认为问题可能来自netbeans或glassfish中的配置错误,因为我在以前的代码版本中都遇到了同样的错误。

    • 问题内容: 相同的.war文件可以很好地部署到Glassfish v2.1上。我不知道上一次尝试v3,但我想检查一下热部署功能,因为有传言说它可以在glassfish v3的netbeans 6.8中使用。因此,我像往常一样进行部署,并收到以下错误消息: 我不明白为什么它抱怨任何与EJB相关的东西,因为这是一个.war文件。有任何想法吗? 更新: 我对glassfish提出了一个错误:https

    • 我正试图将我的spring应用程序部署到heroku,但我相信maven插件中存在一些错误。尝试了所有可能的版本组合,在本地工作,但在部署时不工作。 当我跑步的时候: git push heroku master 以下是错误: 4.0.0 org.springframework.Boot Spring-Boot-starter-parent 2.3.3.发布com.project techupda

    • 每次我尝试在netbeans上部署web应用程序时,都会出现以下错误:\ C: \Users{myname}\Documents\NetBeansProjects\WebApplication2\nbproject\build impl。xml:1045:模块尚未部署。有关详细信息,请参阅服务器日志。 问题是,apache日志中没有错误! 我已经卸载了我的netbean并重新安装它,但问题仍然存在