You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by geecxf <am...@ge.com> on 2013/03/14 17:18:35 UTC
Code only STSClient
I've spent a day trying to figure out how to build a code only STSClient. I
would like to do the analogue of the following in code only:
<cxf:bus>
<cxf:features>
<cxf:logging />
</cxf:features>
</cxf:bus>
<jaxws:client
name="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"
createdFromAPI="false" username="alice" password="clarinet" />
<http:conduit name="https://localhost:.*">
<http:tlsClientParameters
disableCNCheck="true">
<sec:trustManagers>
<sec:keyStore type="jks" password="cspass"
resource="certs/clientKeystore.jks" />
</sec:trustManagers>
</http:tlsClientParameters>
</http:conduit>
SpringBusFactory bf = new SpringBusFactory();
SpringBus bus = (SpringBus) bf.createBus("clientSts.xml");
SpringBusFactory.setDefaultBus(bus);
SpringBusFactory.setThreadDefaultBus(bus);
.....
STSClient stsClient = new STSClient(bus);
Why in code only? Because I can't figure out how to make the example as is
work in an OSGI bundle. Clearly I lack the low level understanding of these
framework that is required to get this work. I've been reading through the
documentation to figure this out. There are examples of how to create
standard REST clients and SOAP clients from code only and those I have
applied with success; however, none of those examples seem to fit with this
particular use case.
Finally, it would be nice to know what the patter is for building and using
clients in OSGI using Spring. I've grepped through the sample code looking
for a simple example of this but the only osgi sample is hosting a service
not making calls from a bundle.
I'm probably missing something or maybe I have not done enough research but
I've spent a day trying to figure this out and there's just too much to
learn. I would really appreciate some clues that would at least point me in
the right direction. Thanks in advance.
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Code only STSClient
Posted by geecxf <am...@ge.com>.
Thanks for samples, I will take a look at them. FWIW I have no problem
hosting web services in Karaf using CXF. I have created several web services
both SOAP and REST versions using Spring. Where I am stuck is creating and
using CXF clients in an OSGI bundle.
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724584.html
Sent from the cxf-user mailing list archive at Nabble.com.
RE: Code only STSClient
Posted by geecxf <am...@ge.com>.
Just to clarify, I DO want to use the CXF STSClient. I have no intention of
re-inventing the wheel. Actually, I am mostly following the code in the CXF
system tests for my own functional tests. The problem is that most of those
tests initialize the CXF like this:
SpringBus bus = (SpringBus) bf.createBus("clientSts.xml");
Unfortunately, that pattern does not work for me when creating OSGI bundles
that make client calls. So really all I am doing is trying to adapt the CXF
STSClient system tests to run in an OSGI container.
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724797.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Code only STSClient
Posted by geecxf <am...@ge.com>.
Hi Glen,
I agree with you that debugging may be the only option left at this point. I
also agree that it would be a great learning opportunity to debug Karaf. In
fact, I think it's a great idea and I am an advocate of that approach. The
last time I ran into a similar unexplained problem I had to debug CXF and
that led to eventually finding a bug in CXF
(http://cxf.547215.n5.nabble.com/Bug-in-2-7-2-td5722635.html). That took two
very long days.
As always though, there is an obstacle to this path that is not purely
technical. The obstacle in this case is that my manager would probably not
approve of me taking a two day hiatus from my other work just to pursue
this when a viable work around exits. Still, I'll probably end up debugging
this during whatever spare time I can find. In the meanwhile if you or
anyone thinks else has any helpful clues or working theories on why I am
observing this behavior please let me know.
Thanks for all the help,
D
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724934.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Code only STSClient
Posted by geecxf <am...@ge.com>.
I believe I have found the problem. Glen's suggestion of using a debugger to
figure out the problem turned out to be a very good one. I put breakpoints
in the following places:
HTTPConduit constructor
SpringBus constructor
SpringBus setApplicationContext() method
Start of my client code
End of my client code
Those breakpoints were enough to reveal the problem. The problem is that the
CXF bus bean I want my client to use gets created AFTER Spring creates the
class with the client code that I want to use that bus. Injecting the bus as
a property works because it creates a dependency which forces Spring to
create the bean BEFORE creating the class with the client code.
Thus the problem seems to be one of ordering the Spring instantiation of the
CXF bean and whatever code would use that bean. Lesson learned.
One straightforward solution to this problem is to add a "depends-on"
attribute to any potential bean that might use the cxf bus bean. That
guarantees the bean is available before you try to use it.
Thanks,
D
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724943.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Code only STSClient
Posted by Glen Mazza <gm...@talend.com>.
I haven't debugged OSGi within Eclipse yet (hmm, new blog entry
opportunity... :), but I have with Tomcat and it's easier than one
might assume:
http://www.jroller.com/gmazza/entry/eclipse_debug_web_services. You
might wish to debug your OSGi container within Eclipse (perhaps a bit
more of a headache to learn but certainly a useful skill that will help
in future troubleshooting) so you can find out "why cxf is not using the
trust store that I set up in the <http:conduit> configuration" and
figure out which side of the "or" in "either ignores the <http:conduit>
configuration or it ignores the specified trust store" is the case,
helping point you to a resolution.
Glen
On 03/20/2013 03:41 PM, geecxf wrote:
> Just to re-iterate. The nature of the error is clear to me (not my first
> rodeo with SSL/TLS :) What's not clear is why cxf is not using the trust
> store that I set up in the <http:conduit> configuration. It works just fine
> when I inject the bus as a string property but not when using
> getDefaultBus() or getThreadDefaultBus(). It seems like when I use
> getDefaultBus() or getThreadDefaultBus it either ignores the <http:conduit>
> configuration or it ignores the specified trust store.
>
> I'll have a look at the links you suggested to see if there is any
> information that could help.
>
> Thanks,
>
> D
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724901.html
> Sent from the cxf-user mailing list archive at Nabble.com.
RE: Code only STSClient
Posted by geecxf <am...@ge.com>.
Just to re-iterate. The nature of the error is clear to me (not my first
rodeo with SSL/TLS :) What's not clear is why cxf is not using the trust
store that I set up in the <http:conduit> configuration. It works just fine
when I inject the bus as a string property but not when using
getDefaultBus() or getThreadDefaultBus(). It seems like when I use
getDefaultBus() or getThreadDefaultBus it either ignores the <http:conduit>
configuration or it ignores the specified trust store.
I'll have a look at the links you suggested to see if there is any
information that could help.
Thanks,
D
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724901.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Code only STSClient
Posted by geecxf <am...@ge.com>.
Yes, of course but the configured <http:conduit> is setup with the right
trust store. The question is: why is it not picking up the trust store
configuration in the <http:conduit>?
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724900.html
Sent from the cxf-user mailing list archive at Nabble.com.
RE: Code only STSClient
Posted by geecxf <am...@ge.com>.
I have more information to add to this bizarre problem. The sheer act of
injecting "cxf" as a SpringBus property causes
SpringBusFactory.getThreadDefaultBus() to return a bus that works.
Let me clarify: I am injecting the bean with name="cxf" (see bean definition
below). The field that the setter sets is of type SpringBus. However, I am
not using this field anywhere in my code at all. In know I'm not using it
because Eclipse has highlighted it in squiggly lines complaining that it is
an unused field.
However, when I inject the property, SpringBusFactory.getThreadDefaultBus()
returns a bus that does not give any SSL errors. When I don't inject the
property SpringBusFactory.getThreadDefaultBus() returns a bus that does
result in SSL errors. Perhaps this is a garbage collection issue or a
threading issue? To add to the mystery SpringBusFactory.getDefaultBus() does
not work at all regardless of whether I inject the property or not.
This is the bean I am injecting:
<cxf:bus name="cxf">
<cxf:features>
<cxf:logging />
</cxf:features>
</cxf:bus>
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724902.html
Sent from the cxf-user mailing list archive at Nabble.com.
RE: Code only STSClient
Posted by Andrei Shakirin <as...@talend.com>.
I guess the solution was described in other thread today:
http://cxf.547215.n5.nabble.com/SSL-WS-Client-Configuration-does-not-work-tt5724702.html
Regards,
Andrei.
> -----Original Message-----
> From: Glen Mazza [mailto:gmazza@talend.com]
> Sent: Mittwoch, 20. März 2013 16:09
> To: users@cxf.apache.org
> Subject: Re: Code only STSClient
>
> Doesn't that error message just mean the server's public cert isn't in the
> client's truststore
> (http://www.jroller.com/gmazza/entry/ssl_for_web_services#SSL8)?
>
> Glen
>
> On 03/20/2013 11:00 AM, Andrei Shakirin wrote:
> > Hi,
> >
> > Your problem is caused by SSL handshake by getting WSDL from
> 'https://localhost:9093/SecurityTokenService/Transport?wsdl':
> >
> > javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
> Problem parsing
> 'https://localhost:9093/SecurityTokenService/Transport?wsdl'.:
> > javax.net.ssl.SSLHandshakeException:
> > sun.security.validator.ValidatorException: PKIX path building failed:
> > sun.security.provider.certpath.SunCertPathBuilderException: unable to
> > find valid certification path to requested target at
> > com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at
> > com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
> >
> > It means that Sun security provider doesn't accept certificate from server.
> >
> > I have not the solution at the moment, will look into in the next days.
> > You can try proposals from following links:
> > http://caffiendfrog.blogspot.de/2011/06/setting-up-apache-cxf-with-ssl
> > -for.html
> > http://stackoverflow.com/questions/8000918/apache-cxf-soap-client-usin
> > g-generated-stubs-in-https
> > http://stackoverflow.com/questions/12178273/how-do-i-setup-a-cxf-
> soap-
> > client-connection-over-https-with-username-password-n
> >
> > Regards,
> > Andrei.
> >
> >> -----Original Message-----
> >> From: geecxf [mailto:amiri@ge.com]
> >> Sent: Dienstag, 19. März 2013 19:57
> >> To: users@cxf.apache.org
> >> Subject: RE: Code only STSClient
> >>
> >> Andrei,
> >>
> >> Unfortunately, getDefaultBus() and getDefaultSpringBus() are not
> >> returning a bus that works. On the other hand, injecting the bus into
> >> a class property does work. Here is my spring configuration:
> >>
> >> <cxf:bus name="cxf">
> >> <cxf:features>
> >> <cxf:logging />
> >> </cxf:features>
> >> </cxf:bus>
> >>
> >> <jaxws:client
> >>
> >> name="{http://docs.oasis-open.org/ws-sx/ws-
> >> trust/200512/}SecurityTokenService"
> >> createdFromAPI="true" username="demo" password="demo" />
> >>
> >> <http:conduit name="https://localhost:.*" >
> >> <http:tlsClientParameters
> >> disableCNCheck="true">
> >> <sec:trustManagers>
> >> <sec:keyStore type="jks" password="cspass"
> >> resource="certs/clientKeystore.jks" />
> >> </sec:trustManagers>
> >> </http:tlsClientParameters>
> >> </http:conduit>
> >>
> >> The error I get with the bus returned from getDefaultBus() and
> >> getThreadDefaultBus():
> >>
> >> "org.apache.cxf.service.factory.ServiceConstructionException: Failed
> >> to create service. at
> >>
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
> >> 94)
> >> at
> >> org.apache.cxf.ws.security.trust.STSClient.createClient(STSClient.jav
> >> a:550)
> >> at
> >> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> >> ient.j
> >> ava:641)
> >> at
> >> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> >> ient.j
> >> ava:635)
> >> at
> >> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> >> ient.j
> >> ava:627)
> >> at
> >>
> com.ge.dsp.example.webservice.test.SamlRestTest.requestSecurityToken(
> >> S
> >> amlRestTest.java:400)
> >> at
> >>
> com.ge.dsp.example.webservice.test.SamlRestTest.testGetSamlBearerToke
> >> nFromSts(SamlRestTest.java:291)
> >> at com.ge.dsp.testng.runner.TestNgRunner.test(TestNgRunner.java:153)
> >> at
> >> com.ge.dsp.testng.runner.TestNgRunner.init(TestNgRunner.java:130) at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >> actory$8.run(AbstractAutowireCapableBeanFactory.java:1568)
> >> at java.security.AccessController.doPrivileged(Native Method) at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >>
> actory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java
> >> :1566)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >>
> actory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522
> >> )
> >> at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >> actory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >> actory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >> actory.createBean(AbstractAutowireCapableBeanFactory.java:456)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
> >> je
> >> ct(AbstractBeanFactory.java:294)
> >> at
> >> org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
> >> y.g
> >> etSingleton(DefaultSingletonBeanRegistry.java:225)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
> >> a
> >> n(AbstractBeanFactory.java:291)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> >> (A
> >> bstractBeanFactory.java:193)
> >> at
> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
> >> preI
> >> nstantiateSingletons(DefaultListableBeanFactory.java:609)
> >> at
> >> org.springframework.context.support.AbstractApplicationContext.finish
> >> Bea
> >> nFactoryInitialization(AbstractApplicationContext.java:918)
> >> at
> >>
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
> >> pli
> >>
> cationContext.access$1600(AbstractDelegatedExecutionApplicationContex
> >> t.j
> >> ava:69)
> >> at
> >>
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
> >> pli
> >> cationContext$4.run(AbstractDelegatedExecutionApplicationContext.java
> >> :35
> >> 5)
> >> at
> >> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus
> >> tomTC
> >> CL(PrivilegedUtils.java:85)
> >> at
> >>
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
> >> pli
> >>
> cationContext.completeRefresh(AbstractDelegatedExecutionApplicationCo
> >> n
> >> text.java:320)
> >> at
> >>
> org.springframework.osgi.extender.internal.dependencies.startup.Depen
> >> de
> >>
> ncyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> >> cyWaiterApplicationContextExecutor.java:132)
> >> at java.lang.Thread.run(Thread.java:680) Caused by:
> >> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
> >> Problem parsing
> >> 'https://localhost:9093/SecurityTokenService/Transport?wsdl'.:
> >> javax.net.ssl.SSLHandshakeException:
> >> sun.security.validator.ValidatorException: PKIX path building failed:
> >> sun.security.provider.certpath.SunCertPathBuilderException: unable to
> >> find valid certification path to requested target at
> >> com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at
> >> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
> >> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
> >>
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl
> >> .java:249)
> >> at
> >>
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.
> >> java:192)
> >> at
> >>
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
> >> 92)
> >> ... 52 more Caused by: javax.net.ssl.SSLHandshakeException:
> >> sun.security.validator.ValidatorException: PKIX path building failed:
> >> sun.security.provider.certpath.SunCertPathBuilderException: unable to
> >> find valid certification path to requested target at
> >> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
> >> at
> >> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1
> >> 747) at
> >> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:241)
> >> at
> >> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235)
> >> at
> >> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Clien
> >> tHandsh
> >> aker.java:1209)
> >> at
> >> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHa
> >> ndsh
> >> aker.java:135)
> >> at
> >> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:5
> >> 93)
> >> at
> >> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.jav
> >> a:52
> >> 9)
> >> at
> >> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.j
> >> ava:9
> >> 43)
> >> at
> >> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SS
> >> LSock
> >> etImpl.java:1188)
> >> at
> >> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketIm
> >> pl.ja
> >> va:1215)
> >> at
> >> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketIm
> >> pl.ja
> >> va:1199)
> >> at
> >> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:
> >> 434)
> >> at
> >>
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
> >> (
> >> AbstractDelegateHttpsURLConnection.java:166)
> >> at
> >>
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCo
> >> nnection.java:1172)
> >> at
> >>
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Http
> >> sURLConnectionImpl.java:234)
> >> at
> >>
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrent
> >> E
> >> ntity(XMLEntityManager.java:675)
> >> at
> >>
> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineD
> >> o
> >> cVersion(XMLVersionDetector.java:186)
> >> at
> >> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
> >> ML
> >> 11Configuration.java:772)
> >> at
> >> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
> >> ML
> >> 11Configuration.java:737)
> >> at
> >> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
> >> jav
> >> a:119)
> >> at
> >>
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.
> >> j
> >> ava:232)
> >> at
> >>
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Doc
> >> u
> >> mentBuilderImpl.java:284)
> >> ... 58 more Caused by: sun.security.validator.ValidatorException:
> >> PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException:
> >> unable to find valid certification path to requested target at
> >> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:323)
> >> at
> >> sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.jav
> >> a:217) at
> >> sun.security.validator.Validator.validate(Validator.java:218) at
> >> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustM
> >> ana
> >> gerImpl.java:126)
> >> at
> >> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
> >> X50
> >> 9TrustManagerImpl.java:209)
> >> at
> >> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
> >> X50
> >> 9TrustManagerImpl.java:249)
> >> at
> >> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Clien
> >> tHandsh
> >> aker.java:1188)
> >> ... 76 more Caused by:
> >> sun.security.provider.certpath.SunCertPathBuilderException: unable to
> >> find valid certification path to requested target at
> >> sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCert
> >> Path
> >> Builder.java:174)
> >> at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238)
> >> at
> >> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:318)
> >> ... 82 more ... Removed 25 stack frames
> >> org.apache.cxf.service.factory.ServiceConstructionException: Failed
> >> to create service. at
> >>
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
> >> 94)
> >> at
> >> org.apache.cxf.ws.security.trust.STSClient.createClient(STSClient.jav
> >> a:550)
> >> at
> >> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> >> ient.j
> >> ava:641)
> >> at
> >> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> >> ient.j
> >> ava:635)
> >> at
> >> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> >> ient.j
> >> ava:627)
> >> at
> >>
> com.ge.dsp.example.webservice.test.SamlRestTest.requestSecurityToken(
> >> S
> >> amlRestTest.java:400)
> >> at
> >>
> com.ge.dsp.example.webservice.test.SamlRestTest.testGetSamlBearerToke
> >> nFromSts(SamlRestTest.java:291)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> >>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> >> j
> >> ava:39)
> >> at
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> >> sorImpl.java:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597) at
> >>
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocat
> >> ionHelper.java:80)
> >> at org.testng.internal.Invoker.invokeMethod(Invoker.java:714) at
> >> org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) at
> >> org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) at
> >>
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWo
> >> rker.java:127)
> >> at
> >> org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
> >> at
> >> org.testng.TestRunner.privateRun(TestRunner.java:767) at
> >> org.testng.TestRunner.run(TestRunner.java:617) at
> >> org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at
> >> org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at
> >> org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at
> >> org.testng.SuiteRunner.run(SuiteRunner.java:240) at
> >> org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at
> >> org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at
> >> org.testng.TestNG.runSuitesSequentially(TestNG.java:1198) at
> >> org.testng.TestNG.runSuitesLocally(TestNG.java:1123) at
> >> org.testng.TestNG.run(TestNG.java:1031) at
> >> com.ge.dsp.testng.runner.TestNgRunner.test(TestNgRunner.java:153) at
> >> com.ge.dsp.testng.runner.TestNgRunner.init(TestNgRunner.java:130) at
> >> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> >>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> >> j
> >> ava:39)
> >> at
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> >> sorImpl.java:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597) at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >> actory$8.run(AbstractAutowireCapableBeanFactory.java:1568)
> >> at java.security.AccessController.doPrivileged(Native Method) at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >>
> actory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java
> >> :1566)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >>
> actory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522
> >> )
> >> at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >> actory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >> actory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractAutowireCapableBean
> >> F
> >> actory.createBean(AbstractAutowireCapableBeanFactory.java:456)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
> >> je
> >> ct(AbstractBeanFactory.java:294)
> >> at
> >> org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
> >> y.g
> >> etSingleton(DefaultSingletonBeanRegistry.java:225)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
> >> a
> >> n(AbstractBeanFactory.java:291)
> >> at
> >>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> >> (A
> >> bstractBeanFactory.java:193)
> >> at
> >> org.springframework.beans.factory.support.DefaultListableBeanFactory.
> >> preI
> >> nstantiateSingletons(DefaultListableBeanFactory.java:609)
> >> at
> >> org.springframework.context.support.AbstractApplicationContext.finish
> >> Bea
> >> nFactoryInitialization(AbstractApplicationContext.java:918)
> >> at
> >>
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
> >> pli
> >>
> cationContext.access$1600(AbstractDelegatedExecutionApplicationContex
> >> t.j
> >> ava:69)
> >> at
> >>
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
> >> pli
> >> cationContext$4.run(AbstractDelegatedExecutionApplicationContext.java
> >> :35
> >> 5)
> >> at
> >> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus
> >> tomTC
> >> CL(PrivilegedUtils.java:85)
> >> at
> >>
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
> >> pli
> >>
> cationContext.completeRefresh(AbstractDelegatedExecutionApplicationCo
> >> n
> >> text.java:320)
> >> at
> >>
> org.springframework.osgi.extender.internal.dependencies.startup.Depen
> >> de
> >>
> ncyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> >> cyWaiterApplicationContextExecutor.java:132)
> >> at java.lang.Thread.run(Thread.java:680) Caused by:
> >> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
> >> Problem parsing
> >> 'https://localhost:9093/SecurityTokenService/Transport?wsdl'.:
> >> javax.net.ssl.SSLHandshakeException:
> >> sun.security.validator.ValidatorException: PKIX path building failed:
> >> sun.security.provider.certpath.SunCertPathBuilderException: unable to
> >> find valid certification path to requested target at
> >> com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at
> >> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
> >> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
> >>
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl
> >> .java:249)
> >> at
> >>
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.
> >> java:192)
> >> at
> >>
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
> >> 92)
> >> ... 52 more Caused by: javax.net.ssl.SSLHandshakeException:
> >> sun.security.validator.ValidatorException: PKIX path building failed:
> >> sun.security.provider.certpath.SunCertPathBuilderException: unable to
> >> find valid certification path to requested target at
> >> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
> >> at
> >> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1
> >> 747) at
> >> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:241)
> >> at
> >> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235)
> >> at
> >> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Clien
> >> tHandsh
> >> aker.java:1209)
> >> at
> >> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHa
> >> ndsh
> >> aker.java:135)
> >> at
> >> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:5
> >> 93)
> >> at
> >> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.jav
> >> a:52
> >> 9)
> >> at
> >> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.j
> >> ava:9
> >> 43)
> >> at
> >> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SS
> >> LSock
> >> etImpl.java:1188)
> >> at
> >> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketIm
> >> pl.ja
> >> va:1215)
> >> at
> >> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketIm
> >> pl.ja
> >> va:1199)
> >> at
> >> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:
> >> 434)
> >> at
> >>
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
> >> (
> >> AbstractDelegateHttpsURLConnection.java:166)
> >> at
> >>
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCo
> >> nnection.java:1172)
> >> at
> >>
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Http
> >> sURLConnectionImpl.java:234)
> >> at
> >>
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrent
> >> E
> >> ntity(XMLEntityManager.java:675)
> >> at
> >>
> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineD
> >> o
> >> cVersion(XMLVersionDetector.java:186)
> >> at
> >> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
> >> ML
> >> 11Configuration.java:772)
> >> at
> >> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
> >> ML
> >> 11Configuration.java:737)
> >> at
> >> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
> >> jav
> >> a:119)
> >> at
> >>
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.
> >> j
> >> ava:232)
> >> at
> >>
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Doc
> >> u
> >> mentBuilderImpl.java:284)
> >> ... 58 more Caused by: sun.security.validator.ValidatorException:
> >> PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException:
> >> unable to find valid certification path to requested target at
> >> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:323)
> >> at
> >> sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.jav
> >> a:217) at
> >> sun.security.validator.Validator.validate(Validator.java:218) at
> >> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustM
> >> ana
> >> gerImpl.java:126)
> >> at
> >> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
> >> X50
> >> 9TrustManagerImpl.java:209)
> >> at
> >> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(
> >> X50
> >> 9TrustManagerImpl.java:249)
> >> at
> >> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Clien
> >> tHandsh
> >> aker.java:1188)
> >> ... 76 more Caused by:
> >> sun.security.provider.certpath.SunCertPathBuilderException: unable to
> >> find valid certification path to requested target at
> >> sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCert
> >> Path
> >> Builder.java:174)
> >> at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238)
> >> at
> >> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:318)
> >> ... 82 more "
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >> http://cxf.547215.n5.nabble.com/Code-only-
> >> STSClient-tp5724575p5724805.html
> >> Sent from the cxf-user mailing list archive at Nabble.com.
Re: Code only STSClient
Posted by Glen Mazza <gm...@talend.com>.
Doesn't that error message just mean the server's public cert isn't in
the client's truststore
(http://www.jroller.com/gmazza/entry/ssl_for_web_services#SSL8)?
Glen
On 03/20/2013 11:00 AM, Andrei Shakirin wrote:
> Hi,
>
> Your problem is caused by SSL handshake by getting WSDL from 'https://localhost:9093/SecurityTokenService/Transport?wsdl':
>
> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'https://localhost:9093/SecurityTokenService/Transport?wsdl'.:
> javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
>
> It means that Sun security provider doesn't accept certificate from server.
>
> I have not the solution at the moment, will look into in the next days.
> You can try proposals from following links:
> http://caffiendfrog.blogspot.de/2011/06/setting-up-apache-cxf-with-ssl-for.html
> http://stackoverflow.com/questions/8000918/apache-cxf-soap-client-using-generated-stubs-in-https
> http://stackoverflow.com/questions/12178273/how-do-i-setup-a-cxf-soap-client-connection-over-https-with-username-password-n
>
> Regards,
> Andrei.
>
>> -----Original Message-----
>> From: geecxf [mailto:amiri@ge.com]
>> Sent: Dienstag, 19. März 2013 19:57
>> To: users@cxf.apache.org
>> Subject: RE: Code only STSClient
>>
>> Andrei,
>>
>> Unfortunately, getDefaultBus() and getDefaultSpringBus() are not returning
>> a bus that works. On the other hand, injecting the bus into a class property
>> does work. Here is my spring configuration:
>>
>> <cxf:bus name="cxf">
>> <cxf:features>
>> <cxf:logging />
>> </cxf:features>
>> </cxf:bus>
>>
>> <jaxws:client
>>
>> name="{http://docs.oasis-open.org/ws-sx/ws-
>> trust/200512/}SecurityTokenService"
>> createdFromAPI="true" username="demo" password="demo" />
>>
>> <http:conduit name="https://localhost:.*" >
>> <http:tlsClientParameters
>> disableCNCheck="true">
>> <sec:trustManagers>
>> <sec:keyStore type="jks" password="cspass"
>> resource="certs/clientKeystore.jks" />
>> </sec:trustManagers>
>> </http:tlsClientParameters>
>> </http:conduit>
>>
>> The error I get with the bus returned from getDefaultBus() and
>> getThreadDefaultBus():
>>
>> "org.apache.cxf.service.factory.ServiceConstructionException: Failed to
>> create service. at
>> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
>> 94)
>> at
>> org.apache.cxf.ws.security.trust.STSClient.createClient(STSClient.java:550)
>> at
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
>> ava:641)
>> at
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
>> ava:635)
>> at
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
>> ava:627)
>> at
>> com.ge.dsp.example.webservice.test.SamlRestTest.requestSecurityToken(S
>> amlRestTest.java:400)
>> at
>> com.ge.dsp.example.webservice.test.SamlRestTest.testGetSamlBearerToke
>> nFromSts(SamlRestTest.java:291)
>> at com.ge.dsp.testng.runner.TestNgRunner.test(TestNgRunner.java:153) at
>> com.ge.dsp.testng.runner.TestNgRunner.init(TestNgRunner.java:130) at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory$8.run(AbstractAutowireCapableBeanFactory.java:1568)
>> at java.security.AccessController.doPrivileged(Native Method) at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java
>> :1566)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory.createBean(AbstractAutowireCapableBeanFactory.java:456)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObje
>> ct(AbstractBeanFactory.java:294)
>> at
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
>> etSingleton(DefaultSingletonBeanRegistry.java:225)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBea
>> n(AbstractBeanFactory.java:291)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(A
>> bstractBeanFactory.java:193)
>> at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preI
>> nstantiateSingletons(DefaultListableBeanFactory.java:609)
>> at
>> org.springframework.context.support.AbstractApplicationContext.finishBea
>> nFactoryInitialization(AbstractApplicationContext.java:918)
>> at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
>> cationContext.access$1600(AbstractDelegatedExecutionApplicationContext.j
>> ava:69)
>> at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
>> cationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:35
>> 5)
>> at
>> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTC
>> CL(PrivilegedUtils.java:85)
>> at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
>> cationContext.completeRefresh(AbstractDelegatedExecutionApplicationCon
>> text.java:320)
>> at
>> org.springframework.osgi.extender.internal.dependencies.startup.Depende
>> ncyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
>> cyWaiterApplicationContextExecutor.java:132)
>> at java.lang.Thread.run(Thread.java:680) Caused by:
>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
>> Problem parsing
>> 'https://localhost:9093/SecurityTokenService/Transport?wsdl'.:
>> javax.net.ssl.SSLHandshakeException:
>> sun.security.validator.ValidatorException: PKIX path building failed:
>> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
>> valid certification path to requested target at
>> com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at
>> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
>> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl
>> .java:249)
>> at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.
>> java:192)
>> at
>> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
>> 92)
>> ... 52 more Caused by: javax.net.ssl.SSLHandshakeException:
>> sun.security.validator.ValidatorException: PKIX path building failed:
>> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
>> valid certification path to requested target at
>> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174) at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1747) at
>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:241) at
>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235) at
>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandsh
>> aker.java:1209)
>> at
>> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandsh
>> aker.java:135)
>> at
>> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
>> at
>> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:52
>> 9)
>> at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:9
>> 43)
>> at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSock
>> etImpl.java:1188)
>> at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.ja
>> va:1215)
>> at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.ja
>> va:1199)
>> at
>> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
>> at
>> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(
>> AbstractDelegateHttpsURLConnection.java:166)
>> at
>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCo
>> nnection.java:1172)
>> at
>> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Http
>> sURLConnectionImpl.java:234)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentE
>> ntity(XMLEntityManager.java:675)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDo
>> cVersion(XMLVersionDetector.java:186)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML
>> 11Configuration.java:772)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML
>> 11Configuration.java:737)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
>> a:119)
>> at
>> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.j
>> ava:232)
>> at
>> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Docu
>> mentBuilderImpl.java:284)
>> ... 58 more Caused by: sun.security.validator.ValidatorException: PKIX path
>> building failed: sun.security.provider.certpath.SunCertPathBuilderException:
>> unable to find valid certification path to requested target at
>> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:323) at
>> sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:217)
>> at sun.security.validator.Validator.validate(Validator.java:218) at
>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustMana
>> gerImpl.java:126)
>> at
>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X50
>> 9TrustManagerImpl.java:209)
>> at
>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X50
>> 9TrustManagerImpl.java:249)
>> at
>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandsh
>> aker.java:1188)
>> ... 76 more Caused by:
>> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
>> valid certification path to requested target at
>> sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPath
>> Builder.java:174)
>> at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238) at
>> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:318) ... 82
>> more ... Removed 25 stack frames
>> org.apache.cxf.service.factory.ServiceConstructionException: Failed to
>> create service. at
>> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
>> 94)
>> at
>> org.apache.cxf.ws.security.trust.STSClient.createClient(STSClient.java:550)
>> at
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
>> ava:641)
>> at
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
>> ava:635)
>> at
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
>> ava:627)
>> at
>> com.ge.dsp.example.webservice.test.SamlRestTest.requestSecurityToken(S
>> amlRestTest.java:400)
>> at
>> com.ge.dsp.example.webservice.test.SamlRestTest.testGetSamlBearerToke
>> nFromSts(SamlRestTest.java:291)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
>> ava:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597) at
>> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocat
>> ionHelper.java:80)
>> at org.testng.internal.Invoker.invokeMethod(Invoker.java:714) at
>> org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) at
>> org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) at
>> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWo
>> rker.java:127)
>> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
>> at
>> org.testng.TestRunner.privateRun(TestRunner.java:767) at
>> org.testng.TestRunner.run(TestRunner.java:617) at
>> org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at
>> org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at
>> org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at
>> org.testng.SuiteRunner.run(SuiteRunner.java:240) at
>> org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at
>> org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at
>> org.testng.TestNG.runSuitesSequentially(TestNG.java:1198) at
>> org.testng.TestNG.runSuitesLocally(TestNG.java:1123) at
>> org.testng.TestNG.run(TestNG.java:1031) at
>> com.ge.dsp.testng.runner.TestNgRunner.test(TestNgRunner.java:153) at
>> com.ge.dsp.testng.runner.TestNgRunner.init(TestNgRunner.java:130) at
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
>> ava:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597) at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory$8.run(AbstractAutowireCapableBeanFactory.java:1568)
>> at java.security.AccessController.doPrivileged(Native Method) at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java
>> :1566)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
>> actory.createBean(AbstractAutowireCapableBeanFactory.java:456)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObje
>> ct(AbstractBeanFactory.java:294)
>> at
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
>> etSingleton(DefaultSingletonBeanRegistry.java:225)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBea
>> n(AbstractBeanFactory.java:291)
>> at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(A
>> bstractBeanFactory.java:193)
>> at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preI
>> nstantiateSingletons(DefaultListableBeanFactory.java:609)
>> at
>> org.springframework.context.support.AbstractApplicationContext.finishBea
>> nFactoryInitialization(AbstractApplicationContext.java:918)
>> at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
>> cationContext.access$1600(AbstractDelegatedExecutionApplicationContext.j
>> ava:69)
>> at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
>> cationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:35
>> 5)
>> at
>> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTC
>> CL(PrivilegedUtils.java:85)
>> at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
>> cationContext.completeRefresh(AbstractDelegatedExecutionApplicationCon
>> text.java:320)
>> at
>> org.springframework.osgi.extender.internal.dependencies.startup.Depende
>> ncyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
>> cyWaiterApplicationContextExecutor.java:132)
>> at java.lang.Thread.run(Thread.java:680) Caused by:
>> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
>> Problem parsing
>> 'https://localhost:9093/SecurityTokenService/Transport?wsdl'.:
>> javax.net.ssl.SSLHandshakeException:
>> sun.security.validator.ValidatorException: PKIX path building failed:
>> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
>> valid certification path to requested target at
>> com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at
>> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
>> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl
>> .java:249)
>> at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.
>> java:192)
>> at
>> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
>> 92)
>> ... 52 more Caused by: javax.net.ssl.SSLHandshakeException:
>> sun.security.validator.ValidatorException: PKIX path building failed:
>> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
>> valid certification path to requested target at
>> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174) at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1747) at
>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:241) at
>> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235) at
>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandsh
>> aker.java:1209)
>> at
>> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandsh
>> aker.java:135)
>> at
>> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
>> at
>> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:52
>> 9)
>> at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:9
>> 43)
>> at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSock
>> etImpl.java:1188)
>> at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.ja
>> va:1215)
>> at
>> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.ja
>> va:1199)
>> at
>> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
>> at
>> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(
>> AbstractDelegateHttpsURLConnection.java:166)
>> at
>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCo
>> nnection.java:1172)
>> at
>> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Http
>> sURLConnectionImpl.java:234)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentE
>> ntity(XMLEntityManager.java:675)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDo
>> cVersion(XMLVersionDetector.java:186)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML
>> 11Configuration.java:772)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML
>> 11Configuration.java:737)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
>> a:119)
>> at
>> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.j
>> ava:232)
>> at
>> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Docu
>> mentBuilderImpl.java:284)
>> ... 58 more Caused by: sun.security.validator.ValidatorException: PKIX path
>> building failed: sun.security.provider.certpath.SunCertPathBuilderException:
>> unable to find valid certification path to requested target at
>> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:323) at
>> sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:217)
>> at sun.security.validator.Validator.validate(Validator.java:218) at
>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustMana
>> gerImpl.java:126)
>> at
>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X50
>> 9TrustManagerImpl.java:209)
>> at
>> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X50
>> 9TrustManagerImpl.java:249)
>> at
>> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandsh
>> aker.java:1188)
>> ... 76 more Caused by:
>> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
>> valid certification path to requested target at
>> sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPath
>> Builder.java:174)
>> at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238) at
>> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:318) ... 82
>> more "
>>
>>
>>
>> --
>> View this message in context: http://cxf.547215.n5.nabble.com/Code-only-
>> STSClient-tp5724575p5724805.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
RE: Code only STSClient
Posted by Andrei Shakirin <as...@talend.com>.
Hi,
Your problem is caused by SSL handshake by getting WSDL from 'https://localhost:9093/SecurityTokenService/Transport?wsdl':
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'https://localhost:9093/SecurityTokenService/Transport?wsdl'.:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
It means that Sun security provider doesn't accept certificate from server.
I have not the solution at the moment, will look into in the next days.
You can try proposals from following links:
http://caffiendfrog.blogspot.de/2011/06/setting-up-apache-cxf-with-ssl-for.html
http://stackoverflow.com/questions/8000918/apache-cxf-soap-client-using-generated-stubs-in-https
http://stackoverflow.com/questions/12178273/how-do-i-setup-a-cxf-soap-client-connection-over-https-with-username-password-n
Regards,
Andrei.
> -----Original Message-----
> From: geecxf [mailto:amiri@ge.com]
> Sent: Dienstag, 19. März 2013 19:57
> To: users@cxf.apache.org
> Subject: RE: Code only STSClient
>
> Andrei,
>
> Unfortunately, getDefaultBus() and getDefaultSpringBus() are not returning
> a bus that works. On the other hand, injecting the bus into a class property
> does work. Here is my spring configuration:
>
> <cxf:bus name="cxf">
> <cxf:features>
> <cxf:logging />
> </cxf:features>
> </cxf:bus>
>
> <jaxws:client
>
> name="{http://docs.oasis-open.org/ws-sx/ws-
> trust/200512/}SecurityTokenService"
> createdFromAPI="true" username="demo" password="demo" />
>
> <http:conduit name="https://localhost:.*" >
> <http:tlsClientParameters
> disableCNCheck="true">
> <sec:trustManagers>
> <sec:keyStore type="jks" password="cspass"
> resource="certs/clientKeystore.jks" />
> </sec:trustManagers>
> </http:tlsClientParameters>
> </http:conduit>
>
> The error I get with the bus returned from getDefaultBus() and
> getThreadDefaultBus():
>
> "org.apache.cxf.service.factory.ServiceConstructionException: Failed to
> create service. at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
> 94)
> at
> org.apache.cxf.ws.security.trust.STSClient.createClient(STSClient.java:550)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
> ava:641)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
> ava:635)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
> ava:627)
> at
> com.ge.dsp.example.webservice.test.SamlRestTest.requestSecurityToken(S
> amlRestTest.java:400)
> at
> com.ge.dsp.example.webservice.test.SamlRestTest.testGetSamlBearerToke
> nFromSts(SamlRestTest.java:291)
> at com.ge.dsp.testng.runner.TestNgRunner.test(TestNgRunner.java:153) at
> com.ge.dsp.testng.runner.TestNgRunner.init(TestNgRunner.java:130) at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory$8.run(AbstractAutowireCapableBeanFactory.java:1568)
> at java.security.AccessController.doPrivileged(Native Method) at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java
> :1566)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.createBean(AbstractAutowireCapableBeanFactory.java:456)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObje
> ct(AbstractBeanFactory.java:294)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
> etSingleton(DefaultSingletonBeanRegistry.java:225)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBea
> n(AbstractBeanFactory.java:291)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(A
> bstractBeanFactory.java:193)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preI
> nstantiateSingletons(DefaultListableBeanFactory.java:609)
> at
> org.springframework.context.support.AbstractApplicationContext.finishBea
> nFactoryInitialization(AbstractApplicationContext.java:918)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
> cationContext.access$1600(AbstractDelegatedExecutionApplicationContext.j
> ava:69)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
> cationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:35
> 5)
> at
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTC
> CL(PrivilegedUtils.java:85)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
> cationContext.completeRefresh(AbstractDelegatedExecutionApplicationCon
> text.java:320)
> at
> org.springframework.osgi.extender.internal.dependencies.startup.Depende
> ncyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:132)
> at java.lang.Thread.run(Thread.java:680) Caused by:
> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
> Problem parsing
> 'https://localhost:9093/SecurityTokenService/Transport?wsdl'.:
> javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target at
> com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at
> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl
> .java:249)
> at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.
> java:192)
> at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
> 92)
> ... 52 more Caused by: javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target at
> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174) at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1747) at
> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:241) at
> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235) at
> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandsh
> aker.java:1209)
> at
> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandsh
> aker.java:135)
> at
> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
> at
> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:52
> 9)
> at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:9
> 43)
> at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSock
> etImpl.java:1188)
> at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.ja
> va:1215)
> at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.ja
> va:1199)
> at
> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
> at
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(
> AbstractDelegateHttpsURLConnection.java:166)
> at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCo
> nnection.java:1172)
> at
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Http
> sURLConnectionImpl.java:234)
> at
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentE
> ntity(XMLEntityManager.java:675)
> at
> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDo
> cVersion(XMLVersionDetector.java:186)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML
> 11Configuration.java:772)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML
> 11Configuration.java:737)
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
> a:119)
> at
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.j
> ava:232)
> at
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Docu
> mentBuilderImpl.java:284)
> ... 58 more Caused by: sun.security.validator.ValidatorException: PKIX path
> building failed: sun.security.provider.certpath.SunCertPathBuilderException:
> unable to find valid certification path to requested target at
> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:323) at
> sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:217)
> at sun.security.validator.Validator.validate(Validator.java:218) at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustMana
> gerImpl.java:126)
> at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X50
> 9TrustManagerImpl.java:209)
> at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X50
> 9TrustManagerImpl.java:249)
> at
> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandsh
> aker.java:1188)
> ... 76 more Caused by:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target at
> sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPath
> Builder.java:174)
> at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238) at
> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:318) ... 82
> more ... Removed 25 stack frames
> org.apache.cxf.service.factory.ServiceConstructionException: Failed to
> create service. at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
> 94)
> at
> org.apache.cxf.ws.security.trust.STSClient.createClient(STSClient.java:550)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
> ava:641)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
> ava:635)
> at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.j
> ava:627)
> at
> com.ge.dsp.example.webservice.test.SamlRestTest.requestSecurityToken(S
> amlRestTest.java:400)
> at
> com.ge.dsp.example.webservice.test.SamlRestTest.testGetSamlBearerToke
> nFromSts(SamlRestTest.java:291)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597) at
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocat
> ionHelper.java:80)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:714) at
> org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) at
> org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) at
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWo
> rker.java:127)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
> at
> org.testng.TestRunner.privateRun(TestRunner.java:767) at
> org.testng.TestRunner.run(TestRunner.java:617) at
> org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at
> org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at
> org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at
> org.testng.SuiteRunner.run(SuiteRunner.java:240) at
> org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at
> org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at
> org.testng.TestNG.runSuitesSequentially(TestNG.java:1198) at
> org.testng.TestNG.runSuitesLocally(TestNG.java:1123) at
> org.testng.TestNG.run(TestNG.java:1031) at
> com.ge.dsp.testng.runner.TestNgRunner.test(TestNgRunner.java:153) at
> com.ge.dsp.testng.runner.TestNgRunner.init(TestNgRunner.java:130) at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597) at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory$8.run(AbstractAutowireCapableBeanFactory.java:1568)
> at java.security.AccessController.doPrivileged(Native Method) at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java
> :1566)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.createBean(AbstractAutowireCapableBeanFactory.java:456)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObje
> ct(AbstractBeanFactory.java:294)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
> etSingleton(DefaultSingletonBeanRegistry.java:225)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBea
> n(AbstractBeanFactory.java:291)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(A
> bstractBeanFactory.java:193)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preI
> nstantiateSingletons(DefaultListableBeanFactory.java:609)
> at
> org.springframework.context.support.AbstractApplicationContext.finishBea
> nFactoryInitialization(AbstractApplicationContext.java:918)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
> cationContext.access$1600(AbstractDelegatedExecutionApplicationContext.j
> ava:69)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
> cationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:35
> 5)
> at
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTC
> CL(PrivilegedUtils.java:85)
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionAppli
> cationContext.completeRefresh(AbstractDelegatedExecutionApplicationCon
> text.java:320)
> at
> org.springframework.osgi.extender.internal.dependencies.startup.Depende
> ncyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:132)
> at java.lang.Thread.run(Thread.java:680) Caused by:
> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
> Problem parsing
> 'https://localhost:9093/SecurityTokenService/Transport?wsdl'.:
> javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target at
> com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at
> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
> com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl
> .java:249)
> at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.
> java:192)
> at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
> 92)
> ... 52 more Caused by: javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target at
> com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174) at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1747) at
> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:241) at
> com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235) at
> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandsh
> aker.java:1209)
> at
> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandsh
> aker.java:135)
> at
> com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
> at
> com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:52
> 9)
> at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:9
> 43)
> at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSock
> etImpl.java:1188)
> at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.ja
> va:1215)
> at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.ja
> va:1199)
> at
> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
> at
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(
> AbstractDelegateHttpsURLConnection.java:166)
> at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCo
> nnection.java:1172)
> at
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Http
> sURLConnectionImpl.java:234)
> at
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentE
> ntity(XMLEntityManager.java:675)
> at
> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDo
> cVersion(XMLVersionDetector.java:186)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML
> 11Configuration.java:772)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML
> 11Configuration.java:737)
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
> a:119)
> at
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.j
> ava:232)
> at
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Docu
> mentBuilderImpl.java:284)
> ... 58 more Caused by: sun.security.validator.ValidatorException: PKIX path
> building failed: sun.security.provider.certpath.SunCertPathBuilderException:
> unable to find valid certification path to requested target at
> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:323) at
> sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:217)
> at sun.security.validator.Validator.validate(Validator.java:218) at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustMana
> gerImpl.java:126)
> at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X50
> 9TrustManagerImpl.java:209)
> at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X50
> 9TrustManagerImpl.java:249)
> at
> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandsh
> aker.java:1188)
> ... 76 more Caused by:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target at
> sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPath
> Builder.java:174)
> at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238) at
> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:318) ... 82
> more "
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Code-only-
> STSClient-tp5724575p5724805.html
> Sent from the cxf-user mailing list archive at Nabble.com.
RE: Code only STSClient
Posted by geecxf <am...@ge.com>.
Andrei,
Unfortunately, getDefaultBus() and getDefaultSpringBus() are not returning a
bus that works. On the other hand, injecting the bus into a class property
does work. Here is my spring configuration:
<cxf:bus name="cxf">
<cxf:features>
<cxf:logging />
</cxf:features>
</cxf:bus>
<jaxws:client
name="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"
createdFromAPI="true" username="demo" password="demo" />
<http:conduit name="https://localhost:.*" >
<http:tlsClientParameters
disableCNCheck="true">
<sec:trustManagers>
<sec:keyStore type="jks" password="cspass"
resource="certs/clientKeystore.jks" />
</sec:trustManagers>
</http:tlsClientParameters>
</http:conduit>
The error I get with the bus returned from getDefaultBus() and
getThreadDefaultBus():
"org.apache.cxf.service.factory.ServiceConstructionException: Failed to
create service. at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:94)
at
org.apache.cxf.ws.security.trust.STSClient.createClient(STSClient.java:550)
at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:641)
at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:635)
at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:627)
at
com.ge.dsp.example.webservice.test.SamlRestTest.requestSecurityToken(SamlRestTest.java:400)
at
com.ge.dsp.example.webservice.test.SamlRestTest.testGetSamlBearerTokenFromSts(SamlRestTest.java:291)
at com.ge.dsp.testng.runner.TestNgRunner.test(TestNgRunner.java:153) at
com.ge.dsp.testng.runner.TestNgRunner.init(TestNgRunner.java:130) at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$8.run(AbstractAutowireCapableBeanFactory.java:1568)
at java.security.AccessController.doPrivileged(Native Method) at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1566)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:680) Caused by:
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem
parsing 'https://localhost:9093/SecurityTokenService/Transport?wsdl'.:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target at
com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:249)
at
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:192)
at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
... 52 more Caused by: javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target at
com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1747) at
com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:241) at
com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235) at
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1209)
at
com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:135)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
at
com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:943)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1188)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1215)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1199)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:675)
at
com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:232)
at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
... 58 more Caused by: sun.security.validator.ValidatorException: PKIX path
building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target at
sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:323) at
sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:217)
at sun.security.validator.Validator.validate(Validator.java:218) at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126)
at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209)
at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:249)
at
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1188)
... 76 more Caused by:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target at
sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:174)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238) at
sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:318) ... 82
more ... Removed 25 stack frames
org.apache.cxf.service.factory.ServiceConstructionException: Failed to
create service. at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:94)
at
org.apache.cxf.ws.security.trust.STSClient.createClient(STSClient.java:550)
at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:641)
at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:635)
at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSClient.java:627)
at
com.ge.dsp.example.webservice.test.SamlRestTest.requestSecurityToken(SamlRestTest.java:400)
at
com.ge.dsp.example.webservice.test.SamlRestTest.testGetSamlBearerTokenFromSts(SamlRestTest.java:291)
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
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714) at
org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) at
org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) at
org.testng.TestRunner.privateRun(TestRunner.java:767) at
org.testng.TestRunner.run(TestRunner.java:617) at
org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at
org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at
org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at
org.testng.SuiteRunner.run(SuiteRunner.java:240) at
org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at
org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at
org.testng.TestNG.runSuitesSequentially(TestNG.java:1198) at
org.testng.TestNG.runSuitesLocally(TestNG.java:1123) at
org.testng.TestNG.run(TestNG.java:1031) at
com.ge.dsp.testng.runner.TestNgRunner.test(TestNgRunner.java:153) at
com.ge.dsp.testng.runner.TestNgRunner.init(TestNgRunner.java:130) 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
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$8.run(AbstractAutowireCapableBeanFactory.java:1568)
at java.security.AccessController.doPrivileged(Native Method) at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1566)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:680) Caused by:
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem
parsing 'https://localhost:9093/SecurityTokenService/Transport?wsdl'.:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target at
com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at
org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:249)
at
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:192)
at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
... 52 more Caused by: javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target at
com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174) at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1747) at
com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:241) at
com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235) at
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1209)
at
com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:135)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
at
com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:943)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1188)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1215)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1199)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:675)
at
com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:232)
at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
... 58 more Caused by: sun.security.validator.ValidatorException: PKIX path
building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target at
sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:323) at
sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:217)
at sun.security.validator.Validator.validate(Validator.java:218) at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126)
at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209)
at
com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:249)
at
com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1188)
... 76 more Caused by:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target at
sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:174)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238) at
sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:318) ... 82
more "
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724805.html
Sent from the cxf-user mailing list archive at Nabble.com.
RE: Code only STSClient
Posted by Andrei Shakirin <as...@talend.com>.
Hi,
> The short answer is that there is no concrete use case yet (you can thank
> agile development for that). The longer answer is that I was tasked with
> building a WS-Trust 1.4 compliant STS to issue SAML assertions that relying
> parties external to the OSGI container hosting the STS might consume. These
> might be SOAP web services or RESTful web services (or even something
> else).
>
> Thus, it made sense in my mind to write functional tests that produced a RST
> and validated the RSTR. And since our functional tests are deployed as OSGI
> bundles I was looking for a nice way of simply duplicating a subset of the CXF
> system tests in an OSGI bundle.
>
> I see your point about letting CXF create an embedded STS client. Certainly,
> that's the expected pattern in the only other implementation of WS-* that I
> have ever seen (i.e. WCF). However, in the end an STS is just a service that
> produces tokens and what we are building is not necessarily to support WS-
> SecureConversation. We're more interested in the generation and
> consumption of SAML assertions. You could argue (and so would I) that a
> simpler token granting service might be more appropriate for such a
> nebulous use case (e.g. OAuth) but the ask was for a WS-Trust complaint STS
> and we all take our orders from someone.
Sure, you can re-create STS client from scratch, STS is just a SOAP Web Service.
But as far as CXF already has STS client implementation (org.apache.cxf.ws.security.trust.STSClient), why not reuse it?
CXF STS client cares about a lot of WS-Trust aspects like security token validation, claims management, token renewing, supports configurable secure conversation.
It works standalone, in web and OSGi containers.
If you want to re-implement the client anyway, you can take CXF STS Client as basis.
>
> Of the solutions you suggested, I like using BusFactory.getDefaultBus() and
> BusFactory.getThreadDefaultBus() static methods the most. Is there
> something specific I have to do in Spring to set the DefaultBus() or the
> ThreadDefaultBus()? Does Spring initialization and other code in the OSGI
> bundle run on the same thread?
>
If you use Spring configuration to create client and service - by default SpringBusFactory implementation will be used and BusFactory.getDeafultBus(), BusFactory.getThreadDefaultBus() will return SpringBus. SpringBus is also available as Spring bean under name "cxf".
Cheers,
Andrei.
> Thanks very much for the help.
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Code-only-
> STSClient-tp5724575p5724704.html
> Sent from the cxf-user mailing list archive at Nabble.com.
RE: Code only STSClient
Posted by geecxf <am...@ge.com>.
The short answer is that there is no concrete use case yet (you can thank
agile development for that). The longer answer is that I was tasked with
building a WS-Trust 1.4 compliant STS to issue SAML assertions that relying
parties external to the OSGI container hosting the STS might consume. These
might be SOAP web services or RESTful web services (or even something else).
Thus, it made sense in my mind to write functional tests that produced a RST
and validated the RSTR. And since our functional tests are deployed as OSGI
bundles I was looking for a nice way of simply duplicating a subset of the
CXF system tests in an OSGI bundle.
I see your point about letting CXF create an embedded STS client. Certainly,
that's the expected pattern in the only other implementation of WS-* that I
have ever seen (i.e. WCF). However, in the end an STS is just a service that
produces tokens and what we are building is not necessarily to support
WS-SecureConversation. We're more interested in the generation and
consumption of SAML assertions. You could argue (and so would I) that a
simpler token granting service might be more appropriate for such a nebulous
use case (e.g. OAuth) but the ask was for a WS-Trust complaint STS and we
all take our orders from someone.
Of the solutions you suggested, I like using BusFactory.getDefaultBus() and
BusFactory.getThreadDefaultBus() static methods the most. Is there something
specific I have to do in Spring to set the DefaultBus() or the
ThreadDefaultBus()? Does Spring initialization and other code in the OSGI
bundle run on the same thread?
Thanks very much for the help.
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724704.html
Sent from the cxf-user mailing list archive at Nabble.com.
RE: Code only STSClient
Posted by Andrei Shakirin <as...@talend.com>.
Hi,
> For example, is there a way for me to register the bus with CXF in spring so that I can retrieve it in my code through some CXF API?
There are some options to do it:
a) use @Resource annotation for Bus field or setter in your spring bean
@Resource(name = "cxf")
public void setBus(Bus b) {
}
b) explicitly inject cxf bus in your bean:
<bean id="test" class="org.apache..cxf.test">
<property name="bus" ref="cxf" />
</bean>
c) use BusFactory.getDefaultBus() and BusFactory.getThreadDefaultBus() static methods.
May I ask you to explain your use case more detailed?
Normally there is no need to create your own STSClient, because CXF runtime contains embedded one.
So it is enough to
a) properly configure the client in spring or programmatically: <jaxws:client id="doubleit"
wsdlLocation="classpath:/DoubleIt.wsdl"
serviceClass="org.example.contract.doubleit.DoubleItPortType"
xmlns:ns1="http://www.example.org/contract/DoubleIt"
serviceName="ns1:DoubleItService"
endpointName="ns1:DoubleItPort">
<jaxws:properties>
<entry key="ws-security.sts.client">
<bean class="org.apache.cxf.ws.security.trust.STSClient">
<argument ref="cxf"/>
<property name="wsdlLocation" value="DoubleItSTSService.wsdl"/>
<property name="serviceName" value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}DoubleItSTSService"/>
<property name="endpointName" value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}DoubleItSTSPort"/>
<property name="properties">
<map>
<entry key="ws-security.callback-handler" value="client.ClientCallbackHandler"/>
<entry key="ws-security.sts.token.username" value="myclientkey"/>
<entry key="ws-security.sts.token.properties" value="clientKeystore.properties"/>
<entry key="ws-security.sts.token.usecert" value="false"/>
</map>
</property>
</bean>
</entry>
</jaxws:properties>
</jaxws:client>
b) Use appropriate STS WS security policy, where you can enforce SSL via transport binding, for example:
<wsp:Policy wsu:Id="Transport_policy">
<wsp:ExactlyOne>
<wsp:All>
<wsap10:UsingAddressing/>
<sp:TransportBinding
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken>
<wsp:Policy/>
</sp:HttpsToken>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic128 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Lax />
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp />
</wsp:Policy>
</sp:TransportBinding>
<sp:SignedSupportingTokens
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:Policy>
<sp:UsernameToken
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp:WssUsernameToken10 />
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SignedSupportingTokens>
<sp:Wss11
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:Policy>
<sp:MustSupportRefKeyIdentifier />
<sp:MustSupportRefIssuerSerial />
<sp:MustSupportRefThumbprint />
<sp:MustSupportRefEncryptedKey />
</wsp:Policy>
</sp:Wss11>
<sp:Trust13
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:Policy>
<sp:MustSupportIssuedTokens />
<sp:RequireClientEntropy />
<sp:RequireServerEntropy />
</wsp:Policy>
</sp:Trust13>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
CXF will automatically activate appropriate interceptors, communicate with STS, inject security token in SOAP message, etc.
You can find more details in Glen's blog: http://www.jroller.com/gmazza/entry/cxf_sts_tutorial .
This is recommended way to work with STS in CXF. Why it doesn't fit for your use case?
Regards,
Andrei.
> -----Original Message-----
> From: geecxf [mailto:amiri@ge.com]
> Sent: Freitag, 15. März 2013 23:55
> To: users@cxf.apache.org
> Subject: Re: Code only STSClient
>
> Thanks for the response. The short answer is that I didn't really set it to false.
> I just copied it like that from the CXF system tests. I'll look at the links you
> suggested. Perhaps the solution is as simple as setting that flag to true. Have
> a great weekend.
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Code-only-
> STSClient-tp5724575p5724663.html
> Sent from the cxf-user mailing list archive at Nabble.com.
Re: Code only STSClient
Posted by geecxf <am...@ge.com>.
Thanks for the response. The short answer is that I didn't really set it to
false. I just copied it like that from the CXF system tests. I'll look at
the links you suggested. Perhaps the solution is as simple as setting that
flag to true. Have a great weekend.
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724663.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Code only STSClient
Posted by Glen Mazza <gm...@talend.com>.
Short answer is, I don't know, but I'm not sure why you have
createdFromAPI="false" in your STSClient definition. It should be
"true"
(https://github.com/gmazza/blog-samples/blob/master/cxf_sts_tutorial/client/src/main/resources/cxf.xml)
providing you've already explicitly creating a SOAP client within your
Java code
(https://github.com/gmazza/blog-samples/blob/master/cxf_sts_tutorial/client/src/main/java/client/WSClient.java).
"false" creates a new bean, "true" applies the value of that bean to any
client sharing the conduit characteristics.
Glen
On 03/14/2013 09:00 PM, geecxf wrote:
> I took a look at the samples and while they are very useful they don't really
> address my particular problem. I was able to overcome that problem in one
> way but that solution leads to more questions. Basically, I can make the
> solution work by making my class ApplicationContextAware. In my bundles
> module context I have declared the following beans:
>
> <cxf:bus name="cxf">
> <cxf:features>
> <cxf:logging />
> </cxf:features>
> </cxf:bus>
>
> <jaxws:client
>
> name="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"
> createdFromAPI="false" username="demo" password="demo" />
>
> <http:conduit name="https://localhost:.*">
> <http:tlsClientParameters
> disableCNCheck="true">
> <sec:trustManagers>
> <sec:keyStore type="jks" password="cspass"
> resource="certs/clientKeystore.jks" />
> </sec:trustManagers>
> </http:tlsClientParameters>
> </http:conduit>
>
> And in code:
>
> SpringBus bus = (SpringBus) this.applicationContext.getBean("cxf");
>
> ...
>
> STSClient stsClient = new STSClient(bus);
>
> The http:conduit is necessary to set the trust store for the STSClient.
> While this solution works it requires that I make the class
> ApplicationContextAware and I'm wondering if there is a better way. For
> example, is there a way for me to register the bus with CXF in spring so
> that I can retrieve it in my code through some CXF API?
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724598.html
> Sent from the cxf-user mailing list archive at Nabble.com.
Re: Code only STSClient
Posted by geecxf <am...@ge.com>.
I took a look at the samples and while they are very useful they don't really
address my particular problem. I was able to overcome that problem in one
way but that solution leads to more questions. Basically, I can make the
solution work by making my class ApplicationContextAware. In my bundles
module context I have declared the following beans:
<cxf:bus name="cxf">
<cxf:features>
<cxf:logging />
</cxf:features>
</cxf:bus>
<jaxws:client
name="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"
createdFromAPI="false" username="demo" password="demo" />
<http:conduit name="https://localhost:.*">
<http:tlsClientParameters
disableCNCheck="true">
<sec:trustManagers>
<sec:keyStore type="jks" password="cspass"
resource="certs/clientKeystore.jks" />
</sec:trustManagers>
</http:tlsClientParameters>
</http:conduit>
And in code:
SpringBus bus = (SpringBus) this.applicationContext.getBean("cxf");
...
STSClient stsClient = new STSClient(bus);
The http:conduit is necessary to set the trust store for the STSClient.
While this solution works it requires that I make the class
ApplicationContextAware and I'm wondering if there is a better way. For
example, is there a way for me to register the bus with CXF in spring so
that I can retrieve it in my code through some CXF API?
--
View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575p5724598.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Code only STSClient
Posted by Glen Mazza <gm...@talend.com>.
Karaf-based (and FOSS) Talend ESB http://www.talend.com/products/esb
offers two OSGi-based STS examples in its examples/cxf folder (also
viewable here:
https://github.com/Talend/tesb-rt-se/tree/master/examples/cxf). But you
first might wish to set aside the STS portion and first concentrate on
getting *any* web service w/XML files hosted on OSGi, such as my example
here: http://www.jroller.com/gmazza/entry/web_service_tutorial . Once
you're getting XML config properly detected, then you can build your STS
client with normal XML config files.
HTH,
Glen
PS: It might also help to see if you can deploy to Tomcat successfully,
to rule out your code being the problem:
http://www.jroller.com/gmazza/entry/cxf_sts_tutorial
On 03/14/2013 12:18 PM, geecxf wrote:
> I've spent a day trying to figure out how to build a code only STSClient. I
> would like to do the analogue of the following in code only:
>
> <cxf:bus>
> <cxf:features>
> <cxf:logging />
> </cxf:features>
> </cxf:bus>
>
> <jaxws:client
>
> name="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"
> createdFromAPI="false" username="alice" password="clarinet" />
>
> <http:conduit name="https://localhost:.*">
> <http:tlsClientParameters
> disableCNCheck="true">
> <sec:trustManagers>
> <sec:keyStore type="jks" password="cspass"
> resource="certs/clientKeystore.jks" />
> </sec:trustManagers>
> </http:tlsClientParameters>
> </http:conduit>
>
> SpringBusFactory bf = new SpringBusFactory();
>
> SpringBus bus = (SpringBus) bf.createBus("clientSts.xml");
> SpringBusFactory.setDefaultBus(bus);
> SpringBusFactory.setThreadDefaultBus(bus);
>
> .....
>
> STSClient stsClient = new STSClient(bus);
>
> Why in code only? Because I can't figure out how to make the example as is
> work in an OSGI bundle. Clearly I lack the low level understanding of these
> framework that is required to get this work. I've been reading through the
> documentation to figure this out. There are examples of how to create
> standard REST clients and SOAP clients from code only and those I have
> applied with success; however, none of those examples seem to fit with this
> particular use case.
>
> Finally, it would be nice to know what the patter is for building and using
> clients in OSGI using Spring. I've grepped through the sample code looking
> for a simple example of this but the only osgi sample is hosting a service
> not making calls from a bundle.
>
> I'm probably missing something or maybe I have not done enough research but
> I've spent a day trying to figure this out and there's just too much to
> learn. I would really appreciate some clues that would at least point me in
> the right direction. Thanks in advance.
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Code-only-STSClient-tp5724575.html
> Sent from the cxf-user mailing list archive at Nabble.com.