NoClassDefFoundError: org/jboss/seam/intercept/Proxy when Seam Component is an EJB in
another module
----------------------------------------------------------------------------------------------------
Key: JBSEAM-3758
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3758
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.1.0.SP1, 2.1.0.GA
Environment: JBoss AS 4.2.2, Seam 2.0.2.GA, 2.0.2.SP1, 2.1.0.GA, 2.1.0.SP1
Reporter: Andre Rodrigues
I have all my backing beans in the web application (java bean components). My business
logic is inside EJBs in a module which has no reference to Seam whatsoever. So, the EAR
class loader has no reference to Seam classes, Seam's jar are only in my web
application (WEB-INF/lib).
After some debugging, I saw that seam (2.0.2.SP1) passes an Array of interfaces to the
ProxyFactory class. ProxyFactory gets the ClassLoader from the first class in the array.
When the first class in the array is either Proxy or Instance, everything works fine. When
the EJB interface is the first element on the array (happens after a few restarts of
JBoss), ProxyFactory gets its ClassLoader, the EAR ClassLoader, which, as metioned before,
doesn't "know" about Seam.
I think a simple solution would be change the method createProxyFactory in the Component
class to the following:
Set<Class> interfaces = new TreeSet<Class>(); // instead of a HashSet, to
guarantee the order of the elements
// so these classes the first elements on the array
interfaces.add(Instance.class);
interfaces.add(Proxy.class);
if ( type.isSessionBean() )
{
interfaces.addAll(businessInterfaces);
}
else
{
interfaces.add(HttpSessionActivationListener.class);
interfaces.add(Mutable.class);
}
ProxyFactory factory = new ProxyFactory();
// excluding this part, which was included in 2.1.0, but didn't really solved the
problem
/*{
@Override
protected ClassLoader getClassLoader()
{
return beanClass.getClassLoader();
}
};*/
A full description of the problem can be found at the forum location below.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira