简体   繁体   English

Netbeans 8.0.2 模块尚未部署

[英]Netbeans 8.0.2 The module has not been deployed

I just installed netbeans and I have problems deploying a new Java Web App.我刚刚安装了 netbeans,但在部署新的 Java Web 应用程序时遇到了问题。 I simply create the project without editing anything, this is what project has by default (using apache):我只是在不编辑任何内容的情况下创建项目,这是默认情况下的项目(使用 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:\Users\2kGamer\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:\Users\2kGamer\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>

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'单击“Java(TM) 平台 SE 二进制”
  4. Click on 'End Process' button单击“结束进程”按钮
  5. Go to your NetBeans project转到您的 NetBeans 项目
  6. Clean & Build the project清理并构建项目

In my case I had to run Netbeans as administrator, that solved the problem for me.就我而言,我必须以管理员身份运行 Netbeans,这为我解决了问题。 I'm using Apache Netbeans IDE 11.0我正在使用 Apache Netbeans IDE 11.0

UPDATE: this was solved by rebooting but there was another error when running app.更新:这是通过重新启动解决的,但运行应用程序时出现另一个错误。 This time tomcat woudnt start.这次tomcat启动不了。 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要解决此问题(最新 apache 和 netbeans 版本的错误),请执行以下操作: 从 NetBeans 启动 Tomcat 时出错 - '127.0.0.1*' 未被识别为内部或外部命令

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

I had the same error here but with glassfish server.我在这里遇到了同样的错误,但是使用 glassfish 服务器。 Maybe it can help.也许它可以提供帮助。 I needed to configure the glassfish-web.xml file with the content inside the <resources> from glassfish-resources.xml.我需要使用 glassfish-resources.xml 中<resources>的内容来配置 glassfish-web.xml 文件。 As I got another error I could find this annotation in the server log:当我遇到另一个错误时,我可以在服务器日志中找到这个注释:

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.xml 文件中应用<glassfish-web-app>

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.最后单击添加库以确保添加了您的库。

Try to change Tomcat version, in my case tomcat "8.0.41" and "8.5.8" didn't work.尝试更改 Tomcat 版本,在我的情况下,tomcat“8.0.41”和“8.5.8”不起作用。 But "8.5.37" worked fine.但是“8.5.37”工作正常。

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

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.在 Netbeans -> 项目中,打开服务器资源 -> glassfish-resources.xml 我们必须在 Glassfish 上手动创建 JDBC 资源和 JDBC 连接池。 I am using my values here, don't use them, see your .xml !我在这里使用我的值,不要使用它们,请参阅您的 .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 :)右键单击您的项目并按运行 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM