Skip to Content

Cannot access PCD object from WD (DynPage works fine...)

Hi all,

I wrote this code in a dynpage:

Hashtable env = new Hashtable(); 
env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY); 
env.put(Context.SECURITY_PRINCIPAL, req.getUser());                               
env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_ADMINISTRATION);
 
InitialContext initialContext = null; 

initialContext = new InitialContext(env);
String iViewID = "pcd:portal_content/Development/ClickMe";
			 
IAdminBase result =(IAdminBase)initialContext.lookup(iViewID); 
IAttributeSet myIview = (IAttributeSet) 

result.getImplementation(IAdminBase.ATTRIBUTE_SET);
			
res.write("1 --> " + myIview.getAttribute("com.sap.portal.pcd.gl.CreatedAt") + "<BR>");
res.write("2 --> " + myIview.getAttribute("com.sap.portal.reserved.iview.IsolationMode"));

I use the following jars in my classpath:

com.sap.portal.ivs.api_landscape_api.jar

com.sap.portal.ivs.api_portalpcm_api.jar

com.sap.portal.pcm.admin.apiservice_api.jar

gl_api.jar

prtjndisupport.jar

and added the following sharing reference to portalapp.xml:

com.sap.portal.pcm.admin.apiservice

I wrote the same code in my WD application.

Instead of req.getUser() I used WDClientUser.getCurrentUser().getSAPUser()

I added the following sharing reference: PORTAL:sap.com/com.sap.portal.pcm.admin.apiservice

The code compiles but when I run it I get:

java.lang.NoClassDefFoundError: com/sapportals/portal/prt/jndisupport/InitialContext

I copied the 'prtjndisupport.jar' to the lib folder, compile and run again and then I got: java.lang.NoClassDefFoundError: EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap

the class 'ConcurrentReaderHashMap' is under 'concurrency.jar' but when I added this jar under the lib folder and run, the TLN, DTN were gone - see snapshot (I needed to restart the server).

http://img129.imageshack.us/img129/4638/errjndiwz3.jpg

I guess something is wrong in the runtime.

What jars/sharing references do I need?

My portal is EP6 SP17.

The J2EE/Web Dynpro are under the same machine.

Thanks,

Omri

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer