[jboss-user] [EJB 3.0] - Re: Why is Remote Interface not installed

baumar do-not-reply at jboss.com
Tue Apr 29 12:11:41 EDT 2008


Hi, 

Sorry to forget this, I was too straight.
(My analysis was: the NamingException is due to the ClassNotFoundException: The class of the remote interface cannot be found because it is not there, as it shows in the JMX-console. But maybe that analysis is already wrong...)

The code for the client is:

public class PersonFeederClient {
  | 	public static void main(String[] args) {		
  | 		Properties props =null;
  | 		InitialContext context = null;		
  | 		// get context
  | 		props = new Properties();
  | 	    props.put("java.naming.factory.initial",
  | 	        "org.jnp.interfaces.NamingContextFactory");
  | 	    props.put("java.naming.factory.url.pkgs",
  | 	        "org.jboss.naming:org.jnp.interfaces");
  | 	    props.put("java.naming.provider.url", "jnp://localhost:1099");		
  | 	    try {
  | 			context = new InitialContext(props);
  | 		} catch (NamingException e) {
  | 			System.out.println("could not get context, exit.");
  | 			e.printStackTrace();
  | 			System.exit(0);
  | 		}
  | 		
  | 		
  | 		PersonHandlerRemote phr = null;
  | 		try {
  | 			 phr = (PersonHandlerRemote) context.lookup("PersonHandlerBean/remote");
  | 		} catch (NamingException e) {
  | 			System.out.println("could not get PersonHandlerRemote, exit.");
  | 			e.printStackTrace();
  | 			System.exit(0);
  | 		}
  | 		System.out.println("methods in PersonHandlerRemote: ");
  | 		for (Method method : phr.getClass().getMethods()) {
  | 			System.out.println(method.getName());
  | 		}
  | 		// create a list of persons
  | 		
  | 		Person smith = new Person();
  | 		smith.initAll(1, "John", "Smith");
  | 				
  | 		phr.addPerson(smith);		
  | 		phr.printAllPerson("added Smith:");
  | 		System.out.println();
  | 
  | 		phr.deletePerson(smith);
  | 		phr.printAllPerson("deleted Smith");
  | 		System.out.println();
  | }
  | 

And the stacktrace is: 

could not get PersonHandlerRemote, exit.
  | javax.naming.NamingException: Could not dereference object [Root exception is java.lang.reflect.UndeclaredThrowableException]
  | 	at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1150)
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
  | 	at javax.naming.InitialContext.lookup(Unknown Source)
  | 	at com.informationcontrol.forumorganizer.client.PersonFeederClient.main(PersonFeederClient.java:36)
  | Caused by: java.lang.reflect.UndeclaredThrowableException
  | 	at $Proxy0.createProxy(Unknown Source)
  | 	at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:52)
  | 	at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
  | 	at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125)
  | 	at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142)
  | 	... 4 more
  | Caused by: java.lang.ClassNotFoundException: [Lorg.jboss.aop.advice.Interceptor;
  | 	at java.net.URLClassLoader$1.run(Unknown Source)
  | 	at java.security.AccessController.doPrivileged(Native Method)
  | 	at java.net.URLClassLoader.findClass(Unknown Source)
  | 	at java.lang.ClassLoader.loadClass(Unknown Source)
  | 	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
  | 	at java.lang.ClassLoader.loadClass(Unknown Source)
  | 	at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50)
  | 	at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139)
  | 	at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
  | 	at java.io.ObjectInputStream.readClassDesc(Unknown Source)
  | 	at java.io.ObjectInputStream.readArray(Unknown Source)
  | 	at java.io.ObjectInputStream.readObject0(Unknown Source)
  | 	at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
  | 	at java.io.ObjectInputStream.readSerialData(Unknown Source)
  | 	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
  | 	at java.io.ObjectInputStream.readObject0(Unknown Source)
  | 	at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
  | 	at java.io.ObjectInputStream.readSerialData(Unknown Source)
  | 	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
  | 	at java.io.ObjectInputStream.readObject0(Unknown Source)
  | 	at java.io.ObjectInputStream.readObject(Unknown Source)
  | 	at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:122)
  | 	at java.io.ObjectInputStream.readExternalData(Unknown Source)
  | 	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
  | 	at java.io.ObjectInputStream.readObject0(Unknown Source)
  | 	at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
  | 	at java.io.ObjectInputStream.readSerialData(Unknown Source)
  | 	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
  | 	at java.io.ObjectInputStream.readObject0(Unknown Source)
  | 	at java.io.ObjectInputStream.readObject(Unknown Source)
  | 	at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
  | 	at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
  | 	at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
  | 	at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
  | 	at org.jboss.remoting.Client.invoke(Client.java:525)
  | 	at org.jboss.remoting.Client.invoke(Client.java:488)
  | 	at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.aspects.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:48)
  | 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  | 	at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61)
  | 	... 9 more
  | 

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

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



More information about the jboss-user mailing list