cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot access Portal Service from Web dynpro DC

Former Member
0 Kudos

Hi all,

I cannot access the portal service from my web dynpro dc.

1. I created a Portal Service (say xxxservice) in a DC (say the DC name is testservice and the vendor is xx.com)

2. Created a public part under the testservice DC and added my classes to it.

3. Built and deployed the testservice DC.

Now,

4. I created a web dynpro DC.

5. In the used DC section added the public part of the testservice DC and also the epbc.prtapi._api.jar for build time and runtime with strong qualifier.

6. In the web dynpro "Sharing Reference", I added PORTAL:xx.com/testservice

7. In the component controller, I am calling a method from the Portal Service.

8. Built the web dynpro DC and deployed it.

9. But at the run time it gives, NoClassDefFoundError on the xxxservice.

I looked at many forum threads and tried everything. For eg: changed the Sharing Reference to PORTAL:sap.com/testservice but nothing works.

Please do suggest me if I am missing something

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Laxmi,

I am sure something wrong at Portal Service DC creation. On webdynpro part you done fine .. by putting PORTAL:sap.com/testservice

Check the below steps:

1. Create DC Portal Applicaiton Stand alone (SDA)

2. Add portal Service for the newly created portal service dc

3. build and activate

4. by default you should be get public part by name API which is compilation dependency

5. here you dont need to do anything else

6. on webdynpro just add the used dc to this API public part of portal service dc

7. add PORTAL:sap.com/testservice sharing reference

If u go by this you shouldnt get any error..

Now, u are saying something like ur own classes .. i think u are trying to put u r own classes to service.. but remeber portal service is to have only IYourService class and YourService class.. other classes should be made to be jar.. and add that jar to External library DC and create PPs compile & Assemble and add that DC to current service dc.

Hope it is clear.. if not pls let me know..

Thanks,

Raags

Answers (8)

Answers (8)

Former Member
0 Kudos

It works.

Former Member
0 Kudos

Hi Raags,

You r awesome. It changed it to "<parfile>.TestService" and it worked like a charm.

Great

Thanks a ton

Former Member
0 Kudos

Wow.. Nice to hear this..

All the best for rest...

Thanks,

Raags

Former Member
0 Kudos

I am getting a new error i.e., NullPointerException.

The service being returned is null.

I am using the following statement to get the service

ITestService testserv = (ITestService) WDPortalUtils.getServiceReference(ITestService.KEY);

Dont know why it returns a null testserv object

Former Member
0 Kudos

so your "ITestService class cannot be found" gone? i hope without that you cant run.. so you surpassed that class not found problme?

Former Member
0 Kudos

Instead of "ITestService.KEY" use "<PARFilename>.TestService"

<PARFilename> = your deployed par name of service

This should work.. (i hope u already solved the class not found prble)

Thanks,

Raags

Former Member
0 Kudos

No luck.

Now I am getting an error saying my ITestService class cannot be found.

Former Member
0 Kudos

Hi,

Right now I am not using NWDI for this web dynpro DC. I just created a DC under my NWDS and deployed it.

Please let me know if I need to add any jar to the external library and expose that library as used DC in my web dynpro DC.

Thanks

Former Member
0 Kudos

So, you should add this <u><b>prtapi.jar</b></u>

This has that IService class.

Thanks,

Raags

Former Member
0 Kudos

Hi all,

Thank u for all of ur response.

I created exactly the way you guys mentioned.

The problem is:

I created a custom method in my portal service say readProperties() and added the signatur of the method in the ITestService interface too..

In my web dynpro DC when I try accessing this method, I get an error saying:

java.lang.NoClassDefFoundError: com/sapportals/portal/prt/service/IService

Am I missing any jars which should be added to my web dynpro DC?

Former Member
0 Kudos

It seems SCA files are not checked in your NWDI Track. Usuall that IService class should be availble to you. As you are building using DC, Those classes should come thru SCA on your track like JTEC, PRT, etc SCAs.

pls check in your track whether these scas are checked in. you can see it in the transport studio of track on CMS page.

Thanks,

Raags

Former Member
0 Kudos

Hi Laxmi,

I think you have to add the "testservice" to the library references instead of sharing references of your webdynpro DC.

Johan

Former Member
0 Kudos

After deploying the portal service, does the server needs a restart?

Former Member
0 Kudos

no need to do that.. u can check by going to the portal -> system administration -> support -> portal runtime -> Application Console -> here look for your TestService in the dropdown.. Now click show

Under Portal Service Items - you would see its started or stopped .. also allows u to restart the service..

Thanks,

Raags