You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by ender <gd...@hotmail.com> on 2007/03/20 15:13:46 UTC

Error calling JSR181 component

Hello,
I'm trying to host a webservice in ServiceMix using a http-consumer in
combination with the jsr181 component (see config files below). However,
when calling the service, I keep getting the following error:
----------------------------------------------------
ERROR - DefaultFaultHandler            - Fault occurred!
java.lang.IllegalStateException: The current event is not START_ELEMENT
 but 7
        at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:124)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:337)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:309)
        at org.codehaus.xfire.jaxb2.JaxbType.readObject(JaxbType.java:196)
        at
org.apache.servicemix.jsr181.xfire.ServiceFactoryHelper$FixedJAXWSOperationBinding.readMessage(ServiceFactoryHelper.java:404)
        at
org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.java:42)
        at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at
org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
        at
org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
        at
org.apache.servicemix.jsr181.Jsr181ExchangeProcessor.process(Jsr181ExchangeProcessor.java:113)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:489)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:441)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:595)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:174)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:619)
----------------------------------------------------

Config files:
----------------------------------------------------
<beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
		xmlns:ns="http://newmedia.geisha.ibbt.be" >
		
    <classpath>
        <location>.</location>
    </classpath>
  
    <jsr181:endpoint service="ns:EchoService"
    				 endpoint="EchoServiceSOAP11port_http"
    				 pojoClass="be.ibbt.geisha.newmedia.EchoServiceImpl"
                     wsdlResource="classpath:EchoService.wsdl"
                     style="document"  />
</beans>


<beans xmlns:http="http://servicemix.apache.org/http/1.0"
	   xmlns:ns="http://newmedia.geisha.ibbt.be">

  <http:endpoint service="ns:EchoMutateHttp"
                 endpoint="EchoMutate"
                 role="consumer"                
                 targetService="ns:EchoService"
                 targetEndpoint="EchoServiceSOAP11port_http"
                 locationURI="http://0.0.0.0:8192/echoMutate/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                 soap="true"
                 soapVersion="1.1" />
</beans>

generated POJO class:

@WebService(serviceName = "EchoService", targetNamespace =
"http://newmedia.geisha.ibbt.be", endpointInterface =
"be.ibbt.geisha.newmedia.EchoServicePortType")
public class EchoServiceImpl implements EchoServicePortType{
	public String echo(String param0) {
		System.err.println("POJO called");
		StringBuffer buff = new StringBuffer();
		for (int i = 0; i < param0.length(); i++) {
			char ch = (i % 2 == 0 ? Character.toLowerCase(param0.charAt(i))
					: Character.toUpperCase(param0.charAt(i)));
			buff.append(ch);
		}
		return buff.toString();
	}

	public void testMethod() {
		
	}

generated Interface:

@WebService(name = "EchoServicePortType", targetNamespace =
"http://newmedia.geisha.ibbt.be")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use =
SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface EchoServicePortType {


    @WebMethod(operationName = "echo", action = "urn:echo")
    @RequestWrapper(targetNamespace = "http://newmedia.geisha.ibbt.be/xsd",
localName = "echo", className = "be.ibbt.geisha.newmedia.xsd.Echo")
    @ResponseWrapper(targetNamespace = "http://newmedia.geisha.ibbt.be/xsd",
localName = "echoResponse", className =
"be.ibbt.geisha.newmedia.xsd.EchoResponse")
    @WebResult(name = "return", targetNamespace =
"http://newmedia.geisha.ibbt.be/xsd")
    public String echo(
        @WebParam(name = "param0", targetNamespace =
"http://newmedia.geisha.ibbt.be/xsd")
        String param0);

}

----------------------------------------------------

The POJO class file was generated from a WSDL file, by using Maven
generate-sources.
Note that the error disappeats when adding 'annotations="true"' to the
jsr181 config file, but the SOAP message returned to the client in this case
is not correctly formatted according to the WSDL.

Any ideas?

Thanks,
Stein Desmet


-- 
View this message in context: http://www.nabble.com/Error-calling--JSR181-component-tf3433923s12049.html#a9573220
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Error calling JSR181 component

Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,

Can you raise a JIRA and attach your failing SA to it (as well as some 
instructions on how to reproduce it)?  We'll try to look into it as soon 
as possible...

Regards,

Gert

Bummer wrote:
> The jsr181 ochestration sample gave the same error (.... current event is not
> START_ELEMENT ....)
> 
> In the CityTimeImpl.java class
> [...]
>   public GetCityTimeResponse getCityTime(GetCityTimeRequest
> GetCityTimeRequest) {
>             
>             GetInfoByCity GetInfoByCity = new GetInfoByCity();
>             GetInfoByCity.setUSCity(GetCityTimeRequest.getCity());
>             
>             GetInfoByCityResponse r = usZip.getInfoByCity(GetInfoByCity);
>             Element e = (Element)
> r.getGetInfoByCityResult().getContent().get(0);
>             e = (Element) e.getElementsByTagName("Table").item(0);
>             e = (Element) e.getElementsByTagName("ZIP").item(0);
>             String ZipCode = e.getTextContent();
>             
>             //String lt = localTime.localTimeByZipCode(ZipCode); // at this
> part it errored 
> 
>             GetCityTimeResponse rep = new GetCityTimeResponse();
>             rep.getString().add("23:23");
>             //rep.setTime(lt);  // wsgen didn't generate "setTime" function
>             return rep;
>         }
> [...]
> 
> 
> 
> 
> 
> ender wrote:
>> I tried it with the latest trunk from the SVN, as well as the latest 3.1
>> branch, and it gives the same error with each of them.
>>
>> Greetings
>> Stein Desmet
>>
>>
>>
>> gnodet wrote:
>>> Which exact version do you use ?
>>> I think some bugs that could be relatd have been fixed in 3.1 branch,
>>> so if you could compile and try with the latest 3.1 source code,
>>> this may fix the problem.
>>> Else, you should raise a JIRA and attach all the files needed to
>>> reproduce
>>> the problem. Thanks.
>>>
>>>
>>
> 

Re: Error calling JSR181 component

Posted by Bummer <sa...@gmail.com>.
The jsr181 ochestration sample gave the same error (.... current event is not
START_ELEMENT ....)

In the CityTimeImpl.java class
[...]
  public GetCityTimeResponse getCityTime(GetCityTimeRequest
GetCityTimeRequest) {
            
            GetInfoByCity GetInfoByCity = new GetInfoByCity();
            GetInfoByCity.setUSCity(GetCityTimeRequest.getCity());
            
            GetInfoByCityResponse r = usZip.getInfoByCity(GetInfoByCity);
            Element e = (Element)
r.getGetInfoByCityResult().getContent().get(0);
            e = (Element) e.getElementsByTagName("Table").item(0);
            e = (Element) e.getElementsByTagName("ZIP").item(0);
            String ZipCode = e.getTextContent();
            
            //String lt = localTime.localTimeByZipCode(ZipCode); // at this
part it errored 

            GetCityTimeResponse rep = new GetCityTimeResponse();
            rep.getString().add("23:23");
            //rep.setTime(lt);  // wsgen didn't generate "setTime" function
            return rep;
        }
[...]





ender wrote:
> 
> I tried it with the latest trunk from the SVN, as well as the latest 3.1
> branch, and it gives the same error with each of them.
> 
> Greetings
> Stein Desmet
> 
> 
> 
> gnodet wrote:
>> 
>> Which exact version do you use ?
>> I think some bugs that could be relatd have been fixed in 3.1 branch,
>> so if you could compile and try with the latest 3.1 source code,
>> this may fix the problem.
>> Else, you should raise a JIRA and attach all the files needed to
>> reproduce
>> the problem. Thanks.
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Error-calling--JSR181-component-tf3433923s12049.html#a10869039
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Error calling JSR181 component

Posted by ender <gd...@hotmail.com>.
I tried it with the latest trunk from the SVN, as well as the latest 3.1
branch, and it gives the same error with each of them.

Greetings
Stein Desmet



gnodet wrote:
> 
> Which exact version do you use ?
> I think some bugs that could be relatd have been fixed in 3.1 branch,
> so if you could compile and try with the latest 3.1 source code,
> this may fix the problem.
> Else, you should raise a JIRA and attach all the files needed to reproduce
> the problem. Thanks.
> 
> 

-- 
View this message in context: http://www.nabble.com/Error-calling--JSR181-component-tf3433923s12049.html#a9593356
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Error calling JSR181 component

Posted by Guillaume Nodet <gn...@gmail.com>.
Which exact version do you use ?
I think some bugs that could be relatd have been fixed in 3.1 branch,
so if you could compile and try with the latest 3.1 source code,
this may fix the problem.
Else, you should raise a JIRA and attach all the files needed to reproduce
the problem. Thanks.

On 3/20/07, ender <gd...@hotmail.com> wrote:
>
>
> Hello,
> I'm trying to host a webservice in ServiceMix using a http-consumer in
> combination with the jsr181 component (see config files below). However,
> when calling the service, I keep getting the following error:
> ----------------------------------------------------
> ERROR - DefaultFaultHandler            - Fault occurred!
> java.lang.IllegalStateException: The current event is not START_ELEMENT
> but 7
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(
> StAXStreamConnector.java:124)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(
> UnmarshallerImpl.java:337)
>         at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(
> UnmarshallerImpl.java:309)
>         at org.codehaus.xfire.jaxb2.JaxbType.readObject(JaxbType.java:196)
>         at
>
> org.apache.servicemix.jsr181.xfire.ServiceFactoryHelper$FixedJAXWSOperationBinding.readMessage
> (ServiceFactoryHelper.java:404)
>         at
> org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(
> SoapBodyHandler.java:42)
>         at
> org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java
> :131)
>         at
> org.codehaus.xfire.transport.DefaultEndpoint.onReceive(
> DefaultEndpoint.java:64)
>         at
> org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java
> :38)
>         at
> org.apache.servicemix.jsr181.Jsr181ExchangeProcessor.process(
> Jsr181ExchangeProcessor.java:113)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(
> AsyncBaseLifeCycle.java:489)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(
> AsyncBaseLifeCycle.java:441)
>         at
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(
> BaseLifeCycle.java:46)
>         at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> DeliveryChannelImpl.java:595)
>         at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(
> AbstractFlow.java:174)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java
> :176)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java
> :134)
>         at
>
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask
> (ThreadPoolExecutor.java:665)
>         at
>
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run
> (ThreadPoolExecutor.java:690)
>         at java.lang.Thread.run(Thread.java:619)
> ----------------------------------------------------
>
> Config files:
> ----------------------------------------------------
> <beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
>                 xmlns:ns="http://newmedia.geisha.ibbt.be" >
>
>     <classpath>
>         <location>.</location>
>     </classpath>
>
>     <jsr181:endpoint service="ns:EchoService"
>                                  endpoint="EchoServiceSOAP11port_http"
>                                  pojoClass="
> be.ibbt.geisha.newmedia.EchoServiceImpl"
>                      wsdlResource="classpath:EchoService.wsdl"
>                      style="document"  />
> </beans>
>
>
> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>            xmlns:ns="http://newmedia.geisha.ibbt.be">
>
>   <http:endpoint service="ns:EchoMutateHttp"
>                  endpoint="EchoMutate"
>                  role="consumer"
>                  targetService="ns:EchoService"
>                  targetEndpoint="EchoServiceSOAP11port_http"
>                  locationURI="http://0.0.0.0:8192/echoMutate/"
>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>                  soap="true"
>                  soapVersion="1.1" />
> </beans>
>
> generated POJO class:
>
> @WebService(serviceName = "EchoService", targetNamespace =
> "http://newmedia.geisha.ibbt.be", endpointInterface =
> "be.ibbt.geisha.newmedia.EchoServicePortType")
> public class EchoServiceImpl implements EchoServicePortType{
>         public String echo(String param0) {
>                 System.err.println("POJO called");
>                 StringBuffer buff = new StringBuffer();
>                 for (int i = 0; i < param0.length(); i++) {
>                         char ch = (i % 2 == 0 ? Character.toLowerCase(
> param0.charAt(i))
>                                         : Character.toUpperCase(
> param0.charAt(i)));
>                         buff.append(ch);
>                 }
>                 return buff.toString();
>         }
>
>         public void testMethod() {
>
>         }
>
> generated Interface:
>
> @WebService(name = "EchoServicePortType", targetNamespace =
> "http://newmedia.geisha.ibbt.be")
> @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use =
> SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface EchoServicePortType {
>
>
>     @WebMethod(operationName = "echo", action = "urn:echo")
>     @RequestWrapper(targetNamespace = "http://newmedia.geisha.ibbt.be/xsd
> ",
> localName = "echo", className = "be.ibbt.geisha.newmedia.xsd.Echo")
>     @ResponseWrapper(targetNamespace = "http://newmedia.geisha.ibbt.be/xsd
> ",
> localName = "echoResponse", className =
> "be.ibbt.geisha.newmedia.xsd.EchoResponse")
>     @WebResult(name = "return", targetNamespace =
> "http://newmedia.geisha.ibbt.be/xsd")
>     public String echo(
>         @WebParam(name = "param0", targetNamespace =
> "http://newmedia.geisha.ibbt.be/xsd")
>         String param0);
>
> }
>
> ----------------------------------------------------
>
> The POJO class file was generated from a WSDL file, by using Maven
> generate-sources.
> Note that the error disappeats when adding 'annotations="true"' to the
> jsr181 config file, but the SOAP message returned to the client in this
> case
> is not correctly formatted according to the WSDL.
>
> Any ideas?
>
> Thanks,
> Stein Desmet
>
>
> --
> View this message in context:
> http://www.nabble.com/Error-calling--JSR181-component-tf3433923s12049.html#a9573220
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/