Netbeans 11.2:没有为项目或全局定义合适的Deployment Server [英] Netbeans 11.2: No suitable Deployment Server is defined for the project or globally

查看:554
本文介绍了Netbeans 11.2:没有为项目或全局定义合适的Deployment Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac上安装了Netbeans 11.2 IDE.在服务->服务器下,我将GlassFish Server添加为服务器.

I installed Netbeans 11.2 IDE on my Mac. Under Services -> Servers I added GlassFish Server as a server.

然后我打开了一个Maven项目.我可以清理并构建"它.然后我想运行它,但这导致以下错误消息:

Then I opened a maven project. I could "clean and build" it. Then I wanted to run it but this resulted in the following error message:

No suitable Deployment Server is defined for the project or globally.

我想这与以下内容有关:Netbeans中有一个名为输出-Java DB数据库进程"的窗口,当我启动GlassFish Server时,该窗口向我显示此消息:

I guess this has something to do with the following: there is a window in Netbeans called "Output - Java DB Database Process" and when I started the GlassFish Server the window showed me this message:

Sat Feb 08 18:02:45 CET 2020 : Security manager installed using the Basic server security policy.
Sat Feb 08 18:02:46 CET 2020 : Could not listen on port 1527 on host localhost: java.net.BindException: Address already in use (Bind failed)

我使用以下命令来检查哪个进程正在使用端口1527:

I used the following command to check which process was using port 1527:

sudo lsof -n -i :1527 | grep LISTEN

这将导致以下输出(注意:我删除了真实的用户名和真实的IP地址)

This resulted in the following output (note: I removed the real username and the real IP address)

java    6722 <user>   36u  IPv6 <IP Address>      0t0  TCP 127.0.0.1:tlisrv (LISTEN)

由于这是一个Java进程,所以我不想杀死它.

Since this is a java process I don't want to just kill it.

我该怎么办?

P.S.:

GlassFish Server的版本为5.1.0,请参见屏幕截图:

The version of the GlassFish Server is 5.1.0, see Screenshot:

P.P.S .:这个问题对我没有帮助: NetBeans:未定义合适的Deployment Server用于项目或全球

P.P.S.: this question didn't help me: NetBeans: No suitable Deployment Server is defined for the project or globally

P.P.P.S .:服务器日志中显示以下内容:

P.P.P.S.: the server log says - among other things - the following:

Context path from ServletContext:  differs from path from bundle: /|#]

这是日志的屏幕截图:

P.P.P.P.S:

P.P.P.P.S:

nb-configuration.xml文件的内容如下:

the content of the file nb-configuration.xml is the following:

    <?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
    <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
        <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.7-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
        <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>gfv3ee6</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
    </properties>
</project-shared-configuration>

推荐答案

对于glassfish 5.1,您应该在 nb-configuration.xml

For glassfish 5.1 you should change this parameters in nb-configuration.xml

  • netbeans_2e_hint_2e_j2eeVersion
  • netbeans_2e_hint_2e_deploy_2e_server

尝试先将 gfv3ee6 更改为 gfv5ee8 ,然后将 1.7-web 更改为 1.8-web

Try fist changing gfv3ee6 to gfv5ee8 and then change 1.7-web to 1.8-web

对我来说,这个配置是这样的:

For me worked this config:

<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
    <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.8-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
    <org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>ide</org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>
    <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>gfv5ee8</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
</properties>

它应解决此错误:

No suitable Deployment Server is defined for the project or globally.

Context path from ServletContext:  differs from path from bundle: /|#

错误尝试关闭(或杀死,包括NetBeans本身)所有Java进程,然后再次启动NetBeans并运行项目.看来您的项目已部署到另一个glassfish实例(以前的版本?).

error try to close (or kill, including NetBeans itself) all java processes and start NetBeans again and run the project. It looks like your project was deployed to a different instance of glassfish (the previous version?).

我想您不必担心这些消息:

Sat Feb 08 18:02:45 CET 2020 : Security manager installed using the Basic server security policy.
Sat Feb 08 18:02:46 CET 2020 : Could not listen on port 1527 on host localhost: java.net.BindException: Address already in use (Bind failed)

除非确实如此,否则因为以前有玻璃鱼.在这种情况下,只需停止或杀死前一个实例即可.

unless it indeed because of the previous instances of glassfish. In such a case just stop the previous instance or kill it.

这篇关于Netbeans 11.2:没有为项目或全局定义合适的Deployment Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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