Here is all my codes:

MyBeanLocal.java
****************
@Local
public interface MyBeanLocal {
        public String test(String text);
}

TestMyBean.java
***************
@Stateless
public class TestMyBean implements MyBeanLocal {

        public static final String LocalJNDIName =  
TestMyBean.class.getSimpleName() + "/local";
        
        public String test(String text) {
                return "Hello, " + text;
        }

}

TestClient.java
*************
public class TestClient {
        public static void main(String[] args) {

                Context context;
                try {
                        context = new InitialContext();
                        MyBeanLocal beanLocal = (MyBeanLocal) context
                                        .lookup(TestMyBean.LocalJNDIName);
                        beanLocal.test("Wei Chen");
                } catch (NamingException e) {
                        e.printStackTrace();
                }
        }
}

jndi.properties
*************
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost:1099

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

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

Reply via email to