[jboss-user] [JBoss Seam] - Re: jboss-ejb3-all.jar StatelessRemoteProxy serialVersionUID

nynymike do-not-reply at jboss.com
Fri Aug 24 16:24:50 EDT 2007


My impression is that jboss-ejb3-all.jar is included in the jboss-embeddbable, not the JBoss AS. 

When I take out the jboss-ejb2-all.jar, and replace with the ejb files I see on the AS (ejb3-persistence.jar, jboss-annotations-ejb3.jar, jboss-ejb3-client.jar, jboss-ejb3x.jar) I get an error:

  | javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
  | 	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
  | 	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
  | 	at javax.naming.InitialContext.init(InitialContext.java:223)
  | 	at javax.naming.InitialContext.<init>(InitialContext.java:197)
  | 	at us.ziacom.voicemail.test.TestVmManagerSessionBean.testLookupAccount(TestVmManagerSessionBean.java:20)
  | Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
  | 	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
  | 	at java.security.AccessController.doPrivileged(Native Method)
  | 	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
  | 	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
  | 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
  | 	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
  | 	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
  | 	at java.lang.Class.forName0(Native Method)
  | 	at java.lang.Class.forName(Class.java:247)
  | 	at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
  | 	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
  | 	... 26 more
  | 

This is my program. Its pretty simple...

  | import java.util.Properties;
  | 
  | import javax.naming.Context;
  | import javax.naming.InitialContext;
  | import javax.naming.NamingException;
  | import javax.rmi.PortableRemoteObject;
  | 
  | import org.testng.annotations.Test;
  | 
  | import us.ziacom.action.VmManagerSessionBean;
  | import us.ziacom.action.interfaces.IVmManagerRemote;
  | import us.ziacom.vm.model.Account;
  | 
  | public class TestVmManagerSessionBean {
  | 	
  | 	  @Test(groups = { "sessionBean" })
  | 	  public void testLookupAccount() throws NamingException {
  | 	    Context ctx = new InitialContext(getInitialContextProperties());
  | 	    System.out.println("JNDI Name: " + VmManagerSessionBean.RemoteJNDIName);
  | 	    Object ref = ctx.lookup("voicemail/" + VmManagerSessionBean.RemoteJNDIName);
  | 	    IVmManagerRemote vmMgrRemote = (IVmManagerRemote) PortableRemoteObject.narrow(ref, IVmManagerRemote.class);
  | 	    Account acct = vmMgrRemote.lookupAccount("6467230651");
  | 	    System.out.println(acct.getFullname());
  | 	  }
  | 
  | 	   private static Properties getInitialContextProperties(){
  | 		  Properties props = new Properties();
  | //		  props.put(Context.SECURITY_PRINCIPAL, "user");
  | //		  props.put(Context.SECURITY_CREDENTIALS, "password");
  | 	      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
  | 	      props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
  | 	      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
  | 	      return props;
  | 	   }
  | }
  | 
Do I need to change org.jnp.interfaces.NamingContextFactory to org.jboss.naming.NamingContextFactory? 

I am new to RMI... maybe that's why I am so confused...

thanks in advance,

- Mike

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

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



More information about the jboss-user mailing list