geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "VARIN, FRANCIS A." <FVA...@AMICA.com>
Subject Issue attempting to deploy second DB2 Datasource
Date Tue, 18 Apr 2006 17:40:09 GMT
  

Problem Description: 

We have successfully deployed a DB2 datasource using the DB2 type 2
driver. However the deployment of a second pool fails complaining that
the supporting DB2 .dll file has already been loaded. 

 

Datasource definitions: 

 

<?xml version="1.0" encoding="UTF-8"?>

<connector configId="user/database-pool-BLUGDB/1/car"
xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.0">

           <dep:dependency
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.0">

                       <dep:uri>db2/db2java/8.1.7/jar</dep:uri>

           </dep:dependency>

           <dependency>

                       <uri>db2/db2jcc/8.1.7/jar</uri>

           </dependency>

           <dependency>

                       <uri>db2/db2jcc_license_cu/8.1.7/jar</uri>

           </dependency>

           <resourceadapter>

                       <outbound-resourceadapter>

                                   <connection-definition>

 
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-int
erface>

 
<connectiondefinition-instance>

 
<name>BLUEGDB</name>

 
<config-property-setting name="Password">xxxx</config-property-setting>

 
<config-property-setting
name="CommitBeforeAutocommit">false</config-property-setting>

 
<config-property-setting
name="Driver">COM.ibm.db2.jdbc.app.DB2Driver</config-property-setting>

 
<config-property-setting
name="ExceptionSorterClass">org.tranql.connector.AllExceptionsAreFatalSo
rter</config-property-setting>

 
<config-property-setting name="UserName">xxxx</config-property-setting>

 
<config-property-setting
name="ConnectionURL">jdbc:db2://xxxxx:50000/VINDB</config-property-setti
ng>

 
<connectionmanager>

 
<local-transaction/>

 
<single-pool>

 
<match-one/>

 
</single-pool>

 
</connectionmanager>

 
</connectiondefinition-instance>

                                   </connection-definition>

                       </outbound-resourceadapter>

           </resourceadapter>

</connector>

 

 

 

<?xml version="1.0" encoding="UTF-8"?>

<connector configId="user/database-pool-AUDLOGDB/1/car"
xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.0">

           <dep:dependency
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.0">

                       <dep:uri>db2/db2java/8.1.7/jar</dep:uri>

           </dep:dependency>

           <dependency>

                       <uri>db2/db2jcc/8.1.7/jar</uri>

           </dependency>

           <dependency>

                       <uri>db2/db2jcc_license_cu/8.1.7/jar</uri>

           </dependency>

           <resourceadapter>

                       <outbound-resourceadapter>

                                   <connection-definition>

 
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-int
erface>

 
<connectiondefinition-instance>

 
<name>AUDLOGDB</name>

 
<config-property-setting name="Password">xxxx</config-property-setting>

 
<config-property-setting
name="CommitBeforeAutocommit">false</config-property-setting>

 
<config-property-setting
name="Driver">COM.ibm.db2.jdbc.app.DB2Driver</config-property-setting>

 
<config-property-setting
name="ExceptionSorterClass">org.tranql.connector.AllExceptionsAreFatalSo
rter</config-property-setting>

 
<config-property-setting name="UserName">xxxx</config-property-setting>

 
<config-property-setting
name="ConnectionURL">jdbc:db2://xxxxxx:50000/VINDB</config-property-sett
ing>

 
<connectionmanager>

 
<local-transaction/>

 
<single-pool>

 
<match-one/>

 
</single-pool>

 
</connectionmanager>

 
</connectiondefinition-instance>

                                   </connection-definition>

                       </outbound-resourceadapter>

           </resourceadapter>

</connector>

 

NOTE: the user, password and server names have been changed to "x" in
the above samples. They actually contain the correct data. Both server
names are the same for each datasource. Also, the "connectionURL" is the
same since we are pointing at a DB2 Connect box that resolves the actual
url to the real database. 

 

 

Resulting Error Message: 

The following error occurs either at deployment or when the Geronimo
server starts: 

 

11:25:45,739 ERROR [GBeanInstanceState] Error while starting; GBean is
now in the FAILED state:
objectName="geronimo.server:J2EEApplication=null,J2EEServer=geronimo,JCA
Resource=user/database-pool-BLUEGDB/1/car,j2eeType=JCAManagedConnectionF
actory,name=BLUEGDB"

java.sql.SQLException: java.lang.UnsatisfiedLinkError: Native Library
C:\Program Files\SQLLIB\bin\db2jdbc.dll already loaded in another
classloader

           at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)

           at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

           at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
ccessorImpl.java:39)

           at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)

           at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)

           at java.lang.Class.newInstance0(Class.java:306)

           at java.lang.Class.newInstance(Class.java:259)

           at
org.tranql.connector.jdbc.JDBCDriverMCF.setDriver(JDBCDriverMCF.java:145
)

           at
org.tranql.connector.jdbc.JDBCDriverMCF$$FastClassByCGLIB$$81f38179.invo
ke(<generated>)

           at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)

           at
org.apache.geronimo.gbean.DynamicGBeanDelegate$Operation.invoke(DynamicG
BeanDelegate.java:181)

           at
org.apache.geronimo.gbean.DynamicGBeanDelegate.setAttribute(DynamicGBean
Delegate.java:134)

           at
org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper.s
etAttribute(ManagedConnectionFactoryWrapper.java:254)

           at
org.apache.geronimo.gbean.runtime.GBeanAttribute$DynamicSetterMethodInvo
ker.invoke(GBeanAttribute.java:430)

           at
org.apache.geronimo.gbean.runtime.GBeanAttribute.setValue(GBeanAttribute
..java:403)

           at
org.apache.geronimo.gbean.runtime.GBeanAttribute.inject(GBeanAttribute.j
ava:334)

           at
org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInst
ance.java:925)

           at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GB
eanInstanceState.java:325)

           at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstance
State.java:110)

           at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBea
nInstanceState.java:132)

           at
org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInst
ance.java:537)

           at
org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKe
rnel.java:208)

           at
org.apache.geronimo.kernel.config.Configuration.startRecursiveGBeans(Con
figuration.java:315)

           at
org.apache.geronimo.kernel.config.Configuration$$FastClassByCGLIB$$7f4b4
a9b.invoke(<generated>)

           at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)

           at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInv
oker.java:38)

           at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.j
ava:118)

           at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.jav
a:835)

           at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:178
)

           at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:173
)

           at
org.apache.geronimo.kernel.config.ConfigurationManagerImpl.start(Configu
rationManagerImpl.java:142)

           at
org.apache.geronimo.kernel.config.ConfigurationManagerImpl$$FastClassByC
GLIB$$fbed85d2.invoke(<generated>)

           at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)

           at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInv
oker.java:38)

           at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.j
ava:118)

           at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.jav
a:835)

           at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:178
)

           at
org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:125)

           at
org.apache.geronimo.kernel.KernelGBean$$FastClassByCGLIB$$1cccefc9.invok
e(<generated>)

           at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)

           at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInv
oker.java:38)

           at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.j
ava:118)

           at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.jav
a:835)

           at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:178
)

           at
org.apache.geronimo.kernel.jmx.MBeanServerDelegate.invoke(MBeanServerDel
egate.java:117)

           at
mx4j.remote.rmi.RMIConnectionInvoker.invoke(RMIConnectionInvoker.java:21
9)

           at sun.reflect.GeneratedMethodAccessor335.invoke(Unknown
Source)

           at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

           at java.lang.reflect.Method.invoke(Method.java:324)

           at
mx4j.remote.rmi.RMIConnectionProxy.invoke(RMIConnectionProxy.java:34)

           at
mx4j.remote.rmi.RMIConnectionSubjectInvoker.chain(RMIConnectionSubjectIn
voker.java:99)

           at
mx4j.remote.rmi.RMIConnectionSubjectInvoker.access$000(RMIConnectionSubj
ectInvoker.java:31)

           at
mx4j.remote.rmi.RMIConnectionSubjectInvoker$1.run(RMIConnectionSubjectIn
voker.java:90)

           at java.security.AccessController.doPrivileged(Native Method)

           at
javax.security.auth.Subject.doAsPrivileged(Subject.java:499)

           at
mx4j.remote.MX4JRemoteUtils.subjectInvoke(MX4JRemoteUtils.java:163)

           at
mx4j.remote.rmi.RMIConnectionSubjectInvoker.subjectInvoke(RMIConnectionS
ubjectInvoker.java:86)

           at
mx4j.remote.rmi.RMIConnectionSubjectInvoker.invoke(RMIConnectionSubjectI
nvoker.java:80)

           at $Proxy0.invoke(Unknown Source)

           at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.j
ava:221)

           at sun.reflect.GeneratedMethodAccessor335.invoke(Unknown
Source)

           at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

           at java.lang.reflect.Method.invoke(Method.java:324)

           at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)

           at sun.rmi.transport.Transport$1.run(Transport.java:148)

           at java.security.AccessController.doPrivileged(Native Method)

           at
sun.rmi.transport.Transport.serviceCall(Transport.java:144)

           at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)

           at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.ja
va:701)

           at java.lang.Thread.run(Thread.java:536)

 

 

Questions: 

So, this leaves me with the following questions: 

1)     What must I do to define multiple DB2 databases using this
approach?

2)     Is there some other way of describing the databases using the
descriptor syntax that could allow two or more definitions to be
configured?

 

 

Francis A. Varin, M.S. 
IT Architect II 
Corporate Information Systems 
Amica Mutual Insurance Company 
1-800-652-6422 ext. 24536  
http://www.amica.com <http://www.amica.com/>  

 



Mime
View raw message