Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Runtime exception:java.lang.NoClassDefFoundError

Dear all:

I create two dc project in my local track

demo_web DC Type:J2EE / WebModule

demo_app DC Type:J2EE / Enterprise Application

user.jsp in demo_web,this jsp file used useBean to get user info

------------------------------

   try {
    IWDClientUser cuser = WDClientUser.getCurrentUser();
   
    if (cuser == null || cuser.isAnonymousUser()) {
     WDClientUser.forceLoggedInClientUser();

    }
    IUser iuser = cuser.getSAPUser();
    usrid = iuser.getUniqueName().trim().toUpperCase();
   } catch (WDUMException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }

---------------------------------

DC build is OK,but runtime get error:

----------------------------------

500 Internal Server Error is returned for HTTP request [http://portal.com.cn:50000/demo.sap.com~demo_web/user.jsp]:
  component [jsp],
  web module [demo.sap.com~demo_web],
  application [demo.sap.com/demo_app],
  DC name [demo.sap.com/demo_app],
  CSN component[],
  problem categorization [com.sap.ASJ.web.000137],
  internal categorization [-1063655795].

[EXCEPTION]
java.lang.NoClassDefFoundError: com/sap/tc/webdynpro/services/sal/um/api/WDUMException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2502)
at java.lang.Class.getConstructor0(Class.java:2802)
at java.lang.Class.newInstance0(Class.java:332)
at java.lang.Class.newInstance(Class.java:314)
at java.beans.Beans.instantiate(Beans.java:209)
at java.beans.Beans.instantiate(Beans.java:49)

---------------------------------------

EP:7.40  NWDS:7.3.17

Thanks,

Blues

Former Member
replied

hi lei,

you're using deprecated dependencies (warning/yellow icon entries).

try to replace them with the following:

  • tc/bl/exception/lib
  • tc/bl/logging/api
  • tc/wd/api
  • /tc/je/usermanagement/api

this should do the trick.

besides i think it is not best practice to use web dynpro specific APIs in non web dynpro related context. based on your provided information i assume you want to read user related data. if that's the case try the UME API of SAP (UMFactory, IUserFactory)

regards,

christian

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question