I'm hunting down a problem in my database configuration where the DefaultDS is being used and I can't get my PostgresqlDB resource to be used. Does anyone see anything wrong w/ the following config?
 
Here's what JBoss's output reports upon startup, 'run_with_tomcat.sh' :
---------------------------------------------
[XADataSourceLoader] Starting
[DefaultDS] XA Connection pool DefaultDS bound to java:/DefaultDS
[XADataSourceLoader] Started
[XADataSourceLoader] Starting
[PostgresqlDB] XA Connection pool PostgresqlDB bound to java:/PostgresqlDB
[XADataSourceLoader] Started
[ServerDataCollector] Starting
Here's the lookup.
--- MyEntityBean.java ----------------
dataSource = (DataSource) context.lookup("java:/PostgresqlDB");
And here's the <resource-ref... tag I use in my ejb-jar.xml:
-----------------------------------------------
   <resource-ref>
      <res-ref-name>jdbc/PostgresqlDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
   </resource-ref>
And here's the <resource-ref... tag I use in my jboss.xml:
-----------------------------------------------
 <resource-managers>
      <resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
         <res-name>jdbc/PostgresqlDB</res-name>
         <res-type>javax.sql.DataSource</res-type>
         <res-jndi-name>java:/access</res-jndi-name>
      </resource-manager>
 <enteprise-beans>
     <session>
        ...
         <resource-ref>
            <res-ref-name>jdbc/PostgresqlDB</res-ref-name>
            <resource-name>jdbc/access</resource-name>
         </resource-ref>
       ...
 
And my ~/conf/tomcat/jboss.jcml DataSource
--------------------------------------------------------
  <mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=DefaultDS">
    <attribute name="PoolName">DefaultDS</attribute>
    <attribute name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</attribute>
    <attribute name="Properties"></attribute>
    <attribute name="URL">jdbc:postgresql:acais:@localhost:5432</attribute>
    <attribute name="GCMinIdleTime">1200000</attribute>
    <attribute name="JDBCUser">myuser</attribute>
    <attribute name="MaxSize">10</attribute>
    <attribute name="Password">mypass</attribute>
    <attribute name="GCEnabled">false</attribute>
    <attribute name="InvalidateOnError">false</attribute>
    <attribute name="TimestampUsed">false</attribute>
    <attribute name="Blocking">true</attribute>
    <attribute name="GCInterval">120000</attribute>
    <attribute name="IdleTimeout">1800000</attribute>
    <attribute name="IdleTimeoutEnabled">false</attribute>
    <attribute name="LoggingEnabled">false</attribute>
    <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
    <attribute name="MinSize">0</attribute>
  </mbean>
 
  <mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=PostgresqlDB">
    <attribute name="PoolName">PostgresqlDB</attribute>
    <attribute name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</attribute>
    <attribute name="Properties"></attribute>
    <attribute name="URL">jdbc:postgresql:acais:@localhost:5432</attribute>
    <attribute name="GCMinIdleTime">1200000</attribute>
    <attribute name="JDBCUser">myuser</attribute>
    <attribute name="MaxSize">10</attribute>
    <attribute name="Password">mypass</attribute>
    <attribute name="GCEnabled">false</attribute>
    <attribute name="InvalidateOnError">false</attribute>
    <attribute name="TimestampUsed">false</attribute>
    <attribute name="Blocking">true</attribute>
    <attribute name="GCInterval">120000</attribute>
    <attribute name="IdleTimeout">1800000</attribute>
    <attribute name="IdleTimeoutEnabled">false</attribute>
    <attribute name="LoggingEnabled">false</attribute>
    <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
    <attribute name="MinSize">0</attribute>
</mbean>
 
 

Reply via email to