Pinned topicunable to expose the methods of java class in component queue at PCC level

‏2012-02-23T12:02:06Z
|Tags:

Answered question
This question has been answered.

Unanswered question
This question has not been answered yet.

Hi…
I have written java code (i.e jar file )for component queue. This java code contains 2 public methods and 1 private method.
Problem: I unable to expose these two public methods from component queue in PCC. Even I can’t see the public method names when I am configure the class in adaptor configuration of component queue properties at PCC level.
I don’t know why it is not showing, There is no error in java file, it was compiled successfully and even I run that java code as standalone ( i.e by using main method ), it's run successfully.

Re: unable to expose the methods of java class in component queue at PCC level

‏2012-02-24T17:02:28Z

This is the accepted answer.
This is the accepted answer.

your sample code has nothing wrong with it and should work (but this is obviously not you real code). If you are referencing other libraries than jace & pe then you need to add them as references in the PCC. these references are needed for reflection on your types to enumerate the methods. This action is available via the references context menu on a node in the PCC (i don't recall which).

Also, it' can be important to target the JRE version that you are running the PCC with to ensure the reflection will work.

I was having the same issue, the code was as simple as above, and there are 0 .jar dependencies. PCC showed me the .jar file and the classes in the configuration settings, but was not showing me the functions. The problem was the .jar file was invalid, and PCC was smart enough to find the classes in the archive, but did not indicate the .jar file was invalid. If this happens make sure the jar file is valid.