Topic
  • 5 replies
  • Latest Post - ‏2012-05-09T12:18:35Z by SystemAdmin
SystemAdmin
SystemAdmin
7615 Posts

Pinned topic java.awt.HeadlessException

‏2012-05-08T14:07:37Z |
Hi Folks..

I' am trying to parse the body of an email through a java program. The java code will return me the List which consist of results. I created a java connector and connected the package which identified me the methods in the java code, picked up the required method, sent the input to it and grabbed the result in a BPM Local Variable of type String with the "Is List" check box true....I also tried the local variable as type "ANY".....

When I try to run the service the Error I' am Getting is

com.lombardisoftware.core.TeamWorksException: java.awt.HeadlessException
at com.lombardisoftware.core.TeamWorksException.asTeamWorksException(TeamWorksException.java:130)
at com.lombardisoftware.core.RegexExceptionRewriter.rewrite(RegexExceptionRewriter.java:76)
at com.lombardisoftware.core.ExceptionHandler.returnProcessedException(ExceptionHandler.java:311)
at com.lombardisoftware.servlet.ControllerServlet.doError(ControllerServlet.java:163)
at com.lombardisoftware.servlet.ControllerServlet.doCommon(ControllerServlet.java:455)
blaw blaw...........
....................

I guess some1 know how to resolve this issue...Thanks in Advance!!!!!
Updated on 2012-05-09T12:18:35Z at 2012-05-09T12:18:35Z by SystemAdmin
  • AnthonyBpm
    AnthonyBpm
    390 Posts

    Re: java.awt.HeadlessException

    ‏2012-05-08T14:25:17Z  
    Can you provide the java method signature?

    Also, is your Java program retrieving the email (e.g. pop) or are you just simply executing your parsing in your Java class?
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: java.awt.HeadlessException

    ‏2012-05-08T14:31:34Z  
    Can you provide the java method signature?

    Also, is your Java program retrieving the email (e.g. pop) or are you just simply executing your parsing in your Java class?
    public static List custOrders(String text)
    { Actual method definition @java code..
    }

    List custOrders(String) This is what am picking from the identified methods

    I' am passing the Body of the email to the java program which is of type string..only parsing logic is done there....I can see the results of the java code on Ellipse IDE. The list I' am returning has some items in it..
  • AnthonyBpm
    AnthonyBpm
    390 Posts

    Re: java.awt.HeadlessException

    ‏2012-05-08T16:10:48Z  
    public static List custOrders(String text)
    { Actual method definition @java code..
    }

    List custOrders(String) This is what am picking from the identified methods

    I' am passing the Body of the email to the java program which is of type string..only parsing logic is done there....I can see the results of the java code on Ellipse IDE. The list I' am returning has some items in it..
    ArrayList<String> should be the return value, however, I have unfortunately not see that work as of late. See this thread for more information on returning a list from java:
    https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14788043&#14788043

    You could also try invoking the method from a server-script to see if you get more informative error messages:

    
    var zList = Packages.sri.kanth.package.ClassName.custOrders(
    "email body"); 
    // You can now invoke List method cals from server script tw.local.listSize = zList.size();
    


    I would also add informative loggin inside of your java class to make sure that you're not erroring out in there. Sometimes the error message that gets propagated up from Java isn't the best.
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: java.awt.HeadlessException

    ‏2012-05-08T18:40:00Z  
    ArrayList<String> should be the return value, however, I have unfortunately not see that work as of late. See this thread for more information on returning a list from java:
    https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14788043&#14788043

    You could also try invoking the method from a server-script to see if you get more informative error messages:

    <pre class="jive-pre"> var zList = Packages.sri.kanth.package.ClassName.custOrders( "email body"); // You can now invoke List method cals from server script tw.local.listSize = zList.size(); </pre>

    I would also add informative loggin inside of your java class to make sure that you're not erroring out in there. Sometimes the error message that gets propagated up from Java isn't the best.
    The problem is not with the java program...I' am able to see the results there...What I'am doing now is instead of list I took a string and appending the results to the string with a space(" ") i.e., if the result of list is (abc, pqr, xyz) I' am taking to a result string as "abc pqr xyz",

    and changed the method definition to
    public static String custOrders(String str){}
    I' am able to get the result but, I have to write script to split the result string and get each and every value which are separated by space(" "). I' am working on this right now....but the good thing is I' am able to get the result string with the list values separated by space(" ")
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: java.awt.HeadlessException

    ‏2012-05-09T12:18:35Z  
    The problem is not with the java program...I' am able to see the results there...What I'am doing now is instead of list I took a string and appending the results to the string with a space(" ") i.e., if the result of list is (abc, pqr, xyz) I' am taking to a result string as "abc pqr xyz",

    and changed the method definition to
    public static String custOrders(String str){}
    I' am able to get the result but, I have to write script to split the result string and get each and every value which are separated by space(" "). I' am working on this right now....but the good thing is I' am able to get the result string with the list values separated by space(" ")
    Thanks Folks Problem solved...