Java 企业应用程序 build-impl.xml 抛出错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23651788/
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
Enterprise application build-impl.xml throws error
提问by ken4ward
I am using Glassfish-4.0, Netbeans-8. I started trying out a sample enterprise application. I have tried this same tutorial a couple of times trying to get where and when exactly the problem got infused in the application. To my surprise, it is from the onset. Once I create a new application by doing this in Netbeans:
我正在使用 Glassfish-4.0、Netbeans-8。我开始尝试一个示例企业应用程序。我已经尝试过几次相同的教程,试图了解问题在应用程序中的确切位置和时间。令我惊讶的是,它是从一开始的。一旦我通过在 Netbeans 中执行此操作创建了一个新应用程序:
Project => J2EE => Enterprise Application => Entered the project name => selects glassfish and JDK-7 and clicked finished. I tried running this application as is and it throws this error in the build-impl.xml
file on this line (this is in the ContactProject-ejb project):
Project => J2EE => Enterprise Application => 输入项目名称 => 选择 glassfish 和 JDK-7 并单击完成。我尝试按原样运行此应用程序,它build-impl.xml
在此行的文件中引发此错误(这是在 ContactProject-ejb 项目中):
934 <nbdeploy debugmode="false" forceRedeploy="${forceRedeploy}"/>
While a similar error throws up in the ContactProject file
虽然 ContactProject 文件中出现了类似的错误
<target name="-run-deploy-am" unless="no.deps">
<!-- Task to deploy to the Access Manager runtime. -->
<ant antfile="${project.ContactApp-ejb}/build.xml" inheritall="false" target="-run-deploy-am"/>
<ant antfile="${project.ContactApp-war}/build.xml" inheritall="false" target="-run-deploy-am"/>
</target>
<target depends="-init-cos,dist-directory-deploy,pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,post-run-deploy" name="run-deploy"/>
<target if="netbeans.home" name="-run-deploy-nb">
<nbdeploy clientModuleUri="${client.module.uri}" clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
</target>
<target name="-init-deploy-ant" unless="netbeans.home">
<property name="deploy.ant.archive" value="${dist.jar}"/>
<property name="deploy.ant.resource.dir" value="${resource.dir}"/>
<property name="deploy.ant.enabled" value="true"/>
</target>
<target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/>
<target if="netbeans.home" name="-run-undeploy-nb">
<fail message="Undeploy is not supported from within the IDE"/>
</target>
<target depends="dist" name="verify">
<nbverify file="${dist.jar}"/>
</target>
What exactly could be the problem with this? This is the error when I try running the ejb file. I have searched the log of Glassfish, it's blank, so no indication if whatsoever is going on.
这到底是什么问题?这是我尝试运行 ejb 文件时的错误。我已经搜索了 Glassfish 的日志,它是空白的,所以没有任何迹象表明发生了什么。
pre-run-deploy:
In-place deployment at C:\Users\Ken4ward\Documents\NetBeansProjects\ContactApp\ContactApp-ejb\build\classes
GlassFish Server 4, deploy, null, false
C:\Users\Ken4ward\Documents\NetBeansProjects\ContactApp\ContactApp-ejb\nbproject\build-impl.xml:935: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 1 minute 10 seconds)
采纳答案by unwichtich
You are not even providing the error message...
您甚至没有提供错误消息...
It looks like the problem is that you didn't build the submodules (i.e. the EJB and the WAR project) and therefore Maven can't find the artifacts in your local repository.
看起来问题在于您没有构建子模块(即 EJB 和 WAR 项目),因此 Maven 在您的本地存储库中找不到工件。
To fix this either build the parent Maven project (the parent of the EAR projecT) or right-click on your EAR project and click "Build with Dependencies".
要解决此问题,请构建父 Maven 项目(EAR 项目的父项目)或右键单击您的 EAR 项目并单击“ Build with Dependencies”。
If this doesn't fix the problem, update the question with the real error message (Hint: The message containing the line number in the build-impl.xml
is not the real error message).
如果这不能解决问题,请使用真实的错误消息更新问题(提示:包含行号的消息build-impl.xml
不是真正的错误消息)。
回答by Krystian
In my case problem was with no connection from glassfish to mysql db.
在我的情况下,问题是从 glassfish 到 mysql db 没有连接。
I based my connection on that tutorial.
我的联系基于该教程。
回答by Elton
I had the same problem bugging me for a whole weekend. I found out that the problem was the name of my project directory had a "&" special character in it. I renamed the directory - removed the "&" and that solved my problem. I hope this saves someone a lot of time.
我整个周末都遇到了同样的问题。我发现问题是我的项目目录的名称中有一个“&”特殊字符。我重命名了目录 - 删除了“&”并解决了我的问题。我希望这可以为某人节省很多时间。
回答by Edgar de Jesus Ceballos Garcia
I had the same things you showed up, but Drew is right that's not the error, in my case was the my connection could not be established because in the beginning I had no password to access my connection, but then I placed a password and I forgot to place it on the config as well. I did it in configuration files, double clicking the one named glassfish-resources.xml, seek the property with the name Password and the password goes there (value="It should be empty for you").
我遇到了和你一样的事情,但德鲁是对的,这不是错误,在我的情况下,我的连接无法建立,因为一开始我没有密码来访问我的连接,但后来我输入了一个密码,我也忘了把它放在配置上。我是在配置文件中完成的,双击名为 glassfish-resources.xml 的文件,寻找名为 Password 的属性,密码就在那里(value="It should be empty for you")。