cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.NoClassDefFoundError: com/sapportals/wcm/repository/ResourceExcep

Former Member
0 Kudos

Hi,

When I try to execute the following piece of code in my PDK appln:

IUser sapUser = (IUser)request.getUser();

ResourceContext irCtx = new ResourceContext(sapUser);

rid = RID.getRID(path);

ICollection currentFolder =(ICollection) ResourceFactory.getInstance().getResource(rid,irCtx);

getting the error:

#1.5 #001321CCE41F002900000009000109D0000467BA8A43814B#1239950788234#com.sap.portal.prt.runtime#sap.com/irj#com.sap.portal.prt.runtime#Administrator#17051##n/a##46b100502b1b11de8eb0001321cce41f#SAPEngine_Application_Thread[impl:3]_41##0#0#Error##Java###12:16_17/04/09_0028_21412850

[EXCEPTION]

#1#java.lang.NoClassDefFoundError: com/sapportals/wcm/repository/ResourceException

My Portalapp.xml file has the following Sharing References:

<property name="SharingReference" value="com.sap.netweaver.bc.rf,knowledgemanagement,com.sap.portal.runtime.config,com.sap.netweaver.bc.util,com.sap.netweaver.bc.crt,com.sap.netweaver.bc.rf,usermanagement,com.sap.netweaver.bc.rf.service,com.sap.netweaver.bc.util"/>

How can I correct this?

Thanks and Regards,

Shyam.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member206159
Active Contributor
0 Kudos

Try add the following PORTAL:sap.com/com.sap.km.application under properties->webdynpro refernce->sharing reference

Also check the below thread that will help you.

Raghu

Former Member
0 Kudos

Hi,

This is not a webdynpro application. This is a pdk application.

Thanks and Regards,

Shyam.

Former Member
0 Kudos

This has worked for me:

<application-config>

<property name="PrivateSharingReference" value="com.sap.portal.htmlb,knowledgemanagement"/>

</application-config>

Former Member
0 Kudos

Hi Nicholls,

I've tried this. But its the same error again. Pls help...

Thanks and Regards,

Shyam.

Former Member
0 Kudos

Hello

I used this code in a service (therefor the cmadmin_service user). This worked for me..

Did you use the right classes?


import com.sapportals.portal.security.usermanagement.IUser;
import com.sapportals.wcm.repository.IResource;
import com.sapportals.wcm.repository.IResourceContext;

RID bronFolder = RID.getRID(manager.getPrefix());
IUser user = WPUMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");
IResourceContext context = new ResourceContext(user);
IResource res = resourseFactory.getResource(bronFolder, context);

And a better way to write that code is getting your resource, check whether it is a collection and then cast it..

Christof

Former Member
0 Kudos

Hi Christof,

After trying your code, I am getting the following error:

#1.5 #001321CCE41F001900000003000109D0000467F44E62A8DD#1240198891734#com.sap.portal.prt.runtime#sap.com/irj#com.sap.portal.prt.runtime#Administrator#42538##n/a##fe6470902d5c11deb830001321cce41f#SAPEngine_Application_Thread[impl:3]_23##0#0#Error##Java###09:11_20/04/09_0034_21412850

[EXCEPTION]

#1#java.lang.NoClassDefFoundError: com/sapportals/portal/security/usermanagement/UserManagementException

What could be the reason?

Thanks and Regards,

Shyam.

Former Member
0 Kudos

Hi

To me, it seems he ain't knowing the exception classes (in both cases). So you could try adding them, the pars, into your project. Next thing to do is referencing to these libs in your project, so you're sure he'll find the classes.

(I don't have that much experience - 1 year -, but was able to do some nice things already )

Christof