Bug 780879 (SOA-3335) - Quickstart security_cert produces strange output on client
Summary: Quickstart security_cert produces strange output on client
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-3335
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: Examples
Version: 5.2.0.ER2,5.2.0.ER3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 5.2.0.ER4
Assignee: tcunning
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-31 10:35 UTC by mvanek
Modified: 2013-03-13 04:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-12 08:20:29 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBESB-3685 0 None None None Never
Red Hat Issue Tracker SOA-3335 0 None None None Never

Description mvanek 2011-08-31 10:35:39 UTC
Affects: Interactive Demo/Tutorial
project_key: SOA

Try security_cert quickstart.
It works according to the description, but on the client the output is somewhat strange:
----------------------------------------------------------------------------------------
saygoodbye_over_http:
     [echo] 
     [echo] Invoke JBR Gateway with successful login
     [java] Calling JBoss Remoting Listener using locator URI: http://localhost:8765
     [java] JBR Class: java.lang.String
     [java] Response from JBoss Remoting Listener 'http://localhost:8765' was '��ysr%org.jboss.remoting.InvocationResponsea�3tm�Z
                                                                                                                                 isExceptionLpayloadtLjava/util/Map;LresulttLjava/lang/Object;L sessionIdtLjava/lang/String;xpsrjava.util.HashMap���`�FloadFactorI     thresholdxp?@
                                                                     tResponseCodeMessagetOKt
                                                                                             ResponseCodesrjava.lang.Integer⠤���8Ivaluexrjava.lang.Number���
                                                                                                                                                            ���xp�t
                                                                                                                                                                   Content-Typettext/xml; charset=ISO-8859-1xt<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:sayGoodbyeResponse xmlns:ns2="http://security_cert/goodbyeworld"><return>... Ah Goodbye then!!!! - Goodbye!!</return></ns2:sayGoodbyeResponse></soap:Body></soap:Envelope>t"3j001-ofbv3n-gs063lgw-1-gs063lha-2'.
     [echo] 
     [echo] 
     [echo] Invoke JBR Gateway with unsuccessful login
     [java] Calling JBoss Remoting Listener using locator URI: http://localhost:8765
     [java] Call was not successful. See server.log for details. Exception was:
     [java] org.jboss.remoting.transport.http.WebServerError: ��ysr%org.jboss.remoting.InvocationResponsea�3tm�Z
                                                                                                                isExceptionLpayloadtLjava/util/Map;LresulttLjava/lang/Object;L  sessionIdtLjava/lang/String;xpsrjava.util.HashMap���`�FloadFactorI     thresholdxp?@
                                                     tResponseCodeMessaget▒Invalid Login Credentials.t
                                                                                                      ResponseCodesrjava.lang.Integer⠤���8Ivaluexrjava.lang.Number���
                                                                                                                                                                     ���xp�t
                                                                                                                                                                            Content-Typettext/plainxt�org.jboss.soa.esb.couriers.FaultMessageException: org.jboss.soa.esb.services.security.SecurityServiceException: Exception while trying to login: at org.jboss.soa.esb.listeners.message.errors.Factory.createExceptionFromFault(Factory.java:50)        at org.jboss.internal.soa.esb.couriers.helpers.JmsComposer.compose(JmsComposer.java:82) at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:461)   at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:228)    at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:204)     at org.jboss.soa.esb.client.ServiceInvoker$EPRInvoker.attemptDelivery(ServiceInvoker.java:675) at org.jboss.soa.esb.client.ServiceInvoker$EPRInvoker.access$200(ServiceInvoker.java:569)       at org.jboss.soa.esb.client.ServiceInvoker.post(ServiceInvoker.java:359)       at org.jboss.soa.esb.client.ServiceInvoker.deliverSync(ServiceInvoker.java:219) at org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter.deliverSyncWithoutDecomposing(UncomposedMessageDeliveryAdapter.java:107)       at org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter.deliverSync(UncomposedMessageDeliveryAdapter.java:86)   at org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.invoke(JBossRemotingGatewayListener.java:375)      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)      at org.jboss.remoting.transport.coyote.CoyoteInvoker.service(CoyoteInvoker.java:396)   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)      at java.lang.Thread.run(Thread.java:662)Caused by: org.jboss.soa.esb.services.security.SecurityServiceException: Exception while trying to login:      at org.jboss.internal.soa.esb.services.security.JaasSecurityService.authenticate(JaasSecurityService.java:102)  at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:549)     at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:433)      at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:550)     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)     ... 1 moreCaused by: javax.security.auth.login.LoginException: SignatureException : Signature does not match.   at org.jboss.soa.esb.services.security.auth.login.CertificateLoginModule.login(CertificateLoginModule.java:181)        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:597)     at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)        at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)     at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683) at java.security.AccessController.doPrivileged(Native Method)   at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)     at javax.security.auth.login.LoginContext.login(LoginContext.java:579) at org.jboss.internal.soa.esb.services.security.JaasSecurityService.authenticate(JaasSecurityService.java:94)   ... 6 moret"3j001-udaxx1-gs063mw0-1-gs063mw1-2
     [java]     at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:497)
     [java]     at org.jboss.remoting.transport.http.HTTPClientInvoker.makeInvocation(HTTPClientInvoker.java:253)
     [java]     at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:176)
     [java]     at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:169)
     [java]     at org.jboss.remoting.Client.invoke(Client.java:2070)
     [java]     at org.jboss.remoting.Client.invoke(Client.java:879)
     [java]     at org.jboss.remoting.Client.invoke(Client.java:867)
     [java]     at org.jboss.soa.esb.samples.quickstart.securitycert.test.SendMessage.sendMessageToJBRListener(SendMessage.java:75)
     [java]     at org.jboss.soa.esb.samples.quickstart.securitycert.test.SendMessage.main(SendMessage.java:115)

Comment 1 tcunning 2011-09-09 16:44:42 UTC
I'm not sure what is going on here.   JBossRemotingGateway returns a String to the ServerInvoker, which is wrapped in a InvocationResponse, but when that gets back to the client, the HTTPUnMarshaller treats it as a String because it looks at the Content-Type and it sees text/xml;charset=UTF-8.     The response we're getting back looks like a InvocationResponse object incorrectly unmarshalled.

I see the same thing with previous ESB releases and jboss-5.1.0.GA.

Comment 2 tcunning 2011-09-09 18:55:14 UTC
This seems like a remoting bug.    org.jboss.remoting.transport.web.WebUtil.isBinary does an equalsIgnoreCase on the contentType to see if it is "application/octet-stream".   If it is "application/octet-stream?charset=UTF-8" or something similar, it fails this test.    HttpClientInvoker grabs the contentType from java.net.HttpURLConnection.getHeaderFields() and overwrites any value we may have placed in there.    I'm not seeing a way around this without remoting making a fix.

Comment 3 tcunning 2011-09-09 18:57:30 UTC
One other datapoint, if the contentType does equal application/octet-stream, this quickstart works as expected.

Comment 4 tcunning 2011-09-09 19:04:14 UTC
Link: Added: This issue depends JBREM-1301


Comment 5 tcunning 2011-09-09 19:04:26 UTC
Logged JBREM-1301.

Comment 6 tcunning 2011-09-16 17:59:07 UTC
Link: Added: This issue relates to JBESB-3685


Comment 7 tcunning 2011-09-16 18:12:42 UTC
cunningts-imac:product cunningt$ svn commit
Sending        product/rosetta/src/org/jboss/internal/soa/esb/remoting/HttpMarshaller.java
Sending        product/rosetta/src/org/jboss/internal/soa/esb/remoting/JBossRemotingUtil.java
Sending        product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
Transmitting file data ...
Committed revision 37470.

Comment 8 tcunning 2011-09-16 18:12:59 UTC
Change should be in ER4.

Comment 9 David Le Sage 2011-09-18 23:26:17 UTC
Release Notes Docs Status: Added: Not Required
Writer: Added: dlesage


Comment 10 Marek Baluch 2011-10-12 08:20:29 UTC
Verified in ER4.


Note You need to log in before you can comment on or make changes to this bug.