oooops!!! Fogot to give the code.
The code of EJB is totally ok. Here're some codes of the Swing client:

/*
*RemoteString.java
*/
package ejbtest;

import java.util.*;
import javax.naming.*;
import com.foshanshop.ejb3.HelloWorld;

public class RemoteString {
public static String getRemoteString(String name,String url) throws Exception{
        Properties props = new Properties();        
        props.setProperty("java.naming.factory.initial", 
"org.jnp.interfaces.NamingContextFactory");
        props.setProperty("java.naming.provider.url", url + ":1099");
        InitialContext ctx = new InitialContext(props);
        HelloWorld helloworld = (HelloWorld)ctx.lookup("HelloWorldBean/remote");
        return helloworld.SayHello(name);
}
}


/*
*A part of the codes for Swing, mouse event:
*/
public void mouseReleased(MouseEvent arg0) {
try{
String info[] = textField.getText().split(":");
textArea.setText(RemoteString.getRemoteString(info[1],info[0]));
}
catch(Exception e){textArea.setText(e.getMessage());}
}


I repeat: the SwingEJBTest.JAR ran well on the server computer, 
but not in other ones.


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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4179333
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to