2 Replies Latest reply on May 11, 2009 9:57 AM by matterbury

    How to configure JBoss 4.2.3.GA to use Derby datasource, net

    matterbury

      I am using Derby 10.4.2.1 with JBoss 4.2.3.GA.
      I am using Derby in network mode (not embedded mode).
      I have a jar of EJB2 beans that I deploy.

      If I run Derby using port 1527 everything works fine when I copy the jar into the deploy directory.

      If I run Derby using another port, it doesn't work (first few lines):

      17:27:03,129 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLNonTransientConnectionException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:155)
      


      I set the connection string in the -ds.xml port correctly:
      <datasources>
       <xa-datasource>
       <jndi-name>jdbc/telco</jndi-name>
       <track-connection-by-tx/>
       <isSameRM-override-value>false</isSameRM-override-value>
       <connection-url>jdbc:derby://localhost:39063/Telco</connection-url>
       <xa-datasource-class>org.apache.derby.jdbc.ClientXADataSource</xa-datasource-class>
       <xa-datasource-property name="DatabaseName">Telco</xa-datasource-property>
       <xa-datasource-property name="User">app</xa-datasource-property>
       <xa-datasource-property name="Password">app</xa-datasource-property>
      
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>
       <type-mapping>Derby</type-mapping>
       </metadata>
       </xa-datasource>
      </datasources>
      


      I have searched my JBoss installation and the JBoss source and my beans, and 1527 isn't mentioned anywhere, so I presume it comes from the derby.jar and/or derbyclient.jar files used to access Derby, so it seems JBoss isn't telling Derby the right port.

      Does anyone have any ideas or suggestions on how to track this down (what can I tweak to turn on useful debug logging for example)?

      TIA, m.