Workaround Description: Subclass webservice implementation and specify interfaces/annotations directly. e.g. for PicketLinkSTS you would create the following and specify it as the servlet in web.xml @WebServiceProvider(serviceName="PicketLinkSTS", portName="PicketLinkSTSPort", targetNamespace="urn:picketlink:identity-federation:sts", wsdlLocation="WEB-INF/wsdl/PicketLinkSTS.wsdl") @ServiceMode(value=Service.Mode.PAYLOAD) public class PicketLinkSTS extends org.picketlink.identity.federation.core.wstrust.PicketLinkSTS implements Provider<Source> { } project_key: SOA There is an exception while deploying secuirty_saml QS with CXF enabled: 17:59:16,231 ERROR [[/picketlink-sts]] StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PicketLinkSTS': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) ... While trying to run the example, there is another exception being thrown: 17:59:45,470 ERROR [[/picketlink-sts]] StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PicketLinkSTS': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) ... Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'WEB-INF/wsdl/PicketLinkSTS.wsdl'.: java.io.FileNotFoundException: /qa/home/mvecera/work/soa/510ER6.cxf/jboss-as/bin/WEB-INF/wsdl/PicketLinkSTS.wsdl at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2111) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2303) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2335) at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:232) at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179) at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91) ... 53 more Caused by: java.io.FileNotFoundException: /qa/home/mvecera/work/soa/510ER6.cxf/jboss-as/bin/WEB-INF/wsdl/PicketLinkSTS.wsdl at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:105) at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:112) at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2101) ... 58 more It seems like CXF is trying to locate the WSDL file in a wrong place. The same problem is in our integration test suite making this test unable to verify correct SAML operation.
Affects Testing: Removed: [Regression] Added: [Regression, Blocks Testing]
On which machine? How is it being deployed? I have just started ER6 and seen a different error java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperationsForProvider(JaxWsServiceFactoryBean.java:264) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:256) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:424) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:528) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:278) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:178)
Yes, this is the first exception during deployment. Ignore this and try running the example with ant runtest and the other shows up.
I suspect that the first exception (ClassCastException) is the issue and the second (FileNotFoundException) a consequence of the first failure to parse the WSDL. Sounds like an issue with CXF integration though, will do some investigation.
The CXF codebase assumes that the service class (PicketLinkSTS) implements a parameterized interface, presumably javax.xml.ws.Provider. Unfortunately PicketLinkSTS does not implement this directly, rather it is referenced indirectly through SecurityTokenService.
Will add a workaround for this specific deployment.
Please send me that workaround when you have it. I need to fix our tests as well and it would be great to have it before another build. Thanks.
It looks like these may be separate issues with the CXF integration working around the first one leads to the following on the console - java.lang.ClassNotFoundException: org.jboss.soa.esb.picketlink.PicketLinkSTS This would suggest that this code is not using the context classloader associated with the war to locate the class/resource. Will investigate further.
Turned out to be a typo in the build.xml, class was found on deployment but not when runtest was executed subsequently.
Update to quickstart to fix picketlink-sts.war
Attachment: Added: security_saml.zip
Workaround Description: Added: Subclass webservice implementation and specify interfaces/annotations directly. e.g. for PicketLinkSTS you would create the following and specify it as the servlet in web.xml @WebServiceProvider(serviceName="PicketLinkSTS", portName="PicketLinkSTSPort", targetNamespace="urn:picketlink:identity-federation:sts", wsdlLocation="WEB-INF/wsdl/PicketLinkSTS.wsdl") @ServiceMode(value=Service.Mode.PAYLOAD) public class PicketLinkSTS extends org.picketlink.identity.federation.core.wstrust.PicketLinkSTS implements Provider<Source> { }
Link: Added: This issue depends JBESB-3560
Updated in ESB codebase, will be in next merge.
Verified with 5.1.0 ER8
Release Notes Docs Status: Added: Not Required
Temporarily reopening to update release note info.
Release Notes Docs Status: Removed: Not Required Added: Documented as Resolved Issue Writer: Added: dlesage Release Notes Text: Added: https://issues.jboss.org/browse/SOA-2770 A java.lang.ClassCastException occurred if the user deployed the security_saml quick start with CXF enabled. This was caused by an error in a build file which lead to the class being found on deployment but not on the subsequent run test. To fix this problem, the picketlink-sts.war file has been updated in the quick start. As a result, the exception no longer occurs.