cancel
Showing results for 
Search instead for 
Did you mean: 

Get EP User - NULLPOINTER EXCEPTION ???

Former Member
0 Kudos

Hi guys,

To be honest I normally develop in ABAP Webdynpro but have had to change to Java Webdynpro for one specific piece of development.

Here goes....I am debugging my application in Eclipse with the code being deployed remotely to the server. Here is the code snippet that is not working:

IWDClientUser wdClientUser =WDClientUser.getCurrentUser();

com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();

sapUser.getAccessibilityLevel();

com.sapportals.portal.security.usermanagement.IUser ep5User =

com.sapportals.wcm.util.usermanagement.WPUMFactory.getUserFactory().getEP5User(sapUser);{code}

The BOLD line above always raises an NULLPOINTER exception.

The application is not in an iView yet on the Portal as I am still coding....but surely I can test like this?

Reason I need the user is that I need to upload files to KM......

I have all the correct JAR files installed......I think.....

1) \lib\prtapi.jar

2) Portal user management API - \portalapps\com.sap.portal.usermanagement\lib\com.sap.security.api.e p5.jar

3) \portalapps\com.sap.netweaver.bc.rf\lib\bc.rf.framework_api.jar

4) KM Repository Framework APIs - \portalapps\com.sap.netweaver.bc.rf.service\lib\bc.rf.global.service.urlgenerator_api.jar

5) Repository Framework Utility: URL Generator - \portalapps\com.sap.netweaver.bc.sf\lib\bc.sf.framework_api.jar

6)Repository Framework: Repository Services \portalapps\com.sap.netweaver.bc.util\lib\bc.util.public_api.jar

7) com.sap.security.api.perm.jar

This is really holding back my development time.....does anyone have any ideas on why it is throwing a nullpointer exception or how I can get around this error?

Thanks for the help

Lynton

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

If you have already created the application you can set the authentication by double clicking on the application; select the tab Application Properties; click on New a pop up will open up; selected the radio button pre defined; click on Browse; select Autentication from the list; and set the value to true from drop down.

Former Member
0 Kudos

hi lynton,

please check the following link it may help you...

http://help.sap.com/saphelp_nw04/helpdata/en/b9/9482887ddb3e47bd1a738c3e900195/frameset.htm

Thanks and Regards

shanto aloor

Former Member
0 Kudos

Hi,

Have you enabled authentication for your application?

Regards,

Murtuza

Former Member
0 Kudos

How do I enable authentication on a Java Webdynpro application? Is there a checkbox somewhere?

If I choose to deploy and run the application from the SAP Netweaver Developer Studio and it runs on a remote SAP Portal server, can I get access to the EP user in code or do I have to stick it into an iView for that?

Also, with teh JAR files I have copied them into the webdynpro folder and am not referencing the ones on the server....would that make a difference?

Thanks again

Lynton

former_member192434
Active Contributor
0 Kudos

Hi

While creating applicaiton you will get one check box called authontication....just checked that check

box

and to refer jar file to server you need to put jar file into lib folder of your application

Thanks

Former Member
0 Kudos

Hi,

How do I enable authentication on a Java Webdynpro application? Is there a checkbox somewhere?

Go to the application properties and select authentication and set the value to true.

If I choose to deploy and run the application from the SAP Netweaver Developer Studio and it runs on a remote SAP Portal server, can I get access to the EP user in code or do I have to stick it into an iView for that?

If you run with the authentication enabled, you will get the logged in user using the WDClientUser API's

Also, with teh JAR files I have copied them into the webdynpro folder and am not referencing the ones on the server....would that make a difference?

If you are using DC's for development make use of references to the respective Dc's instead of adding archives. Hope both the systems are on same patch levels.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi there,

I have looked everywhere in the project properties and cannot find anything where I can tick authentication.....can you explain where I must go because I cannot see any tabs etc....??

Former Member
0 Kudos

Hi,

Tick will be available only when you create a new application. If the application is already created, you can check if authetication has been set or edit to set it. Double click application name. Go to Application Properties tab. If there is no authentication property set, then click on New button. Select Predefined radio button. Click Browse and choose Authentication. Select value as true or false as required.

Regards,

Harini S