Description:
|
From Jiri Sedlacek:
Created attachment 751056 [details]
reproducer app
example switchyard service is attached, can be started e.g. by http posting JSON object
{"id": 1, "name": "aaa","unitPrice": 1.2}
to http://localhost:8080/http-bean-service/
output with enabled message tracing is below, there is some problem with transformation.
------- Begin Message Trace -------
Service ->
{urn:ledegen:http-bean-service:1.0}
CountService
Operation ->
Phase -> IN
State -> OK
Exchange Context ->
Message Context ->
user-agent : curl/7.29.0
org.switchyard.messageId : e62a8af7-7d0c-4bf0-93e8-9ac26ae6e187
content-length : 41
http_request_info : HttpRequestInfo [authType=null, characterEncoding=null, contentType=application/x-www-form-urlencoded, contextPath=/http-bean-service, localAddr=127.0.0.1, localName=localhost, method=POST, pathInfo=/, protocol=HTTP/1.1, queryString=null, remoteAddr=127.0.0.1, remoteHost=127.0.0.1, remoteUser=null, contentLength=41, requestSessionId=null, requestURI=/http-bean-service, scheme=http, serverName=localhost, requestPath=, pathInfoTokens=[], queryParams={}, credentials=[ConfidentialityCredential [confidential=false]]]
org.switchyard.contentType : urn:sedlacek:input
accept : /
host : localhost:8080
content-type : application/x-www-form-urlencoded
Message Content ->
{"id": 1, "name": "aaa","unitPrice": 1.2}
------ End Message Trace -------
[0m[0m13:16:30,061 INFO [org.switchyard.handlers.MessageTrace] (http-localhost/127.0.0.1:8080-1)
------- Begin Message Trace -------
Service ->
{urn:ledegen:http-bean-service:1.0}
CountService
Operation ->
Phase -> OUT
State -> FAULT
Exchange Context ->
org.switchyard.exchange.transaction.beforeInvoked : true
org.switchyard.exchangeDurationMS : 2605
Message Context ->
org.switchyard.messageId : f778e491-fd3d-4cc1-b156-003e25e3bdb6
org.switchyard.relatesTo : e62a8af7-7d0c-4bf0-93e8-9ac26ae6e187
Message Content ->
org.switchyard.HandlerException: org.switchyard.exception.SwitchYardException: Cannot convert from 'org.jboss.soa.qa.shared.data.SimpleOrder' to 'org.jboss.soa.qa.shared.data.SimpleOrder'. No registered Transformer available for transforming from 'java:org.jboss.soa.qa.shared.data.SimpleOrder' to 'java:org.jboss.soa.qa.shared.data.SimpleOrder'. A Transformer must be registered.
— Caused by org.switchyard.exception.SwitchYardException: Cannot convert from 'org.jboss.soa.qa.shared.data.SimpleOrder' to 'org.jboss.soa.qa.shared.data.SimpleOrder'. No registered Transformer available for transforming from 'java:org.jboss.soa.qa.shared.data.SimpleOrder' to 'java:org.jboss.soa.qa.shared.data.SimpleOrder'. A Transformer must be registered.
------ End Message Trace -------
[0m[0m13:21:52,767 INFO [org.switchyard.handlers.MessageTrace] (http-localhost/127.0.0.1:8080-1)
------- Begin Message Trace -------
Service ->
{urn:ledegen:http-bean-service:1.0}
CountService
Operation ->
Phase -> IN
State -> OK
Exchange Context ->
Message Context ->
user-agent : curl/7.29.0
org.switchyard.messageId : 95185686-54ed-4f9d-a8b4-5d4bc6bc48be
content-length : 41
org.switchyard.contentType : urn:sedlacek:input
accept : /
host : localhost:8080
content-type : application/x-www-form-urlencoded
http_request_info : HttpRequestInfo [authType=null, characterEncoding=null, contentType=application/x-www-form-urlencoded, contextPath=/http-bean-service, localAddr=127.0.0.1, localName=localhost, method=POST, pathInfo=/, protocol=HTTP/1.1, queryString=null, remoteAddr=127.0.0.1, remoteHost=127.0.0.1, remoteUser=null, contentLength=41, requestSessionId=null, requestURI=/http-bean-service, scheme=http, serverName=localhost, requestPath=, pathInfoTokens=[], queryParams={}, credentials=[ConfidentialityCredential [confidential=false]]]
Message Content ->
{"id": 1, "name": "aaa","unitPrice": 1.2}
------ End Message Trace -------
[0m[0m13:22:24,181 INFO [org.switchyard.handlers.MessageTrace] (http-localhost/127.0.0.1:8080-1)
------- Begin Message Trace -------
Service ->
{urn:ledegen:http-bean-service:1.0}
CountService
Operation ->
Phase -> OUT
State -> FAULT
Exchange Context ->
org.switchyard.exchangeDurationMS : 31415
org.switchyard.exchange.transaction.beforeInvoked : true
Message Context ->
org.switchyard.messageId : 061fefac-5991-4ed7-bde5-0756f55761f6
org.switchyard.relatesTo : 95185686-54ed-4f9d-a8b4-5d4bc6bc48be
Message Content ->
org.switchyard.HandlerException: org.switchyard.exception.SwitchYardException: Cannot convert from 'org.jboss.soa.qa.shared.data.SimpleOrder' to 'org.jboss.soa.qa.shared.data.SimpleOrder'. No registered Transformer available for transforming from 'java:org.jboss.soa.qa.shared.data.SimpleOrder' to 'java:org.jboss.soa.qa.shared.data.SimpleOrder'. A Transformer must be registered.
— Caused by org.switchyard.exception.SwitchYardException: Cannot convert from 'org.jboss.soa.qa.shared.data.SimpleOrder' to 'org.jboss.soa.qa.shared.data.SimpleOrder'. No registered Transformer available for transforming from 'java:org.jboss.soa.qa.shared.data.SimpleOrder' to 'java:org.jboss.soa.qa.shared.data.SimpleOrder'. A Transformer must be registered.
------ End Message Trace -------
In the method org.switchyard.interbnal.DefaultMessage.getContent(..), lines 104-108, it tries to find transformer for same fromType and toType, which throws NPE.
I'm not sure whether transformations should be processed in this code at all, if message was transformed before it enters bean execution.
Reproducible apps are attached to the bugzilla.
|