Customer Portal

a web project relative path problem

Comments 2

  • Avatar
    oldforum
    0
    Comment actions Permalink
    I have settled this problem, I share my experience to all clover.etl develop friends:


    1. in action class , we can get project path:
    String projectpath = request.getSession().getServletContext().getRealPath("/");

    2.define parameter in graphOrganLevel.grf
    <DBConnection dbConfig="${projectpath}WEB-INF/clover/connection/pms.cfg" id="DBConnPms"/>

    3.invoice graph
    param = "-P:projectpath="+projectpath;
    fileName = projectpath+"WEB-INF/clover/graphOrganLevel.grf";
    String[] s = {param, fileName};
    runGraph.main(s);

    ok , now it can run without error.
  • Avatar
    oldforum
    0
    Comment actions Permalink
    I find the why the tomcat will stop :
    I comment "System.exit(0);" in runGraph class, then the problem disappear.

    The source code like this:

    public static void main(String args[]) {
    ...
    if (finishedOK) {
    // everything O.K.
    System.out.println("Execution of graph finished !");
    //laq add comment: after I comment "System.exit(0)" the tomcat will not stop.
    //System.exit(0);
    } else {
    // something FAILED !!
    System.err.println("Failed starting graph !");
    //laq add comment: I think this line also neet to be commented.
    //System.exit(-1);
    }
    ....
    }

Please sign in to leave a comment.