[JBossWS] - ClassCastException @ BaseDeserializerFactory.getSpecialized
by vasquezr
Using Jboss 4.0.2.
Have a web service client(dyamic proxy method) that uses a complex type as a return parameter which consists of two java Object (WSDL anyType ).
The web service and client both worked until there was an attempt to add security to the application which housed the ejb endpoint.
The following code was added to the dynamic proxy client in order to get it to send a username and password.
Stub stub = (Stub)myService;
stub._setProperty(Stub.USERNAME_PROPERTY,username);
stub._setProperty(Stub.PASSWORD_PROPERTY,password);
myResult = myService.runServiceMethod(x,y,z);
This seems to get past the authentication issue but is now throwing the following exception
Exception:java.rmi.RemoteException: null; nested exception is:
java.lang.ClassCastException,Stack:java.rmi.RemoteException: null; nested exception is:
java.lang.ClassCastException
at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:176)
at $Proxy1.runJob(Unknown Source)
...
...
Caused by: java.lang.ClassCastException
at org.jboss.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:200)
at org.jboss.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:118)
at org.jboss.axis.encoding.DeserializationContextImpl.getDeserializer(DeserializationContextImpl.java:574)
at org.jboss.axis.message.RPCHandler.onStartChild(RPCHandler.java:309)
at org.jboss.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:1168)
at org.jboss.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:244)
at org.jboss.axis.message.SOAPElementAxisImpl.publishToHandler(SOAPElementAxisImpl.java:1386)
at org.jboss.axis.message.RPCElement.deserialize(RPCElement.java:262)
at org.jboss.axis.message.RPCElement.getParams(RPCElement.java:396)
at org.jboss.axis.client.Call.invoke(Call.java:2662)
at org.jboss.axis.client.Call.invoke(Call.java:2538)
at org.jboss.axis.client.Call.invokeInternal(Call.java:1976)
at org.jboss.axis.client.Call.invoke(Call.java:1914)
at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:265)
at org.jboss.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:381)
at $Proxy0.runJob(Unknown Source)
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:324)
at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:105)
... 4 more
it seems we are getting a result back but are having an issue deserializing the response.
Has anyone had a similar experience ?
can anyone provide some insight ?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093164#4093164
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093164
17 years
[JBossWS] - @EJB in a web service
by trippstowe
I am having some problems with dependency injection of an ejb in a webservice on jboss 4.0.5. What am i doing wrong?
The below code i have also tried @EJB without any parameters:
Also i could not get the setter to work either. it never entered the setter and displayed the logs.
| @EJB(name="LookupTest/remote",
| beanInterface=RemoteLookupTest.class)
| RemoteLookupTest ps;
|
| /* public void setPersonService(RemoteLookupTest newPs){
| log.info("injecting new personService: "+newPs);
| this.ps = newPs;
| log.info("injected personService: ps="+ps);
| }
| */
| @WebMethod
| public Person queryPerson(long personId) throws RemoteException{
| System.out.println(ps.getName());
| }
|
this code gives me a null pointer exception at the ps.getName();
this next code snippet is the next function in the web service and it works fine. this makes me think that the bean is deployed correctly.
| @WebMethod
| public void testLookupBean() throws RemoteException{
| try{
| Context ctx = new InitialContext();
| String jndiName = "LookupTest/remote";
| RemoteLookupTest obj = (RemoteLookupTest)ctx.lookup(jndiName);
| System.out.println(obj.getName());
|
thanks in advance
-==-
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093087#4093087
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093087
17 years
[JBossWS] - Re: Web service parameters are always null
by ppollard
Here it is:
| <definitions name='AbstractBeanService' targetNamespace='http://company.com/remedyAbstractService_1_0/types' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://company.com/remedyAbstractService_1_0/types' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types>
| <xs:schema targetNamespace='http://company.com/remedyAbstractService_1_0/types' version='1.0' xmlns:tns='http://company.com/remedyAbstractService_1_0/types' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
| <xs:element name='sendTicketRequestToPartner' type='tns:sendTicketRequestToPartner'/>
| <xs:element name='sendTicketRequestToPartnerResponse' type='tns:sendTicketRequestToPartnerResponse'/>
| <xs:complexType name='sendTicketRequestToPartner'>
| <xs:sequence>
| <xs:element minOccurs='0' name='remedyUserID' type='xs:string'/>
| <xs:element minOccurs='0' name='remedyPassword' type='xs:string'/>
| <xs:element name='remedyTransactionCode' type='xs:int'/>
| <xs:element minOccurs='0' name='remedyTPSID' type='xs:string'/>
| <xs:element minOccurs='0' name='remedyTicketNumber' type='xs:string'/>
| <xs:element minOccurs='0' name='partner' type='xs:string'/>
| <xs:element minOccurs='0' name='partnerTicketNumber' type='xs:string'/>
| <xs:element minOccurs='0' name='technicalNotes' type='xs:string'/>
| <xs:element minOccurs='0' name='closedCode' type='xs:string'/>
| <xs:element minOccurs='0' name='resolvedBy' type='xs:string'/>
| <xs:element minOccurs='0' name='solution' type='xs:string'/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name='sendTicketRequestToPartnerResponse'>
| <xs:sequence>
| <xs:element minOccurs='0' name='result' type='xs:string'/>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| </types>
| <message name='AbstractBean_sendTicketRequestToPartner'>
| <part element='tns:sendTicketRequestToPartner' name='sendTicketRequestToPartner'></part>
| </message>
| <message name='AbstractBean_sendTicketRequestToPartnerResponse'>
| <part element='tns:sendTicketRequestToPartnerResponse' name='sendTicketRequestToPartnerResponse'></part>
| </message>
| <portType name='AbstractBean'>
| <operation name='sendTicketRequestToPartner' parameterOrder='sendTicketRequestToPartner'>
| <input message='tns:AbstractBean_sendTicketRequestToPartner'></input>
| <output message='tns:AbstractBean_sendTicketRequestToPartnerResponse'></output>
| </operation>
| </portType>
| <binding name='AbstractBeanBinding' type='tns:AbstractBean'>
| <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='sendTicketRequestToPartner'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body use='literal'/>
| </input>
| <output>
| <soap:body use='literal'/>
| </output>
| </operation>
| </binding>
| <service name='AbstractBeanService'>
| <port binding='tns:AbstractBeanBinding' name='AbstractBeanPort'>
| <soap:address location='http://localhost:8080/remedyAbstractService/remedyAbstractService_1_0'/>
| </port>
| </service>
| </definitions>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093058#4093058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093058
17 years