[jboss-user] [JNDI/Naming/Network] - BMP Bean deployed but ClassCastException

jelid do-not-reply at jboss.com
Tue Oct 7 18:07:23 EDT 2008


Hi,
I realize an entity-bean (Bean managed persistence) and deploy it correctly but when i try to get the Home interface, I got a ClassCastException.

Has anyone an Idea of the problem?
Here under i report pieces of the code I hope are enough to resolve the problem!

############client code ##################
Client code that generate the exception:
	         Context jndiContext = getInitialContext();
	           
	         Object ref = jndiContext.lookup("SavingsAccountHomeRemote");
	               
	         SavingsAccountHomeRemote home = (SavingsAccountHomeRemote)
	            (PortableRemoteObject.narrow(ref,SavingsAccountHomeRemote.class));
#############ejb-jar.xml (essential)##########
      <ejb-name>SavingsAccountEJB</ejb-name>
      com.eli.beans.SavingsAccountHomeRemote
      com.eli.beans.SavingsAccount
      <ejb-class>com.eli.beans.SavingsAccountBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
############# jboss.xml (essential) ###########

     <enterprise-beans>
     
     	<ejb-name>SavingsAccountEJB</ejb-name>
     	<jndi-name>SavingsAccountHomeRemote</jndi-name>
     
     </enterprise-beans>

############ Deployment confirmation ###########
23:35:45,640 INFO  [EjbModule] Deploying SavingsAccountEJB
23:35:45,687 INFO  [ProxyFactory] Bound EJB Home 'SavingsAccountEJB' to jndi 'SavingsAccountHomeRemote'

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180895#4180895

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180895



More information about the jboss-user mailing list