cancel
Showing results for 
Search instead for 
Did you mean: 

when cast Service to IClusterInformation ava.lang.NoClassDefFoundError:

Former Member
0 Kudos

Hi experts,

want to use the Portal Service IClusterInformation in an Abstract Portal Application. To do so I have imported / added

- the jar com.sap.portal.runtime.system.clusterinformation_api.jar to the project

- and the reference <property name="ServiceReference" value="com.sap.portal.runtime.system.clusterinformation"/> to portalapp.xml

IPortalRuntimeResources runtimeResources = PortalRuntime.getRuntimeResources();
IService iService = runtimeResources.getService("com.sap.portal.runtime.system.clusterinformation.clusterinformation");
//response.write(iService.getKey());
IClusterInformation clusterInfo = (IClusterInformation)iService;   <-- EXCEPTION

In the cast IClusterInformation (last line of code) i get the exception java.lang.NoClassDefFoundError: com/sapportals/portal/prt/service/clusterinformation/IClusterInformation

The application is running on EP70 SP16

What I am doing wrong !?!? Can anybody help me, please ?

Regards

Flo

Accepted Solutions (1)

Accepted Solutions (1)

lokesh_kamana
Active Contributor
0 Kudos

Hi,

I tried this its working fine

Abstract Portal Component


IPortalRuntimeResources runtimeResources =	PortalRuntime.getRuntimeResources();
		IService aService =
		runtimeResources.getService(IClusterInformation.KEY);
		IClusterInformation myService = (IClusterInformation)aService;
		
		String lok = myService.getSAPJ2EEServerDirectory();
		response.write(lok);

Portalapp.xml


<application>
  <application-config>
    <property name="SharingReference" value="com.sap.portal.runtime.system.clusterinformation"/>
  </application-config>
  <components>
    <component name="accesservice">
      <component-config>
        <property name="ClassName" value="com.lok.accesservice"/>
      </component-config>
      <component-profile/>
    </component>
  </components>
  <services/>
</application>

Thanks & Regards,

Lokesh

Answers (1)

Answers (1)

0 Kudos

Hi,

Instead of adding servicereference in portalapp.xml, add sharing reference com.sap.portal.runtime.system.clusterinformation to the deployment descriptor.

Regards,

Praveen Gudapati

Former Member
0 Kudos

Hi,

thanks for your reply. Unfortunatelly it doesnt help. First I had the entry with SharingReference... right now I changed it back and am still getting the same exception.

Regards

Flo