You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by jbgill <jb...@q.com> on 2010/04/06 01:00:07 UTC

SMX 4: OpenSAML bundle missing opensaml.properties file?

Hi,

I'm trying to get SAML token handling working via the CXF WSS4JInInterceptor
in my CXF OSGI bundle. (Using a recent SMX 4.1-SNAPSHOT build).  It appears
that the SAML token is being received by the interceptor, but I get the
following exception trace when it tries to construct the OpenSAML assertion
object:  

16:23:25,073 | WARN  | 72@qtp-5531913-0 | PhaseInterceptorChain            |
ache.cxf.common.logging.LogUtils  361 | Interceptor for
{http://cxf.examples.servicemix.apache.org/}HelloWorldImplService has thrown
exception, unwinding now
java.lang.NullPointerException
        at java.util.Properties$LineReader.readLine(Properties.java:418)
        at java.util.Properties.load0(Properties.java:337)
        at java.util.Properties.load(Properties.java:325)
        at org.opensaml.SAMLConfig.loadProperties(Unknown Source)
        at org.opensaml.SAMLConfig.<init>(Unknown Source)
        at org.opensaml.SAMLConfig.instance(Unknown Source)
        at org.opensaml.SAMLObject.<init>(Unknown Source)
        at org.opensaml.SAMLSignedObject.<init>(Unknown Source)
        at org.opensaml.SAMLAssertion.<init>(Unknown Source)
        at
org.apache.ws.security.processor.SAMLTokenProcessor.handleSAMLToken(SAMLTokenProcessor.java:68)
        at
org.apache.ws.security.processor.SAMLTokenProcessor.handleToken(SAMLTokenProcessor.java:53)
        at
org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:326)
        at
org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:243)
        at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:199)
        at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:78)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
        at
org.apache.cxf.transport.http_osgi.OsgiDestination.doMessage(OsgiDestination.java:79)
        at
org.apache.cxf.transport.http_osgi.OsgiServletController.invokeDestination(OsgiServletController.java:327)
        at
org.apache.cxf.transport.http_osgi.OsgiServletController.invoke(OsgiServletController.java:151)
        at
org.apache.cxf.transport.http_osgi.OsgiServlet.invoke(OsgiServlet.java:53)
        at
org.apache.cxf.transport.http_osgi.SpringOsgiServlet.invoke(SpringOsgiServlet.java:48)
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)

Looking at OpenSAML 1.1 source, SAMLConfig.class is trying to load
conf/opensaml.properties with the following stream:  
     
      this.getClass().getResourceAsStream("/conf/opensaml.properties")

However, it appears that the opensaml bundle jar in servicemix does not
contain this file where other distributions of the opensaml-1.1.jar DO
contain this file.  I've tried adding my own conf/opensaml.properties, but
it still can't seem to find it.

Is this a bug, or am I doing something wrong?  

Thanks,
JB
-- 
View this message in context: http://old.nabble.com/SMX-4%3A--OpenSAML-bundle-missing-opensaml.properties-file--tp28145776p28145776.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SMX 4: OpenSAML bundle missing opensaml.properties file?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Thanks for the testcase.
And this is  a bug, create jira ticket SMX4-515[1] to track it,  
besides the conf folder, the bundle also need pick the schemas folder.
The fix is already commited, you can grap the latest opensaml bundle  
snapshot to override the one in your SMX4(using  
org.apache.servicemix.bundles.opensaml-1.1_4-SNAPSHOT.jar to override  
org.apache.servicemix.bundles.opensaml-1.1_3.jar), and your testcase  
works ok with this fix.

[1]https://issues.apache.org/activemq/browse/SMX4-515

Freeman
On 2010-4-6, at 下午10:53, jbgill wrote:

>
> Hi Freeman,
>
> I have attached a small project that reproduces the problem.  It is  
> based on
> the cxf-ws-security-osgi example in the distribution with a couple  
> of small
> changes to send/receive a saml token.  Both the client.html and the
> request.xml contain a hard-coded saml token in the soap header.
> -JB
> http://old.nabble.com/file/p28152980/samlTest.tar.gz samlTest.tar.gz
>
>
>
> Freeman Fang wrote:
>>
>> Hi,
>>
>> Could you please append a working testcase which I can reproduce this
>> problem?
>> Also the testcase is very helpful to verify the fix if this is a real
>> bug.
>>
>> From my first glance this is caused by our opensaml bundle didn't
>> include the necessary conf file.
>> But I do need your testcase.
>>
>> Thanks
>> Freeman
>> On 2010-4-6, at 上午7:00, jbgill wrote:
>>
>>
>> -- 
>> Freeman Fang
>> ------------------------
>> Open Source SOA: http://fusesource.com
>>
>>
>>
>
> -- 
> View this message in context: http://old.nabble.com/SMX-4%3A--OpenSAML-bundle-missing-opensaml.properties-file--tp28145776p28152980.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


Re: SMX 4: OpenSAML bundle missing opensaml.properties file?

Posted by jbgill <jb...@q.com>.
Hi Freeman,

I have attached a small project that reproduces the problem.  It is based on
the cxf-ws-security-osgi example in the distribution with a couple of small
changes to send/receive a saml token.  Both the client.html and the
request.xml contain a hard-coded saml token in the soap header.
-JB
http://old.nabble.com/file/p28152980/samlTest.tar.gz samlTest.tar.gz 



Freeman Fang wrote:
> 
> Hi,
> 
> Could you please append a working testcase which I can reproduce this  
> problem?
> Also the testcase is very helpful to verify the fix if this is a real  
> bug.
> 
>  From my first glance this is caused by our opensaml bundle didn't  
> include the necessary conf file.
> But I do need your testcase.
> 
> Thanks
> Freeman
> On 2010-4-6, at 上午7:00, jbgill wrote:
> 
> 
> -- 
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/SMX-4%3A--OpenSAML-bundle-missing-opensaml.properties-file--tp28145776p28152980.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SMX 4: OpenSAML bundle missing opensaml.properties file?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Could you please append a working testcase which I can reproduce this  
problem?
Also the testcase is very helpful to verify the fix if this is a real  
bug.

 From my first glance this is caused by our opensaml bundle didn't  
include the necessary conf file.
But I do need your testcase.

Thanks
Freeman
On 2010-4-6, at 上午7:00, jbgill wrote:

>
> Hi,
>
> I'm trying to get SAML token handling working via the CXF  
> WSS4JInInterceptor
> in my CXF OSGI bundle. (Using a recent SMX 4.1-SNAPSHOT build).  It  
> appears
> that the SAML token is being received by the interceptor, but I get  
> the
> following exception trace when it tries to construct the OpenSAML  
> assertion
> object:
>
> 16:23:25,073 | WARN  | 72@qtp-5531913-0 |  
> PhaseInterceptorChain            |
> ache.cxf.common.logging.LogUtils  361 | Interceptor for
> {http://cxf.examples.servicemix.apache.org/}HelloWorldImplService  
> has thrown
> exception, unwinding now
> java.lang.NullPointerException
>        at java.util.Properties$LineReader.readLine(Properties.java: 
> 418)
>        at java.util.Properties.load0(Properties.java:337)
>        at java.util.Properties.load(Properties.java:325)
>        at org.opensaml.SAMLConfig.loadProperties(Unknown Source)
>        at org.opensaml.SAMLConfig.<init>(Unknown Source)
>        at org.opensaml.SAMLConfig.instance(Unknown Source)
>        at org.opensaml.SAMLObject.<init>(Unknown Source)
>        at org.opensaml.SAMLSignedObject.<init>(Unknown Source)
>        at org.opensaml.SAMLAssertion.<init>(Unknown Source)
>        at
> org 
> .apache 
> .ws 
> .security 
> .processor 
> .SAMLTokenProcessor.handleSAMLToken(SAMLTokenProcessor.java:68)
>        at
> org 
> .apache 
> .ws 
> .security 
> .processor.SAMLTokenProcessor.handleToken(SAMLTokenProcessor.java:53)
>        at
> org 
> .apache 
> .ws 
> .security 
> .WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:326)
>        at
> org 
> .apache 
> .ws 
> .security 
> .WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:243)
>        at
> org 
> .apache 
> .cxf 
> .ws 
> .security 
> .wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:199)
>        at
> org 
> .apache 
> .cxf 
> .ws 
> .security 
> .wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:78)
>        at
> org 
> .apache 
> .cxf 
> .phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java: 
> 243)
>        at
> org 
> .apache 
> .cxf 
> .transport 
> .ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
>        at
> org 
> .apache 
> .cxf 
> .transport.http_osgi.OsgiDestination.doMessage(OsgiDestination.java: 
> 79)
>        at
> org 
> .apache 
> .cxf 
> .transport 
> .http_osgi 
> .OsgiServletController.invokeDestination(OsgiServletController.java: 
> 327)
>        at
> org 
> .apache 
> .cxf 
> .transport 
> .http_osgi.OsgiServletController.invoke(OsgiServletController.java: 
> 151)
>        at
> org 
> .apache.cxf.transport.http_osgi.OsgiServlet.invoke(OsgiServlet.java: 
> 53)
>        at
> org 
> .apache 
> .cxf 
> .transport.http_osgi.SpringOsgiServlet.invoke(SpringOsgiServlet.java: 
> 48)
>        at
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java: 
> 179)
>        at
> org 
> .apache 
> .cxf 
> .transport 
> .servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>
> Looking at OpenSAML 1.1 source, SAMLConfig.class is trying to load
> conf/opensaml.properties with the following stream:
>
>      this.getClass().getResourceAsStream("/conf/opensaml.properties")
>
> However, it appears that the opensaml bundle jar in servicemix does  
> not
> contain this file where other distributions of the opensaml-1.1.jar DO
> contain this file.  I've tried adding my own conf/ 
> opensaml.properties, but
> it still can't seem to find it.
>
> Is this a bug, or am I doing something wrong?
>
> Thanks,
> JB
> -- 
> View this message in context: http://old.nabble.com/SMX-4%3A--OpenSAML-bundle-missing-opensaml.properties-file--tp28145776p28145776.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com