Netbeans 和 Glassfish 部署问题
我使用 netbeans 编写了一个 Web 应用程序,我总是通过 netbeans 本身将其部署到 Glassfish 服务器。现在我已经完成了它,我希望能够独立于 netbeans 运行它,这在我尝试的第一台 PC 上是成功的,我使用“start-domain”命令启动了 glassfish 服务器,以及我之前部署的服务已经在那里等着我了。
不过我后来尝试在另一台电脑上执行此操作。该服务通过 netbeans 部署得非常好,但是当我尝试自行启动 glassfish 服务器时,问题就出现了。由于某些奇怪的原因,netbeans 对我来说似乎使用了不同版本的 glassfish,因为如果我启动服务器,然后转到 netbeans 部署服务,我会收到以下错误消息:
Starting GlassFish Server 3.1
GlassFish Server 3.1 Server cannot start. Port is occupied.
In-place deployment [path]
Initializing...
deploy?DEFAULT=[path] failed. Instance is not GlassFish Server 3.1.
我只安装了一个版本的 glassfish,那就是3.1。在项目设置中,我选择了正确的 Glassfish 服务器,但它似乎仍然单独运行。任何帮助将非常感激,因为它让我很困惑!
I have written a web application using netbeans which I have always deployed to the Glassfish server through netbeans itself. Now that I've finished it, I want to be able to run it independently of netbeans, and this was succesful on the first PC I tried it on, I started the glassfish server using "start-domain" command, and my previously deployed service was already there waiting for me.
However I have since tried doing this on another PC. The service deploys completely fine through netbeans, but when I try starting the glassfish server on its own, the problems start. For some strange reason netbeans seems to be using a different version of glassfish to me, because if I start the server, and then go to netbeans to deploy the service, I get the following error message:
Starting GlassFish Server 3.1
GlassFish Server 3.1 Server cannot start. Port is occupied.
In-place deployment [path]
Initializing...
deploy?DEFAULT=[path] failed. Instance is not GlassFish Server 3.1.
I only have one version of glassfish installed, and that is 3.1. In the project settings I have the correct Glassfish server selected, but still, it seems to be running it separately. Any help would be very much appreciated, because it's confused the heck out of me!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你的GF(我的意思是服务器;))正在尝试打开一个由其他进程获取的端口。
您可以使用
netstat -aon
查找与端口绑定的进程检查这里我对详细信息的回答
Your GF (server I meant;) )is trying to open a port which is aquired by some other process.
You can look for the process that is binded with port using
netstat -aon
Check here my answer for detailed information
最后我解决了glassfish的问题。
在这里:
PS:我们将端口更改为 8284,但小心8284 未被使用。如果它也在使用中,您可以更改任何其他号码。
问候。
finally i solved the problem for glassfish.
here you are :
PS: We changed port to 8284 but be careful that 8284 is not in use. if it is in use too you can change any other number.
regards.
我认为您没有注册使用 Glassfish 手动启动的 Glassfish 实例(“服务”选项卡,右键单击“服务器”,“添加服务器”,键入 Glassfish 3.1,指向安装的基本目录。
现在 Netbeans 应该能够识别该服务器,并显示它正在运行。
另一方面,为什么不通过 Glassfish 的控制台将内置的 war 或 Ear 部署到 Glassfish 上呢?您不必通过 Netbeans 进行部署......
I don't think you have registered the instance of Glassfish that you started manually with Glassfish (Services tab, rightclick on Servers, Add Server, type Glassfish 3.1, point to the base directory of the installation.
Now Netbeans should recognize that server, and show that it's running.
On the other hand, why don't you just deploy the built war or ear to Glassfish via its console? You don't have to pass through Netbeans for deployment....