Local home and remote home Configuration
torreblanca Jul 12, 2002 6:14 PMHi,
I'm using JBoss-3.0.1rc1_tomcat-4.0.4 and I have an entity bean with remote home and local home but I don't know if my ejb-jar.xml is right or do I need another configuration files?.
My ejb-jar.xml contains :
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<enterprise-beans>
<ejb-name>Account</ejb-name>
com.bmp.AccountHome
com.bmp.Account
<local-home>com.bmp.AccountLocalHome</local-home>
com.bmp.AccountLocal
<ejb-class>com.bmp.AccountBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>com.bmp.AccountPK</prim-key-class>
False
<resource-ref>
<res-ref-name>java:/MySqlDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<ejb-name>Account</ejb-name>
<method-intf>Local</method-intf>
<method-name>*</method-name>
<ejb-name>Account</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
and my client :
Object obj = ctx.lookup("Account");
AccountHome home = (AccountHome) javax.rmi.PortableRemoteObject.narrow(obj,AccountHome.class);
And then I get the following error :
javax.naming.NameNotFoundException: Account not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
60)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
at java.lang.Thread.run(Thread.java:536)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
RemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:450)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:434)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.bmp.AccountClient.main(AccountClient.java:25)