[JBoss Web Services Users] - web services and virtual hosts (jbossws 3.0.5 on AS4.2.2)
by brettcave
theres a few topics on this, and doesn't seem to be resolved yet, although jbossws-native 3.0.3 addressed the issue - is there perhaps a step missing, or is this an issue with a component other than just jbossws (ejb2.1 endpoints?)
1) upgrade jboss to jbossws-native 3.0.5 and restart (all libs and the jbossws.sar updated in deploy)
2) update libraries in my project classpath (ide and compile cp's) - specifically jbossws-spi.jar for the annotations (jaxb-api stays the same). recompile and redeploy project.
jboss-web.deployer/server.xml:
<Host name="my.virtual.host"
| ......>
| <Alias>my.virtual.host.name</Alias>
| <Alias>my.virtual.host.name:80</Alias>
| <Valve ... />
| </Host>
|
The default "localhost" virtualhost is still configured, and listens on 0.0.0.0:8080 to all headers excluding the virtualhost aliases above.
MyWSBean.java (seam 2.1.1):
@Name("myWS")
| @Stateless()
| @WebContext(virtualHosts = {"my.virtual.host"}, contextRoot = "/services")
| @WebService(name="myWS", serviceName="myWS")
| public class MyWSBean {}
|
See theres a few jira issues about this, assuming there is no working for jboss 4? (5.0.1 is resolved).
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267270#4267270
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267270
15 years, 1 month
[JBoss Web Services Users] - Basic WebService setup failing (wsconsume 4.2.2 vs 5.1.0 - g
by jpebe001
Hi there @ JBoss web,
Disclaimer: I do not think the following is a bug (because this is pretty basic functionality) but I cannot see what, for the life of us, we are doing wrong or unconventional.
We are using a basic example and we have the following setups
A: JBoss 5.1.0 with CXF WS Stack 3.2.1
B: JBoss 4.2.2 with CXF WS Stack 3.0.2
For both A and B we have the SAME WSDL file (reproduced for completeness hereunder - note that this is automatically generated through the same server class annotation).
| <?xml version="1.0" encoding="UTF-8"?>
| <wsdl:definitions name="testApiService" targetNamespace="http://server.ws.ixaris.com"
| xmlns:ns1="http://schemas.xmlsoap.org/wsdl/soap/http"
| xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
| xmlns:tns="http://server.ws.ixaris.com"
| xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema">
| <wsdl:types>
| <xs:schema elementFormDefault="unqualified" targetNamespace="http://server.ws.ixaris.com" version="1.0"
| xmlns:tns="http://server.ws.ixaris.com"
| xmlns:xs="http://www.w3.org/2001/XMLSchema">
| <xs:element name="apiCaller" type="tns:apiCaller"/>
| <xs:element name="apiCallerResponse" type="tns:apiCallerResponse"/>
| <xs:complexType name="apiCaller">
| <xs:sequence>
| <xs:element form="qualified" minOccurs="0" name="arg0" type="tns:testpayment"/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name="testpayment">
| <xs:sequence>
| <xs:element name="paymentId" type="xs:string"/>
| <xs:element name="userId" type="xs:string"/>
| <xs:element name="amount" type="xs:double"/>
| <xs:element name="currency" type="xs:string"/>
| <xs:element name="date" type="xs:dateTime"/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name="apiCallerResponse">
| <xs:sequence>
| <xs:element form="qualified" minOccurs="0" name="testApiCallerResult" type="tns:testpaymentconfirmation"/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name="testpaymentconfirmation">
| <xs:sequence>
| <xs:element name="statusCode" type="xs:int"/>
| <xs:element minOccurs="0" name="statusMessage" type="xs:string"/>
| <xs:element minOccurs="0" name="paymentObject" type="tns:testpayment"/>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| </wsdl:types>
| <wsdl:message name="apiCaller">
| <wsdl:part element="tns:apiCaller" name="parameters">
| </wsdl:part>
| </wsdl:message>
| <wsdl:message name="apiCallerResponse">
| <wsdl:part element="tns:apiCallerResponse" name="parameters">
| </wsdl:part>
| </wsdl:message>
| <wsdl:portType name="testApiService">
| <wsdl:operation name="apiCaller">
| <wsdl:input message="tns:apiCaller" name="apiCaller">
| </wsdl:input>
| <wsdl:output message="tns:apiCallerResponse" name="apiCallerResponse">
| </wsdl:output>
| </wsdl:operation>
| </wsdl:portType>
| <wsdl:binding name="testApiServiceSoapBinding" type="tns:testApiService">
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
| <wsdl:operation name="apiCaller">
| <soap:operation soapAction="" style="document"/>
| <wsdl:input name="apiCaller">
| <soap:body use="literal"/>
| </wsdl:input>
| <wsdl:output name="apiCallerResponse">
| <soap:body use="literal"/>
| </wsdl:output>
| </wsdl:operation>
| </wsdl:binding>
| <wsdl:service name="testApiService">
| <wsdl:port binding="tns:testApiServiceSoapBinding" name="testapiport">
| <soap:address location="http://127.0.0.1:8080/testapiwebservice/testapiservice"/>
| </wsdl:port>
| </wsdl:service>
| </wsdl:definitions>
|
Using the wsconsume tool in the JBoss BIN folder, this WSDL file generates different clients for setups A and B (described above). The main and (possibly only) interesting difference in the service interface is the following:
In A: JBoss 5.1.0 with CXF WS Stack 3.2.1: (class finally generated by Apache CXF 2.2.4)
| @WebResult(name = "testApiCallerResult", targetNamespace = "")
| @.. //other annotations identical!
| public com.ixaris.ws.server.Testpaymentconfirmation apiCaller(
| @WebParam(name = "arg0", targetNamespace = "http://server.ws.ixaris.com")
| com.ixaris.ws.server.Testpayment arg0
| );
|
In B: JBoss 4.2.2 with CXF WS Stack 3.0.2: (class finally generated by JAX-WS RI 2.1.1-b03)
| @WebResult(name = "testApiCallerResult", targetNamespace = "http://server.ws.ixaris.com")
| @.. //other annotations identical!
| public Testpaymentconfirmation apiCaller(
| @WebParam(name = "arg0", targetNamespace = "http://server.ws.ixaris.com")
| Testpayment arg0);
|
As you can see the client generated by the wsconsume tool in setup A does not have a namespace and generates the following exception:
| Exception in thread "main" javax.xml.ws.WebServiceException: class com.ixaris.ws.client.endpoints.ApiCallerResponse do not have a property of the name testApiCallerResult
| at com.sun.xml.internal.ws.client.sei.ResponseBuilder$DocLit.<init>(ResponseBuilder.java:486)
| at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.<init>(SyncMethodHandler.java:171)
| at com.sun.xml.internal.ws.client.sei.SEIStub.<init>(SEIStub.java:67)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:544)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:292)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:274)
| at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:267)
| at javax.xml.ws.Service.getPort(Service.java:92)
| at com.ixaris.ws.client.endpoints.TestApiService_Service.getTestapiport(TestApiService_Service.java:62)
| at com.ixaris.ws.client.testapiclient.testApiClientProcess(testapiclient.java:31)
| at com.ixaris.ws.client.testapiclient.main(testapiclient.java:84)
| Caused by: javax.xml.bind.JAXBException: testApiCallerResult is not a valid property on class com.ixaris.ws.client.endpoints.ApiCallerResponse
| at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getElementPropertyAccessor(JAXBContextImpl.java:910)
| at com.sun.xml.internal.ws.client.sei.ResponseBuilder$DocLit.<init>(ResponseBuilder.java:475)
| ... 10 more
|
Note that if I add this
targetNamespace = "http://server.ws.ixaris.com"
to the Jboss 5.1.0 and CXF 3.2.1 (setup A) WebResult annotation on the interface, everything works fine.
Note: I am running BOTH war files on JBoss 5.1.0 with CXF stack 3.2.1
Any ideas why this is happening ?
Many Thanks
JP
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267001#4267001
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267001
15 years, 1 month
[JBoss Web Services Users] - Accessing Secured WebService is failing
by pvenkatesh
Hi All
I am able to access my webservice if i access it without applying any security stuff, but it's failing when I enable security for my service
I've exactly followed the following link to apply security for my webservice
http://www.developer.com/java/other/article.php/10936_3802631_1/Securing-...
My WAR file structure is as follows
JBossWS
|
|-src
| |_org.jbia.ws
| |_Hello.java
|
|-lib
| |
| all the jarfile
|
|-WebContent
| |
| WEB-INF
| | |-jboss-wsse-server.xml
| | |-server.keystore
| | |-server.truststore
| | |-web.xml
| |
| META-INF
| | |
| | |-MANIFEST.MF
My JAR file's structure is as follows
WebService
|
|-src
| |_org.jbia.ws
| |_Client.java
| |_All the generated stuff based on wsdl(hello.java, HelloBindingStrub.java,HelloProxy.java,HellowService.java, HelloServiceLocatior.java)
|
|-lib
| |
| all the jarfile
|
|-META-INF
| |
| |-jboss-wsse-client.xml
| |-client.keystore
| |-client.truststore
| |-standard-jaxws-client-config.xml
| |
I tried to print the SOAP Request mesage at stub class as follows, but it's going as NULL
| SOAPMessage message = _call.getMessageContext().getMessage();
| System.out.println("------------------------");
| System.out.println(message);
| System.out.println("------------------------");
|
My Client java files is as follows
| package org.jbia.ws;
|
| import java.rmi.RemoteException;
|
| public class Client {
| String st = null;
| public String hello(String args) {
| HelloProxy svc = new HelloProxy();
| Hello hello = svc.getHello();
| try {
| st = hello.sayHello(args);
| } catch (RemoteException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| return st;
| }
| public static void main(String[] args) {
| Client cl = new Client();
| cl.hello("Venkat");
| }
| }
|
The exception I am getting is as follows
17:09:26,531 ERROR [HandlerChainExecutor] Exception during handler processing
| java.lang.NullPointerException
| at org.jboss.ws.extensions.security.Util.matchNode(Util.java:188)
| at org.jboss.ws.extensions.security.Util.matchNode(Util.java:183)
| at org.jboss.ws.extensions.security.Util.findElement(Util.java:89)
| at org.jboss.ws.extensions.security.WSSecurityDispatcher.handleInbound(WSSecurityDispatcher.java:115)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleInboundSecurity(WSSecurityHandler.java:78)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer.handleInbound(WSSecurityHandlerServer.java:41)
| at org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:295)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:140)
| at org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callRequestHandlerChain(HandlerDelegateJAXWS.java:87)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:126)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:170)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:408)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:272)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
| at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:619)
| 17:09:26,625 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
| javax.xml.ws.WebServiceException: java.lang.NullPointerException
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.processHandlerFailure(HandlerChainExecutor.java:276)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:155)
| at org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callRequestHandlerChain(HandlerDelegateJAXWS.java:87)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:126)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:170)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:408)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:272)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
| at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: java.lang.NullPointerException
| at org.jboss.ws.extensions.security.Util.matchNode(Util.java:188)
| at org.jboss.ws.extensions.security.Util.matchNode(Util.java:183)
| at org.jboss.ws.extensions.security.Util.findElement(Util.java:89)
| at org.jboss.ws.extensions.security.WSSecurityDispatcher.handleInbound(WSSecurityDispatcher.java:115)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleInboundSecurity(WSSecurityHandler.java:78)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer.handleInbound(WSSecurityHandlerServer.java:41)
| at org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:295)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:140)
| ... 27 more
| 17:09:26,796 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
| javax.xml.ws.WebServiceException: java.lang.NullPointerException
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.processHandlerFailure(HandlerChainExecutor.java:276)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:155)
| at org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callRequestHandlerChain(HandlerDelegateJAXWS.java:87)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:126)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:170)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:408)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:272)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
| at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: java.lang.NullPointerException
| at org.jboss.ws.extensions.security.Util.matchNode(Util.java:188)
| at org.jboss.ws.extensions.security.Util.matchNode(Util.java:183)
| at org.jboss.ws.extensions.security.Util.findElement(Util.java:89)
| at org.jboss.ws.extensions.security.WSSecurityDispatcher.handleInbound(WSSecurityDispatcher.java:115)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleInboundSecurity(WSSecurityHandler.java:78)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer.handleInbound(WSSecurityHandlerServer.java:41)
| at org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:295)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:140)
| ... 27 more
|
I would appriciate if someone throws some light on this issue
Thanks
With Regards
Venkatesh
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266743#4266743
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266743
15 years, 1 month
[JBoss Web Services Users] - Handlers number depends on number of concurrent threads
by sergey.olifirenko
Hello, I've found possible bug related to WS Handlers creation during concurrent WS access.
Problem is in number of created Handlers for WS and as result their execution order. Their number differs in two cases
1) Single thread calls WS. Then 20 threads concurrently call the same WS. (example below shows 3 created Handlers with order C-B-A-WS-A-B-C )
2) 20 threads call WS concurrently. (example below shows creation 20*3 = 60 handlers, with invalid execution order f.e. C-B-A-B-A-C-...-A-A-WS-A-C-B-A-B-A-C-...-A-A)
As I understand WS Handlers initilization isn't synchronized.
Is it known issue?
Example:
There is following handler chain:
<handler-chains 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 javaee_web_services_1_2.xsd">
<handler-chain>
<handler-class>com.softcomputer.softlab.lab.service.HandlerA</handler-class>
<handler-class>com.softcomputer.softlab.lab.service.HandlerB</handler-class>
<handler-class>com.softcomputer.softlab.lab.service.HandlerC</handler-class>
</handler-chain>
</handler-chains>
Service:
@WebService(name = "TimeService")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@Stateless
@HandlerChain(file = "META-INF/custom_handlers.xml")
public class TimeService implements ITimeService
{
@WebMethod
public long getServerTime(Void dummy)
{
try {
Thread.sleep(200);
}
catch (Exception e) { throw new IllegalStateException(e); }
return System.currentTimeMillis();
}
}
Handlers are following:
public class HandlerA implements SOAPHandler
{
public HandlerA()
{
logMsg(this, "Constructor");
}
public void close(MessageContext arg0)
{
shortLog(this.getClass(), "close");
}
public Set getHeaders()
{
shortLog(this.getClass(), "get Headers");
return null;
}
public boolean handleFault(SOAPMessageContext arg0)
{
fullHandlerLog(this.getClass(), "handleFault", arg0);
return true;
}
public boolean handleMessage(SOAPMessageContext arg0)
{
fullHandlerLog(this.getClass(), "handle Message ", arg0);
return true;
}
}
public class HandlerB implements SOAPHandler
{
public HandlerB()
{
logMsg(this, "Constructor");
}
public void close(MessageContext arg0)
{
shortLog(this.getClass(), "close");
}
public Set getHeaders()
{
shortLog(this.getClass(), "get Headers");
return null;
}
public boolean handleFault(SOAPMessageContext arg0)
{
fullHandlerLog(this.getClass(), "handleFault", arg0);
return true;
}
public boolean handleMessage(SOAPMessageContext arg0)
{
fullHandlerLog(this.getClass(), "handle Message ", arg0);
return true;
}
}
C is the same like A and B.
Part of 1st case Log:
2009-11-20 11:28:28,882 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerA Constructor
2009-11-20 11:28:28,882 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerA get Headers
2009-11-20 11:28:28,882 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerB Constructor
2009-11-20 11:28:28,882 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerB get Headers
2009-11-20 11:28:28,882 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerC Constructor
2009-11-20 11:28:28,882 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerC get Headers
2009-11-20 11:30:30,035 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerC handle Message opName_:urn:getServerTime; way_: IN; user_:scc; ts_:1258709429988
2009-11-20 11:30:30,035 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerB handle Message opName_:urn:getServerTime; way_: IN; user_:scc; ts_:1258709430035
2009-11-20 11:30:30,035 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerA handle Message opName_:urn:getServerTime; way_: IN; user_:scc; ts_:1258709430035
2009-11-20 11:30:30,722 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerA handle Message opName_:ns1:getServerTimeResponse; way_: OUT; user_:FROM_LAB; ts_:1258709430722
2009-11-20 11:30:30,722 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerB handle Message opName_:ns1:getServerTimeResponse; way_: OUT; user_:FROM_LAB; ts_:1258709430722
2009-11-20 11:30:30,722 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerC handle Message opName_:ns1:getServerTimeResponse; way_: OUT; user_:FROM_LAB; ts_:1258709430722
2009-11-20 11:30:30,722 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerA close
2009-11-20 11:30:30,722 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerB close
2009-11-20 11:30:30,722 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerC close
2009-11-20 11:33:01,687 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerC handle Message opName_:getServerTime; way_: IN; user_:prf3; ts_:1258709581687
2009-11-20 11:33:01,687 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerB handle Message opName_:getServerTime; way_: IN; user_:prf3; ts_:1258709581687
2009-11-20 11:33:01,687 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerA handle Message opName_:getServerTime; way_: IN; user_:prf3; ts_:1258709581687
2009-11-20 11:33:01,718 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerC handle Message opName_:getServerTime; way_: IN; user_:prf2; ts_:1258709581718
2009-11-20 11:33:01,718 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerB handle Message opName_:getServerTime; way_: IN; user_:prf2; ts_:1258709581718
2009-11-20 11:33:01,718 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerA handle Message opName_:getServerTime; way_: IN; user_:prf2; ts_:1258709581718
...
2009-11-20 11:33:01,922 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerA handle Message opName_:ns1:getServerTimeResponse; way_: OUT; user_:FROM_LAB; ts_:1258709581922
2009-11-20 11:33:01,922 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerB handle Message opName_:ns1:getServerTimeResponse; way_: OUT; user_:FROM_LAB; ts_:1258709581922
2009-11-20 11:33:01,922 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerC handle Message opName_:ns1:getServerTimeResponse; way_: OUT; user_:FROM_LAB; ts_:1258709581922
2009-11-20 11:33:01,922 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerA close
2009-11-20 11:33:01,922 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerB close
2009-11-20 11:33:01,922 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerC close
2009-11-20 11:33:01,937 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerA handle Message opName_:ns1:getServerTimeResponse; way_: OUT; user_:FROM_LAB; ts_:1258709581937
2009-11-20 11:33:01,937 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerB handle Message opName_:ns1:getServerTimeResponse; way_: OUT; user_:FROM_LAB; ts_:1258709581937
2009-11-20 11:33:01,937 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerC handle Message opName_:ns1:getServerTimeResponse; way_: OUT; user_:FROM_LAB; ts_:1258709581937
2009-11-20 11:33:01,937 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerA close
2009-11-20 11:33:01,937 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerB close
2009-11-20 11:33:01,937 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerC close
Part of 2nd case Log(execution order detailed for thread 10):
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-18] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-17] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-9] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-7] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-4] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-6] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-13] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-14] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-16] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-8] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-10] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-20] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-3] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-11] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-15] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-12] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-19] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-5] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-1] HandlerA Constructor
2009-11-20 11:43:44,499 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-17] HandlerA get Headers
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-18] HandlerA get Headers
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-18] HandlerB Constructor
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-18] HandlerB get Headers
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-18] HandlerC Constructor
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-18] HandlerC get Headers
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-17] HandlerB Constructor
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-17] HandlerB get Headers
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-17] HandlerC Constructor
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-17] HandlerC get Headers
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerA get Headers
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerB Constructor
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerB get Headers
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerC Constructor
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-2] HandlerC get Headers
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-16] HandlerA get Headers
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-16] HandlerB Constructor
2009-11-20 11:43:44,515 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-16] HandlerB get Headers
...
2009-11-20 11:43:44,608 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-14] HandlerC handle Message opName_:getServerTime; way_: IN; user_:prf4; ts_:125871022454...6
2009-11-20 11:43:44,608 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-7] HandlerC handle Message opName_:getServerTime; way_: IN; user_:prf2; ts_:1258710224546
2009-11-20 11:43:44,608 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-10] HandlerC handle Message opName_:getServerTime; way_: IN; user_:prf18; ts_:1258710224546
2009-11-20 11:43:44,608 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-17] HandlerC handle Message opName_:getServerTime; way_: IN; user_:prf19; ts_:1258710224546
...
2009-11-20 11:43:44,608 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-10] HandlerB handle Message opName_:getServerTime; way_: IN; user_:prf18; ts_:1258710224608
...
2009-11-20 11:43:44,608 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-10] HandlerA handle Message opName_:getServerTime; way_: IN; user_:prf18; ts_:1258710224608
...
2009-11-20 11:43:44,608 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-10] HandlerC handle Message opName_:getServerTime; way_: IN; user_:prf18; ts_:12587102246080
...
2009-11-20 11:43:44,624 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-10] HandlerB handle Message opName_:getServerTime; way_: IN; user_:prf18; ts_:1258710224624
...
2009-11-20 11:43:44,624 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-10] HandlerA handle Message opName_:getServerTime; way_: IN; user_:prf18; ts_:1258710224624
...
2009-11-20 11:43:44,624 DEBUG [com.softcomputer.softlab.lab.service.WebServiceExecutionTimeLogger|http-0.0.0.0-8080-10] HandlerC handle Message opName_:getServerTime; way_: IN; user_:prf18; ts_:1258710224624
etc. thread 10 calls all 60 handlers randomly.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266712#4266712
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266712
15 years, 1 month
[JBoss Web Services Users] - Linkage error when packaging metro
by peterdnight2
I added an entry to jboss-web.xml, but still get errors below. Help Please ;)
<jboss-web>
<class-loading java2ClassLoadingCompliance="true">
<loader-repository>
com.example:archive=petersLoader
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
</jboss-web>
12:25:04,853 INFO [http] WSSERVLET12: JAX-WS context listener initializing
12:25:05,462 SEVERE [http] WSSERVLET11: failed to parse runtime descriptor: java.lang.LinkageError: loader constraint violation: when resolving field "DATETIME" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the referring class, javax/xml/datatype/DatatypeConstants, and the class loader (instance of ) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type
java.lang.LinkageError: loader constraint violation: when resolving field "DATETIME" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the referring class, javax/xml/datatype/DatatypeConstants, and the class loader (instance of ) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type
at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.(RuntimeBuiltinLeafInfoImpl.java:224)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.(RuntimeTypeInfoSetImpl.java:61)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:127)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:79)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:152)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266615#4266615
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266615
15 years, 1 month