• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

PortableRemoteObject.narrow() throws ClassCastException

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
You've gotta fight it! Don't give in! Read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic