aspose file tools
The moose likes JBoss and the fly likes PortableRemoteObject.narrow() throws ClassCastException Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » JBoss
Reply Bookmark "PortableRemoteObject.narrow() throws ClassCastException" Watch "PortableRemoteObject.narrow() throws ClassCastException" New topic
Author

PortableRemoteObject.narrow() throws ClassCastException

Kelly Dolan
Ranch Hand

Joined: Jan 08, 2002
Posts: 103
First, thanks to anyone that can help me out! Next, the problem...

I have an EAR file that runs under JBoss 2.4.3. I need to upgrade to JBoss to 2.4.4. When I tried deploying the exact same EAR under JBoss 2.4.4, I get a ClassCastException from a call to PortableRemoteObject.narrow(). I have scoured newsgroup postings and have attempted the various things others have tried so I am now at a loss...here's what I know...

1. In JBoss 2.4.3, the narrow() method returns successfully. In JBoss 2.4.4, the narrow() method returns successfully IF I narrow it to EJBHome but not to my specific class.

2. Looking at the implementation of the narrow() method, it calls a method obj1.isAssignableFrom(obj2). In JBoss 2.4.3, this method returns true. In JBoss 2.4.4, this method is returning false.

It seems that the proxy stub that JBoss is generating does not subclass my Home interface properly (???)...I included the structure of my EAR file below. The Home class actually resides in a few locations but I verified that they are in fact identical in case JBoss was loading the class from two different locations.


myapp.ear
- myapp.war
- aclientlib.jar - this jar contains classes required by clients using the ejb
- Home.class
- aejb.jar - this jar is the ejb!
- Home.class
- aclientlib.jar - this jar contains classes required by clients using the ejb
- Home.class


Thanks!

- Kelly
[ May 11, 2007: Message edited by: Bear Bibeault ]
Nadeem Awad
Ranch Hand

Joined: Jan 09, 2005
Posts: 74
Originally posted by Kelly Dolan:




That exception occurs when the WAR file includes any EJB-related classes, either in WEB-INF/lib or WEB-INF/classes folder. Remove any EJB-related JARs/Classes from the WAR and it should work fine.

For more info, check this link:

http://www.jboss.com/?module=bb&op=viewtopic&p=3896901


Share Knowledge to gain it.<br /> <br />SCJP 1.2, SCDJWS 1.4, SCWCD 1.4, SCBCD 1.3, ICAD
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: PortableRemoteObject.narrow() throws ClassCastException
 
Similar Threads
PortableRemoteObject.narrow() throws ClassCastException
BMP JBoss - Oracle Connections through DataSource
NoClassDefFoundError problem with WAR in 8.1
classloader question
problem deploying EAR file