on 04-17-2009 8:13 AM
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.