Topic
6 replies Latest Post - ‏2014-05-08T09:29:48Z by yadesh
Frank42
Frank42
5 Posts
ACCEPTED ANSWER

Pinned topic Exception in process configuration console when adding java component queue

‏2011-08-18T13:06:03Z |
Hi there,

I wrote a work performer that uses additional libraries in an extra jar file. I added the additional jar file and the jar file that contains my work performer to the component manager and everything worked fine.

But when I try to create a new component queue for my work performer, I get a NoClassDefFoundError stacktrace in the java console for a class in the extra jar file, and I cannot create the new component.

I could merge all the jar files into one big one, but I wonder whether there is another option.

Anybody?

Thanks a lot
Frank
Updated on 2011-08-19T07:27:42Z at 2011-08-19T07:27:42Z by Frank42
  • SystemAdmin
    SystemAdmin
    199 Posts
    ACCEPTED ANSWER

    Re: Exception in process configuration console when adding java component queue

    ‏2011-08-18T15:27:20Z  in response to Frank42
    Hi Frank,

    The hardest part of getting getting all of this to work is to understand that there are two JVMs that you are dealing with - PCC (typically run on workstation) and Component Manager (server side, configured through PTM). Both of these JVMs need to know about all the classes involved.

    1) During configuration, Process Configuration Console (PCC) is running in an Applet and only has access to the classpath provided initially from HTML page embedding the Applet. What you need to do is to "Register additional classes". When you are configuring your operation, PCC scans the JAR file that you specify for suitable classes. If there are references to com.example.SomeClassInAnotherJar, you need to to first register all of the dependent JAR files in PCC before attempting to define your operation.

    Citing http://www.ibm.com/developerworks/data/library/techarticle/dm-1006javafilenet/index.html?ca=drs-:
    Developing a component using the method described in this section does cause a slight problem that you need to address. When you configure the Java class using the Process Configuration Console, you get the following error in the applet Java console when retrieving the public methods of the class:
    
    java.lang.NoClassDefFoundError: com/filenet/api/core/Connection at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.getDeclaredMethods(Unknown Source) at filenet.vw.integrator.adaptors.java.VWJavaBaseDialog.initMethodList (VWJavaBaseDialog.java:224) (...)
    


    Due to this exception, none of the public methods of the class are shown. This error is caused by the getConnection() method added above. The return class of this method is not a recognized class and therefore the getDeclaredMethods() method fails. This problem occurs each time a method is added to the Java class using "third party" data types as method arguments or return values. The solution is to use the Process Configuration Console to register the jar files that contain these classes. From the console, open the isolated region, select the Component Queues folder icon, and select the Register additional classes command from the action menu. Next, add the jar-file, which in this case is the jar file containing the Content Engine API (Jace.jar). Finally, commit the change to the Process Engine.

    2) The additional JAR files provided also need to be specified in Process Task Manager (PTM) for you Component Manager.

    Good luck!
    Mattias
    • yadesh
      yadesh
      3 Posts
      ACCEPTED ANSWER

      Re: Exception in process configuration console when adding java component queue

      ‏2014-05-08T09:29:48Z  in response to SystemAdmin

      Hi Admin,

      I was facing some similar issue related to component Manager.Earlier I was using one method in a component jar for doing some operation and i have changed the method signature to return some other(say from float to integer),but when i was trying to deploy the jar with new changes,configuring in adaptor,register additional classes etc ..when i was committing the changes on isolated region it was throwing error like" invalid field type :{0} work class=workflow definition instruction sheet...." etc â€i can able to deploy and commit the jar with same method signature.I'm not using that method any workflow except but the component queue name.

      Can you please help me in this issue,that what is causing it and how can i resolve this..

      Thanks for your help.

       

      Regards

      Yadesh Kasaramoni.

  • SystemAdmin
    SystemAdmin
    199 Posts
    ACCEPTED ANSWER

    Re: Exception in process configuration console when adding java component queue

    ‏2011-08-18T15:37:19Z  in response to Frank42
    I need to clarify some points.

    To reduce the number of additional JAR files that you need to register in PCC, create a Facade class that only exposes your external API and register that class.

    Let's say you have a class that is called com.example.MyOperations that uses Spring, Log4J, etc. To avoid having to specify those dependent jars in PCC, create a com.example.MyOperationsFacade clas which delegates to your com.example.MyOperations class. You now register that Facade class in PCC.

    Note that you of course still need to add the dependent JAR files (Spring, Log4J, etc.) to the Component Manager classpath using PTM.

    Mattias
    • Frank42
      Frank42
      5 Posts
      ACCEPTED ANSWER

      Re: Exception in process configuration console when adding java component queue

      ‏2011-08-19T07:17:10Z  in response to SystemAdmin
      ... and again, my question is completely answered :-)

      Thanks Mattias!

      Frank
      • Frank42
        Frank42
        5 Posts
        ACCEPTED ANSWER

        Re: Exception in process configuration console when adding java component queue

        ‏2011-08-19T07:27:42Z  in response to Frank42
        ... I forgot to check the "question answered" radio button... done
        • yadesh
          yadesh
          3 Posts
          ACCEPTED ANSWER

          Re: Exception in process configuration console when adding java component queue

          ‏2014-05-07T18:12:57Z  in response to Frank42

          Hi Frank,

          I was facing some similar issue related to component Manager.Earlier I was using one method in a component jar for doing some operation and i have changed the method signature to return some other(say from float to integer),but when i was trying to deploy the jar with new changes,configuring in adaptor,register additional classes etc ..when i was committing the changes on isolated region it was throwing error like" invalid field type :{0} work class=workflow definition instruction sheet...." etc â€i can able to deploy and commit the jar with same method signature.I'm not using that method any workflow except but the component queue name.

          Can you please help me in this issue,that what is causing it and how can i resolve this..

          Thanks for your help.

           

          Regards

          Yadesh Kasaramoni.