Netbeans 8.0.2 模块尚未部署
Netbeans 8.0.2 The module has not been deployed
我刚刚安装了 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>
错误:
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>
更新:通过重启解决了这个问题,但是 运行 应用程序出现了另一个错误。这次tomcat不开始了。要解决此问题(最新 apache 和 netbeans 版本的错误),请遵循:Error starting Tomcat from NetBeans - '127.0.0.1*' is not recognized as an internal or external command
可能因为您可能需要像这样在 Glassfish 服务器上手动创建 Db Resource 和 Pool,
在 Netbeans -> 项目中,打开服务器资源 -> glassfish-resources.xml 我们必须在 Glassfish 上手动创建 JDBC 资源和 JDBC 连接池。我在这里使用我的值,不要使用它们,看你的 .xml !
jndi-name 的值是您的 JDBC 资源,pool-name 的值是您的 JDBC 连接池。
为 Glassfish Admin 打开浏览器,https://localhost:4848/
转到,JDBC 连接池 -> 新建:1) 池名称:mysql_customersdb_rootPool 2) 资源类型:javax.sql.ConnectionPoolDataSource 3) 数据库驱动程序供应商:MySql
按下一步,
URL:jdbc:mysql://localhost:3306/customersdb?zeroDateTimeBehavior=convertToNull Url:jdbc:mysql://localhost:3306/customersdb?zeroDateTimeBehavior= convertToNull 用户:root 密码:root
JDBC 资源 -> 新建
JNDI 名称:CustomersDS 池名称:mysql_customersdb_rootPool
按确定。
右键单击您的项目并按 运行 :)
我时常遇到同样的问题。这就是我解决问题的方法,它对我来说就像一个魅力!
- 转到'Task Manager'
- 选择'Processes' 选项卡
- 点击 'Java(TM) Platform SE Binary'
- 单击 'End Process' 按钮
- 转到您的 NetBeans 项目
- 清理并构建项目
在我的例子中,我安装了新版本的 netbeans 并从 java 7 升级到 8。新的 netbeans 有不同版本的 glassfish,所以我打开了项目的属性并将其指向正确的 glassfish 版本并将 jdk 设置为版本 8.
我在这里遇到了同样的错误,但使用的是 glassfish 服务器。也许它可以帮助。我需要使用来自 glassfish-resources.xml 的 <resources>
中的内容配置 glassfish-web.xml 文件。当我遇到另一个错误时,我可以在服务器日志中找到这个注释:
原因:java.lang.RuntimeException:解析 WEB-INF/glassfish-web.xml 存档时出错 [file:/C:/Users/Win/Documents/NetBeansProjects/svad/build/web/]:xml元素应该是 [glassfish-web-app] 而不是 [resources]
然后我所做的就是更改 <resources>
标记并在 glassfish-web.xml 文件中应用 <glassfish-web-app>
。
有时会发生这种情况,因为您放入代码中的某些库未添加,请验证您正在使用的所有库。
要在 netbean 中添加新库:
- 在库文件夹中单击鼠标右键。
- 点击添加库。
- Select 可用库中您需要的库,或从全局库中导入(单击导入按钮)。
- 最后单击“添加库”以确保您的库已添加。
在我的情况下,我必须 运行 Netbeans 作为管理员,这为我解决了问题。
我正在使用 Apache Netbeans IDE 11.0
尝试更改 Tomcat 版本,在我的情况下 tomcat“8.0.41”和“8.5.8”不起作用。但是“8.5.37”工作正常。
此问题的解决方案不同,因为每次部署应用程序都会给您相同的句子或问题不同,因此您应该查看 tomcat 服务器日志以了解确切的问题。
我刚刚安装了 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>
错误:
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>
更新:通过重启解决了这个问题,但是 运行 应用程序出现了另一个错误。这次tomcat不开始了。要解决此问题(最新 apache 和 netbeans 版本的错误),请遵循:Error starting Tomcat from NetBeans - '127.0.0.1*' is not recognized as an internal or external command
可能因为您可能需要像这样在 Glassfish 服务器上手动创建 Db Resource 和 Pool,
在 Netbeans -> 项目中,打开服务器资源 -> glassfish-resources.xml 我们必须在 Glassfish 上手动创建 JDBC 资源和 JDBC 连接池。我在这里使用我的值,不要使用它们,看你的 .xml !
jndi-name 的值是您的 JDBC 资源,pool-name 的值是您的 JDBC 连接池。
为 Glassfish Admin 打开浏览器,https://localhost:4848/
转到,JDBC 连接池 -> 新建:1) 池名称:mysql_customersdb_rootPool 2) 资源类型:javax.sql.ConnectionPoolDataSource 3) 数据库驱动程序供应商:MySql
按下一步,
URL:jdbc:mysql://localhost:3306/customersdb?zeroDateTimeBehavior=convertToNull Url:jdbc:mysql://localhost:3306/customersdb?zeroDateTimeBehavior= convertToNull 用户:root 密码:root
JDBC 资源 -> 新建
JNDI 名称:CustomersDS 池名称:mysql_customersdb_rootPool
按确定。
右键单击您的项目并按 运行 :)
我时常遇到同样的问题。这就是我解决问题的方法,它对我来说就像一个魅力!
- 转到'Task Manager'
- 选择'Processes' 选项卡
- 点击 'Java(TM) Platform SE Binary'
- 单击 'End Process' 按钮
- 转到您的 NetBeans 项目
- 清理并构建项目
在我的例子中,我安装了新版本的 netbeans 并从 java 7 升级到 8。新的 netbeans 有不同版本的 glassfish,所以我打开了项目的属性并将其指向正确的 glassfish 版本并将 jdk 设置为版本 8.
我在这里遇到了同样的错误,但使用的是 glassfish 服务器。也许它可以帮助。我需要使用来自 glassfish-resources.xml 的 <resources>
中的内容配置 glassfish-web.xml 文件。当我遇到另一个错误时,我可以在服务器日志中找到这个注释:
原因:java.lang.RuntimeException:解析 WEB-INF/glassfish-web.xml 存档时出错 [file:/C:/Users/Win/Documents/NetBeansProjects/svad/build/web/]:xml元素应该是 [glassfish-web-app] 而不是 [resources]
然后我所做的就是更改 <resources>
标记并在 glassfish-web.xml 文件中应用 <glassfish-web-app>
。
有时会发生这种情况,因为您放入代码中的某些库未添加,请验证您正在使用的所有库。
要在 netbean 中添加新库:
- 在库文件夹中单击鼠标右键。
- 点击添加库。
- Select 可用库中您需要的库,或从全局库中导入(单击导入按钮)。
- 最后单击“添加库”以确保您的库已添加。
在我的情况下,我必须 运行 Netbeans 作为管理员,这为我解决了问题。 我正在使用 Apache Netbeans IDE 11.0
尝试更改 Tomcat 版本,在我的情况下 tomcat“8.0.41”和“8.5.8”不起作用。但是“8.5.37”工作正常。
此问题的解决方案不同,因为每次部署应用程序都会给您相同的句子或问题不同,因此您应该查看 tomcat 服务器日志以了解确切的问题。