Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Title style corrected

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

Please read first the article How _ to _run_operate JobScheduler _ with _ Jetty for general information.

You can use the Jetty of the JobScheduler for your own application.

  • We assume we have an application in /home/[jobscheduler_user]/my_app which calls a java servlet via ajax with ./myappservlet?some=query.
  • We assume the Java servlet class is com.my.apps.MyServlet and it is complied in com.my.apps.jar.

The following steps are necessary to call the application by _

No Format
http://[jobscheduler_host]:[jobscheduler_jetty_port]/jobscheduler/myapp/

_

where [scheduler_host] and [jobscheduler_jetty_port] have to substitute with the hostname and the jetty port of the JobScheduler.

  • Put the my_app.jar into the JobScheduler java class path
    • Create a folder my_app in the JobScheduler ./lib directory and store the com.my.apps.jar in this new folder.
    • Open the ./config/factory.ini and add the com.my.apps.jar to the class path
Code Block

 ... 
 [java]
 class_path  = <span style="color:red">$\${SCHEDULER_HOME\}/lib/my_app/com.my.apps.jar</span>jar:$\{SCHEDULER_HOME\}/lib/*.jar:$\{SCHEDULER_HOME\}/lib/hibernate/*.jar:$\{SCHEDULER_HOME\}/lib/jetty_ext/*.jar
 ...
  • Add the following servlet elements to the ./config/web.xml (where jobscheduler[scheduler_user] have to substitute with the username of the JobScheduler).
Code Block
languagehtml/xml

    <servlet>
        <servlet-name>MyApp</servlet-name>
        <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
        <init-param>
            <param-name>resourceBase</param-name>
            <param-value>/home/[scheduler_user]</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>MyApp</servlet-name>
        <url-pattern>/myapp/*</url-pattern>
    </servlet-mapping>
    
    <servlet>
        <servlet-name>MyAppServlet</servlet-name>
        <servlet-class>com.my.apps.MyServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>MyAppServlet</servlet-name>
        <url-pattern>/myappservlet</url-pattern>
    </servlet-mapping>

  • Restart the JobScheduler and call

    No Format
    http://[scheduler_host]:[scheduler_jetty_port]/jobscheduler/myapp/