[kepler-dev] Different runModelInThread() Result Between Windows and Linux

Daniel Crawl danielcrawl at gmail.com
Wed Dec 10 12:09:52 PST 2014


Hi Jie,

If you getting java.lang.OutOfMemoryError, try running your program
with more memory by adding "-Xmx2g" or "-Xmx4g" to the java command
line.

Can you send the full stack trace for the NullPointerException that
occurs in parseMoML()? This could be caused by not enough memory, so
the error might go away if you run with -Xmx4g.

I noticed in your workflow that several actors have a new input port 
called "previous" such as DatabaseWriter, DatabaseQuery, and External
Execution. Most actors will ignore new input ports, so it's not clear
how this workflow will execute. Instead of adding a new port, you can
use one of the existing input ports such as the "trigger" port.

If an actor does not have a trigger port, you can add a Constant or
String Constant actor, which does have a trigger port, and connect the
Constant output to one of the existing inputs. For example,
DatabaseWriter does not have a trigger port, but you can use a
Constant actor configured with the database connection parameters and
connect it to the "dbParams" port.

   --dan



On 12/9/14 8:41 AM, ZhangJie wrote:
> Hi Dan,
>
> Many thanks for your generous help! I think my workflows are too
> complicated, Local database connection and webservice are needed. Here is
> one workflow in the attachment. All the workflow are same except parameters,
> but it won’t be executed in your machine.
>
> I have understood the difference between runModelInThread() and runModel()
> by your help. I want to parallel execute workflow because of project
> requirements, so I changed my demo code as following. But it can’t execute
> all workflows without any error(some workflow did be executed correctly).
> There are two typical mistakes:
>
> 1.       parseMoML() mistake: it seems like that execution before workflow
> parse.
>
> Error running model or finding output file:null
>
> or
>
> Error running model or finding output file:XML element "entity" triggers
> exception. in
> file:/E:/Java/KeplerWF_OrderSubmit_Version_MatchResourceL2Order20141117/MCA_
> KeplerWorkflow_Engine/ at line 1 and column 38692
>
> Caused by:
>
> java.lang.NullPointerException
>
> 2.       Cannot create new native thread:
>
> Running model in current thread: L2CP201412090048KeplerWF
>
> 138 ms. Memory: 2938880K Free: 1208526K (41%)
>
> Error running model or finding output file:Executing command "java -jar
> /home/MCA/Software/apache-tomcat-7.0.55/webapps/MultiProcessSysWebService_Th
> read//WEB-INF/lib/WaitL3OrderExecuted.jar 10.3.10.1 3306 mccps mca mca
> L3RN201412090048 Finish" returned a non-zero return value of 1.
>
> The last input was: null.
>
> The standard output was: Error occurred during initialization of VM
>
> java.lang.OutOfMemoryError: unable to create new native thread
>
>      at java.lang.Thread.start0(Native Method)
>
>      at java.lang.Thread.start(Thread.java:714)
>
>      at java.lang.ref.Reference.<clinit>(Reference.java:187)
>
> The error output was:
>
>    in .L2CP201412090048KeplerWF.L3RN201412090048WaitExecuted
>
> Why? Need I change the JVM parameters in my linux server? Because of I run
> hundreds of threads? If needed, should I set it in kepler code?
>
> Any help will be grately appriciated. Thanks for your attention!
>
> with regards,
>
> Jie Zhang
>
>
>
> import org.kepler.ExecutionEngine;
>
> import ptolemy.actor.CompositeActor;
>
> import Workflow.Kepler.KeplerL2OrderWorkFlowGenerator;
>
>
>
> public class test extends Thread {
>
>           public String Id ;
>
>           private ExecutionEngine engine;
>
>
>
>           public test(String Id)  {
>
>                     this.Id=Id;
>
>           }
>
>
>
>           public void run() {
>
>                     // 1.Generate Moml Kepler Workflow by my class
>
>                     KeplerL2OrderWorkFlowGenerator kL2WFG = new
> KeplerL2OrderWorkFlowGenerator(
>
>                                       this.Id);
>
>                     String Moml=kL2WFG.KeplerWorkflow();
>
>
>
>                     //2.Run Moml by Kepler ExecutionEngine
>
>                     System.out.println("Begin to execute!")
>
>                    engine = ExecutionEngine.getInstance();
>
>                     try {
>
>                              CompositeActor model = (CompositeActor)
> ExecutionEngine
>
>                                                          .parseMoML(Moml);
> //this work seems slower than execution thread!
>
>
>
>                                       engine.runModel(model);
>
>
>
>                     } catch (Exception e) {
>
>                              System.out.println("Error running model or
> finding output file: "
>
>                                                 + e.getMessage());
>
>                     }
>
>           }
>
>
>
>           public static void main(String[] args) {
>
>                     // TODO Auto-generated method stub
>
>                     for (int i = 0; i < 50; i++) {
>
>                              test tempTest=new test("WorkFlow"+i);
>
>                              tempTest.start();
>
>                     }
>
>           }
>
> }
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at kepler-project.org
> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>



More information about the Kepler-dev mailing list