This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi Pat, can you please specify at what line are you getting class cast exception. In fact it will be better if you can provide the complete stacktrace. Also can you provide code for Artist cmp i.e. code for its home, remote and bean class.
Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
May be some other bean is associated with the name "ArtistBean" in the deployment descriptor. May be by displaying the name of the class after the lookup should make the picture more clear.
Joined: Dec 29, 2004
Thanks for all the input guys! Your both right. It seems to be a problem with my lookup().
I get this warning when I start my server:
So my bean already exists. How can I correct this?
Prakash, I did the system.out on my obj and got $Proxy51 Any ideas? Cheers for the help, well appreciated!!
Joined: Sep 28, 2002
Prakash, I did the system.out on my obj and got $Proxy51
My mistake, actually on performing lookup we get instance of container generated stub class which implements the home interface.
Depends On Me: , ObjectName: jboss.j2ee:module=MyStoreMgr.jar,service=EjbModule state: FAILED I Depend On: Depends On Me: javax.management.InstanceAlreadyExistsException: jboss.j2ee:jndiName=ArtistBean,service=EJB
Appears that two beans are registered with the same jndi name, you should check ejb-jar.xml file for that. Possibility of some other ear file having an ejb with this jndi name can not be ruled out as well, so you have to check other ear files also (if exists).
I hope this helps
Joined: Dec 29, 2004
Prakash, you GENIUS, I got it working. Cheers for the help!
I had two beans with the same JNDI name, it was from an old project! Deleted it from my server deploy folder and from my environment!