axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dini Omar" <zigg...@gmail.com>
Subject Re: NullPointerException at org.apache.rampart.builder.BindingBuilder.getSignatureBuider(BindingBuilder.java:249)
Date Mon, 21 Jul 2008 13:52:27 GMT
Hi nandana,

Here is how i configured rampart

Policy.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
 !
 ! Copyright 2006 The Apache Software Foundation.
 !
 ! Licensed under the Apache License, Version 2.0 (the "License");
 ! you may not use this file except in compliance with the License.
 ! You may obtain a copy of the License at
 !
 !      http://www.apache.org/licenses/LICENSE-2.0
 !
 ! Unless required by applicable law or agreed to in writing, software
 ! distributed under the License is distributed on an "AS IS" BASIS,
 ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ! See the License for the specific language governing permissions and
 ! limitations under the License.
 !-->
<wsp:Policy wsu:Id="SigOnly"
xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"

xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
    <wsp:ExactlyOne>
        <wsp:All>
            <sp:AsymmetricBinding xmlns:sp="
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                <wsp:Policy>
                    <sp:InitiatorToken>
                        <wsp:Policy>
                            <sp:X509Token sp:IncludeToken="
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient
">
                                <wsp:Policy>
                                    <sp:WssX509V3Token10/>
                                </wsp:Policy>
                            </sp:X509Token>
                        </wsp:Policy>
                    </sp:InitiatorToken>
                    <sp:RecipientToken>
                        <wsp:Policy>
                            <sp:X509Token sp:IncludeToken="
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
                                <wsp:Policy>
                                    <sp:WssX509V3Token10/>
                                </wsp:Policy>
                            </sp:X509Token>
                        </wsp:Policy>webservices.soap.aep.signed.stub
                    </sp:RecipientToken>
                    <sp:AlgorithmSuite>
                        <wsp:Policy>
                            <sp:TripleDesRsa15/>
                        </wsp:Policy>
                    </sp:AlgorithmSuite>
                    <sp:Layout>
                        <wsp:Policy>
                            <sp:Strict/>
                        </wsp:Policy>
                    </sp:Layout>
                    <sp:OnlySignEntireHeadersAndBody/>
                </wsp:Policy>
            </sp:AsymmetricBinding>
            <sp:Wss10 xmlns:sp="
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                <wsp:Policy>
                    <sp:MustSupportRefKeyIdentifier/>
                    <sp:MustSupportRefIssuerSerial/>
                </wsp:Policy>
            </sp:Wss10>
            <sp:SignedParts xmlns:sp="
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                <sp:Body/>
            </sp:SignedParts>

            <ramp:RampartConfig xmlns:ramp="
http://ws.apache.org/rampart/policy">
                <ramp:user>257804</ramp:user>
                <ramp:encryptionUser>service</ramp:encryptionUser>

<ramp:passwordCallbackClass>ie.ros.www.schemas.customs.service.sadfile.client.PWCBHandler</ramp:passwordCallbackClass>
                <ramp:signatureCrypto>
                    <ramp:crypto
provider="org.apache.ws.security.components.crypto.Merlin">
                        <ramp:property
name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
                        <ramp:property
name="org.apache.ws.security.crypto.merlin.file">C:\Documents and
Settings\702723344\My
Documents\alp.workspace\eclipse.workspace\alp.ccs21.webservice.soapgw\keystore\newstore.jks</ramp:property>
                        <ramp:property
name="org.apache.ws.security.crypto.merlin.keystore.password">testpass</ramp:property>
                    </ramp:crypto>
                </ramp:signatureCrypto>
            </ramp:RampartConfig>
        </wsp:All>
    </wsp:ExactlyOne>
</wsp:Policy>

And here is how i am accessing the policy.

ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(System.getProperty("configuration.context"),
null);
                                      SadFileStub stub =  new
SadFileStub(ctx, System.getProperty("endpoint.url"));

 stub._getServiceClient().getOptions().setProperty(RampartMessageData.KEY_RAMPART_POLICY,
loadPolicy(System.getProperty("policy.file")));

 stub._getServiceClient().engageModule("rampart");


Here are the relevant properties

configuration.context=.
policy.file=C:\\Documents and Settings\\702723344\\My
Documents\\alp.workspace\\eclipse.workspace\\soapgw\\conf\\policy.xml
cert.moduleName=rampart

Another thing i should mention is that i did compile this on a Windows
desktop and it works. I only get that error when i move the jar file onto a
Unix/Solaris machine.

Thanks.


On Mon, Jul 21, 2008 at 2:07 PM, Nandana Mihindukulasooriya <
nandana.cse@gmail.com> wrote:

> Hi Dini,
>         Looking at the source [1], it seems that you missing the
> RampartConfig assertion in the policy. Can you please post how you configure
> the client so that we will be able to figure out what the problem is.
>
> thanks,
> nandana
>
>
> [1] -
> http://svn.apache.org/viewvc/webservices/rampart/tags/java/1_3/modules/rampart-core/src/main/java/org/apache/rampart/builder/BindingBuilder.java?annotate=573138
>
>
>
> On Mon, Jul 21, 2008 at 4:27 PM, Dini Omar <ziggy25@gmail.com> wrote:
>
>> Hi all,
>>
>> Does anyone know what this error is about?
>> I am using Rampart 1.3 with Axis 1.3
>>
>>
>> java.lang.NullPointerException
>>         at
>> org.apache.rampart.builder.BindingBuilder.getSignatureBuider(BindingBuilder.java:249)
>>         at
>> org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:596)
>>         at
>> org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:
>>         at
>> org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:95)
>>         at
>> org.apache.rampart.MessageBuilder.build(MessageBuilder.java:131)
>>         at
>> org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)
>>         at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
>>         at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
>>         at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:377)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
>>         at
>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
>>         at
>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>>         at
>> ie.ros.www.schemas.customs.service.sadfile.client.SadFileStub.SadEdifactFile(SadFileStub.java:169)
>>         at com.alp.ccs21.soapwg.gw.ToDHLCli.readFiles(ToDHLCli.java:410)
>>         at com.alp.ccs21.soapwg.gw.ToDHLCli.run(ToDHLCli.java:197)
>>
>> Thanks in advance.
>>
>
>
> --
> Nandana Mihindukulasooriya
> WSO2 inc.
>
> http://nandana83.blogspot.com/
>

Mime
View raw message