将 WildFly 应用服务器与 NetBeans IDE 结合使用 [英] Using the WildFly application server with NetBeans IDE

查看:23
本文介绍了将 WildFly 应用服务器与 NetBeans IDE 结合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直习惯于使用 GlassFish 服务器.我正在将 Java EE 应用程序从 GlassFish (4.0) 迁移到 WildFly 8.1.0 final.

I was accustomed to using GlassFish server all the times. I'm migrating a Java EE application from GlassFish (4.0) to WildFly 8.1.0 final.

我尝试使用 这个插件在 NetBeans 8.0 上使用 WildFly 8.1.0 final/a> 用于服务器,因为服务器没有内置插件.

I tried using WildFly 8.1.0 final on NetBeans 8.0 using this plugin for the server, since there was no built-in plugin for the server.

与 GlassFish 不同的是,即使在 IDE 上启用了 deploy on save 选项,应用程序也不会在保存项目数据时部署.该应用程序会导致非常奇怪/未知/不寻常的问题.例如,这个问题充满了(仅仅)其中一些问题.

Unlike GlassFish, the application is however, not deployed on saving project data even though the deploy on save option on the IDE is enabled. The application leads to very strange/unknown/unusual problems. For example, this question is full of (merely) some of those problems.

我将 NetBeans 升级到 8.0.1(JSF 升级到 2.2.8-02),它有一个内置的 WildFly-Plugin,但它也带来了与以前版本的 IDE 几乎没有区别.

I upgraded NetBeans to 8.0.1 (with JSF to 2.2.8-02) which has a built-in WildFly-Plugin but it also brought all most no difference anyway than the previous version of the IDE.

在错误报告的此评论中,提到了通过如下更改/添加一些与 JDBC 驱动程序相对应的 XML 来进行修复,

In this comment of a bug report, it is mentioned that a fix was made by changing/adding some XML corresponding to a JDBC driver as follows,

<driver name="mysql" module="com.mysql">
  <xa-datasource-class>
    com.mysql.jdbc.jdbc2.optional.MysqlDataSource
  </xa-datasource-class>
</driver>

我还对 standalone-full.xml 文件进行了此更改.这个特定的部分如下所示.

I also made this change to the standalone-full.xml file. This particular part looks like as follows.

<subsystem xmlns="urn:jboss:domain:datasources:2.0">
    <datasources>
        <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
            <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
            <driver>h2</driver>
            <security>
                <user-name>sa</user-name>
                <password>sa</password>
            </security>
        </datasource>

        <datasource jta="false" jndi-name="java:/jdbc/project_datasource" pool-name="project_datasource" enabled="true" use-ccm="false">
            <connection-url>jdbc:mysql://localhost:3306/projectdb</connection-url>
            <driver-class>com.mysql.jdbc.Driver</driver-class>
            <driver>mysql</driver>
            <pool>
                <min-pool-size>5</min-pool-size>
                <max-pool-size>15</max-pool-size>
            </pool>
            <security>
                <user-name>root</user-name>
                <password>root</password>
            </security>
            <validation>
                <validate-on-match>false</validate-on-match>
                <background-validation>false</background-validation>
            </validation>
            <statement>
                <share-prepared-statements>false</share-prepared-statements>
            </statement>
        </datasource>
        <drivers>
            <driver name="h2" module="com.h2database.h2">
                <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
            </driver>
            <driver name="mysql" module="com.mysql">
                <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlDataSource</xa-datasource-class>
            </driver>
        </drivers>
    </datasources>
</subsystem>

但一切都是徒劳的.这样做并没有什么新鲜事.

But all in vain. Doing so made nothing new.

无论如何,现在是否可以将 WildFly(8.1.0 或更高版本,只要可用)与 NetBeans 一起使用(也许通过在某处进行一些更改)?

Anyway, is it possible to use WildFly (8.1.0 or higher, whenever available) with NetBeans for now (maybe by making somewhere some changes)?

看来我现在几乎要远离 WildFly 了.是吗?:)

It appears that I'm almost left with staying away with WildFly for now. Is it? :)

我不知道插件是否有问题.可能会有所不同.

更新:

我至少花了三个星期才遇到这种情况.所以,请不要认为我在这里写的整件事是错误的/毫无意义的,如果你不能在一瞬间重现同样的事情(如链接中提到的 问题 - 包括删除线文本) - 我不能再多说什么了.

It took me at least three weeks to encounter this situation. So, please do not think that the entire thing I wrote here is wrong/meaningless, if you could not reproduce the same thing just within a moment (as mentioned in the linked question - including the strike-through text) - I just cannot say anything more about it.

可重现的事情之一:如果对现有应用程序进行了一些更改,则应用程序不会(自动)部署到服务器,如果这些更改被保存(更不用说在保存时部署

One of the reproducible things : if some changes to an existing application are made, the application is not (automatically) deployed to the server, if those changes are saved (not to mention that the deploy on save option is enabled in the IDE) - but that's just one simplest thing and cannot be relied upon, even though happens correctly.

显然,该插件没有以应有的方式与 IDE 交互/通信(例如,在使用 GlassFish Server 时正确发生).

Apparently the plugin does not interact/communicate with the IDE in a way that it should (as happens correctly, when using GlassFish Server, for example).

推荐答案

只是一个警告,因为我错过了这个并且正在为此撕心裂肺.Wildfly 默认使用端口 9990 进行调试管理,但是如果您有 Nvidia 设备,这会导致问题,因为 Nvidia 网络服务也使用 9990.

Just a warning, as I missed this and was tearing my hair out on this. Wildfly uses port 9990 for debug management as default, this however causes a problem if you have an Nvidia device as the Nvidia network service also uses 9990.

为了修复它,我已经停止了 Nvidia 网络服务(在任务管理器中)并且我的 Netbeans (8.1) 现在可以连接到 wildfly 服务器并且不再失败.

To fix it, I've stopped the Nvidia network service (In task manager) and my Netbeans (8.1) can now connect to the wildfly server and no longer falls over.

您还可以更改wildfly 使用的端口,以阻止冲突.如果您使用的是 standalone.xml 文件,请更改以下行:

You can also change the ports that wildfly uses, to stop the conflict. If you are using the standalone.xml file, change the following line:

<socket-binding name="management-http"
    interface="management"
    port="${jboss.management.http.port:9990}"/>

并将端口号更改为您选择的.现在在 NetBeans 中,当您选择添加服务器并访问实例属性时,请确保将管理端口设置为与您在配置文件中设置的相同.我选择了 9991,目前没有任何问题.

And change the port number to your choosing. Now in NetBeans, when you choose to add the server and get to the Instance Properties, make sure you set the management port to the same as what you have set in the config file. I chose 9991 and had no issues so far.

(我在这里发布,因为这是我在寻找解决问题时不断得到的第一个结果)

(I posted here as this was the first result I kept coming to when searching for fixing the issue)

这篇关于将 WildFly 应用服务器与 NetBeans IDE 结合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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