aspose file tools*
The moose likes JDBC and the fly likes connection error when running web aplication using Tomcat 6.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "connection error when running web aplication using Tomcat 6.0" Watch "connection error when running web aplication using Tomcat 6.0" New topic
Author

connection error when running web aplication using Tomcat 6.0

deepak nv
Greenhorn

Joined: Oct 15, 2010
Posts: 2
hi all,

I have developed a web application using Netbeans. I've used jdbc odbc connection to connect to a database which is on another server. The database server is MS Access 2007 . My program runs fine when I run it from Netbeans integrated tomcat server. The problem comes when it is deployed in some other machine with tomcat installed in it. The database connection fails and an exeception is thrown. I use Tomcat 6 for deployment. I checked it again and again and it was very surprising for me to see the same program running from Netbeans but fail when it is deployed. Can anyone please help me.

i have searched for possible causes and results online but have not got much of an assistance. If anyone can help me sorting this issue, it ll be of great help.

Regards,

Deepak
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Please post the full error you are getting.

So you have three computers involved. The NetBeans computer, the Access computer and the Tomcat computer. The web application works when run on the NetBeans computer (runinng under NetBeans) but does not work when running on the Tomcat server.

Did you try running it on the NetBeans computer without using Netbeans? That is, just run it as a web application under Tomcat on that computer. This may determine if it is a Tomcat configuration issue or a server issue.

And please don't use red font. It won't get your question answered any faster and it's annoying.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Welcome to the Ranch Please avoid coloured text, which many people find difficult to read.
deepak nv
Greenhorn

Joined: Oct 15, 2010
Posts: 2
@ Tom

Thanks for replying
Sorry for dat colored text..
well as for my issue. My project was developed in a computer in which i installed netbeans. every thing is working fine in the project when i am deploying the project in tomcat 6.0 that is integrated with the netbeans. all the connections are wotking fine and dats is fetched properly. The Access database is also present in the same computer.
the problem arises when i am trying to install tomcat 6.0 from tomcat web site. I deployed the WAR file generated from netbeans into the new tomcat dat i have installed in the computer separately. the application is deployed and the jsp pages are getting displayed. when i am trying to fetch the dats, it show the following error

Data selection is failed. Please do it againjava.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Data connection could not be made.

and i have specified th correct path of Database. Everything is working fine if i am using the Integrated tomcat server of Netbeans, but the moment i try and deploy the project from an Tomcat server separately, ie not from net beans i am encountering the issue.

I hope this reduces ambiguity and explains the issue.
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
The connection problem you are experiencing can be caused in many places including, among others, physical hardware, firewalls, software configuration, and software bugs. You need to narrow down those possibilities. I suggest you start with working on the computer that you know is working and getting the application to work without Netbeans. Once you've proven that it is not a Tomcat configuration problem or a software bug, you can move on to the next step.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

My guess:

Your NetBeans tomcat is started by hand, using your Windows logon account
Your installed Tomcat is running as a service, with the LocalSystem Windows account.

Your access database is located on another computer in the network. Your LocalSystem account does not have the rights to access this network location.


OCUP UML fundamental and ITIL foundation
youtube channel
Anil Sable
Greenhorn

Joined: Jan 08, 2012
Posts: 10
Hey Deepak am also facing same problem . Did you find the solution?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

Welcome to the Ranch, Anil!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connection error when running web aplication using Tomcat 6.0