473,699 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to load a .properties file in felix for enable Ws-Security using CXF WSS4J?

3 New Member
My MetaDate.xml file is:-

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Copyright (c) Orga Systems GmbH and/or its affiliates, 2011 - 2012 All 
  3.     Rights Reserved. The software contained on this media is proprietary to and 
  4.     embodies the confidential technology of the copyright holder. Possession, 
  5.     use, duplication or dissemination of the software and media is authorized 
  6.     only pursuant to a valid written license from the copyright holder. This 
  7.     copyright notice must appear in all copies of this software. -->
  8. <beans xmlns="http://www.springframework.org/schema/beans"
  9.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core"
  10.     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  11.                         http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
  12.                         http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
  13.  
  14.     <!-- webservice bean defintions can refer to parent "webserviceImplParent" 
  15.         (defined in ws-core-context.xml) to inherit injection of mandatory dependecies 
  16.         and init-method. Can be overridden here if required -->
  17.  
  18.     <bean id="getAccountImpl" class="com.orga.oslee.bsg.ra.ws.GetAccountImpl" parent="webserviceImplParent" />
  19.  
  20.  
  21.     <bean id="ServerPasswordCallback" class="com.orga.oslee.bsg.ra.ws.ServerPasswordCallback" />
  22.  
  23.     <jaxws:endpoint xmlns:tns="http://oslee.orga.com/bsg/ra/ws"
  24.         id="getAccount" implementor="#getAccountImpl"
  25.         wsdlLocation="/data/AJENA/Sec_Aks/JavaProducts_oslee_bsg_dev_R1.1_security_test_Sec_Aks/install/conf/com.orga.oslee.ra.bsgws.BSGStandardWebservice-dev-R1.0.0/BSGAccountServices.wsdl"
  26.         endpointName="tns:GetAccountPort" serviceName="tns:GetAccountService"
  27.         address="http://kolps12:33333/getaccount">
  28.  
  29.  
  30.         <jaxws:outInterceptors>
  31.             <ref bean="TimestampSignEncrypt_Response" />
  32.         </jaxws:outInterceptors>
  33.  
  34.  
  35.         <jaxws:inInterceptors>
  36.             <ref bean="TimestampSignEncrypt_Request" />
  37.         </jaxws:inInterceptors>
  38.  
  39.     </jaxws:endpoint>
  40.  
  41.  
  42.     <!-- WSS4JInInterceptor for decrypting and validating the signature of the 
  43.         SOAP request. -->
  44.     <bean id="TimestampSignEncrypt_Request" class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
  45.         <constructor-arg>
  46.             <map>
  47.                 <entry key="action" value="Timestamp Signature Encrypt" />
  48.                 <entry key="signaturePropFile" value="serviceKeystore.properties" />
  49.                 <entry key="decryptionPropFile" value="serviceKeystore.properties" />
  50.                 <entry key="passwordCallbackClass" value="com.orga.oslee.bsg.ra.ws.ServerPasswordCallback" />
  51.             </map>
  52.         </constructor-arg>
  53.     </bean>
  54.  
  55.  
  56.  
  57.     <!-- WSS4JOutInterceptor for encoding and signing the SOAP response. -->
  58.     <bean id="TimestampSignEncrypt_Response" class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
  59.         <constructor-arg>
  60.             <map>
  61.                 <entry key="action" value="Timestamp Signature Encrypt" />
  62.                 <entry key="user" value="myservicekey" />
  63.                 <entry key="signaturePropFile" value="serviceKeystore.properties" />
  64.                 <entry key="encryptionPropFile" value="serviceKeystore.properties" />
  65.                 <entry key="encryptionUser" value="useReqSigCert" />
  66.                 <entry key="passwordCallbackClass" value="com.orga.oslee.bsg.ra.ws.ServerPasswordCallback" />
  67.                 <entry key="signatureParts"
  68.                     value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body"/>
  69.                 <entry key="encryptionParts"
  70.                     value="{Element}{http://www.w3.org/2000/09/xmldsig#}Signature;{Content}{http://schemas.xmlsoap.org/soap/envelope/}Body" />
  71.                 <entry key="encryptionSymAlgorithm" value="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
  72.             </map>
  73.         </constructor-arg>
  74.     </bean>
  75. </beans>
  76.  
  77.  

My Keystore.proper ties file was:-

Expand|Select|Wrap|Line Numbers
  1. org.apache.ws.security.crypto.merlin.keystore.file=/data/AJENA/Sec_Aks/JavaProducts_oslee_bsg_dev_R1.1_security_test_Sec_Aks/Component/build/ORGA/OSLEE/ws-standard/src/com/orga/oslee/bsg/ra/ws/temp/keys/Keystore.jks
  2. org.apache.ws.security.crypto.merlin.keystore.password=abpass
  3. org.apache.ws.security.crypto.merlin.keystore.type=jks
  4. org.apache.ws.security.crypto.merlin.keystore.alias=myservicekey
  5.  
  6.  
Here I put my Keystore.proper ties file in src folder and the key.jks file in a temp/keys folder which is under src folder of my Web Service project.


But my problem is when ever I am trying to send any request using SOAP UI it will show the error i.e. :-


org.apache.cxf. binding.soap.So apFault: General security error (Cannot load the resource serviceKeystore .properties)
at org.apache.cxf. ws.security.wss 4j.WSS4JInInter ceptor.createSo apFault(WSS4JIn Interceptor.jav a:643)
at org.apache.cxf. ws.security.wss 4j.WSS4JInInter ceptor.handleMe ssage(WSS4JInIn terceptor.java: 308)
at org.apache.cxf. ws.security.wss 4j.WSS4JInInter ceptor.handleMe ssage(WSS4JInIn terceptor.java: 85)
at org.apache.cxf. phase.PhaseInte rceptorChain.do Intercept(Phase InterceptorChai n.java:263)
at org.apache.cxf. transport.Chain InitiationObser ver.onMessage(C hainInitiationO bserver.java:12 3)
at org.apache.cxf. transport.http_ jetty.JettyHTTP Destination.ser viceRequest(Jet tyHTTPDestinati on.java:323)
at org.apache.cxf. transport.http_ jetty.JettyHTTP Destination.doS ervice(JettyHTT PDestination.ja va:289)
at org.apache.cxf. transport.http_ jetty.JettyHTTP Handler.handle( JettyHTTPHandle r.java:72)

Caused by: org.apache.ws.s ecurity.WSSecur ityException: General security error (Cannot load the resource serviceKeystore .properties)
at org.apache.ws.s ecurity.compone nts.crypto.Cryp toFactory.getPr operties(Crypto Factory.java:24 3)
at org.apache.ws.s ecurity.compone nts.crypto.Cryp toFactory.getIn stance(CryptoFa ctory.java:168)
at org.apache.cxf. ws.security.wss 4j.AbstractWSS4 JInterceptor.lo adCryptoFromPro pertiesFile(Abs tractWSS4JInter ceptor.java:202 )
at org.apache.ws.s ecurity.handler .WSHandler.load Crypto(WSHandle r.java:805)
at org.apache.ws.s ecurity.handler .WSHandler.load SignatureCrypto (WSHandler.java :726)
at org.apache.ws.s ecurity.handler .WSHandler.deco deSignaturePara meter2(WSHandle r.java:1090)
at org.apache.ws.s ecurity.handler .WSHandler.doRe ceiverAction(WS Handler.java:27 2)
at org.apache.cxf. ws.security.wss 4j.WSS4JInInter ceptor.handleMe ssage(WSS4JInIn terceptor.java: 242)


According to a document I also tried by inserting the class folder of key.jks class in the Libraries of my Web Service project.

Please tell me what to do to resolve this?
Jul 19 '12 #1
0 2372

Sign in to post your reply or Sign up for a free account.

Similar topics

8
11450
by: Paul | last post by:
Hello, I've been reading up on security in Java Applets and whilst I understand the concept, I can't successfully get my applet to read a file on my local machine. I discovered from http://java.sun.com/sfaq/#read: ----- Sun's appletviewer allows applets to read files that are named on the access control list for reading. The access control list for reading is null by default, in the JDK. You can allow applets to read directories or files...
3
180323
by: Aaron Boxer | last post by:
Hello, My application is using a jar file MyJar.jar that uses log4j (I have the latest release of log4j). I have put both MyJar.jar and log4j.jar in a directory in my classpath. I have also put the file "log4j.properties" into this same directory. My log4j.properties file reads:
2
15644
by: Sachin | last post by:
Hi All, Is there any class which provides support file properties file similare to java Properties? Basically I looking for reading/writing properties file in C# of format attrName=Value pair Thanks in advance
3
6239
by: Atara | last post by:
I use the following code to load xml file: Dim srcXml As String = pathDataFiles & "test.xml" Dim XmlDoc As New Xml.XmlDocument XmlDoc.Load(srcXml) If my xml file starts with the line - <?xml version="1.0" ?>
0
1060
by: shapper | last post by:
Hello, I am loading a xml file as follows: docXML.Load(server.MapPath("MyFile.XML")) However, instead of using server.MapPath("MyFile.XML") I want to load the file using the siteMapProvider: <providers>
2
1434
by: Mayilsamy | last post by:
hi , I need the information about How to load the file in richtextbox control using vb.net .
5
11745
by: sajithamol | last post by:
I'm trying to read a properties file using BufferedInputStream and getResourceAsStream(),but getting "java.io.IOException: Stream closed' exception. My properties file is not set in the classpath, I even tried by incuding the file as a jar in the classpath but invain. My code snippet is: BufferedInputStream bufferedinputstream =new BufferedInputStream(getClass().getClassLoader().getResourceAsStream(s)); where 's' is the name of the...
3
2841
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I have a asp.net app, in the page there is a scan activex which could scan and save a jpg file in client harddisk. How could we access and display this jpg file on the fly using js in the client IE? Thanks, -Billy zhang
1
1883
by: cathy25 | last post by:
Hi, I am using the following code to read a file. DirectoryInfo dir = new DirectoryInfo(@"C:\"); try { if (dir.Exists) { FileInfo csvfiles = dir.GetFiles("*.csv");
0
8692
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9040
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8924
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7756
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4633
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3060
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2353
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.