Belling the Cat (or) How i made OrangeScape to tango with Tomcat


A month or two ago, a few colleagues of mine, wanted to run OrangeScape in Tomcat for their local testing,   just because they didn’t like jboss and run it.  I wanted them to run through the internet and do it by themselves, so i can chance upon and see if anyone is up there to pull into my team when the time comes.  But they got busy with other things, and forgot about running OrangeScape in Tomcat, and went with jboss.  Now, i am fed up of waiting.  So here i am documenting my findings on how to make OrangeScape tango with TomCat.

I have tested with  Tomcat 6.0.35 and 7.0.23 with JDK 1.6.29.   Running OrangeScape Application in Tomcat is really easier than what i had expected.  really.

Getting the Application War files

You can download the war of your application from the studio.  download the supporting war files (os-commons, runtime, static) from the corresponding build release notes from the community.  The Current release number being 98.

Making changes to make it work in Tomcat

You will have to make changes to 2 files for the OrangeScape Application to work in Tomcat.

    • app.war\WEB-INF\applicationContext.xml
      • search and find the line
        <prop key=”hibernate.connection.datastore”>jdbc/{application-id}</prop>
      • change it to look as below
        <prop key=”hibernate.connection.datastore”>java:comp/env/jdbc/{application-id}</prop>
    • app.war\META-INF\context.xml
      • this file does not exist in the war and you will have to create it. the content should be as follows.
        <?xml version=”1.0″ encoding=”UTF-8″ ?>
        <Context>
                <Resource
                        name=”jdbc/{application-id}”
                        auth=”Container” type=”javax.sql.DataSource”
                        username=”{db-user- id}” password=”{db-user-password}”
                        driverClassName=”com.mysql.jdbc.Driver”
                        url=”jdbc:mysql://localhost:3306/{db-name}”
                        maxActive=”20″
                        maxIdle=”5″
                />
      </Context>

That’s it.  Now, just deploy it to tomcat, and access the url http://localhost:8080/{application-id}/1/signin to log in and start using your application.

Note:

  • The first time, you start the server after making the deployment,  (immediately after deployment, if you use the manager to deploy), you can see a HTTP 500  error will be thrown on the console.  That is because the application is not yet setup but the sla is checking if any jobs are there to execute.
  • as far as i have checked things work.  Webservices & reports were throwing errors. But it could be due to some mistake of mine, since i was in a hurry, to go to sleep.UPDATE:  Everything works fine, as i had noted, it was because of one of my mistakes.

Reference:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s