部署错误:从 netbeans 到 glassfish 4.0 的 Java-Webproject
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20976377/
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
Deployment-Error: Java-Webproject from netbeans to glassfish 4.0
提问by safari
Setup
设置
I'm using Netbeans 7.4
on Mac OSX Mavericks and Glassfish 4.0 (build 89)
on my dedicated server and JDK 1.7
. To use the server locally I setup and ssh-tunnel. The following way:
我Netbeans 7.4
在 Mac OSX Mavericks 和Glassfish 4.0 (build 89)
我的专用服务器和JDK 1.7
. 要在本地使用服务器,我设置了 ssh-tunnel。以下方式:
ssh -L 4848:127.0.0.1:4848 -p 6122 glassfish@XXXXXXXXXX
This is working perfectly fine, I can access the server via localhost without any problems. To use this server I added a server in Netbeans, see prinscreen:
这工作得很好,我可以通过本地主机访问服务器,没有任何问题。要使用此服务器,我在 Netbeans 中添加了一个服务器,请参阅 prinscreen:
Problem
问题
Now I'd like to deploy the project to the server (Right-Click Project -> Deploy) but I get following Error:
现在我想将项目部署到服务器(右键单击项目 -> 部署),但出现以下错误:
Building jar: /Users/tzhware7/NetBeansProjects/SkyLogicAddon/dist/SkyLogicAddon.war
Distributing /Users/tzhware7/NetBeansProjects/SkyLogicAddon/dist/SkyLogicAddon.war to [glassfish.ivo]
glassfish.ivo, deploy, null, false
/Users/tzhware7/NetBeansProjects/SkyLogicAddon/nbproject/build-impl.xml:1050: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 1 second)
Now I'd checked the line where the Error-Show's up, which is following (1049-1051). For me everything looks normal:
现在我检查了错误显示所在的行,它在后面 (1049-1051)。对我来说,一切看起来都很正常:
<target if="netbeans.home" name="-run-deploy-nb">
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
</target>
In advance I checked the serverlogs, which are empty - no error is shown. What am I doing wrong? Can someone advice me what to change? Thank you in advance!
事先我检查了服务器日志,它们是空的 - 没有显示错误。我究竟做错了什么?有人可以建议我改变什么吗?先感谢您!
Edit 1 - 08.01.2014
编辑 1 - 08.01.2014
Allright, I didn't found a solution for solving the problem above, but following way worked at least to deploy the app manually.
好吧,我没有找到解决上述问题的解决方案,但以下方法至少可以手动部署应用程序。
- Netbeans -> Right-Click on Project -> Clean/Build (now check your outputlog where it save's the project.
- Now go to that path, you'll shoud find a
.war
file - Log into your glassfish-server -> Click Application's -> Click deploy -> upload the
.war
file -> Click again deploy
- Netbeans -> 右键单击项目 -> 清理/构建(现在检查保存项目的输出日志。
- 现在去那个路径,你会找到一个
.war
文件 - 登录您的 glassfish-server -> 单击应用程序的 -> 单击部署 -> 上传
.war
文件 -> 再次单击部署
Now glassfish deploys the project for you. :)
现在 glassfish 为您部署项目。:)
Edit 2 - 17.01.2014
编辑 2 - 17.01.2014
I could fix the problem, following was wrong. In netbeans I configured that the Target should be domain1, if you do this, it won't work. Let the target be empty, and everything works fine.
我可以解决问题,以下是错误的。在netbeans 中我配置了Target 应该是domain1,如果你这样做,它就不会工作。让目标为空,一切正常。
Thank you Tim B for your help!
谢谢蒂姆 B 的帮助!
采纳答案by Tim B
If NetBeans can't talk to the server when you add it to the list then it silently fails. The server appears in the list but you can't click on the + and expand it out to see what it contains.
如果 NetBeans 在您将其添加到列表时无法与服务器通信,则它会静默失败。服务器出现在列表中,但您无法单击 + 并将其展开以查看其中包含的内容。
Check in your server list that NetBeans can actually see the server. Also keep in mind that NetBeans needs access to the admin port (usually 4848) not the normal web one, although it looks like your tunnel is correct for that.
在您的服务器列表中检查 NetBeans 是否可以实际看到该服务器。还要记住,NetBeans 需要访问管理端口(通常是 4848)而不是普通的 Web 端口,尽管看起来您的隧道是正确的。
You also need to turn on remote administration and set up the username and password etc. Try pointing a web browser to your localhost 6122 and check you can log in to the admin panel using the same username and password that netbeans is using.
您还需要打开远程管理并设置用户名和密码等。尝试将 Web 浏览器指向您的 localhost 6122 并检查您是否可以使用 netbeans 使用的相同用户名和密码登录管理面板。
To turn on remote administration:
要打开远程管理:
https://blogs.oracle.com/quinn/entry/securing_adminstration_in_glassfish_server1
https://blogs.oracle.com/quinn/entry/securing_adminstration_in_glassfish_server1
asadmin enable-secure-admin
You will also need to add an administrator username and password.
您还需要添加管理员用户名和密码。