2015-03-02 53 views
0

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

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

回答