It may appear quite obvious that any Spring based web application that works under Tomcat should be working when deployed to JBoss EAP 5.1. In fact, this is further than the truth. Most often than not, the Spring based web application would just spew out tones of exception messages. This is exactly what happened when I tried to deploy a Spring 3.0.5/Hibernate 3.5.6 web application to JBoss EAP 5.1. I did finally get the application to work but not after spending many hours of trial and error to figure out the exceptions. Here are my eventual fixes.
1. Removed all the XML parsers under WEB-INF/lib directory, i.e. xmlParsers, xml-api, xalan, xerces.
2. Added hibernate-validator-4.1.0.Final.jar to WEB-INF/lib directory. For some unknown reason, JBoss EAP 5.1 absolutely need this.
3. Add 2 entries to hibernate.properties to pass into Spring. See text in red below.
With these changes, the web application finally works.
Sunday, 13 May 2012
Tuesday, 1 May 2012
Analysing Ant Project with Jenkins and Sonar
Jenkins(or Hudson) and Sonar are perhaps two of the most mature open source tools available today for implementing continuous integration. They comes with a plethora of features that make life easier at monitoring and managing quality of multiple software development projects. Out of the box, Sonar is designed for Maven project. However, it can be configured to work with Ant projects. The following steps show you how to achieve this:
Installation
1. Download this plugin Sonar Ant Jar
2. Copy the jar file into <ANT_HOME>/lib
This is very important, otherwise your project would not compile properly.
Configuration
Ant projects typically come with <PROJECT>.properties and <PROJECT>.xml files. So, just add the following code snippets into the existing ant build file. The code snippets assume that Sonar has already been installed to run at http://localhost:8080/sonar with Postgresql database.
Running
From the command prompt or inside your favourite IDE, run "ant -f myproject.xml sonar". This will take awhile depending on your project size. Once completed, myproject should show up on the project list inside Sonar.
Integrating with Jenkins/Hudson
Under "configure" panel, just add a new ant task to execute the "sonar" task.
Reference:
1. For more details on Ant Task, see Analyse with Ant Task
2. For more details on Jenkins, see Jenkins
3. For more details on Sonar, see Sonar
Installation
1. Download this plugin Sonar Ant Jar
2. Copy the jar file into <ANT_HOME>/lib
This is very important, otherwise your project would not compile properly.
Configuration
Ant projects typically come with <PROJECT>.properties and <PROJECT>.xml files. So, just add the following code snippets into the existing ant build file. The code snippets assume that Sonar has already been installed to run at http://localhost:8080/sonar with Postgresql database.
Running
From the command prompt or inside your favourite IDE, run "ant -f myproject.xml sonar". This will take awhile depending on your project size. Once completed, myproject should show up on the project list inside Sonar.
Integrating with Jenkins/Hudson
Under "configure" panel, just add a new ant task to execute the "sonar" task.
Reference:
1. For more details on Ant Task, see Analyse with Ant Task
2. For more details on Jenkins, see Jenkins
3. For more details on Sonar, see Sonar
Saturday, 28 April 2012
Running Liferay 6.1 CE on Non Root Context
By default Liferay 6.1 CE runs on root context after installation. Sometimes this may not be possible. Assuming that we would like Liferay 6.1 CE to work as http://<hostname>/myportal instead of http://<hostname>/, just make the following changes.
1. Under liferay-portal-6.1.0/tomcat-7.0.23/webapps directory
1. Under liferay-portal-6.1.0/tomcat-7.0.23/webapps directory
- Rename directory ROOT to myportal
- Rename file root to myportal
- Edit myportal file and change <Context path=""...> to <Context path="/myportal"...>
- Edit portal-ext.properties (create one if it does not exist), add in portal.ctx=/myportal
- Login as portal administrator
- Bring up "Control Panel" and click on "Portal Instances" under "Server" tab
- Change the default value "localhost" at "Virtual Host" to the domain where Liferay is hosted.
Wednesday, 18 April 2012
Adding Apache document root permission to SELinux
On redhat linux with SELinux enabled, merely changing the document root path in the /etc/httpd/conf/httpd.conf file is not enough to make Apache work with the new location. Apache will give "File Not Found" error. To fix this problem, just use the following script. Make sure to change $HTTP_DOC to the location of the new apache document root.
Sunday, 15 April 2012
Running multiple Tomcat 7.0 as services on Windows
On a Window system with more than 8G of RAM, it is more beneficial to run multiple Tomcat 7.0. This can easily be achieved by following the steps outlined below.
Saturday, 14 April 2012
Getting vTiger to work with Postgresql
Recently while looking at vTiger CRM, decided to spend some time getting it to work on Postgresql 9 database. It turned out to be a lot more work than I have initially anticipated. Someone has make quite a significant contribution to make vTiger working with Postgresql database. However, there is still a lot of work to be done. Most of the the problems are due to SQL syntax. I'm quite surprise at the syntax that works with MySQL. The list below contains the SQL syntax that are broken in Postgresql but works in MySQL.
- Joining character field to integer field
- Using '0000-00-00 00:00:00' as default date
- Using limit min, max
- Using duplicate index name
- Using non standard GROUP BY syntax
- Using double quote to enclose character data
- Inserting NULL into integer field
- Updating character field without enclosing it in single quote
- Using MYSQL specific build-in functions
- Comparing true/false on integer field
Subscribe to:
Posts (Atom)