File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes JBosss 5.1.0 and Connection Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBosss 5.1.0 and Connection Issue" Watch "JBosss 5.1.0 and Connection Issue" New topic
Author

JBosss 5.1.0 and Connection Issue

Joydeep Ghatak
Ranch Hand

Joined: Sep 30, 2009
Posts: 41

Hi All,

I have a EAR file which runs fine on IBM websphere (6.0 and 6.1), now I have deployed the same in Jboss 5.1.0.As this is a dynamic website I need to make an oracle connection and where the datasource name is different from DefaultDS. I am not using EJB's.

I have configured JBoss inside Eclipse 3.7 (Indigo) and going to do any modification on the code etc through eclipse-JBoss combination only.
The application is deployed successfully and is working fine (log in, quite almost all the functionality is working fine) except one, which is throwing the following exception. Though we have not changed anything for that functionality in the code.

What I have done so far in this approach,

1. Created the oracle-ds.xml with DB and application specific parameters.
2. Deployed the oracle-ds.xml in C:\jboss-5.1.0.GA_MYAPP\server\default\deploy directory
3. Kept the hsqldb-ds.xml as it is, in the same location (As it comes default)
4. Provided the ojdbc14.jar in C:\jboss-5.1.0.GA_MYAPP\common\lib
5. Created and kept jboss-web.xml in <project_home>/src/web/WEB-INF

Output ::
==========
1. JBoss starts successfully showing it is able to detect the new application specific JNDI name (MY_ds)

2. But I am getting the following 2 different exceptions ,

2.1


2.2 This exception we are getting whenever some basic functionality is hitting the DB


What has been done so far ::
=================
1. Tried with commeting out the autoCommit() statements from the code (As the log shows that the autoCommit is set at the JBoss level, so code level autocommit has been closed)
Output :: Receiving the same exception,

2. Modified the oracle-ds.xml with
connection property's autoCommit as 'false', but with no luck.

Info ::
oracle-ds.xml


Thanks in advance,
Joydeep

“Men are only as good as their technical development allows them to be.”
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 973
    
    5

Hi

If it isn't too long, could you post the code for the entire class com.lilly.sdd.common.data.TwoBO please?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

Are you sure you spelled the option correctly? Is it "autoCommit" or "autocommit"? Case matters! By the way, this in bot a JBoss question, it is a question about Oracle and its JDBC driver. All the JBossdoesi s pass the settings to the Oracle JDBC driver, which is the one complaining (though based on the exception stack trace it appears that JBoss is not properly wrapping the original exception).


JBoss In Action
Joydeep Ghatak
Ranch Hand

Joined: Sep 30, 2009
Posts: 41

Thanks James, Thanks Peter,

Hi Peter,
I have tried with both "autoCommit" and "autocommit" in the parameter list, but both are giving the same exception :-(
Moreover the same code was deployed in webshpere AS, where it was working perfectly well.

And as you have mentioned "JBoss is not properly wrapping the original exception", is there any issue with this specific version of JBoss (Jboss 5.1) ? or if you can provide some more information on the same it will be great.

Hi James,
The complete code is more than 350 lines long so I am not putting that here.
But the method which is throwing the exceptions is,

Note ::
1. Originally the following two lines were not commented out, but once we received the above exception we have commented out the above two lines

2. I have checked the the control is going into the 'if (myTX)'
3. myTx is a boolean operator.
and same is the case for rollbackTrans()
I think the main issue is the following exception :-(

Note ::
and

Thanks in advance to both of you.
Thanks,
Joydeep

Joydeep Ghatak
Ranch Hand

Joined: Sep 30, 2009
Posts: 41

Hi all,

The issue is resolved. Doing a change at the code base level we are able to resolve the issue.
Though we are still facing the following exception,



Thanks,
Joydeep
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 973
    
    5

Hi Joydeep

It may be worth checking where you use the Connection instances and make sure you explicitly close them (say in a finally block).
Joydeep Ghatak
Ranch Hand

Joined: Sep 30, 2009
Posts: 41

Thanks James,
We are working on the same.

But just a thought, the same code works properly in Websphere but showing this exception in JBoss.
May be JBoss is more fine tuned from connection point of view.

Thanks,
Joydeep
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBosss 5.1.0 and Connection Issue
 
Similar Threads
java.lang.reflect.UndeclaredThrowableException
ERROR [LoginAction] LoginUseCase - Unexpected exception when creating the session bean object
JBoss 5.1 throwing error for missing jsp files in /WEB-INF folder
Struts Validation problem
javax.naming.NotContextException