SQL Server Express connection error (with Hibernate, Java-based web app, and Tomcat)

I am trying to resolve a database connection problem while trying to setup a Java-based web application.
There is a working Java-based web application (that uses Hibernate and MS SQL Server Express as a database, and Apache Tomcat as a web server).
I am trying to setup a copy of that web site on another computer (for development).
That another computer already has Apache Tomcat and the SQL Server Express installed, and I mad sure that both computers use the same version of Java.  
I backed up the database from the working site and restored it on the new machine.
Then I created the war file on the working machine and expanded it on the new machine.
I made sure the database's setup, configuration, and user's login info is identical on both machines.  The hibernate.properties files are identical on both machines (except the machine's name).
However the web application fails to be displayed, and Tomcat's log files show the database connection errors.that appear when the Tomcat service is being started, such as
"Login failed for user 'myUser'."
The hibernate.properties file contains these lines:
*************************************************************************************************
hibernate.connection.url=jdbc:jtds:sqlserver://XXXXXXX1:1433/musApp;instance=SQLEXPRESS
hibernate.connection.driver_class=net.sourceforge.jtds.jdbc.Driver
hibernate.connection.username=myUser
hibernate.connection.password=myPassword
hibernate.dialect=org.hibernate.dialect.SQLServerDialect
*******************************************************************************************************
The errors from the catalina_xxx.log file are below (between the lines):
--------------------------------------------------------------------------------------------------------
May 28, 2009 12:38:53 PM org.hibernate.connection.ConnectionProviderFactory newConnectionProvider
INFO: Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
May 28, 2009 12:38:55 PM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 4060, SQLState: S1000
May 28, 2009 12:38:55 PM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Cannot open database "musApp" requested by the login. The login failed.
May 28, 2009 12:38:55 PM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 18456, SQLState: 28000
May 28, 2009 12:38:55 PM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Login failed for user 'musAdmin'.
May 28, 2009 12:38:55 PM org.hibernate.cfg.SettingsFactory buildSettings
WARNING: Could not obtain connection metadata
java.sql.SQLException: Cannot open database "musApp" requested by the login. The login failed.
--------------------------------------------------------------------------------------------------------
Could you please assist in resolving the problem?
Again, the application is working on another machine, and the setup is identical (at least, I cannot see the difference).



pavelmedAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pavelmedAuthor Commented:
Forgot to mention: The database server is configured for "SQL Server and Windows Authentication mode".
0
CEHJCommented:
Can you telnet to that address and port from the machine you're trying to run it on?
0
pavelmedAuthor Commented:
I am trying to access the site locally, from the same machine.
I can use the working site also locally, from the working machine.
Both machines are development machines.
On the new machine, if I try to display the web site, it is starting but fails when it tries to use DB data.

I don't have telnet on that machine.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

mrjoltcolaCommented:
I don't know about SQLEXPRESS but on standard SQL Server, I have a similar Hibernate config, but I always have to enable the SQL Server TCP port first. I use "SQL Server Configuration Manager" from the start menu and under SQL Server Network Configuration, enable TCP/IP, then set Listen all and IPall to port 1433
0
CEHJCommented:
MySql must have granted permissions to connect from the host (machine) you're currently connecting from.

http://dev.mysql.com/doc/refman/5.1/en/adding-users.html
0
CEHJCommented:
Oops sorry  - wrong DB!. Nonetheless, make sure you have permission to connect from that host
0
pavelmedAuthor Commented:
I set it up exactly as on working machine: under SQL Server Network Configuration, enabled TCP/IP, and also enalbed TCP/IP under SQL Native Client Configuration.
1433 port is specified under SQL Native Client Configuration.- it is setup that way and works on another machine,
0
mrjoltcolaCommented:
Your sqljdbc.jar (or whatever the source fource driver jar name is) is deployed with your web app or is it in Tomcat common lib?

It doesn't look like a missing jar, it looks like a permissions problems, but since I don't use that driver, I use the standard Microsoft one, I cannot say.
0
pavelmedAuthor Commented:
CEHJ, the user is setup as a database owner on that machine.

However, I would like to test a DB connection.
How can I test a DB connection?  The tool that I am using, the SQL Server Management Studio Express, uses a Windows authentication, so username and password are not needed to connect to the database
0
pavelmedAuthor Commented:
mrjoltcola, I am not sure about that driver.  it users the net.sourceforge.jtds.jdbc.Driver.  In catalina.log file I can see that tomcat loads the file.
0
pavelmedAuthor Commented:
I have resolved this error.
Administrator, please close this question.
0
mrjoltcolaCommented:
Can you provide the solution for our benefit? :)

You normally close your own questions by either deleting or scoring a solution. If you found your own solution, it is good for EE if you post it and score it, and also helps the experts that spent time trying to assist you, for future knowledge purpose.
0
pavelmedAuthor Commented:
mrjoltcola,
Sorry for trying to close the question improperly - I have not been using the site for a while, and did not see that the question was still open.
Anyway, the resolution was not programmatic, it was mostly a cleanup.
I had several prior version war files and applications in the webapps directory, and they were renamed in order not to confused them with the war file I was working with.
Apparently, as some of them were trying to communicate with the same database when I started the Tomcat service, somehow they prevented the right version to work properly.
After I deleted or moved from the webapp directory all old files, the application started working.
At the time I could not investigate what exactly caused the problem as I had to move on.
Thank you for your help.

Administrator, please close this question.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.