cancel
Showing results for 
Search instead for 
Did you mean: 

Error trying to create object of Class IUSer

Former Member
0 Kudos

I am trying to put in a code that is based on Rle assignment for the user on the portal.

i am trying to put this code

IWDClientUser user = WDClientUser.getCurrentUser();

IUser userID = user.getSAPUser();

String Userrole=new String();

for (Iterator iter = userID.getRoles(true); iter.hasNext();) {

IRole role = UMFactory.getRoleFactory().getRole((String) iter.next());

Userrole=role.getUniqueName();

}

But there is an error in line IUser userID = user.getSAPUser();.

when i say add imports it is not adding the packages required to cretae an object of this class.

When i try to manually import

com.sap.security.api.sda

but am not able to.. any ideas how to acheive this and assist me if i am doing anything worng?

regards

Sam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Austin,

Sorry for asking the basic questions.This is what i am doing. I went to DC, right clicked on it and selected properties. Then select JAva build path opition and then select Libraries. There i click on Add External JARs and select com.sap.security.api.jar.

and click ok.

do i need to do anything else here.

And when ever i come back after a while i see that the external

Jar is missing. IT looks weird. I have to keep on importing the external JAr after every few operations.

Not sure what the problem could be

thanks a lto for your patience in helping me ou ton this issue

Below is the erro rmessage i get when trying to activate

***************

Build number assigned: 165853

Change request state from QUEUED to PROCESSING

ACTIVATION request in Build Space "DJI_EMXSSTR_D" at Node ID: 37,961,750

[id: 165,817; parentID: 0; type: 4]

[options: FORCE ACTIVATE PREDECESSORS]

REQUEST PROCESSING started at 2007-04-17 22:13:46.500 GMT

===== Pre-Processing =====

Waiting 19 ms

List of activities to be activated:

1 activity in compartment "sap.com_SAP_ESS_1"

ESS_lea_1005

[seq. no 272][created by RJOGAM at 2007-04-17 18:14:26.0][ID 06c9c16aed2511dbafd000306e5ddf50]

Analyse dependencies to predecessor activities... started at 2007-04-17 22:13:47.253 GMT

Analysing predecessors in compartment "sap.com_SAP_ESS_1"

The following predecessor has to be added to request 165817:

"XSS_lea_selectionlistview_1003" [seq. no 271][created by RJOGAM at 4/17/07 1:34 PM][ID 53225486ec4c11db812200306e5ddf50]

Analyse dependencies to predecessor activities... finished at 2007-04-17 22:13:47.434 GMT and took 181 ms

Analyse activities... started at 2007-04-17 22:13:47.434 GMT

Development line state verification started at 2007-04-17 22:13:47.509 GMT

Verification of the development line [ws/EMXSSTR/sap.com_SAP_ESS/dev/active/] SUCCEEDED

Development line state verification finished at 2007-04-17 22:13:47.540 GMT and took 31 ms

Cache verification, level 2 (Comparison of attributes) started at 2007-04-17 22:13:47.540 GMT

Verification of the following object:

[DC: sap.com/ess/lea, group: 0] SUCCEEDED

Cache verification finished at 2007-04-17 22:13:47.617 GMT and took 77 ms

Analyse dependencies to predecessor activities... finished at 2007-04-17 22:13:47.629 GMT and took 144 ms

SKIP : Development Component "sap.com/ess/lea"

1 component to be build in compartment "sap.com_SAP_ESS_1"

Analyse activities... finished at 2007-04-17 22:13:47.680 GMT and took 246 ms

Calculate all combinations of components and variants to be built...

"sap.com/ess/lea" variant "default"

Prepare build environment in the file system... started at 2007-04-17 22:13:47.852 GMT

Synchronize development configuration... finished at 2007-04-17 22:13:47.862 GMT and took 10 ms

Synchronize component definitions... finished at 2007-04-17 22:13:47.883 GMT and took 20 ms

Synchronize sources...

Development line state verification started at 2007-04-17 22:13:47.970 GMT

Verification of the development line [ws/EMXSSTR/sap.com_SAP_ESS/dev/active/] SUCCEEDED

Development line state verification finished at 2007-04-17 22:13:48.011 GMT and took 41 ms

Cache verification, level 2 (Comparison of attributes) started at 2007-04-17 22:13:48.011 GMT

Verification of the following object:

[DC: sap.com/ess/lea, group: 1] FAILED

Comparison of cache items on the paths:

[/usr/sap/DJI/JC03/j2ee/cluster/server0/temp/CBS/33/.CACHE/1195/DCs/sap.com/ess/lea/_comp/src/packages/com/sap/xss/hr/lea/selectionlist/SelectionListView.wdcontroller]

[ws/EMXSSTR/sap.com_SAP_ESS/dev/active/DCs/sap.com/ess/lea/_comp/src/packages/com/sap/xss/hr/lea/selectionlist/SelectionListView.wdcontroller]

on verification level 2 FAILED due to the following reason:

Difference in attribute 'Timestamp' [Thu Mar 01 16:49:43 EST 2007][Thu Mar 01 16:49:44 EST 2007]

Comparison of cache items on the paths:

[/usr/sap/DJI/JC03/j2ee/cluster/server0/temp/CBS/33/.CACHE/1195/DCs/sap.com/ess/lea/_comp/src/packages/com/sap/xss/hr/lea/selectionlist/SelectionListView.wdcontroller.xlf]

[ws/EMXSSTR/sap.com_SAP_ESS/dev/active/DCs/sap.com/ess/lea/_comp/src/packages/com/sap/xss/hr/lea/selectionlist/SelectionListView.wdcontroller.xlf]

on verification level 2 FAILED due to the following reason:

Difference in attribute 'Timestamp' [Thu Mar 01 16:49:43 EST 2007][Thu Mar 01 16:49:44 EST 2007]

Comparison of cache items on the paths:

[/usr/sap/DJI/JC03/j2ee/cluster/server0/temp/CBS/33/.CACHE/1195/DCs/sap.com/ess/lea/_comp/src/packages/com/sap/xss/hr/lea/selectionlist/SelectionListView.wdview]

[ws/EMXSSTR/sap.com_SAP_ESS/dev/active/DCs/sap.com/ess/lea/_comp/src/packages/com/sap/xss/hr/lea/selectionlist/SelectionListView.wdview]

on verification level 2 FAILED due to the following reason:

Difference in attribute 'Timestamp' [Thu Mar 01 16:49:43 EST 2007][Thu Mar 01 16:49:44 EST 2007]

Comparison of cache items on the paths:

[/usr/sap/DJI/JC03/j2ee/cluster/server0/temp/CBS/33/.CACHE/1195/DCs/sap.com/ess/lea/_comp/src/packages/com/sap/xss/hr/lea/selectionlist/SelectionListView.wdview.xlf]

[ws/EMXSSTR/sap.com_SAP_ESS/dev/active/DCs/sap.com/ess/lea/_comp/src/packages/com/sap/xss/hr/lea/selectionlist/SelectionListView.wdview.xlf]

on verification level 2 FAILED due to the following reason:

Difference in attribute 'Timestamp' [Thu Mar 01 16:49:43 EST 2007][Thu Mar 01 16:49:44 EST 2007]

Cache verification finished at 2007-04-17 22:13:54.824 GMT and took 6 s 813 ms

Synchronize sources... finished at 2007-04-17 22:14:02.175 GMT and took 14 s 292 ms

Synchronize used libraries...

public part "default" of component "sap.com/tc/col/api" ... OK

[PP "default" of DC 226 variant "default"][SC 1196][last successful build: 162348]

public part "default" of component "sap.com/tc/cmi" ... OK

[PP "default" of DC 217 variant "default"][SC 1196][last successful build: 164158]

public part "default" of component "sap.com/tc/ddic/ddicruntime" ... OK

[PP "default" of DC 218 variant "default"][SC 1196][last successful build: 164158]

public part "default" of component "sap.com/tc/wd/webdynpro" ... OK

[PP "default" of DC 196 variant "default"][SC 1192][last successful build: 162348]

public part "default" of component "sap.com/tc/logging" ... OK

[PP "default" of DC 184 variant "default"][SC 1192][last successful build: 162348]

public part "default" of component "sap.com/com.sap.aii.proxy.framework" ... OK

[PP "default" of DC 221 variant "default"][SC 1196][last successful build: 164158]

public part "default" of component "sap.com/com.sap.aii.util.misc" ... OK

[PP "default" of DC 222 variant "default"][SC 1196][last successful build: 162348]

public part "default" of component "sap.com/com.sap.mw.jco" ... OK

[PP "default" of DC 126 variant "default"][SC 1192][last successful build: 162348]

public part "FloorplanManager" of component "sap.com/pcui_gp/xssfpm" ... OK

[PP "FloorplanManager" of DC 223 variant "default"][SC 1193][last successful build: 162556]

public part "FloorplanManager" of component "sap.com/pcui_gp/xssfpm" ... OK

[PP "FloorplanManager" of DC 223 variant "default"][SC 1193][last successful build: 162556]

public part "FloorplanManager" of component "sap.com/pcui_gp/xssfpm" ... OK

[PP "FloorplanManager" of DC 223 variant "default"][SC 1193][last successful build: 162556]

public part "FloorplanManager" of component "sap.com/pcui_gp/xssfpm" ... OK

[PP "FloorplanManager" of DC 223 variant "default"][SC 1193][last successful build: 162556]

public part "FPMUtils" of component "sap.com/pcui_gp/xssutils" ... OK

[PP "FPMUtils" of DC 224 variant "default"][SC 1193][last successful build: 162556]

public part "FPMUtils" of component "sap.com/pcui_gp/xssutils" ... OK

[PP "FPMUtils" of DC 224 variant "default"][SC 1193][last successful build: 162556]

public part "FPMUtils" of component "sap.com/pcui_gp/xssutils" ... OK

[PP "FPMUtils" of DC 224 variant "default"][SC 1193][last successful build: 162556]

public part "FPMUtils" of component "sap.com/pcui_gp/xssutils" ... OK

[PP "FPMUtils" of DC 224 variant "default"][SC 1193][last successful build: 162556]

public part "default" of component "sap.com/tc/ddic/metamodel/content" ... OK

[PP "default" of DC 219 variant "default"][SC 1196][last successful build: 162348]

public part "default" of component "sap.com/tc/wdp/metamodel/content" ... OK

[PP "default" of DC 220 variant "default"][SC 1196][last successful build: 162348]

public part "default" of component "sap.com/com.sap.exception" ... OK

[PP "default" of DC 123 variant "default"][SC 1192][last successful build: 162348]

public part "default" of component "sap.com/com.sap.exception" ... OK

[PP "default" of DC 123 variant "default"][SC 1192][last successful build: 162348]

public part "FcTmDataExchange" of component "sap.com/pcui_gp/tecl" ... OK

[PP "FcTmDataExchange" of DC 230 variant "default"][SC 1193][last successful build: 162556]

public part "FcTmDataExchange" of component "sap.com/pcui_gp/tecl" ... OK

[PP "FcTmDataExchange" of DC 230 variant "default"][SC 1193][last successful build: 162556]

public part "FcTmDataExchange" of component "sap.com/pcui_gp/tecl" ... OK

[PP "FcTmDataExchange" of DC 230 variant "default"][SC 1193][last successful build: 162556]

Synchronize used libraries... finished at 2007-04-17 22:14:06.635 GMT and took 4 s 459 ms

The source cache is in INCONSISTENT state for at least one of the request DCs. The build might produce incorrect results.

Prepare build environment in the file system... finished at 2007-04-17 22:14:06.635 GMT and took 18 s 783 ms

===== Pre-Processing ===== finished at 2007-04-17 22:14:06.636 GMT and took 20 s 117 ms

Waiting 33 ms

===== Processing =====

BUILD DCs

"sap.com/ess/lea" in variant "default"

.. FAILURE: The build failed due to compilation errors. See build log for details. [result code: 202]

===== Processing ===== finished at 2007-04-17 22:16:01.800 GMT and took 1 m 55 s 131 ms

===== Post-Processing =====

Waiting 12 ms

Check whether build was successful for all required variants...

"sap.com/ess/lea" in variant "default" FAILED

===== Post-Processing ===== finished at 2007-04-17 22:16:01.815 GMT and took 3 ms

Change request state from PROCESSING to FAILED

ERROR! The following problem(s) occurred during request processing:

ERROR! The following error occurred during request processing:Activation FAILED due to build problems. See build logs for details.

REQUEST PROCESSING finished at 2007-04-17 22:16:01.824 GMT and took 2 m 15 s 324 ms

***********************************

sam

Message was edited by:

sameer chilama

Message was edited by:

sameer chilama

Greg_Austin
Active Participant
0 Kudos

Adding a jar to the build path in that way won't work for DC's just local projects. You have to create and reference an external library. The blog I pointed to in the previous post gives a good example. When doing it make sure the J2EE server library is deployed and you have the project referenced in your web dynpro.

Answers (6)

Answers (6)

Former Member
0 Kudos

it worked..

thanks Austin

Former Member
0 Kudos

Austin,

i am having issues propogating this code through NWDI. I imported the external JAR and did a build and it was successful but when it try to activate it it does not activate and gives out an error. But when i try to deploy it directly trhough SDM it works fine.

We have not imported PCUI_GP DC intoo DTR could that be an issue?

please advise

Greg_Austin
Active Participant
0 Kudos

Can you post the error? Also make sure you are using the references correctly. This <a href="/people/valery.silaev/blog/2005/09/14/a-bit-of-impractical-scripting-for-web-dynpro gives a good example. You will also need to have the library, if you went that approach, checked in and deployed.

Former Member
0 Kudos

I am having some issues writing this code.

I imported the external file and it was OK. NeXT when I try to comple the code it says un caught exception.

When I try to put try ctach statement.. it is giving me some other problem.

HAve been stuck up woth this. Please help

********

boolean userHasRole = false;

String rolename = "manager_self_service_us";

try {

IWDClientUser user = WDClientUser.getCurrentUser();

IUser userID = user.getSAPUser();

IRole role = UMFactory.getRoleFactory().getRole(rolename);

userHasRole = role.isUserMember(userID.getUniqueID(), true);

}

catch ( WDUMException e1) {

}

IT is giving me error at statment

UMFactory.getRoleFactory().getRole(rolename

it syas

unhandles exception type UMEexception

regards

Sam

Message was edited by:

sameer chilama

Greg_Austin
Active Participant
0 Kudos

Try making your catch block more generic so it will catch more errors. Instead of WDUMException just catch Exception. You can add more catch blocks later if you need to treat different errors differently.

Former Member
0 Kudos

Thanks guys for your quick response. I will try this out and revert back in case of issues and also to complete the points assignment process.

Greg_Austin
Active Participant
0 Kudos

Sam

You are going to have to include that external jar in the build path. If you are using a DC the easiest way I have found is to create an external library with all of the jars you need. Use this library in a J2EE Server library, so that it can be deployed. Then use a public part of the J2EE server library in your web dynpro, also adding a reference to the library. This should get you going in the right direction. I know there are several post and weblogs about creating a library DC. Good luck.

Former Member
0 Kudos

Hi Sameer,

Add "<b><i>com.sap.security.api.jar</i></b>" in your project classpath. You can find it in your NWDS folder/sub-folders. Once you add it to your project buildpath, then say 'import all'.

This should solve your problem.

Thanks,

Raags

PS: Assign points if useful