I'm trying to write a simple webservice using OpenEJB. I started with an example code (webapps/ejb-webservice) from TomEE project:

http://www.apache.org/dyn/closer.cgi/openejb/4.0.0-beta-1/examples-4.0.0-beta-1-src.tar.gz

The service class uses annotations:

@Stateless
@WebService(portName = "CalculatorPort",
        serviceName = "CalculatorWebService",
        targetNamespace = "http://superbiz.org/wsdl")
public class Calculator {
    public int sum(int add1, int add2) {
        return add1 + add2;
    }

    public int multiply(int mul1, int mul2) {
        return mul1 * mul2;
    }
}

Everything builds just fine. No problem with deploying the war to the server either (I'm using TomEE 1.0.0-beta-1-webprofile), but trying to access this webservice triggers a series of NameNotFoundException from an internal OpenEJB method:

2011-10-27 21:54:32,029 - ERROR - Error in safeBind method
javax.naming.NameNotFoundException: Name openejb is not bound in this Context
...
2011-10-27 21:54:32,031 - ERROR - Error in safeBind method
javax.naming.NameNotFoundException: Name TransactionManager is not bound in this Context
...
2011-10-27 21:54:32,033 - ERROR - Error in safeBind method
javax.naming.NameNotFoundException: Name TransactionSynchronizationRegistry is not bound in this Context
...
2011-10-27 21:54:32,034 - ERROR - Error in safeBind method
javax.naming.NameNotFoundException: Name ORB is not bound in this Context
...
2011-10-27 21:54:32,036 - ERROR - Error in safeBind method
javax.naming.NameNotFoundException: Name HandleDelegate is not bound in this Context

I found a post with similar lookup error:

http://openejb.979440.n4.nabble.com/EJB-2-1-OpenEJB-Tomcat-Datasource-Name-openejb-is-not-bound-in-this-Context-td3331555.html

but the problem there was the use of name lookup method. In the example code there are not explicit lookups.

Can anyone tell what might be the source of this problem?

有帮助吗?

解决方案

Moving this to an answer as it might help others to see it listed as solved in the stackoverflow search.

Solution is to use TomEE Plus which supports JAX-WS in addition to some other technologies like JAX-RS and JMS.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top