@Entity @Table(name="CABIN") public class Cabin implements java.io.Serializable{ private int id; private String name; private int deckLevel; private int shipId; private int bedCount;
@Id @Column(name="ID") public int getId( ) { return id; } public void setId(int pk) { id = pk; }
@Column(name="NAME") public String getName( ) { return name; } public void setName(String str) {name = str; }
@Column(name="DECK_LEVEL") public int getDeckLevel( ) { return deckLevel; } public void setDeckLevel(int level) { deckLevel = level; }
@Column(name="SHIP_ID") public int getShipId( ) { return shipId; } public void setShipId(int sid) { shipId = sid; }
@Column(name="BED_COUNT") public int getBedCount( ) { return bedCount; } public void setBedCount(int bed) { bedCount = bed; }
Properties p = new Properties( ); p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); p.put(Context.URL_PKG_PREFIXES, " org.jboss.naming rg.jnp.interfaces"); p.put(Context.PROVIDER_URL, "jnp://localhost:1099"); return new javax.naming.InitialContext(p); }
}
I am using JBoss and geeting an exception javax.naming.NameNotFoundException: TestEJB not bound at org.jnp.server.NamingServer.getBinding(NamingServer.java:529) at org.jnp.server.NamingServer.getBinding(NamingServer.java:537) at org.jnp.server.NamingServer.getObject(NamingServer.java:543) at org.jnp.server.NamingServer.lookup(NamingServer.java:267) at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305) at sun.rmi.transport.Transport$1.run(Transport.java:159) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:155) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142) at org.jnp.server.NamingServer_Stub.lookup(Unknown Source) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589) at javax.naming.InitialContext.lookup(InitialContext.java:392) at Client.main(Client.java:15)
What is the error in this please help. I need to know it urgently
Shailesh Kini
Ranch Hand
Joined: Oct 17, 2001
Posts: 153
posted
0
Hi Ranj,
I am not quite sure if JBoss has complete EJB 3.0 support available yet. If you are just trying out a sample, you may want to use Glassfish app server.