-
1. Re: ejb3.deployer does not have access to ear scoped loader
jaikiran Feb 19, 2009 1:45 AM (in response to barakka)The ejb3.deployer should not use the jars that your application(s) package. They will use the ones that have been shipped in the AS.
"barakka" wrote:
I'm using JBoss 4.2.3 and I would like to update one single ear application to the latest version Hibernate.
You can do this as explained here http://www.jboss.org/index.html?module=bb&op=viewtopic&t=133202 -
2. Re: ejb3.deployer does not have access to ear scoped loader
barakka Feb 19, 2009 9:54 AM (in response to barakka)Hi!
thanks for the replay. I've read the post you suggested and the one that was pointed by that one. I had already explored this topics and read everything I could find on the internet about the jboss classloader, loader repository, etc.
The problem, however, is not related to hibernate search being moved. The class cast exception that I get are basic hibernate classes, like Session, etc.
What I've been able to dig out is that the ejb3.deployer and my ear use two separate classloader, with the one used by the ejb3.deployer loading the lib from the the server folder and the one for my app reading the lib from my ear.
In fact, if you take the issue to its extreme and suppose that the server does not provide any hibernate lib, the ejb3.deployer will not work at all, as it can't find the hibernate classes needed to create the persistence manager factory (declared in my ear persistence.xml). And I believe this behaviour is not the correct one: the deployer should use the ear classloader.
I'm now wondering if I can define the ejb.deployer service within my ear directly, so it will use its classloader.
Thanks,
Riccardo. -
3. Re: ejb3.deployer does not have access to ear scoped loader
jaikiran Feb 22, 2009 2:43 AM (in response to barakka)"barakka" wrote:
The problem, however, is not related to hibernate search being moved. The class cast exception that I get are basic hibernate classes, like Session, etc.
That can happen if your application is not scoped correctly or you do not have the right set (or a complete set) of hibernate jars."barakka" wrote:
What I've been able to dig out is that the ejb3.deployer and my ear use two separate classloader, with the one used by the ejb3.deployer loading the lib from the the server folder and the one for my app reading the lib from my ear.
That's the correct behaviour."barakka" wrote:
In fact, if you take the issue to its extreme and suppose that the server does not provide any hibernate lib, the ejb3.deployer will not work at all, as it can't find the hibernate classes needed to create the persistence manager factory
That's the very reason why the hibernate libraries are provided by the AS."barakka" wrote:
And I believe this behaviour is not the correct one: the deployer should use the ear classloader.
I'm now wondering if I can define the ejb.deployer service within my ear directly, so it will use its classloader.
From your description, i would again say that the application is not correctly scoped :) So the best way to debug this is to provide more details about your application including logs and your application packaging.
Post the output ofjar -tf yourapp.ear
Also post the contents of application.xml and jboss-app.xml (in which the classloader configuration is done).
The other important part would be the TRACE level logs from the org.jboss.classloading package. But let's first check the other details that i asked for before looking at the those TRACE logs (which will be too long to post here).