Classloading Question
spiritualmechanic Jul 14, 2004 1:19 PMI have a question concerning classloading in JBoss4. I'm trying to construct a RARDeployment programmatically, such that it picks up the jbosstestadapter.rar and creates the connection factory.
I get the following error:
15:31:40,208 INFO [STDOUT] Registered RARDeployment
15:31:40,218 INFO [STDOUT] Registered RARDeployment ... create
15:31:40,218 ERROR [RARDeployment] Could not find ManagedConnectionFactory class
: org.jboss.test.jca.adapter.TestManagedConnectionFactory
java.lang.ClassNotFoundException: org.jboss.test.jca.adapter.TestManagedConnecti
onFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at org.jboss.resource.connectionmanager.RARDeployment.startService(RARDe
ployment.java:543)
The code I have is pretty minimal (I create an MBeanServer programmatically) and it picks up my jbosstestadapter.rar, just looking through the logs and making sure it was there.
RARDeployment rd = new RARDeployment(); rd.setManagedConnectionFactoryClass("org.jboss.test.jca.adapter.TestManagedConnectionFactory"); ObjectName oldName = new ObjectName("jboss.jca:name='jbosstestadapter.rar',service=RARDeployment"); rd.setOldRarDeployment(oldName); rd.setConnectionDefinition("javax.resource.cci.ConnectionFactory"); ObjectName name = new ObjectName("jboss.jca:service=ManagedConnectionFactory,name='jbosstestadapter.rar'"); server.registerMBean(rd, name); System.out.println("Registered RARDeployment"); server.invoke(name, "create", null, null); System.out.println("Registered RARDeployment ... create"); server.invoke(name, "start", null, null);
I don't think this is anything JCA-specific (although I may be wrong). I think there's something I need to do with the MBeanServer classloader or something?
Thanks,