[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3758) NoClassDefFoundError: org/jboss/seam/intercept/Proxy when Seam Component is an EJB in another module
by Andre Rodrigues (JIRA)
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
16 years, 1 month
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3176) HotelSearchingAction not serializable
by Kurt Stam (JIRA)
HotelSearchingAction not serializable
-------------------------------------
Key: JBSEAM-3176
URL: https://jira.jboss.org/jira/browse/JBSEAM-3176
Project: Seam
Issue Type: Bug
Components: Examples
Affects Versions: 2.0.3.CR1, 2.0.2.GA
Reporter: Kurt Stam
if you cluster HotelSearchingAction, in it hotels is not serializable, as the List.subList is not serializable.
hotels = results.subList(0,pageSize);
13:03:00,270 ERROR [JBossCacheService] externalizeSession(): exception occurred externalizing session SessionBasedClusteredSession[id: cKrhNBCSg5KciOdaAiMQCA**.server2 lastAccessedTime: 1216227772088 version: 6 lastOutdated: 0] java.io.NotSerializableException: java.util.RandomAccessSubList at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302) at org.jboss.seam.jsf.ListDataModel.writeObject(ListDataModel.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302) at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1380) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302) at org.jboss.web.tomcat.service.session.SessionBasedClusteredSession.writeExternal(SessionBasedClusteredSession.java:175) at org.jboss.web.tomcat.service.session.JBossCacheService.externalizeSession(JBossCacheService.java:1027) at org.jboss.web.tomcat.service.session.JBossCacheService.putSession(JBossCacheService.java:316) at org.jboss.web.tomcat.service.session.JBossCacheClusteredSession.processSessionRepl(JBossCacheClusteredSession.java:121) at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1097) at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:652) at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:49) at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:98) at org.jboss.web.tomcat.service.session.JvmRouteValve.invoke(JvmRouteValve.java:84) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437) at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) at java.lang.Thread.run(Thread.java:595)
--
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
16 years, 1 month