Brian - 

Thanks for the tip, as it turns out that was one of my
problems.  I am able to get the example to work so
long as I use the keystores provided with WSS4J.

One point of confusion here - I found out while
debugging, that Melin expected a file:
keys/x509.PFX.MSFT to be in classpath.  Even after
getting my crypto.properties file named correctly per
your recommendation, that file must still be in Axis'
classpath.

Can you give me some insight on what this file is? 
Where is the prop defined?

Thanks for you help, it is very much appreciated.

Shawn


--- Brian Nielsen <[EMAIL PROTECTED]> wrote:

> Shawn,
> 
> This is just a quick guess, but in the stacktrace it
> says:
> 
> ...
>
org.apache.ws.security.components.crypto.CredentialException:
> Proxy file (keys/x509.PFX.MSFT) not found.[]
> ..
> 
> It looks like the cert cant be found, maybe it
> doesn't locate the right
> crypto.properties file since in the source root
> there is a sample
> crypto.properties that has a key with that name. Try
> changing the filename
> of the crypto.properties and update the  
> 
> <parameter name="encryptionPropFile"
> value="crypto.properties" />
> 
> Aswell, then maybe you'll be able to see what goes
> wrong.
> 
> Good luck.
> 
> /Brian
> 
> 
> 
> -----Original Message-----
> From: Shawn McKinney [mailto:[EMAIL PROTECTED] 
> Sent: 27. april 2005 23:14
> To: Shawn McKinney; [email protected]
> Subject: Re: Problem running Simple UsernameToken
> Encrypt Example
> 
> Apologize for the "newbie" question here but I'm at
> a dead end.  I'm trying
> to run a simple scenario using WSS4J and Axis using
> WSDoAll handlers.  Have
> successfully  sent username token via SOAP, now want
> to encrypt the token
> before sending.  Here's what I've
> done:
> 
> 1. Create keystore using Sun Java keytool command:
> keytool -genkey -keyalg RSA -keystore xes.keystore
> -alias xeskey What is
> your first and last name?
>   [Unknown]:  Shawn McKinney
> What is the name of your organizational unit?
>   [Unknown]:  abc
> What is the name of your organization?
>   [Unknown]:  def
> What is the name of your City or Locality?
>   [Unknown]:  Xyz
> What is the name of your State or Province?
>   [Unknown]:  AX
> What is the two-letter country code for this unit?
>   [Unknown]:  US
> Is CN=Shawn McKinney, OU=abc, O=def, L=Xyz, ST=ZX,
> C=US correct?
>   [no]:  y
> 
> Enter key password for <xeskey>
>         (RETURN if same as keystore password):
> 
> 2. Copy keystore to
> <TomcatHome>/webapps/axis/WEB-INF/classes 
> 
> 3. Create crypto.properties file:
>
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.cry
> pto.Merlin
>
org.apache.ws.security.crypto.merlin.keystore.type=jks
>
org.apache.ws.security.crypto.merlin.keystore.password=changeit
>
org.apache.ws.security.crypto.merlin.keystore.alias=xeskey
>
org.apache.ws.security.crypto.merlin.alias.password=changeit
>
org.apache.ws.security.crypto.merlin.file=xes.keystore
> 
> 
> 4. Copy crypto.properties file to same place as # 2.
> 
> 5. Edit client side .wsdl file:
> 
> <requestFlow >
>  <handler
>  type=
> "java:org.apache.ws.axis.security.WSDoAllSender" >
>     <parameter name="action" value="UsernameToken
> Encrypt"/>
>     <parameter name="passwordCallbackClass"
> value="samples.message.PWCallback"/>
>         <parameter name="passwordType"
> value="PasswordText"
> />             
>     <parameter name="encryptionPropFile"
> value="crypto.properties" />                  
>     <parameter name="encryptionKeyIdentifier"
> value="X509KeyIdentifier" />
>               <parameter name="encryptionUser" value="xeskey" />
>     <parameter name="encryptionParts" 
>        
>
value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wss
> ecurity-secext-1.0.xsd}UsernameToken"
> />
>   </handler>
> 
> 6. Setup corresponding server side instance.  Note: 
> this is not relevant as client side is not working.
> 
> 7. Invoke the client test, get the following
> exception:
> 
> java.lang.reflect.InvocationTargetException
>         at
>
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at
>
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
> sorImpl.java:39)
>         at
>
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
> torAccessorImpl.java:27)
>         at
>
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>         at
>
org.apache.ws.security.components.crypto.CryptoFactory.loadClass(CryptoFacto
> ry.java:117)
>         at
>
org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFac
> tory.java:101)
>         at
>
org.apache.ws.axis.security.WSDoAllSender.loadEncryptionCrypto(WSDoAllSender
> .java:666)
>         at
>
org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:295)
>         at
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
> 32)
>         at
>
org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>         at
>
org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>         at
>
org.apache.axis.client.AxisClient.invoke(AxisClient.java:127)
>         at
>
org.apache.axis.client.Call.invokeEngine(Call.java:2754)
>         at
> org.apache.axis.client.Call.invoke(Call.java:2737)
>         at
> org.apache.axis.client.Call.invoke(Call.java:1773)
>         at
> samples.message.TestMsg.doit(TestMsg.java:125)
>         at
> samples.message.TestMsg.main(TestMsg.java:155)
> Caused by:
>
org.apache.ws.security.components.crypto.CredentialException:
> Proxy file (keys/x509.PFX.MSFT) not found.[]
>         at
>
org.apache.ws.security.components.crypto.Merlin.<init>(Merlin.java:108)
>         ... 17 more
> java.lang.InstantiationException:
> org.apache.ws.security.components.crypto.Merlin
>         at
> java.lang.Class.newInstance0(Class.java:293)
>         at
> java.lang.Class.newInstance(Class.java:261)
>         at
>
org.apache.ws.security.components.crypto.CryptoFactory.loadClass(CryptoFacto
> ry.java:125)
>         at
>
org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFac
> tory.java:101)
>         at
>
org.apache.ws.axis.security.WSDoAllSender.loadEncryptionCrypto(WSDoAllSender
> .java:666)
>         at
>
org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:295)
>         at
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
> 32)
>         at
>
org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>         at
>
org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>         at
>
org.apache.axis.client.AxisClient.invoke(AxisClient.java:127)
>         at
>
org.apache.axis.client.Call.invokeEngine(Call.java:2754)
>         at
> org.apache.axis.client.Call.invoke(Call.java:2737)
>         at
> org.apache.axis.client.Call.invoke(Call.java:1773)
>         at
> samples.message.TestMsg.doit(TestMsg.java:125)
>         at
> samples.message.TestMsg.main(TestMsg.java:155)
> Exception in thread "main" AxisFault
>  faultCode:
>
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode:
>  faultString: java.lang.RuntimeException:
> org.apache.ws.security.components.crypto.Merlin
> cannot create instance
>  faultActor:
>  faultNode:
>  faultDetail:
>        
>
{http://xml.apache.org/axis/}stackTrace:java.lang.RuntimeException:
>
org.apache.ws.security.components.crypto.Merlincannot
> create instance
>         at
>
org.apache.ws.security.components.crypto.CryptoFactory.loadClass(CryptoFacto
> ry.java:130)
>         at
>
org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFac
> tory.java:101)
>         at
>
org.apache.ws.axis.security.WSDoAllSender.loadEncryptionCrypto(WSDoAllSender
> .java:666)
>         at
>
org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:295)
>         at
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
> 32)
>         at
>
org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>         at
>
org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>         at
>
org.apache.axis.client.AxisClient.invoke(AxisClient.java:127)
>         at
>
org.apache.axis.client.Call.invokeEngine(Call.java:2754)
>         at
> org.apache.axis.client.Call.invoke(Call.java:2737)
>         at
> org.apache.axis.client.Call.invoke(Call.java:1773)
>         at
> samples.message.TestMsg.doit(TestMsg.java:125)
>         at
> samples.message.TestMsg.main(TestMsg.java:155)
> 
>        
> {http://xml.apache.org/axis/}hostname:smckinnhp
> 
> java.lang.RuntimeException:
> org.apache.ws.security.components.crypto.Merlin
> cannot create instance
>         at
>
org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
>         at
>
org.apache.axis.client.AxisClient.invoke(AxisClient.java:216)
>         at
>
org.apache.axis.client.Call.invokeEngine(Call.java:2754)
>         at
> org.apache.axis.client.Call.invoke(Call.java:2737)
>         at
> org.apache.axis.client.Call.invoke(Call.java:1773)
>         at
> samples.message.TestMsg.doit(TestMsg.java:125)
>         at
> samples.message.TestMsg.main(TestMsg.java:155)
> Caused by: java.lang.RuntimeException:
> org.apache.ws.security.components.crypto.Merlin
> cannot create instance
>         at
>
org.apache.ws.security.components.crypto.CryptoFactory.loadClass(CryptoFacto
> ry.java:130)
>         at
>
org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFac
> tory.java:101)
>         at
>
org.apache.ws.axis.security.WSDoAllSender.loadEncryptionCrypto(WSDoAllSender
> .java:666)
>         at
>
org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:295)
>         at
>
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
> 32)
>         at
>
org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>         at
>
org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>         at
>
org.apache.axis.client.AxisClient.invoke(AxisClient.java:127)
> 
> 
> 
> 
> 
> Obviously I've misconfigured something here.  Just
> trying to get a basic
> example up and running with an unsigned cert
> generated with Sun's keytool.  
> 
> Any input on this is most appreciated.
> 
> 
> 

Reply via email to