Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

PortableRemoteObject.narrow() throws ClassCastException

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic