From: Christian M. <vc...@cl...> - 2002-08-08 15:46:58
|
In case it could help http://kb.atlassian.com/content/atlassian/howto/classloaders.jsp Chris ----- Original Message ----- From: "Urberg, John" <ju...@ve...> To: <Gavin_King/Cirrus%CI...@ci...>; <hib...@li...> Sent: Thursday, August 08, 2002 4:04 PM Subject: RE: [Hibernate-devel] RE: JMX/JBoss > > Damn! I really don't understand why the following line wouldn't > > work: > > > > ds.storeResource( > > resources[i], Thread.currentThread().getContextClassLoader() > > ); > > > >( in SessionFactoryStub.getImpl() ). Have I got it totally wrong, > > or isn't Thread.currentThread.getContextClassLoader() meant to get > > the classloader used by the calling EJB? Perhaps I'm > > hallucinating... > > I often feel that way when confronted with class loaders. I don't know much > about them yet, so I can't be much help there. > > >> The only way I can see making this MBean useful is if users put all >> > their mapped classes and mappings in the server's classpath. Then > >> they can put them all in one mapping or split them up and it won't > >> matter because the MBean and SessionFactoryStub will have access > >> to them. > > I should always test it out before I make pronounciations! I tried my > little example with the jar files containing the mapping files in Jboss's > lib/ext directory (which get loaded when JBoss starts up). I got the same > exception as I did when it was in the EJB jar file. The SesstionFactory > stub could not find it. When I moved the creation of the SessionFactory > completely into a class in my jar file, everything worked a.o.k. (This last > version is what I'm doing in my application) > > My original attempt created the session factory in the MBean at startup. I > had the domain classes in jboss's lib/ext directory and the MBean seemed to > find them ok. Unless someone has some classloader answers for you, this > will probably be the only way to do it. > > Regards, > John > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Hibernate-devel mailing list > Hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > |