[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] ClassLoader issues



Mike Poindexter wrote:
When I load the XMLBlaster jar using a custom classloader from within an application I get the following:

Property: Loading xmlBlaster.properties from CLASSPATH file:/C:/DPA/lib/xmlBlast
er.jar!/xmlBlaster.properties
Property: No args array given.
[Aug 26, 2003 4:22:07 PM ERROR Global] initLog(): Error in getting LogDeviceFact
ory for client
[Aug 26, 2003 4:22:07 PM ERROR Global] initLog(): Error in getting LogDeviceFact
ory for core
[Aug 26, 2003 4:22:07 PM ERROR Global] initLog(): Error in getting LogDeviceFact
ory for auth
[Aug 26, 2003 4:22:07 PM ERROR Global] initLog(): Error in getting LogDeviceFact
ory for queue
[Aug 26, 2003 4:22:07 PM INFO  XmlBlasterAccess] Loaded security plugin=htpasswd
 version=1.0
[Aug 26, 2003 4:22:08 PM ERROR Global] initLog(): Error in getting LogDeviceFact
ory for classloader
[Aug 26, 2003 4:22:08 PM ERROR Global] initLog(): Error in getting LogDeviceFact
ory for jdbc
[Aug 26, 2003 4:22:08 PM INFO  JdbcConnectionPool] initialize
[Aug 26, 2003 4:22:08 PM ERROR JdbcConnectionPool-jdbc:hsqldb:C:\Documents and S
ettings\Administrator\tmp\clientBPFServer1061932927946] exception when connectin
g to DB, error code : '0 : No suitable driver' DB configuration details follow (
check if the DB is running)
[Aug 26, 2003 4:22:08 PM INFO  JdbcConnectionPool-jdbc:hsqldb:C:\Documents and S
ettings\Administrator\tmp\clientBPFServer1061932927946] diagnostics: initialize
-url                 : 'jdbc:hsqldb:C:\Documents and Settings\Administrator\tmp\
clientBPFServer1061932927946'
[Aug 26, 2003 4:22:08 PM INFO  JdbcConnectionPool-jdbc:hsqldb:C:\Documents and S
ettings\Administrator\tmp\clientBPFServer1061932927946] diagnostics: initialize
-user                : 'sa'
[Aug 26, 2003 4:22:08 PM INFO  JdbcConnectionPool-jdbc:hsqldb:C:\Documents and S
ettings\Administrator\tmp\clientBPFServer1061932927946] diagnostics: initialize
-password            : ''
[Aug 26, 2003 4:22:08 PM INFO  JdbcConnectionPool-jdbc:hsqldb:C:\Documents and S
ettings\Administrator\tmp\clientBPFServer1061932927946] diagnostics: initialize
-max number of conn  : '1'
[Aug 26, 2003 4:22:08 PM INFO  JdbcConnectionPool-jdbc:hsqldb:C:\Documents and S
ettings\Administrator\tmp\clientBPFServer1061932927946] diagnostics: initialize
-conn busy timeout   : '90000'
[Aug 26, 2003 4:22:08 PM INFO  JdbcConnectionPool-jdbc:hsqldb:C:\Documents and S
ettings\Administrator\tmp\clientBPFServer1061932927946] diagnostics: initialize
-driver list         : 'org.hsqldb.jdbcDriver:sun.jdbc.odbc.JdbcOdbcDriver:ORG.a
s220.tinySQL.dbfFileDriver:oracle.jdbc.driver.OracleDriver:com.mysql.jdbc.Driver
:org.postgresql.Driver:de.sag.jdbc.adabasd.ADriver:com.sybase.jdbc2.jdbc.SybDriv
er:com.microsoft.jdbc.sqlserver.SQLServerDriver'
[Aug 26, 2003 4:22:08 PM INFO  JdbcConnectionPool-jdbc:hsqldb:C:\Documents and S
ettings\Administrator\tmp\clientBPFServer1061932927946] diagnostics: initialize
-max. waiting Threads: '300'
[Aug 26, 2003 4:22:08 PM ERROR org.xmlBlaster.util.queue.cache.CacheQueueInterce
ptorPlugin-connection:client/BPFServer] Could not initialize the persistent queu
e 'connection:client/BPFServer'. Is the JDBC Driver jar file in the CLASSPATH ?
Is the DB up and running ? We continue RAM based ...XmlBlasterException errorCod
e=[resource.db.unavailable] serverSideException=false node=[client/BPFServer1061
932927946] location=[Global/type 'JDBC' version '1.0'] message=[getJdbcCommonTab
leQueueManager SQL exception : java.sql.SQLException: No suitable driver] The pr
opery settings are:
 <queue relating='connection' maxEntries='10000000' maxEntriesCache='1000'>
  <address type='IOR' dispatchPlugin='undef'>

  </address>
 </queue>
[Aug 26, 2003 4:22:08 PM ERROR Global] initLog(): Error in getting LogDeviceFact
ory for dispatch
[Aug 26, 2003 4:22:08 PM ERROR Global] initLog(): Error in getting LogDeviceFact
ory for protocol
[Aug 26, 2003 4:22:08 PM ERROR Global] initLog(): Error in getting LogDeviceFact
ory for corba
[Aug 26, 2003 4:22:08 PM INFO  CorbaConnection] Created 'IOR' protocol plugin to
 connect to xmlBlaster server
java.lang.Exception: Stack trace
        at java.lang.Thread.dumpStack(Thread.java:1071)
        at org.xmlBlaster.client.ClientErrorHandler.handleError(ClientErrorHandl
er.java:58)
        at org.xmlBlaster.util.dispatch.DeliveryManager.givingUpDelivery(Deliver
yManager.java:254)
        at org.xmlBlaster.util.dispatch.DeliveryManager.toDead(DeliveryManager.j
ava:247)
        at org.xmlBlaster.util.dispatch.DeliveryConnectionsHandler.updateState(D
eliveryConnectionsHandler.java:272)
        at org.xmlBlaster.util.dispatch.DeliveryConnectionsHandler.toDead(Delive
ryConnectionsHandler.java:239)
        at org.xmlBlaster.util.dispatch.DeliveryConnection.initialize(DeliveryCo
nnection.java:124)
        at org.xmlBlaster.util.dispatch.DeliveryConnectionsHandler.initialize(De
liveryConnectionsHandler.java:143)
        at org.xmlBlaster.util.dispatch.DeliveryManager.<init>(DeliveryManager.j
ava:115)
        at org.xmlBlaster.client.XmlBlasterAccess.connect(XmlBlasterAccess.java:
221)
        at com.btrade.buspluginframework.PluginServer.connect(PluginServer.java:
191)
        at com.btrade.buspluginframework.PluginServer.initialize(PluginServer.ja
va:165)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.btrade.util.loader.ServerLauncher.main(ServerLauncher.java:85)
[Aug 26, 2003 4:22:08 PM INFO  DeliveryManager-connection:client/BPFServer] Swit
ched to synchronous message delivery
Cannot connect to XMLBlaster: XmlBlasterException serverSideException=false node
=[client/BPFServer1061932927946] location=[XmlBlasterAccess-client/BPFServer]
org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation org.jacor
b.orb.ORB  vmcid: 0x0  minor code: 0  completed: No
stackTrace=org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementatio
n org.jacorb.orb.ORB  vmcid: 0x0  minor code: 0  completed: No
        at org.omg.CORBA.ORB.create_impl(ORB.java:297)
        at org.omg.CORBA.ORB.init(ORB.java:336)
        at org.xmlBlaster.protocol.corba.OrbInstanceFactory.createOrbInstance(Or
bInstanceFactory.java:179)
        at org.xmlBlaster.client.protocol.corba.CorbaCallbackServer.initialize(C
orbaCallbackServer.java:85)
        at org.xmlBlaster.client.XmlBlasterAccess.initCbServer(XmlBlasterAccess.
java:321)
        at org.xmlBlaster.client.XmlBlasterAccess.createDefaultCbServer(XmlBlast
erAccess.java:302)
        at org.xmlBlaster.client.XmlBlasterAccess.connect(XmlBlasterAccess.java:
229)
        at com.btrade.buspluginframework.PluginServer.connect(PluginServer.java:
191)
        at com.btrade.buspluginframework.PluginServer.initialize(PluginServer.ja
va:165)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.btrade.util.loader.ServerLauncher.main(ServerLauncher.java:85)
Caused by: java.lang.ClassNotFoundException: org.jacorb.orb.ORB
        at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:217)
        at org.omg.CORBA.ORB.create_impl(ORB.java:295)
        ... 13 more
errorCode=internal.unknown message=Connection failed
        at org.xmlBlaster.util.XmlBlasterException.convert(XmlBlasterException.j
ava:661)
        at org.xmlBlaster.client.XmlBlasterAccess.connect(XmlBlasterAccess.java:
244)
        at com.btrade.buspluginframework.PluginServer.connect(PluginServer.java:
191)
        at com.btrade.buspluginframework.PluginServer.initialize(PluginServer.ja
va:165)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.btrade.util.loader.ServerLauncher.main(ServerLauncher.java:85)
versionInfo=version=0.849,os.name=Windows 2000,os.version=5.0,java.vm.vendor=Sun
 Microsystems Inc.,java.vm.version=1.4.1_01-b01,os.arch=x86,build.timestamp=07/1
5/2003 10:10 AM,build.java.vendor=IBM Corporation,build.java.version=1.3.1
errorCode description=This is an unknown and unexpected error, usually a Java ru
ntime exception, please post it to the mailing list.



The same code works fine when I load XMLBlaster using the system classloader. The hsql jar and all other necessary jars
are in the classpath in both cases. It seems that the XMLBlaster custom classloader is maybe not properly delegating to the parent classloader to load classes?

The client library does not use a custom classloader, so please check your ServerLauncher classpath setup.

Note that xmlBlaster.jar contains a MANIFEST.MF with a
"Class-Path:" section which loads hsqldb.jar, jacorb.jar etc.

Also, it seems that in ClassLoaderFactory.getXmlBlasterClassLoader() the line

URL[] urls = ((URLClassLoader)this.getClass().getClassLoader()).getURLs();

improperly assumes that the parent classloader is a URLClassLoader. Did I miss
something, or is this just assumed to be true? This isn't a problem for me as my classloader derives from URL classloader, but it could potentially be a problem
for someone else.

Yes your are right, but it was convenient for us to use it.

Classloader issues are always a pain,

best regards

Marcel


Thanks, Mike Poindexter




--
http://www.xmlBlaster.org