[jboss-user] [JBoss Portal] - ClassCastException accessing EJB3 from portlet

cuoz do-not-reply at jboss.com
Wed Jul 26 12:32:47 EDT 2006


Hi all,

I posted this to the EJB3 forum originally, but just tested my app using a plain WAR file and it works fine, so I think it is something related to classloading and my portlet...

I'm trying to use my EJB3 application from a JBoss Portal portlet and getting the infamous ClassCastException. I have read all the wiki & other resources on classloading, etc, but have not been able to solve this one.

Specifics are: JBoss 4.0.4GA, Portal 2.4-CR2, EJB3 RC8.

I have packaged the ejb3 application and the portlet application in separate ear files (originally tried using just a war for the portlet), and have also tried scoped loader repositories. The portlet includes a jar file of only the client parts of my ejb3 application. I have JBossAS configured for call by value, etc.

Here are application specifics:
ClientEJB is an entity that implements Client interface
ClientSessionBean is a SLSB
ClientSessionLocal is the local interface to the session bean
The method I am calling on the session bean is:
Client createClient(String username, String password)

It creates an instance of ClientEJB, persists it, and returns it as a Client interface.

The call to the session bean works fine. I get the CCE when I try to use the returned object as a Client and not a ClientEJB.

What should I be doing to make this work?  Hopefully somebody already ran into this scenario and can help. Let me know if you need more information.

Thank you in advance,
Gary.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961064#3961064

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961064



More information about the jboss-user mailing list