|
I receive the following error when I attempt
to execute a client on a bean server by JBOSS.
Error here Can't find
SerialContextProvider
javax.naming.CommunicationException: Can't find
SerialContextProvider
at
com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:65)
at
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:133)
at
javax.naming.InitialContext.lookup(InitialContext.java:350)
at
org.mhtd.db.members.client.MembersTest.main(MembersTest.java:47)
Can anyone suggest what is wrong? My client
is as follows:
public static void main(String[]
args)
{ // Enclosing the whole process in a single "try" block is not an ideal way // to do exception handling, but I don't want to clutter the program up // with catch blocks
try
{ Properties jndiProps = new Properties(); jndiProps.setProperty("java.naming.factory.imitial", "org.jnp.interfaces.NamingContextFactory"); jndiProps.setProperty("java.naming.provider.url", "127.0.0.1"); jndiProps.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces"); // Get a naming context InitialContext jndiContext = new InitialContext(jndiProps); //
Get a reference to a CD Bean
Object ref = jndiContext.lookup("members/Member"); //
Get a reference from this to the Bean's Home
interface
MemberHome home = (MemberHome) PortableRemoteObject.narrow (ref, MemberHome.class); ..........
Thanks
Mark
|
