----
curl -X POST -d @in.xml http://SDGL04R8gtby1t:8080/dpApi
mule throws:
ERROR [[app-client-api].connector.http.mule.default.receiver.2]:
********************************************************************************
Message : Failed to invoke JerseyResourcesComponent{dpApi.commpone
nt.8569405}. Component that caused exception is: JerseyResourcesComponent{dpApi.
commponent.8569405}. Message payload is of type: ContentLengthInputStream
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. String index out of range: -1 (java.lang.StringIndexOutOfBoundsException)
java.lang.String:-1 (null)
2. Failed to invoke JerseyResourcesComponent{dpApi.commponent.8569405}. Componen
t that caused exception is: JerseyResourcesComponent{dpApi.commponent.8569405}.
Message payload is of type: ContentLengthInputStream (org.mule.component.Compone
ntException)
org.mule.component.AbstractComponent:142 (http://www.mulesoft.org/docs/site/cu
rrent3/apidocs/org/mule/component/ComponentException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at java.lang.String.substring(Unknown Source)
at com.sun.jersey.spi.container.ContainerRequest.getEncodedPath(Containe
rRequest.java:365)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for ev
erything)
********************************************************************************
----
<flow name="dpApi">
<inbound-endpoint address="http://localhost:8080/dpApi" />
<jersey:resources>
<component class="com.intuit.cg.services.dp.pipeline.api.ApiResourceImpl" />
</jersey:resources>
<component class="com.intuit.cg.services.dp.pipeline.api.JerseyAdapter"
doc:name="Jersey Adapter" doc:description="Adapt Jersey Request to a
Mule Message "/>
<component
class="com.intuit.cg.services.dp.pipeline.api.XmlToApiMessage"
doc:name="Unmarshal XML" doc:description="Unmarshal the XML String to
a com.intuit.cg.services.dp.api.generated.Message implicitly via
JAXB"/>
<component
class="com.intuit.cg.services.dp.pipeline.api.RequestHandler"
doc:name="API Request Handler" doc:description=""/>
<async>
<jms:outbound-endpoint queue="log.queue"
exchange-pattern="one-way">
</jms:outbound-endpoint>
</async>
</flow>
<flow name="LogManager">
<jms:inbound-endpoint queue="log.queue">
</jms:inbound-endpoint>
<component class="com.intuit.cg.services.dp.pipeline.api.LogManager" />
</flow>
config is
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Thanks. I think I figured it out I was missing "/" at the end. Thanks.
But now I am getting, NullPayload even though I have data in.xml when using curl
Message : The transformer "JAXBUnmarshallerTransformer" does not s
upport source type "org.mule.transport.NullPayload". Endpoint is "null"
Code : MULE_ERROR-65054
--------------------------------------------------------------------------------
Exception stack is:
1. The transformer "JAXBUnmarshallerTransformer" does not support source type "o
rg.mule.transport.NullPayload". Endpoint is "null" (org.mule.api.transformer.Tra
nsformerException)
org.mule.transformer.AbstractTransformer:412 (http://www.mulesoft.org/docs/sit
e/current3/apidocs/org/mule/api/transformer/TransformerException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.transformer.TransformerException: The transformer "JAXBUnmarshaller
Transformer" does not support source type "org.mule.transport.NullPayload". Endp
oint is "null"
at org.mule.transformer.AbstractTransformer.transform(AbstractTransforme
r.java:412)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:359)
at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:311)
!) @POST
@Path("/api")
@Consumes({ MediaType.APPLICATION_XML, "application/xml" })
@Produces({ MediaType.APPLICATION_XML, "application/xml" })
String processApiRequest(String m);
2) Component adds some more info as noted on the mule site:
public Object onCall(MuleEventContext muleEventContext) throws Exception {
String payload;
MuleMessage message = muleEventContext.getMessage();
ContainerResponse cr = (ContainerResponse)
message.getInvocationProperty("jersey_response");
String restMethod = cr.getContainerRequest().getMethod();
message.setOutboundProperty("restMethod", restMethod);
payload = (String) cr.getResponse().getEntity();
return payload;
}
3) Is supposed to do the JAXB parsing
public CreateResponse handle(CreateRequest req) {
CreateResponse resp = dh.handle(req);
return resp;
INFO [[app-client-api].connector.http.mule.default.receiver.2]: No common Objec
t of type 'class javax.xml.bind.JAXBContext' configured, creating a local one fo
r: SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}, SimpleDa
taType{type=com.i.cg.services.dp.api.generated.Message, mimeType='*/*'}
No common Object of type 'class javax.xml.bind.JAXBContext' configured, creating
a local one for: SimpleDataType{type=org.mule.transport.NullPayload, mimeType='
*/*'}, SimpleDataType{type=com.intuit.cg.services.dp.api.generated.Message, mime
Type='*/*'}
ERROR [[app-client-api].connector.http.mule.default.receiver.2]:
********************************************************************************
I think I am missing some header. I'll look more
Those components are hooks for some xml manipulation as on the wire
content. But that shouldn't cause this issue since it's mostly passing
through the Message for now.
Are we missing something here or something wrong that's causing this
issue? From the below error it looks like it's some mimetype issue. I
can try and print message and see what I get.
INFO [[app-client-api].connector.http.mule.default.receiver.2]: No common Objec
t of type 'class javax.xml.bind.JAXBContext' configured, creating a local one fo
r: SimpleDataType{type=org.mule.transport.NullPayload, mimeType='*/*'}, SimpleDa
taType{type=com.i.cg.services.dp.api.generated.Message, mimeType='*/*'}
No common Object of type 'class javax.xml.bind.JAXBContext' configured, creating
a local one for: SimpleDataType{type=org.mule.transport.NullPayload, mimeType='
*/*'}, SimpleDataType{type=com.intuit.cg.services.dp.api.generated.Message, mime
Type='*/*'}
>
this is the link that says we need to modify jersey to add
"jersey_response" before forwarding the request.
http://www.mulesoft.org/documentation/display/MULE3USER/Jersey+Module+Reference