I re-installed JBoss 4.0.5 with the installer and option EJB3. I'm getting the 
error:
javax.naming.NameNotFoundException: org.os.ejb3.Hello not bound
Seams like the reflection lookup doesn't work like it should be for EJB3.
- my Interface:
package org.os.ejb3;
  | public interface Hello {
  |     public String hello();
  | }
  | 
- My Bean:
package org.os.ejb3;
  | 
  | import javax.ejb.Remote;
  | import javax.ejb.Stateless;
  | 
  | 
  | @Stateless
  | @Remote(Hello.class)
  | public class HelloBean implements Hello {
  | 
  |     public String hello() {
  |             return "Hi there this is JBoss server side";
  |     }
  | 
  | }
  | 

-my deployment descriptor:
<?xml version="1.0" encoding="UTF-8"?>
  | <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"; 
  |             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
  |             
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd";
  |             version="3.0">
  | 
  |     <enterprise-beans>
  |     </enterprise-beans>
  |             
  | </ejb-jar>

- my client:
package org.os.ejb3;
  | 
  | import javax.naming.Context;
  | import javax.naming.InitialContext;
  | import javax.naming.NamingException;
  | 
  | public class HelloClient {
  | 
  |     /**
  |      * @param args
  |      */
  |     public static void main(String[] args) {
  |             System.out.println("STARTING HelloClient ... ");
  |             
  |             try {
  |                     Context ctx = new InitialContext();
  |                     
  |                     Hello h = (Hello)ctx.lookup("org.os.ejb3.Hello");
  |                     String s = h.hello();
  |                     
  |                     System.out.println("HelloClient -- received from server 
> " + s);
  |                     
  |             } catch (NamingException e) {
  |                     e.printStackTrace();
  |             }
  |             
  |     }
  | 
  | }
  | 

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

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

Reply via email to