Announcement Announcement Module
Collapse
No announcement yet.
NoClassDefFoundError: net/sf/cglib/proxy/MethodInterceptor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NoClassDefFoundError: net/sf/cglib/proxy/MethodInterceptor

    I did not change anything about this part of the code but it does not work anymore... Although i see the result of the query at server side, i get an exception at client side...

    Please help me.



    Here is the exception i get :

    java.lang.NoClassDefFoundError: net/sf/cglib/proxy/MethodInterceptor
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknow n Source)
    at com.sun.jnlp.JNLPClassLoader.defineClass(Unknown Source)
    at com.sun.jnlp.JNLPClassLoader.access$100(Unknown Source)
    at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.sun.jnlp.JNLPClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at net.sf.hibernate.proxy.SerializableProxy.readResol ve(SerializableProxy.java:45)
    ..............
    at $Proxy12.getTermsAsTrainee(Unknown Source)
    at com.ayesas.intranet.client.training.currentProgram .CurrentProgramController.queryCurrentTerms(Curren tProgramController.java:149)
    at com.ayesas.intranet.client.training.currentProgram .CurrentProgramController.startUp(CurrentProgramCo ntroller.java:85)
    at com.ayesas.intranet.client.infra.navigation.Naviga tionView$NavigationNodeMouseListener.mouseClicked( NavigationView.java:215)


    This is the line referred as CurrentProgramController.java:149

    Code:
    List lstTermsAsTrainee = this.getTdbProgramDao().getTermsAsTrainee(userCurrent);

    And this is TdbProgramDao.getTermsAsTrainee
    Code:
    public List getTermsAsTrainee(User user) throws DataAccessException{
              log.debug("\n\n\n.....getTermsAsTrainee user =" + user);
              if(user!=null){
                
                        String strQuery = "select term from TdbProgramTermTrainee trainee ";
                        strQuery = strQuery + "join trainee.parentTerm term ";
                        strQuery = strQuery + "join trainee.traineeUser user ";
                        strQuery = strQuery + "where user.id=" + user.getId();
                
                        log.debug("strQuery = " + strQuery);
                        List resultObjects = getHibernateTemplate().find(strQuery);
                		
                        log.debug("calls Utility.hibernateInitializeObjectGraph");
                        Utility.hibernateInitializeObjectGraph(resultObjects, getHibernateTemplate());
    			
                        log.debug("returns resultObjects =" + resultObjects);
                        return resultObjects;		
              } 
    }
    Code:
    public static void hibernateInitializeObjectGraph(Object object, 				HibernateTemplate template) {
              new HibernateObjectGraphInitalizer().initialize(object,      template);
    }


    Here is the server side output :

    .....getTermsAsTrainee user =Ugurlu Orhan
    [DEBUG][training.TdbProgramDaoImpl] strQuery = select term from TdbProgramTermTrainee trainee join trainee.parentTerm term join trainee.traineeUser user where user.id=1

    [DEBUG][training.TdbProgramDaoImpl] calls Utility.hibernateInitializeObjectGraph

    [DEBUG][training.TdbProgramDaoImpl] returns resultObjects =[1.:TERM id=127, parentProgramId=114 Instructor=13-Esmer Betul, Trainees=[id=135, user=Ugurlu Orhan, attendance=false]][/code]

  • #2
    You are missing the cglib library on the client side - you can get it from teh spring-with-dependencies.jar.

    Comment


    • #3
      It works on the development environment, but does not work after i deployed on the real server... I checked the build files, all libraries are copied, there is not any exclude.

      Finally i dropped the term trainee table, and deployed again. There is not any problem now. But i wonder why???? I could not find any reasonable explanation for the problem which means it can happen again. This is truly disturbing...

      Comment


      • #4
        It's ClassPathRelated plus in case of JavaWebStart (I saw you are using jnpl) there might be some caching involved. Try to do the deployment several times on several machines in order to spot the problem.

        Comment

        Working...
        X