By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,737 Members | 1,989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,737 IT Pros & Developers. It's quick & easy.

JBoss: Scoped beans & Remote classloader issue

P: n/a
Hello,

In a JBoss 3.2.4 server, I have deployed several enterprise javabeans
(each as a separate .jar, not in an .ear bundle). These beans are
completely self-contained, as they include all their needed
dependencies inside the jar files (and have a reference to them in the
Class-Path entry in their MANIFEST.MF).

The problem shows when I want these beans to be scoped, this is, to
have their own classloader inside JBoss and not use the unified
classloader so that each bean does not see the others' classes,
something very important for my software architecture. For this, I set
in the jboss.xml file of each of my ejb .jar files the following:

<loader-repository>some.dot.com:loader=[some unique
name]</loader-repository>

And in the jboss-service.xml file I enable CallByValue for the EJB
Deployer.

....and with this I get the results I expected. The problem is, I need
some of my ejbs to return to the web tier classes of which this web
tier only has an interface (not the real implementations, which may
vary). This means that, when the web tier receives the data, it should
ask JBoss for the concrete implementation of the class via Remote
Class Loading. For this, I have set in jboss-service.xml:

<mbean code="org.jboss.web.WebService"
name="jboss:service=WebService">
<attribute name="Port">8083</attribute>
<attribute name="DownloadServerClasses">true</attribute>
<attribute name="Host">${jboss.bind.address}</attribute>
<attribute name="BindAddress">${jboss.bind.address}</attribute>
</mbean>
Which made remote classloading work perfectly before I scoped my ejbs,
and which now simply makes JBoss return a ClassNotFoundException when
tomcat asks for the implementation class.

I supose this means that the remote classloader cannot access the
ejbs' concrete classloaders now they're not unified but... Can this
behaviour be changed? Can I configure it some way so that I can do
remote classloading with scoped beans?
Thanks.

Cruinne.
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.