• Post Reply Bookmark Topic Watch Topic
  • New Topic

ClassCastException: PortableRemoteObject...  RSS feed

 
Csaba Birtalan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I've been trying to write a simple unit test for one of my EJB's using Cactus. So I've followed the steps described in the Cactus HowTo EJB tutorial and created my webapp which is part of the .ear which contains the EJB. When I'm running the web-app in my browser which should run the test the following error message appears:

(I'm using JBoss AS 4.2.2, Cactus 1.8.0)



I've read a few topics on this issue but none of the suggestions there would work in my case. The ones I tried are: duplicated reference to the EJB, or set the InitialContext enviroment.

The piece of code where I'm trying to do the job is:



I'd appreciate any suggestions on how to resolve the problem, and I apologize if something in this topic isn't the way it's supposed to be, this is my first time posting on a forum.

Thanks you in advance.

Csaba
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch

Access the jmx-console and view the JNDI tree to see what object is bound to the RSSReaderBean jndi-name. Also, you can tweak your code to debug this issue, by printing out the object instance that is being returned:

[ June 12, 2008: Message edited by: Jaikiran Pai ]
 
Csaba Birtalan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the fast reply. I tried the code provided by you and got the following:



I'm new to JavaEE technology and JBoss too so I don't really know if that's the expected type of the object. Here's the tree from the JNDIView which refers to my application:

(I picked the ones I think are relevant)




and separately for the web-app:


I still don't really know what to do with this.

Thanks again for your help.

Csaba
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Global JNDI Namespace

+- RSSReaderBean (class: org.jnp.interfaces.NamingContext)
| +- home (proxy: $Proxy667 implements interface newsserver.rss.RSSReaderRemoteHome)


This tells that your RSSReaderRemoteHome is bound to the jndi-name "RSSReaderBean/home" and not RSSReaderBean. So change your lookup code to:


 
Csaba Birtalan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your help. This resolved it. It was a newbies error.

Regards,

Csaba
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!