cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.NoClassDefFoundError: com.sap.portal.pcm.system.ISystem

Former Member
0 Kudos

Hi,

I've got a Web DynPro application that gets a list of ISystemObject objects from the PCD to display to the user. It works up to the point I try to cast the object to an ISystem interface to get alias/attributes. Although it compiles fine I get a java.lang.NoClassDefFoundError: com.sap.portal.pcm.system.ISystem exception when it runs in the portal environment.

NetWeaver 7.00 SP15

Any help would be appreciated!

-John


ssd = new ArrayList();
try
{
  Object folder = initialContext.lookup("pcd:portal_content");
  names = initialContext.list(browsing_root);

  if ((names != null) && (names.hasMoreElements()))
  {
    NameClassPair nameClass;
    while (names.hasMore())
    {
      nameClass = (NameClassPair) names.next();    				
      if (nameClass.getClassName().equals(PCDCONTEXT))
      {
        //FOLDER, so list its contents
        String new_root = browsing_root + PATH_SEPARATOR + nameClass.getName();
        list_context(ssd, initialContext, new_root);
      }
      else if (nameClass.getClassName().equals("com.sapportals.iviewserver.systemlandscape.service.ISystemObject"))
      {
        // Found one
        ISystem s = (ISystem)initialContext.lookup(browsing_root + PATH_SEPARATOR + nameClass.getName());							
        ssd.addSapSystem(nameClass.getName(), s.getDefaultAlias());
      }
    }
  }
  return ssd.getSystems();
}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi.

It sounds to me as if you havn't set up reference in used dc to the dc containing class IService.

I don't have the DC name right now. Tips: unpack all dc:s and index them with JarClassFinder (http://www.alphaworks.ibm.com/tech/jarclassfinder/download).

Usually you would need to set up a reference in the usedDC part of the webdynpro to the corresponding dc and also SharingReference in the project preference.

Strange that you don't get compile errors, but it might have to do with run time or design time references in your studio. Check how references to the dc containing IService is setup in your project.

Regards, Mikael.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank Mikael and Alka. You're both saying pretty much the same thing. I suppose I need to do some research to figure out which DC I need (these should be SAP libraries) and then the Sharing Reference to make sure the class loader can find the libraries at runtime. Is there an easy way to figure out which DC and Sharing References I need or is it pretty much a brute force approach?

Thanks,

John

Former Member
0 Kudos

Hi John,

Is it that the project you are workin on is a DC?

If so, then adding the External Jar file for ISystem class will only help it to compile successfully.

To have a run time reference of the classes in the external JAR file, you will need to create an External Library Project and use it as an used DC.

You can refer to Valery's [blog|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2361] [original link is broken] [original link is broken] [original link is broken]; for this.

Regards,

Alka.