Java Netbeans 8.0.2 模块尚未部署

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

Netbeans 8.0.2 The module has not been deployed

javaapachetomcatnetbeans

提问by Alpha2k

I just installed netbeans and I have problems deploying a new Java Web App. I simply create the project without editing anything, this is what project has by default (using apache):

我刚刚安装了 netbeans,但在部署新的 Java Web 应用程序时遇到了问题。我只是在不编辑任何内容的情况下创建项目,这是默认情况下的项目(使用 apache):

index.html

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
    <title>TODO supply a title</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
    <div>TODO write content</div>
</body>
</html>

The errors:

错误:

init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
In-place deployment at C:\UserskGamer\Dropbox\Projects\Java\NetBeans\DAW 2\WebApplication1\build\web
Deployment is in progress...
deploy?config=file%3A%2FC%3A%2FUsers%2F2kGamer%2FAppData%2FLocal%2FTemp%2Fcontext4402830100786872488.xml&path=/WebApplication1
 http://localhost:8084/manager/text/deploy?config=file%3A%2FC%3A%2FUsers%2F2kGamer%2FAppData%2FLocal%2FTemp%2Fcontext4402830100786872488.xml&path=/WebApplication1
C:\UserskGamer\Dropbox\Projects\Java\NetBeans\DAW 2\WebApplication1\nbproject\build-impl.xml:1045: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 51 seconds)



build-impl.xml:1045 
<target if="netbeans.home" name="-run-deploy-nb">
    <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
</target>

采纳答案by justrandom

I've had the same issue every now and then. This is how i solve the issue, it works like a charm for me!

我不时遇到同样的问题。这就是我解决问题的方法,它对我来说就像一个魅力!

  1. Go to 'Task Manager'
  2. Choose 'Processes' tab
  3. Click on 'Java(TM) Platform SE Binary'
  4. Click on 'End Process' button
  5. Go to your NetBeans project
  6. Clean & Build the project
  1. 转到“任务管理器”
  2. 选择“进程”选项卡
  3. 单击“Java(TM) 平台 SE 二进制”
  4. 单击“结束进程”按钮
  5. 转到您的 NetBeans 项目
  6. 清理并构建项目

回答by Alpha2k

UPDATE: this was solved by rebooting but there was another error when running app. This time tomcat woudnt start. To solve this (bugs with latest apache and netbeans versions) follow: Error starting Tomcat from NetBeans - '127.0.0.1*' is not recognized as an internal or external command

更新:这是通过重新启动解决的,但运行应用程序时出现另一个错误。这次tomcat启动不了。要解决此问题(最新 apache 和 netbeans 版本的错误),请执行以下操作:从 NetBeans 启动 Tomcat 时出错 - '127.0.0.1*' 未被识别为内部或外部命令

回答by Rohit Chauhan

Maybe because you may need to create Db Resource and Pool manually on the Glassfish server like this,

可能是因为您可能需要像这样在 Glassfish 服务器上手动创建 Db Resource 和 Pool,

In Netbeans -> Projects, Open Server Resources -> glassfish-resources.xml We have to create JDBC Resource and JDBC Connection Pool Manually on Glassfish. I am using my values here, don't use them, see your .xml !

在 Netbeans -> 项目中,打开服务器资源 -> glassfish-resources.xml 我们必须在 Glassfish 上手动创建 JDBC 资源和 JDBC 连接池。我在这里使用我的值,不要使用它们,请参阅您的 .xml !

Value of jndi-name is your JDBC Resource and Value of pool-name is your JDBC Connection Pool.

jndi-name 的值是您的 JDBC 资源,pool-name 的值是您的 JDBC 连接池。

Open Browser for Glassfish Admin, https://localhost:4848/

打开 Glassfish 管理浏览器,https://localhost:4848/

Go to, JDBC Connection Pool -> New: 1) Pool Name: mysql_customersdb_rootPool 2) Resource Type: javax.sql.ConnectionPoolDataSource 3) Database Driver Vendor: MySql

转到,JDBC 连接池 -> 新建:1) 池名称:mysql_customersdb_rootPool 2) 资源类型:javax.sql.ConnectionPoolDataSource 3) 数据库驱动程序供应商:MySql

Press Next,

按下一步,

URL: jdbc:mysql://localhost:3306/customersdb?zeroDateTimeBehavior=convertToNull Url: jdbc:mysql://localhost:3306/customersdb?zeroDateTimeBehavior=convertToNull User: root Password: root

网址:jdbc:mysql://localhost:3306/customersdb?zeroDateTimeBehavior=convertToNull 网址:jdbc:mysql://localhost:3306/customersdb?zeroDateTimeBehavior=convertToNull 用户:root 密码:root

JDBC Resources -> New

JDBC 资源 -> 新建

JNDI Name: CustomersDS Pool Name: mysql_customersdb_rootPool

JNDI 名称:CustomersDS 池名称:mysql_customersdb_rootPool

Press Ok.

按确定。

Right Click your Project and Press Run :)

右键单击您的项目并按运行 :)

回答by Fred

In my case I had installed a new version of netbeans and upgraded from java 7 to 8. The new netbeans had a different version of glassfish, so I opened the properties of my project and pointed it to the right glassfish version and set the jdk to version 8.

就我而言,我安装了新版本的 netbeans 并从 java 7 升级到 8。新的 netbeans 具有不同版本的 glassfish,因此我打开了项目的属性并将其指向正确的 glassfish 版本并将 jdk 设置为版本 8。

回答by Giovanni Stroppa

I had the same error here but with glassfish server. Maybe it can help. I needed to configure the glassfish-web.xml file with the content inside the <resources>from glassfish-resources.xml. As I got another error I could find this annotation in the server log:

我在这里遇到了同样的错误,但是使用 glassfish 服务器。也许它可以提供帮助。我需要使用<resources>来自 glassfish-resources.xml 中的内容配置 glassfish-web.xml 文件。当我遇到另一个错误时,我可以在服务器日志中找到这个注释:

Caused by: java.lang.RuntimeException: Error in parsing WEB-INF/glassfish-web.xml for archive [file:/C:/Users/Win/Documents/NetBeansProjects/svad/build/web/]: The xml element should be [glassfish-web-app] rather than [resources]

引起:java.lang.RuntimeException:解析存档的 WEB-INF/glassfish-web.xml 时出错 [file:/C:/Users/Win/Documents/NetBeansProjects/svad/build/web/]:xml 元素应该成为 [glassfish-web-app] 而不是 [资源]

All I did then was to change the <resources>tag and apply <glassfish-web-app>in the glassfish-web.xml file.

我所做的只是更改<resources>标签并应用<glassfish-web-app>到 glassfish-web.xml 文件中。

回答by jomitame

Sometimes this happens because some library that you put in your code there isn't added, verify all libraries that you are using.

有时发生这种情况是因为您在代码中放置的某些库未添加,请验证您正在使用的所有库。

To add a new library in netbean:

在 netbean 中添加新库:

  • Rigth click in libraries folder.
  • Click in add library.
  • Select the library that you need in Available Libraries, or import it from Global Libraries (clicking in Import button).
  • Finally click in Add library to be sure that your library is added.
  • 右键单击库文件夹。
  • 单击添加库。
  • 在可用库中选择您需要的库,或从全局库中导入它(单击导入按钮)。
  • 最后单击添加库以确保添加了您的库。

回答by ricardo130

In my case I had to run Netbeans as administrator, that solved the problem for me. I'm using Apache Netbeans IDE 11.0

就我而言,我必须以管理员身份运行 Netbeans,这为我解决了问题。我正在使用 Apache Netbeans IDE 11.0

回答by Seymur Asadov

Try to change Tomcat version, in my case tomcat "8.0.41" and "8.5.8" didn't work. But "8.5.37" worked fine.

尝试更改 Tomcat 版本,在我的情况下,tomcat“8.0.41”和“8.5.8”不起作用。但是“8.5.37”工作正常。

回答by khaoula0513

the solution to this problem differs because each time you deploy the application will give you the same sentence or the problem is different, so you should see the tomcat server log for the exact problem.

这个问题的解决方案不同,因为每次部署应用程序都会给你同样的句子或者问题不同,所以你应该查看tomcat服务器日志以了解确切的问题。