部署错误:从 netbeans 到 glassfish 4.0 的 Java-Webproject [英] Deployment-Error: Java-Webproject from netbeans to glassfish 4.0

查看:16
本文介绍了部署错误:从 netbeans 到 glassfish 4.0 的 Java-Webproject的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置

我在 Mac OSX Mavericks 上使用 Netbeans 7.4,在我的专用服务器上使用 Glassfish 4.0 (build 89)JDK 1.7.要在本地使用服务器,我设置了 ssh-tunnel.方式如下:

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:

ssh -L 4848:127.0.0.1:4848 -p 6122 glassfish@XXXXXXXXXX

这工作得很好,我可以通过本地主机访问服务器,没有任何问题.为了使用这个服务器,我在 Netbeans 中添加了一个服务器,参见 prinscreen:

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:

问题

现在我想将项目部署到服务器(右键单击项目 -> 部署),但出现以下错误:

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)

现在我检查了错误显示出现的行,它在后面 (1049-1051).对我来说,一切看起来都很正常:

Now I'd checked the line where the Error-Show's up, which is following (1049-1051). For me everything looks normal:

<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!

编辑 1 - 2014 年 1 月 8 日

好吧,我没有找到解决上述问题的解决方案,但以下方法至少可以手动部署应用程序.

Allright, I didn't found a solution for solving the problem above, but following way worked at least to deploy the app manually.

  1. Netbeans -> 右键单击​​项目 -> 清理/构建(现在检查保存项目的输出日志.
  2. 现在去那个路径,你会找到一个.war文件
  3. 登录您的 glassfish-server -> 单击应用程序的 -> 单击部署 -> 上传 .war 文件 -> 再次单击部署
  1. Netbeans -> Right-Click on Project -> Clean/Build (now check your outputlog where it save's the project.
  2. Now go to that path, you'll shoud find a .war file
  3. Log into your glassfish-server -> Click Application's -> Click deploy -> upload the .war file -> Click again deploy

现在 glassfish 为您部署项目.:)

Now glassfish deploys the project for you. :)

编辑 2 - 17.01.2014

我可以解决问题,以下是错误的.在netbeans 中我配置了Target 应该是domain1,如果你这样做,它就不会工作.让目标为空,一切正常.

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.

感谢 Tim B 的帮助!

推荐答案

如果 NetBeans 在您将其添加到列表时无法与服务器通信,则它会默默地失败.服务器出现在列表中,但您无法单击 + 并将其展开以查看其中包含的内容.

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 实际上可以看到服务器.还要记住,NetBeans 需要访问管理端口(通常是 4848)而不是普通的 Web 端口,尽管看起来您的隧道是正确的.

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.

您还需要打开远程管理并设置用户名和密码等.尝试将 Web 浏览器指向您的 localhost 6122 并检查您是否可以使用与 netbeans 相同的用户名和密码登录管理面板.

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.

要开启远程管理:

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.

这篇关于部署错误:从 netbeans 到 glassfish 4.0 的 Java-Webproject的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆