如何将 GlassFish 连接池和 GlassFish 领域转换为 WildFly 容器?

How convert GlassFish connection pool and GlassFish realm to WildFly container?

我有一个针对 GlassFish 容器开发的应用程序。在我的搜索中,我看到了如何在 WildFly 中创建连接池,但是,glassfish-resources.xml 中的数据库配置如何?我如何调整此文件以与 WildFly 一起使用?关于 glassFish-web.xml,具有领域配置?我如何将其转换为在 WildFly 中使用?下面是glassFish-resources.xhtml:

的代码
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
    <jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="org.postgresql.ds.PGSimpleDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="post-gre-sql_netclin_postgresPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
        <property name="serverName" value="localhost"/>
        <property name="portNumber" value="xxxx"/>
        <property name="databaseName" value="netclin"/>
        <property name="User" value="postgres"/>
        <property name="Password" value="xxxx"/>
        <property name="URL" value="jdbc:postgresql://localhost:5432/xxx"/>
        <property name="driverClass" value="org.postgresql.Driver"/>
    </jdbc-connection-pool>

    <jdbc-resource enabled="true" jndi-name="netclin2" object-type="user" pool-name="post-gre-sql_netclin_postgresPool"/>
</resources>

下面是 glassfish-web.xml 代码:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
  <glassfish-web-app error-url="">
   <context-root>/umamaoNovo</context-root>
    <security-role-mapping>
       <role-name>papelAdministradores</role-name>
        <group-name>administradores</group-name>
     </security-role-mapping>
   <security-role-mapping>
    <role-name>papelUsuarios</role-name>
    <group-name>administradores</group-name>
    <group-name>usuarios</group-name>
    <group-name>trabalhadores</group-name>
</security-role-mapping>
<security-role-mapping>
    <role-name>papelTrabalhadores</role-name>
    <group-name>administradores</group-name>
    <group-name>usuarios</group-name>
    <group-name>trabalhadores</group-name>
</security-role-mapping>
<class-loader delegate="true"/>
<jsp-config>
    <property name="keepgenerated" value="true">
        <description>Keep a copy of the generated servlet class' java code.</description>
    </property>
</jsp-config>

按照 Wildfly 制作者自己的指南进行操作。下面是 link: Glassfish to Wildfly Migration

这里也有非常相似的指南。Another Glassfish to Wildfly Migration