cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime exception:java.lang.NoClassDefFoundError

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

christian_santej
Active Participant
0 Kudos

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

Former Member
0 Kudos

Hi christian

Thanks for your reply.

In accordance with your suggestion,I was get the same exception.

I guess that's because there is no "Runtime" option in dependency details.

regards,

blues

Former Member
0 Kudos

Hi Christian:

     I add dependencies in "demo_app" project,It works.


Thanks a lot


regards,

blues

christian_santej
Active Participant
0 Kudos

hi lei,

ah that's good news. you're welcome.

regards,

christian

Answers (0)