Mock tests, Interview questions, Tutorials and Tech news
 
 

Archive

Posts Tagged ‘JForum integration’

Request.getContextPath() throws nullpointer Exception in Linux

September 7th, 2009 smitha No comments

Recently I faced this problem. I have tomcat deployed both on windows server and one of my Linux server where I use windows server for development and Linux for production.

My code uses the HttpRequest’s request.getContextPath() function in some of the servlets.  In Linux server the application war is placed in  /home/smitha/myWork/ directory (not in the webapp folder of tomcat) and specified it in the server.xml file:

<Context path=”/myApp” docBase=”/home/smitha/myWork/myApp” debug=”5″ reloadable=”true” crossContext=”true” />

In windows everything worked fine. But on Linux machine, my application initially loaded fine ( showed index page) but request.getContextPath() threw ‘NullPointerExcpetion’.

Also in logs I saw an Exception saying the directory =”/home/smitha/myWork/myApp doesn’t exist.

The application war file has to be unzipped by tomcat if the application is deployed properly.. but it was not happening.   The cause for this problem was the directory =”/home/smitha/myWork/ was not owned by tomcat user. Tomcat user need to have permissions to create directory in the myWork directory to unzip the war.

By changing the ownership of the directory using chown command I solved the problem. Alternatevely one can also add the owner of /home/smitha/myWork/ directory to tomcat group and grant write permission to the group. This will also solve the problem.

Spring Application and Jforum Integration – Sharing same c3p pool

August 3rd, 2009 smitha No comments

I hope you have gone through my previous blog about Jforum integration. There I have explained integration of Jforum into a spring / jsf application.

After integration the main problem was the database connectivity. My spring application was using a c3p pool datasource and the Jforum was also creating c3p pool and datasources to connect to db. As I had all tables (both Jforum and my application tables) in same db, it was not appropriate to have 2 pools for same db by same application.

Read more…

Jforum Integration with a Spring and JSF WebApplication

July 31st, 2009 smitha 10 comments

I am working on a web application, in which forum feature has to be integrated. Jforum  was chosen to integrate. Jforum is an open source forum implementation in Java (http://www.jforum.net ).

My Application is a spring / JSF application using mysql Db.Jforum has separate user tables and separate authentication mechanism. For integration it provides Single Sign on Facility and easy configuration. By turning ‘Single sign on’ facility on, the login and registration screens on Jforum will get disabled. The jforum searches for special attributes in session for logged user information and if the user is not present in its table it will automatically create one.All the authentication details will be handled by my application. Also I wanted to keep jforum tables in same db.

Read more…

Get Adobe Flash playerPlugin by wpburn.com wordpress themes