This content has been marked as final.
Show 2 replies
-
1. Re: Client notifications or callbacks
mustaghattack Aug 17, 2005 12:33 PM (in response to gamac)Sorry I have no idea to do that :(
In fact I would like to do exactly what you did : a remote client which invoke methods on sessions beans to manipulate entities beans. Could you please tell me how to do that ?
I try to use this simple client :import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.wiskee.bd.Massifs;
import org.wiskee.bd.Massif;
public class Client {
public static void main(String[] args) {
try {
System.out.println( "CLIENT" );
Context context = new InitialContext();
Massifs massifs = (Massifs) context.lookup(Massifs.class.getName());
System.out.println( "Ajout du massif pyrenees" );
massifs.addMassif( "Pyrenees" );
System.out.println( "Liste des massifs : ");
for( Massif m : massifs.getAllMassif() ) {
System.out.println( m.getMassifId() + " : " + m.getNom() );
}
} catch (NamingException e) {
e.printStackTrace();
}
}
}
I put this library in my build path :
- jbossall-client.jar
- jboss-ejb3.jar
- jboss-aop-jdk50.jar
- jboss-aspect-library-jdk50.jar
- jboss-remoting.jar
- commons-httpclient.jar
- my beans interface definition in a jar (wiskee.jar)
But I get the following error :CLIENT
Ajout du massif pyrenees
java.lang.reflect.UndeclaredThrowableException
at $Proxy0.addMassif(Unknown Source)
at Client.main(Client.java:20)
Caused by: java.rmi.ConnectException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is:
java.io.EOFException
at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:266)
...
I use eclipse 3.1 and JBoss 4.0.2 with EJB 3.0 RC1
Thank you -
2. Re: Client notifications or callbacks
elkner Aug 19, 2005 10:32 AM (in response to gamac)"gamac" wrote:
What I would like to have now is some mechanism to forward notifications of inserts, updates or deletes of customers on the database to the client application ...
Have a look at the JMS examples ...