>https://github.com/apache/tomee/tree/master/examples/pojo-webservice doesnt
>use an ejb. Note the mapping in web.xml can be refined since it is /* here.
This is a bit frustrating :-(
*ATTEMPT 1 =====================================*
I have tried to replicate the pojo-webservice web.xml in a new project, with
this steps in Netbeans:
- New Project - Maven - Web Application
- New - Web Services
Then I ignore the non-109 web server warnings. And I try to run it (there is
no web.xml nor sun-jaxws.xml, WEB-INF is empty). I can see the default
project index page but the Web Services do not start:
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WebServiceTest2]
org.apache.openejb.OpenEJBException: Unable to load servlet class:
com.sun.xml.ws.tx.coord.v11.endpoint.RegistrationRequesterPortImpl: null
at
org.apache.openejb.config.WsDeployer.processPorts(WsDeployer.java:234)
....
Caused by: java.lang.NullPointerException
at org.apache.openejb.config.WsDeployer.readWsdl(WsDeployer.java:450)
....
SEVERE - ContainerBase.removeChild: destroy:
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was
attempted ([before_destroy]) for component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WebServiceTest2]]
in state [STARTING_PREP]
at
org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:408)
....
*ATTEMPT 2 =====================================*
Then in the same project I create this web.xml (still no sun-jaxws.xml
file), and try again:
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<servlet>
<servlet-name>TestOp</servlet-name>
<servlet-class>com.example.webservices.TestOp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestOp</servlet-name>
<url-pattern>/TestOp</url-pattern>
</servlet-mapping>
</web-app>
While cleaning I get this message, strange...
Building war: C:\WebServiceTest2\target\WebServiceTest2-1.0-SNAPSHOT.war
Warning: selected war files include a WEB-INF/web.xml which will be ignored
Then I get again the "non-jsr 109 compliance" window and finally errors:
SEVERE - Unable to deploy collapsed ear in war
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WebServiceTest]
org.apache.openejb.OpenEJBException: Unable to load servlet class:
com.sun.xml.ws.tx.coord.v11.endpoint.RegistrationRequesterPortImpl: null
at
org.apache.openejb.config.WsDeployer.processPorts(WsDeployer.java:234)
...
SEVERE - ContainerBase.removeChild: destroy:
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was
attempted ([before_destroy]) for component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WebServiceTest]]
in state [STARTING_PREP]
at
org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:408)
...
SEVERE - ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WebServiceTest]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:158)
....
Caused by: org.apache.tomee.catalina.TomEERuntimeException:
org.apache.openejb.OpenEJBException: Unable to load servlet class:
com.sun.xml.ws.tx.coord.v11.endpoint.RegistrationRequesterPortImpl: null
at
org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1266)
....
Caused by: org.apache.openejb.OpenEJBException: Unable to load servlet
class: com.sun.xml.ws.tx.coord.v11.endpoint.RegistrationRequesterPortImpl:
null
at
org.apache.openejb.config.WsDeployer.processPorts(WsDeployer.java:234)
....
Caused by: java.lang.NullPointerException
*ATTEMPT 3 =====================================*
I try to use
https://github.com/apache/tomee/tree/master/examples/pojo-webservice.
First error is "Unable to find interface javax.transaction.UserTransaction"
which I can fix by replacing in pom.xml this:
<dependency>
<groupId>org.apache.tomee</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
with this:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
But then running the project and accessing the Web Service gives:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>
No binding operation info while invoking unknown method with params unknown.
</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I get again the errors:
<http://tomee-openejb.979440.n4.nabble.com/file/n4679064/nonjsr109.jpg>
SEVERE - Creation of the naming context failed:
javax.naming.OperationNotSupportedException: Context is read only
javax.naming.NameNotFoundException: Name [comp] is not bound in this
Context. Unable to find [comp].
at org.apache.naming.NamingContext.lookup(NamingContext.java:817)
...
WARNING - Interceptor for {http://pojo.ws.superbiz.org/}PojoWSService has
thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: No binding operation info while invoking
unknown method with params unknown.
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:58)
....
And also if I try to test the Web Service I get this error:
<http://tomee-openejb.979440.n4.nabble.com/file/n4679064/nontesterpage.jpg>
What can I do? It should be simple to create a Web Service from scratch with
Netbeans + TomEE but this looks hectic.
--
View this message in context:
http://tomee-openejb.979440.n4.nabble.com/TomEE-and-Web-Services-tp4679025p4679064.html
Sent from the TomEE Users mailing list archive at Nabble.com.