2
votes

I am trying to deploy a stateless ejb on jboss 4.2.3 using ejb3 annotations. Everything builds and deploys correctly, and I do not get any errors when jboss starts up. However the ejb is not getting bound to any JNDI location for lookup when I look at the bindings in jboss. Below is what I have for my ejb.

Remote

@Remote
public interface TestWebService {

public String TestWebMethod(String param1, String param2);

}

Stateless EJB

@Stateless
@RemoteBinding(jndiBinding="TestWeb")
@Remote(TestWebService.class)

public class TestWebServiceBean implements TestWebService{

public String TestWebMethod(String param1, String param2) {
    System.out.println("HELLO "+param1+" "+param2);
    return "Welcome!!";
}

 }

I have tried not having the @Remote and @RemoteBinding and it doesn't make a difference. I have also added and ejb-jar.xml file (which should not be needed with ejb3) and that does not appear to make a difference. Below is the output I see in the jboss log on startup.

installing MBean: jboss.j2ee:ear=ejb_web_service_ear-0.0.1-    SNAPSHOT.ear,jar=ejb_web_service-0.0.1-SNAPSHOT.jar,name=TestWebServiceBean,service=EJB3 with dependencies:
 21:56:00,633 INFO  [EJBContainer] STARTED EJB: com.tomax.ejb.TestWebServiceBean ejbName: TestWebServiceBean
1

1 Answers

4
votes

I figured this out, so in case anyone else has similar problems hopefully this will help. First I had the incorrect package for the annotations in jboss 4.2.3, they should be org.jboss.anotation.ejb.* for this version of jboss, in 5 and up this has changed. Also there were some additional dependency jars in my ear file that should not have been included since they are provided by the container. Once I removed those then it worked.