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

ZhangJie zhangjiewanwansui at gmail.com
Tue Dec 9 08:41:36 PST 2014


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();

                   }

         }

}

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20141210/1147601c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: L2CP201411240001KeplerWF_LocationOK_Linux.xml
Type: text/xml
Size: 230628 bytes
Desc: not available
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20141210/1147601c/attachment-0001.xml>


More information about the Kepler-dev mailing list