[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - How to configure JBoss 4.2.3.GA to use Derby datasource, net

matterbury do-not-reply at jboss.com
Fri May 8 17:36:05 EDT 2009


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.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229821#4229821

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229821



More information about the jboss-user mailing list