Solved

JBoss + postgresql + SQLException - Different results on Windows and Linux

Posted on 2004-09-13
3
271 Views
Last Modified: 2010-05-18
Does JBoss for Linux need to be configured differently than JBoss for Windows for SQLException handling?

I installed the latest 3.2.5 JBoss on Windows and Linux and didn't configure anything. I'm using Eclipse 3.0 with MyEclipse 3.8.1 (+ update packs) to create a deploy directory for my application for JBoss on Windows. I then zip up this directory and move it to the same diretcory on the Linux both and unzip it and test the application there.

Here is my situation: I am creating a Struts 1.1 based application that runs fine under Tomcat 5 and JBoss 3.2.5 on Windows. During login, I am validating the user against their PostgreSQL database login. If they enter a bad username/password, PostgreSQL generates an exception. On Windows the following code works:

try
{
    // Code to attempt login with username/password entered
}
catch (SQLException e)
{
    log.error("Error in validating user.");
    log.error("\tSQL statement = " + sQuery);
    log.error("\terror code = " + e.getErrorCode());
    log.error("\tstate = " + e.getSQLState());

    if (e.getSQLState().equals("08004"))
    {
        // have a password/userid error, return null user
    }

the 'state' is '08004' on userid/password errors.

I packaged up my exploded war directory on Windows and moved it over to Linux and unzipped it into jboss-3.2.5/servers/default/deploy -- same location as on Windows. However when I run the same code on Windows and enter in an invalid user id/passowrd combination, when the exception is thrown and caught and my code is run, the 'state' returned is NULL.

If a proper userid/password are entered they are logged into the system and everything runs fine.

Thanks in advance for any corrections or suggestions.

Brian
0
Comment
Question by:Brian Bezanson
3 Comments
 

Author Comment

by:Brian Bezanson
ID: 12180038
The solution to the above issue was to update the versions of JBoss, PostgreSQL, and especially the Java JRE to their respective current versions. Once the JRE was updated to 1.4.2_05 the result code came back as expected.

Brian
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12318407
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question