I was now trying out the security sample that comes with Axis2 std dist. I am getting the following exception. Have anyone come across similar exception. Digging into the code source I find the place where the null pointer is being thrown.... MessageDigest md5 = null; try { md5 = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { //System.out.println("Error: " + e); //todo heve to be properly handle } md5.update(sb.toString().getBytes()); md5 is null. If I create a simple java class with just a single statement of MessageDigest.getInstance("MD5"); everything works fine. Any idea why MessageDigest.getInstance("MD5") might be returning a null?
Exception in thread "main" java.lang.NullPointerException at org.apache.axiom.om.util.UUIDGenerator.getInitialUUID(UUIDGenerator.java :76) at org.apache.axiom.om.util.UUIDGenerator.getUUID(UUIDGenerator.java:46) at org.apache.axiom.om.OMOutputFormat.getMimeBoundary(OMOutputFormat.java:7 6) at org.apache.axiom.om.OMOutputFormat.getContentType(OMOutputFormat.java:61 ) at org.apache.axis2.transport.http.SOAPOverHTTPSender$AxisSOAPRequestEntity .getContentType(SOAPOverHTTPSender.java:220) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.addRequestHe aders(EntityEnclosingMethod.java:376) at org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMet hodBase.java:2036) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase .java:1919) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java :993) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMe thodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMetho dDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3 96) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3 46) at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(Abstrac tHTTPSender.java:530) at org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSend er.java:92) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageW ithCommons(CommonsHTTPTransportSender.java:299) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Common sHTTPTransportSender.java:207) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:589) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper ation.java:328) at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisO peration.java:279) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:457 ) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:399 ) at sample.security.Client.main(Client.java:64) Thanks and regards, Sagar Kar -----Original Message----- From: Ruchith Fernando [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 23, 2006 11:45 AM To: axis-user@ws.apache.org Subject: Re: [Axis2] WS-Security: Security module isn't doing anything Hm m ... very strange ... this is exactly the way we have configuration in the security sample shipped with axis2-1.0-std-bin distro (Except for the fact that you will have to include the sec.properties file in the classpath, and if not it will throw an exception). Did you try the security sample in axis2-1.0-std-bin ? Thanks, Ruchith On 5/23/06, Kar, Sagar (Genworth, Contractor) <[EMAIL PROTECTED]> wrote: > Hi, > > I have provided the repository location as a system property and have > omitted the axis2.xml. > Like -Daxis2.repo=D:\workspace\RAD\BankApp\Axis2ESBClient\client_repo > The structure of client_repo is > +client_repo > +conf > -axis2.xml > -sec.properties > +modules > -addressing-1.0.mar > -rampart-1.0.mar > > > Thanks and regards, > Sagar Kar > > > -----Original Message----- > From: Ruchith Fernando [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 11:28 AM > To: axis-user@ws.apache.org > Subject: Re: [Axis2] WS-Security: Security module isn't doing anything > > Hi, > > Did you specify the location of the axis2.xml file when you created > the service client or the Stub? > > OR > > Did you provide the location of the axis2.xml file in the VM argument > named "axis2.xml" (Example: -Daxis2.xml=/path/to/axis2.xml) ? > > Thanks, > Ruchith > > On 5/23/06, Kar, Sagar (Genworth, Contractor) <[EMAIL PROTECTED]> > wrote: > > Hi, > > > > I am trying to use Axis2 to invoke a secured web service deployed on > > a > > > websphere appserver v 6.0. > > I am a newbie to WS-Security and Axis2. > > The websphere service is working fine and I can hit it with a > > websphere client. > > I just want to configure axis2 so that the rampart module starts to > > create the required security headers. > > The problem is that rampart is not doing anything ..... And I am > > unable to figure out how do I ask it to start generating the headers. > > Its not even throwing up so I don't know if its configured properly > > or > not. > > Do I need to add something in <phaseOrder type="outflow"> that > > would start it up. > > > > > > Following is my axis2.xml and sec.properties. If the values are > > incorrect then isn't the rampart module supposed to throw some > > exceptions? > > -------------------------------------Axis2.xml---------------------- > > -- > > -- > > ---------------- > > <axisconfig name="AxisJava2.0"> > > > > <!-- Engage the addressing module --> > > <module ref="addressing"/> > > > > <!-- Engage the security module --> > > <module ref="rampart"/> > > > > <!-- Test with addressing and MTOM: Client's > > Configuration:START--> > > > > <parameter name="OutflowSecurity"> > > <action> > > <items>Timestamp Signature Encrypt</items> > > <user>esb</user> > > <passwordCallbackClass>test.PWCallback</passwordCallbackClass> > > <signaturePropFile>sec.properties</signaturePropFile> > > > > <signatureKeyIdentifier>KeyIdentifier</signatureKeyIdentifier> > > > > <signatureParts>{Element}{http://www.w3.org/2005/08/addressing}To;{E > > le > > me > > nt}{http://www.w3.org/2005/08/addressing}ReplyTo;{Element}{http://www. > > w3 > > .org/2005/08/addressing}MessageID;{Element}{http://docs.oasis-open.o > > rg > > /w > > ss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp</si > > gn > > at > > ureParts> > > > > <optimizeParts>//xenc:EncryptedData/xenc:CipherData/xenc:CipherValue > > </ > > op > > timizeParts> > > </action> > > </parameter> > > > > <parameter name="InflowSecurity"> > > <action> > > <items>Timestamp Signature Encrypt</items> > > > > <passwordCallbackClass>sample.security.PWCallback</passwordCallbackC > > la > > ss > > > > > <signaturePropFile>sec.properties</signaturePropFile> > > </action> > > </parameter> > > > > <!-- Test with addressing and MTOM: Client's > > Configuration:END--> > > > > <!-- ================================================= --> > > <!-- Parameters --> > > <!-- ================================================= --> > > <parameter name="hotdeployment" locked="false">true</parameter> > > <parameter name="hotupdate" locked="false">false</parameter> > > <parameter name="enableMTOM" locked="false">true</parameter> > > <!-- Uncomment this to enable REST support --> > > <!-- <parameter name="enableREST" > > locked="false">true</parameter>--> > > > > > > <parameter name="userName" locked="false">admin</parameter> > > <parameter name="password" locked="false">axis2</parameter> > > > > <!-- ================================================= --> > > <!-- Message Receivers --> > > <!-- ================================================= --> > > <!--This is the Deafult Message Receiver for the system , if you > > want to have MessageReceivers for --> > > <!--all the other MEP implement it and add the correct entry to > > here , so that you can refer from--> > > <!--any operation --> > > <!--Note : You can ovride this for particular service by adding > > the same element with your requirement--> > > <messageReceivers> > > <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" > > > > class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/> > > <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" > > > > class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/> > > </messageReceivers> > > <!-- ================================================= --> > > <!-- Transport Ins --> > > <!-- ================================================= --> > > <transportReceiver name="http" > > > > class="org.apache.axis2.transport.http.SimpleHTTPServer"> > > <parameter name="port" locked="false">6060</parameter> > > <!--If you want to give your own host address for EPR > > generation--> > > <!--uncommet following paramter , and set as you required.--> > > <!--<parameter name="hostname" > > locked="false">http://myApp.com/ws</parameter>--> > > </transportReceiver> > > > > <transportReceiver name="tcp" > > > class="org.apache.axis2.transport.tcp.TCPServer"> > > <parameter name="port" locked="false">6061</parameter> > > <!--If you want to give your own host address for EPR > > generation--> > > <!--uncommet following paramter , and set as you required.--> > > <!--<parameter name="hostname" > > locked="false">tcp://myApp.com/ws</parameter>--> > > </transportReceiver> > > > > <!-- ================================================= --> > > <!-- Transport Outs --> > > <!-- ================================================= --> > > > > <transportSender name="tcp" > > > > class="org.apache.axis2.transport.tcp.TCPTransportSender"/> > > <transportSender name="local" > > > > class="org.apache.axis2.transport.local.LocalTransportSender"/> > > <transportSender name="jms" > > > class="org.apache.axis2.transport.jms.JMSSender"/> > > <transportSender name="http" > > > > class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> > > <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> > > <parameter name="Transfer-Encoding" > > locked="false">chunked</parameter> > > </transportSender> > > <transportSender name="https" > > > > class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> > > <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> > > <parameter name="Transfer-Encoding" > > locked="false">chunked</parameter> > > </transportSender> > > > > <!-- ================================================= --> > > <!-- Phases --> > > <!-- ================================================= --> > > <phaseOrder type="inflow"> > > <!-- System pre defined phases --> > > <phase name="Transport"> > > <handler name="RequestURIBasedDispatcher" > > > > class="org.apache.axis2.engine.RequestURIBasedDispatcher"> > > <order phase="Dispatch"/> > > </handler> > > <handler name="SOAPActionBasedDispatcher" > > > > class="org.apache.axis2.engine.SOAPActionBasedDispatcher"> > > <order phase="Dispatch"/> > > </handler> > > </phase> > > <phase name="Security"/> > > <phase name="PreDispatch"/> > > <phase name="Dispatch" > > class="org.apache.axis2.engine.DispatchPhase"> > > <handler name="AddressingBasedDispatcher" > > > > class="org.apache.axis2.engine.AddressingBasedDispatcher"> > > <order phase="Dispatch"/> > > </handler> > > > > <handler name="SOAPMessageBodyBasedDispatcher" > > > > class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"> > > <order phase="Dispatch"/> > > </handler> > > <handler name="InstanceDispatcher" > > > class="org.apache.axis2.engine.InstanceDispatcher"> > > <order phase="PostDispatch"/> > > </handler> > > </phase> > > <!-- System pre defined phases --> > > <!-- After Postdispatch phase module author or or service > > author can add any phase he want --> > > <phase name="OperationInPhase"/> > > </phaseOrder> > > <phaseOrder type="outflow"> > > <!-- user can add his own phases to this area --> > > <phase name="OperationOutPhase"/> > > <!--system predefined phase--> > > <!--these phase will run irrespective of the service--> > > <phase name="PolicyDetermination"/> > > <phase name="MessageOut"/> > > </phaseOrder> > > <phaseOrder type="INfaultflow"> > > <phase name="PreDispatch"/> > > <phase name="Dispatch" > > class="org.apache.axis2.engine.DispatchPhase"> > > <handler name="RequestURIBasedDispatcher" > > > > class="org.apache.axis2.engine.RequestURIBasedDispatcher"> > > <order phase="Dispatch"/> > > </handler> > > > > <handler name="SOAPActionBasedDispatcher" > > > > class="org.apache.axis2.engine.SOAPActionBasedDispatcher"> > > <order phase="Dispatch"/> > > </handler> > > > > <handler name="AddressingBasedDispatcher" > > > > class="org.apache.axis2.engine.AddressingBasedDispatcher"> > > <order phase="Dispatch"/> > > </handler> > > > > <handler name="SOAPMessageBodyBasedDispatcher" > > > > class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"> > > <order phase="Dispatch"/> > > </handler> > > <handler name="InstanceDispatcher" > > > class="org.apache.axis2.engine.InstanceDispatcher"> > > <order phase="PostDispatch"/> > > </handler> > > </phase> > > <!-- user can add his own phases to this area --> > > <phase name="OperationInFaultPhase"/> > > </phaseOrder> > > <phaseOrder type="Outfaultflow"> > > <!-- user can add his own phases to this area --> > > <phase name="OperationOutFaultPhase"/> > > <phase name="PolicyDetermination"/> > > <phase name="MessageOut"/> > > </phaseOrder> > > </axisconfig> > > ------------------------------------------------sec.properties------ > > -- > > -- > > ---------------- > > org.apache.ws.security.crypto.provider=org.apache.ws.security.compon > > en > > ts > > .crypto.Merlin > > org.apache.ws.security.crypto.merlin.keystore.type=jks > > org.apache.ws.security.crypto.merlin.keystore.password=clientstore > > org.apache.ws.security.crypto.merlin.file=D:\security\esb_test\clien > > ts > > to > > re.jks > > > > > > > > Thanks and regards, > > Sagar Kar > > Patni Computer Systems Inc. > > ' 434-845-0911 Ext. 4724 > > Visit us at: http://www.patni.com > > > > > > -------------------------------------------------------------------- > > - To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]