Skip to Content
0
Jul 11, 2006 at 07:11 AM

Using ICacheService in Web Dynpro DC

37 Views

Dear,

My Web Dynpro DC application allows users to upload several files. Since I don't want to keep all these files continuously in memory, during the complete user session, I want to temporarily save them to disk. Therefore I'm trying to use the ICacheService interface, com.sapportals.wcm.service.cache.ICacheServicehttps://media.sdn.sap.com/javadocs/NW04/SPS15/km/com/sapportals/wcm/service/cache/package-frame.html">com.sapportals.wcm.service.cache.ICacheService>, part of the Knowledge Management and Collaboration (KMC) API.

To be able to compile (the code below), I created a separate DC of type "External Library" that contains these 3 jar files: bc.sf.framework_api.jar, bc.sf.service.cache_api.jar and bc.util.public_api.jar. These 3 jar files where obtained from these 3 par files: com.sap.netweaver.bc.sf.par.bak, com.sap.netweaver.bc.sf.service.par.bak and com.sap.netweaver.bc.util.par.bak. It took a little bit of searching to find the required jar files, but anyway, everything compiles fine... The External Library only has a public part of type API.

As you may have guessed, my problem is to get this working at runtime... I can't deploy the External Library DC (using a public part of type assembly) together with my Web Dynpro, because that causes class loader issues. After all, these jar files are already deployed on the server. But if I don't define any runtime dependency or reference, I get a java.lang.ClassNotFoundException.

<b>The question is: how to define the runtime reference(s)?</b>

Should I define a Web Dynpro Sharing Reference like "PORTAL:sap.com/com.sap.km.bs.sf.service"? Then how can I obtain a reference to CacheServiceFactory?

FYI, we're using SAP NetWeaver 2004 SPS 15.

FYI, the relevant code I (think I) need looks like

ICache cache = CacheServiceFactory.getInstance().getCache("CACHE_ID");

Any help is greatly appreciated!

Kind regards,

/Sigiswald