cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error after adding jar files

Former Member
0 Kudos

Hello,

I want to use KM APIs in my webdynpro application for which i added the following Jar files in my project :

prtapi.jar

bc.rf.framework_api.jar

bc.rf.global.service.urlgenerator_api.jar

bc.sf.framework_api.jar

bc.util.public_api.jar

com.sap.security.api.ep5.jar

but when i am trying to use 'com.sapportals.portal.security.usermanagement.IUser' in my code i am getting the following complite time error:

com.sapportals cannot be resolved or is not a type...

Please help.

Regards,

Shikhil

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member185086
Active Contributor
0 Kudos

Hi

I assume that you project are in DC level (Not a simple WD project) ,Place all the jar in External Lib Dc .

[Here is help for both 7.0 and 7.1|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417100)ID0696977050DB21017738670101569258End?blog=/pub/wlg/12177]

else if you are put these jar at Java build bath then at same place you will find one more option that is Webdynpro reference

put the exect name of the used jar after deployment .

[Other help|;

Best Regards

Satish Kumar

Former Member
0 Kudos

Hi Shikhil,

You need to add these 2 jars to your project:

com.sap.security.api.jar

com.sap.security.api.perm.jar

Regards.

Rajat

Former Member
0 Kudos

Hi,

Please add "com.sap.security.api.jar" file and Porject properties ->webdynpro reference>sharing refernece--->PORTAL:sap.com/com.sap.km.application

the import statement should be

import com.sapportals.portal.security.usermanagement.IUser;

after doing this close your project and reopen and rebuild it

Regards,

Manivannan P

Former Member
0 Kudos

Hello ,

Thanks for the reply....I did whatever you said but on writing the Import Statement as :

import com.sapportals.portal.security.usermanagement.IUser;

I get the error as :

The import com.sapportals cannot be resolved

Please help.

Regards,

Shikhil

Former Member
0 Kudos

Hi,

The jar files which you have added seems to be different. Please add the below jar file and check:

com.sap.security.api.jar

Regards,

Ponraj M

Former Member
0 Kudos

Ponraj,

Thanks for the reply...that jar file is already added in the Webdynpro Project.....but it seems like somehow the other files which i mentioned earlier are getting removed from the project ...what can be the reason for it...

Please help.

Regards,

Shikhil

Former Member
0 Kudos

Hi,

Are you using "Add Variable" and extending the WD_RUNTIME option with whatever lib you want?

Regards,

Daniel

Former Member
0 Kudos

Hi Shikhil,

Please let me know whether it is a DC or a normal project and just list the steps on the way you have added all those jar files.

Regards,

Ponraj M

Former Member
0 Kudos

Hello Daniel,

Thanks for the reply....I didn't add the Jar files using the 'Add Variable' option you mentioned....since they are not available at that location...is there a way to add the files from there...? i downloaded the files from Portal -> System Admin.-> Support -> Portal Runtime....

It's a DC....and the way i have added the jar files is ....Right Click on Project -> Properties -> Java Build Path -> Add External JARs and then selected the Jar files...

Please help..

Regards,

Shikhil

Edited by: Shikhil Arora on Nov 10, 2009 9:34 PM

Former Member
0 Kudos

Hi,

I'm not sure about all jars you are trying to use. I never really needed to work with KM or UME API's in here. However, I suggest you talking a look into what is bundled with NWDS since most of these common API's are in there.

Try that:

- Right-Click your Project, Select "Properties";

- Java Build Path, Tab "Libraries";

- Add Variable, go all the way down and select (one click!) "WD_RUNTIME";

- "Extend" button will now be enabled. Click-it and select whatever lib you want;

com.sap.security_2.0.0 looks promising in your case. You will find "com.sap.security.api.jar" in there.

Regards,

Daniel

Former Member
0 Kudos

Hi Shikhil,

If its a DC project you cant add the jar files by simply clicking on Add external jars. You have to build a separate DC of type external library including all the jar files and then you have to create public parts for the jar files. Then these public parts can be added into the DC where you need to access those jar files.

Regards,

Ponraj M

Former Member
0 Kudos

Ponraj,

Thanks for the reply....i tried to add the jar files using the 'External Library' DC....still getting the following error in the View Controller -> Implementation Tab:

com.sapportals cannot be resolved

at the following line:

import com.sapportals.portal.security.usermanagement.IUser;

Please help.

Regards,

Shikhil

Former Member
0 Kudos

Hi Shikhil,

IUser is already available as Public parts within DC environment. Just right click on Used DC's and navigate to SAP-JEE -> com.sap.security.api.sda ->DC Metadata -> Public parts and then select default within it. Make sure you have checked both build and run time dependency. Now after adding this PP just organize your imports once from your project. This will add all the necessary imports and you will be able to use IUser.

Regards,

Ponraj M

Former Member
0 Kudos

Ponraj,

Thanks for the reply....i am able to use the com.sap.security.api.IUser ....and i have already added the Used DC for it....but when i am trying to use com.sapportals.portal.security.usermanagement.IUser ...it says com.sapportals cannot be resolved or is not a type...even though i have added the Jar Files for it....

I get the same error for ResourceContext and ICollection even if i have added the Jar files for them.

Please help.

Regards,

Shikhil

Edited by: Shikhil Arora on Nov 13, 2009 3:16 PM

Former Member
0 Kudos

Hi Shikhil,

Try doing one more thing. The place where you are using IUser, try giving the complete package name wherver you are referncing the IUser.

Regards,

Ponraj M

Former Member
0 Kudos

Ponraj,

I have tried to reference the complete package name where referencing IUser still it gives me the same error...

Pls help.

Regards,

Shikhil