Hi Xinjun , If you are interested we already have a wss4j based security module in Axis2. (Which has a sender handler and a receiver handler) Code is available here: https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/security/
When the security module is engaged on a certain service it will be providing the classloader of the AxisService to WSS4J and the properties file are expected to be in service archive. See: org.apache.axis2.security.handler.WSDoAllHandler#getClassLoader() Thanks, Ruchith On 3/20/06, Xinjun Chen <[EMAIL PROTECTED]> wrote: > > > Hi, > When I write simple SecurityHandler use the StAX and WSS4J in Axis2, the > exception appended occurs. > I tried the following testings: > 1. Put the crypto.properties and keys/x509.PFX.MSFT are in the same folder > as the TestSecurity.class. I still get the exception that the > crypto.properties cannot be loaded. > 2. I tried to load the crypto.properties file from inside the > TestSecurity.class, the property file can be loaded. > 3. I tried to put the path of the directory which contains crypto.properties > file in the classpath (set the user Environment Variable in Windows), and I > still failed to load the crypto.properties. > 3. I tried to put the path of the crypto.properties file in the classpath > (set the user Environment Variable in Windows), and I failed to load the > crypto.properties again. > > Could anyone point me a way out? > PS: accidentally I posted this question in Axis maillist just now. Please > forgive me if you have read the question in Axis-user maillist. > > > Exception in thread "main" > java.lang.ExceptionInInitializerError > at > com.crimsonlogic.wsgate.core.ws.handler.test.TestSecurity.test(TestSecurity.java:132) > at > com.crimsonlogic.wsgate.core.ws.handler.test.TestSecurity.main > (TestSecurity.java:46) > Caused by: java.lang.RuntimeException: CryptoFactory: Cannot load > properties: crypto.properties > at > org.apache.ws.security.components.crypto.CryptoFactory.getProperties(CryptoFactory.java:150) > at > org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:96) > at > org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:54) > at > com.crimsonlogic.wsgate.core.ws.handler.security2.SenderHandler > .<clinit>(SenderHandler.java:34) > ... 2 more > > > Regards, > > Xinjun --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
