[JBossWS] - Caused by: org.jboss.ws.WSException: Cannot obtain java type
by patel_123
hi
I am exposing my EJB3 components as web services.
WSDL document is generated correctly.
But when my client application tries to access the webservice it throws the following exception,
Caused by: org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://wb1-329:8080}validateUser
at org.jboss.ws.deployment.JSR109MetaDataBuilder.buildParameterMetaDataDoc(JSR109MetaDataBuilder.java:451)
at org.jboss.ws.deployment.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuilder.java:200)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaDataInternal(JSR109ClientMetaDataBuilder.java:208)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:126)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:82)
at org.jboss.ws.jaxrpc.ServiceImpl.(ServiceImpl.java:96)
at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
at client.UserBean.loginUser(UserBean.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
please help me in resolving this error
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057241#4057241
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057241
17 years, 6 months
[JBossWS] - jb0ss4.2.0, JAX-WS2.0 deployment exception
by J2EEUser
Hi,
I am trying JAX-WS2.0 sample deployment on JBoss4.2.0. I am getting the following deplyment exception:
Cannot start service endpoint; - nested throwable:
=========
(org.jboss.ws.WSException: {http://www.test.com}arg0 is not a valid property on class fromwsdl.server.AddNumbers)
at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
at org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:101)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy46.start(Unknown Source)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
=============
sun-jaxws.xml
=======
<?xml version="1.0" encoding="UTF-8"?>
<endpoint
name="fromwsdl"
interface="fromwsdl.server.AddNumbersPortType"
implementation="fromwsdl.server.AddNumbersImpl"
wsdl="WEB-INF/wsdl/AddNumbers.wsdl"
service="{http://www.test.com}AddNumbersService"
port="{http://www.test.com}AddNumbersPort"
url-pattern="/addnumbers" />
======
web.xml
========
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" mlns="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 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
fromwsdl
<display-name>fromwsdl</display-name>
<listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
JAX-WS endpoint - fromwsdl
<display-name>fromwsdl</display-name>
<servlet-name>AddNumbersPort</servlet-name>
<servlet-class>fromwsdl.server.AddNumbersImpl</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>AddNumbersPort</servlet-name>
<url-pattern>/addnumbers</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
</web-app>
========
Anyone had this issue? I have to solve this ASAP to develop actual web service implementations.
Can anyone please help me in solving this?
THanks in advance.
RR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056989#4056989
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056989
17 years, 6 months
[JBossWS] - Re: MTOM + WS Security = problem
by davideling
Ehm... sorry my last reply was only a code snippet...
Service implementation
| @WebService(endpointInterface="serviceJBossCipheredSigned.ServiceJBossCipheredSigned",
| portName="ServiceJBossCipheredSignedSOAP",
| serviceName="ServiceJBossCipheredSigned"
| )
| @BindingType(javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING)
| @EndpointConfig(configName = "Standard WSSecurity Endpoint")
| public class ServiceJBossCipheredSignedImpl implements
| ServiceJBossCipheredSigned {
| // bla bla ...
| }
|
Service configuration (jboss-wsse-service.xml):
| <jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
| <key-store-file>WEB-INF/wsse.keystore</key-store-file>
| <key-store-password>jbossws</key-store-password>
| <trust-store-file>WEB-INF/wsse.truststore</trust-store-file>
| <trust-store-password>jbossws</trust-store-password>
| <config>
| <encrypt type="x509v3" alias="wsseClient"/>
| <sign type="x509v3" alias="wsseServer" />
| <requires>
| <signature />
| <encryption />
| <username />
| </requires>
| </config>
| </jboss-ws-security>
|
Client implementation:
| public void testInvocation() throws Exception {
|
| // 1) Service
| Service service = Service.create(
| new File("wsdl/mywsdl.wsdl").toURL(),
| new QName("http://serviceJBossCipheredSigned/",
| "ServiceJBossCipheredSigned")
| );
|
| // Configuration file WS-Security
| ((ServiceExt) service).setSecurityConfig(
| "META-INF/jboss-wsse-client.xml");
|
| // 2) Port Creation
| ServiceJBossCipheredSigned port = (ServiceJBossCipheredSigned)
| service.getPort(
| new QName("http://serviceJBossCipheredSigned/",
| "ServiceJBossCipheredSignedSOAP"),
| ServiceJBossCipheredSigned.class);
|
| // Enable MTOM
| SOAPBinding binding =
| (SOAPBinding) ((BindingProvider) port).getBinding();
| binding.setMTOMEnabled(true);
|
| // Enable WS-Security on port
| ((StubExt) port).setConfigName("Standard WSSecurity Client");
|
| // Set endpoint address
| Map<String, Object> reqContext =
| ((BindingProvider)port).getRequestContext();
| reqContext.put(
| BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
| "http://bla bla"
| );
|
| // Set username e password
| reqContext.put(Stub.USERNAME_PROPERTY, "myUsername");
| reqContext.put(Stub.PASSWORD_PROPERTY, "myPassword");
|
| ... bla bla and invocation
|
| );
|
Client configuration
| <jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
|
| <key-store-file>META-INF/wsse.keystore</key-store-file>
| <key-store-password>jbossws</key-store-password>
| <trust-store-file>META-INF/wsse.truststore</trust-store-file>
| <trust-store-password>jbossws</trust-store-password>
|
| <config>
| <username/>
| <encrypt type="x509v3" alias="wsseServer"/>
| <sign type="x509v3" alias="wsseClient"/>
| <requires>
| <signature />
| <encryption />
| </requires>
| </config>
|
| </jboss-ws-security>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056935#4056935
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056935
17 years, 6 months
[JBossWS] - Re: MTOM + WS Security = problem
by mr_d
Hello davideling,
Thanks for your reply,
My annotations on my service implementation are:
| @BindingType(javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING)
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
| @EndpointConfig(configName = "Standard WSSecurity Endpoint")
|
as suggested in http://jbws.dyndns.org/mediawiki/index.php/JAX-WS_User_Guide#MTOM.2FXOP.
If I try your annotations (without @SOAPBinding) I have the same exception:
| javax.xml.ws.soap.SOAPFaultException: Endpoint {http://foo.org/mtom}ServiceImpl does not contain
| operation meta data for: {http://www.w3.org/2001/04/xmlenc#}EncryptedData
|
Now, the weird part: If I disable ws security on the client part, it works (even if on the server side I have @EndpointConfig(configName = "Standard WSSecurity Endpoint")). As I said on my first post, when I activate mtom and ws-security, it seems that only mtom works, so if my client send an encrypted soap message, the server will not know how to handle it and will throws the exception.
You said, you've got the attachment inlined. I don't know what a soap message looks like using mtom + ws security, but mtom is supposed to use multi parts isn't it? So, are you sure that ws security has not disable mtom?
Well, maybe I need to dig more information
:oD.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056930#4056930
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056930
17 years, 6 months
[JBossWS] - Jbossws client: java.lang.IncompatibleClassChangeError
by Christy
Hi!
Can somebody help me please?
I wrote a simple client using jbossws. I've generated necessary files using wsconsume.
Here is the code of my client:
public class ClientJaxWS {
public String getCall() {
String res = "";
WSJaxwsService service = new WSJaxwsService();
WSJaxws port = service.getWSJaxwsPort();
res = port.hello("it is me");
System.out.println("res = " + res);
return res;
}
}
But when I try to run my client I have next eror:
java.lang.IncompatibleClassChangeError
at client.ws.jaxws.ClientJaxWS.getCall(ClientJaxWS.java:13)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:63)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
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:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Does anybody know what is the problem and what is the reason?
Maybe someone has working examples?
Thank you in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056864#4056864
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056864
17 years, 6 months
[JBossWS] - Re: Problem with inheritance and JBossWS
by hannes.koller
Ok I have managed to create a simple example of the behavior. Please note that I am pretty new to webservices and JBossWS (started using it a few days ago) so sorry if something is overly complicated. Feedback is highly appreciated.
I am using JBoss 4.2.0.GA and java version "1.5.0_08"
I started with the following WSDL (I have modified an echo tutorial I found on the web so please dont be confused by the namespace and other irregularities):
| <?xml version="1.0" encoding="UTF-8"?>
| <definitions name='EchoService' targetNamespace='http://echo/'
| xmlns='http://schemas.xmlsoap.org/wsdl/'
| xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
| xmlns:tns='http://echo/'
| xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types>
| <xs:schema targetNamespace='http://echo/' version='1.0'
| xmlns:tns='http://echo/'
| xmlns:xs='http://www.w3.org/2001/XMLSchema'>
|
| <xs:complexType name='Something'>
| <xs:sequence>
| <xs:element minOccurs='0' name='arg0' type='xs:string' />
| </xs:sequence>
| </xs:complexType>
|
| <xs:complexType name='A'>
| <xs:sequence>
| <xs:element minOccurs='0' name='arg0' type='xs:string' />
| </xs:sequence>
| </xs:complexType>
|
| <xs:complexType name='B'>
| <xs:complexContent>
| <xs:extension base="tns:A">
| <xs:sequence>
| <xs:element minOccurs='0' name='arg1' type='xs:string' />
| </xs:sequence>
| </xs:extension>
| </xs:complexContent>
| </xs:complexType>
| <xs:complexType name='C'>
| <xs:complexContent>
| <xs:extension base="tns:B">
| <xs:sequence>
| <xs:element minOccurs='0' name='arg2' type='xs:string' />
| </xs:sequence>
| </xs:extension>
| </xs:complexContent>
| </xs:complexType>
|
| <xs:complexType name="BResponse">
| <xs:sequence>
| <xs:element name="something" type="tns:Something" minOccurs="1" maxOccurs="1" nillable="true"/>
| <xs:element name="b" type="tns:B" minOccurs="1" maxOccurs="1" nillable="true"/>
| </xs:sequence>
| </xs:complexType>
|
| <xs:element name="bResponse" type="tns:BResponse"/>
| <xs:element name="something" type="tns:Something"/>
| </xs:schema>
| </types>
|
| <message name='GetB_Request' />
|
| <message name='GetB_GetBResponse'>
| <part name='para' element="tns:bResponse"/>
| </message>
|
| <portType name='GetB'>
| <operation name='getB' >
| <input message='tns:GetB_Request'/>
| <output message='tns:GetB_GetBResponse' />
| </operation>
| </portType>
| <binding name='GetBBinding' type='tns:GetB'>
| <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http' />
| <operation name='getB'>
| <soap:operation soapAction='' />
| <input>
| <soap:body use='literal' />
| </input>
| <output>
| <soap:body use='literal' />
| </output>
| </operation>
| </binding>
| <service name='GetBService'>
| <port binding='tns:GetBBinding' name='GetBPort'>
| <soap:address location='REPLACE_WITH_ACTUAL_URL' />
| </port>
| </service>
| </definitions>
|
We have an A->B->C Class Hierarchy here, and a BResponse Complex Type which consists of a "B" and a "Something". Note the "minOccurs=1 maxOccurs=1 nillable=true " . If I throw the file at wsconsume it creates a number of classes. The BResponse Class looks like this:
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "BResponse", propOrder = {
| "something",
| "b"
| })
| public class BResponse {
|
| @XmlElement(required = true, nillable = true)
| protected Something something;
| @XmlElement(required = true, nillable = true)
| protected B b;
| ....}
|
I have written a very simple Server:
| @javax.jws.WebService(endpointInterface="echo.GetB", serviceName="GetBService", targetNamespace="http://echo/", portName="GetBPort" )
| public class DummyGetB implements GetB {
|
| public BResponse getB() {
|
| BResponse response = new BResponse();
|
| C c = new C();
| c.setArg0("1");
| c.setArg1("2");
| c.setArg2("3");
|
| response.setB(c);
|
| return response;
| }
|
| }
|
and a Client:
| public class Client {
|
| public static void main(String[] args) throws Exception {
| GetBService getB = new GetBService(new URL("http://127.0.0.1:8080/server?wsdl"),new QName("http://echo/", "GetBService"));
|
| GetB getBPort = getB.getGetBPort();
| BResponse bResponse = getBPort.getB();
|
| System.out.println(bResponse.getB().getClass());
| B b = bResponse.getB();
| System.out.println(b.getArg0());
| System.out.println(b.getArg1());
| C c = (C)bResponse.getB();
| System.out.println(c.getArg2());
| }
|
If I try this example I get:
| class echo.B
| 1
| 2
| Exception in thread "main" java.lang.ClassCastException: echo.B
| at at.ac.arsenal.Client.main(Client.java:53)
|
Only a "B" gets transmitted, although it should be a "C"
Now, to get the behavior I was talking about change the minOccurrs parameter of something element of BResponse to 0:
| ..............
| <xs:complexType name="BResponse">
| <xs:sequence>
| <xs:element name="something" type="tns:Something" minOccurs="0" maxOccurs="1" nillable="true"/>
| <xs:element name="b" type="tns:B" minOccurs="1" maxOccurs="1" nillable="true"/>
| </xs:sequence>
| </xs:complexType>
| ................
|
Then rerun wsconsume. The generated BResponse class now looks like this. Notice the JAXBElement type of variable something;
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "BResponse", propOrder = {
| "something",
| "b"
| })
| public class BResponse {
|
| @XmlElementRef(name = "something", type = JAXBElement.class)
| protected JAXBElement<Something> something;
| @XmlElement(required = true, nillable = true)
| protected B b;
|
I Recompile and Redeploy the server then rerun the Client. The output is now:
| class echo.C
| 1
| 2
| 3
|
now C gets transmitted and the arg2 property has the correct value.
As I said before this is of course no solution to the original problem, but I think it might be useful in tracking down the source of it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056777#4056777
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056777
17 years, 6 months