Hi,

> there seems to be some classloader related issues when an Exception is
> thrown from a bean in one ejb-jar to a bean that's loaded from another
> ejb-jar file within the same VM.
>
> Lets assume that we have the following two ejb-jar files deployed in
JBoss:
>
> foo.jar
> -------
> Foo.class
> FooHome.class
> FooBean.class
> FooException.class
> META-INF/ejb-jar.xml // nothing special here...
>
> goo.jar
> -------
> Goo.class
> GooHome.class
> GooBean.class
> Foo.class
> FooHome.class
> FooException.class
> META-INF/ejb-jar.xml // declares an ejb-ref to the Foo EJB
> META-INF/jboss.xml // maps the ejb-ref to the jndi-name
>
>
> Consider the following scenario:
>
> An operation on a GooBean instance triggers an invocation on the FooBean
> which throws a FooException in order to indicate some problem.
>
> Now the GooBean can't catch the FooException as the exception thrown from
> the FooBean has bean instantiated by a different CL (the GooBean recevies
a
> java.lang.reflect.UndeclaredThrowableException).
>
> Is there any workarounds for this problem or do I have to place both the
> FooBean and GooBean classes into the same ejb-jar file in order to get the
> scenario outlined above to work.

Yes, put the Exceptions into there own jar and put this jar file into
$JBOSS_HOME/lib/ext. Maybe it will work if you put the Exception in both
jars (goo.jar and foo.jar).

CU

---
Ingo Bruell
OBL GmbH ([EMAIL PROTECTED])
Hude (Oldenburg)
Germany


Reply via email to