• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

whats wrong with this client ?

 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My JBoss client lookup return me org.jnp.interfaces.NamingContext type instead of my Bean remote type, I could not figure out anything wrong with the client. Please have a look.

Remote Interface



Bean Class



Client Class




Exception on the invocation of client. The loojup return me a type of org.jnp.interfaces.NamingContext, it shoud have been my remote type.

Exception in thread "main" java.lang.ClassCastException: org.jnp.interfaces.NamingContext
at mine.test.ejb.client.EjbClient.main(EjbClient.java:18)
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which version of JBoss AS?

Use JNDIView to determine the exact name to which the EJB was bound. In AS 5.x, the name will show in the console log.
 
Sanju Thomas
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter, Thanks for the reply. I am using jboss-5.0.1.GA.
 
Sanju Thomas
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Peter its worked. This is what shown in the console.

12:22:50,131 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=mybean.jar,nam
e=MyBean,service=EJB3
12:22:50,131 INFO [EJBContainer] STARTED EJB: mine.test.ejb.MyBean ejbName: MyB
ean
12:22:50,209 INFO [JndiSessionRegistrarBase] Binding the following Entries in G
lobal JNDI:

MyBean/remote - EJB3.x Default Remote Business Interface
MyBean/remote-mine.test.ejb.IBean - EJB3.x Remote Business Interface


"/remote" with the bean name is something new I think. It was not there in JBoss 4, isn't it ?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Based on this code, the remote interface of the bean should have been bound to "MyBean"

MyBean/remote - EJB3.x Default Remote Business Interface



Looks wrong. It should not have bound to MyBean/remote since you have overridden it in the code. Are you sure the jar that you are deploying, contains exactly this piece of code? And do you have any ejb-jar.xml or jboss.xml for this EJB app?

 
Sanju Thomas
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you are correct, I removed the jndi binding code from the bean class.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic