[jboss-user] [JBoss Seam] - Re: @Remote still shown as

bluetrade do-not-reply at jboss.com
Fri Jul 28 19:47:19 EDT 2006


It seems to be bound anyways to "ClassName/remote" even though this is not explicitly listed. I assume this because if I specify this, I get an error that differs from the error I get when misspell something in this string. 

However, none-the-less I cannot really figure out what's going on, since I get the following error: 

  | javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.ejb3.stateless.StatelessRemoteProxy; local class incompatible: stream classdesc serialVersionUID = 2583299153931800023, local class serialVersionUID = -9097306519795868]
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:723)
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:588)
  | 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
  | 	at de.myties.sample.chat.ChatTester.main(ChatTester.java:18)
  | Caused by: java.io.InvalidClassException: org.jboss.ejb3.stateless.StatelessRemoteProxy; local class incompatible: stream classdesc serialVersionUID = 2583299153931800023, local class serialVersionUID = -9097306519795868
  | 	at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
  | 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
  | 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
  | 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
  | 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
  | 	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
  | 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
  | 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
  | 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
  | 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
  | 	at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
  | 	at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:653)
  | 	... 3 more
  | 

My interface:

  | import java.rmi.Remote;
  | 
  | @javax.ejb.Remote
  | public interface ChatServer extends Remote {
  | 	public void sendMessage(Message msg);
  | 	public void addClient(ChatClient client);
  | 	public void notifyClients();
  | }
  | 
My class:

  | 
  | import java.rmi.RemoteException;
  | import java.rmi.server.UnicastRemoteObject;
  | 
  | import javax.ejb.Stateless;
  | import javax.persistence.EntityManager;
  | 
  | import org.jboss.seam.annotations.In;
  | import org.jboss.seam.annotations.Name;
  | @Stateless
  | @Name("chatServer")
  | public class ChatServerImpl extends UnicastRemoteObject implements ChatServer {
  | 
  | 	@In(create=true)
  | 	EntityManager entityManager;
  | 	
  | 	public ChatServerImpl() throws RemoteException {
  | 		System.out.println("Started Chat Server!");
  | 	}
  | 	
  | 	public void addClient(ChatClient client) {
  | 		
  | 
  | 	}
  | 
  | 	public void notifyClients() {
  | 		System.out.println("Notifying clients");
  | 
  | 	}
  | 
  | 	public void sendMessage(Message msg) {
  | 		// TODO Auto-generated method stub
  | 
  | 	}
  | 
  | }
  | 

The client:
import javax.naming.Context;

  | import com.sun.corba.se.impl.javax.rmi.PortableRemoteObject;
  | 
  | public class ChatTester {
  | 	public static void main(String args[]) {
  | 		try {
  |             Context jndiContext = getInitialContext( );
  |             Object ref = jndiContext.lookup("jboss-seam-myties/ChatServerImpl/remote");
  |             ChatServer srv = (ChatServer)javax.rmi.PortableRemoteObject.narrow(ref, ChatServer.class);
  | 
  |             srv.notifyClients();
  |         } catch (javax.naming.NamingException ne){ne.printStackTrace( );}
  |     }
  | 
  |     public static Context getInitialContext( )
  |         throws javax.naming.NamingException {
  |     	Properties p = new Properties( );
  |         p.put(Context.INITIAL_CONTEXT_FACTORY,
  |             "org.jnp.interfaces.NamingContextFactory");
  |         p.put(Context.URL_PKG_PREFIXES,
  |             " org.jboss.naming:org.jnp.interfaces");
  |         p.put(Context.PROVIDER_URL, "jnp://localhost:1099");
  |         return new javax.naming.InitialContext(p);
  |     
  | 	}
  | }
  | 

I am not sure whether this is related to seam, but I thought so... Maybe you have any clues to this?
Thank you very much in advance and by this time, for reading the post :)

Joey

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

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



More information about the jboss-user mailing list