Subject | Re: [Firebird-Java] Re: Need help with JCA/JDBC driver install to connect to Firebird Database - Linux |
---|---|
Author | Rick Fincher |
Post date | 2006-05-05T23:27:31Z |
Hi Biji,
After this post I'll e-mail you directly because this is more of a
Tomcat problem than JayBird. I think we can sort it out for you though.
I see a couple of things that it might be. From your output below, I
see you are trying to log in with a user database realm provided by a
database on the Firebird server. Since you were able to log in as
manager this seems to be working. I'm puzzled because the JDBC realm
seems to have failed to load because of a bad username/password. Did you
set up your user name, password, and "manager" role in the in
conf/tomcat-users.xml?
If so this needs to be disabled to ue a jdbc realm. Check your
server.xml file and be sure you only have one realm tag.
The actual error you are getting is an authentication error trying to
log into Firebird.
It may be that your web app is trying to load with a security role
listed in the WEB-INF file of the web app that is not in the realm that
you specified.
If that part is OK, set yourself up as the role "admin" as well as
"manager" in Tomcat so that you can log into the admin tool and look at
the DataSources set up for Tomcat. The username/password may be
incorrect here too. Again, the DataSources should not be configured
directly in server.xml but in the admin tool so that you can add/modify
DataSources without restarting Tomcat.
To do that you need to go into the "Tomcat Administratorn" tool. This
is different from the manager, and is right above the selection for
"Tomcat Manager" on Tomcat's splash page.
You should see a DataSource for each of your databases there. I'm
assuming you are using DataSources in your web app and not trying to
open the database directly from within your servlet code or JSP page.
It sounds like you may be trying to set your web app's context in
$CATALINA_HOME/conf/server.xml directly. This is no longer recommended
for contexts in Tomcat. You set up your contexts in the META-INF
directory of your web app in a file called context.xml. It will look
something like:
<Context docBase="app" path="/app" >
<ResourceLink name="jdbc/db" global="jdbc/db"
type="javax.sql.DataSource"/>
</Context>
After Tomcat is running you can see your contexts by going to the directory:
$CATALINA_HOME/conf/Catalina/localhost (assuming localhost is the name of your host).
In that directory you should see a file with a ".xml" filename for each web application. Tomcat creates this file by reading the $CATALINA_HOME/webapps/web_app_name/META-INF/context.xml file of the web app and reading your entry there.
It should looks something like:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<ResourceLink
global="jdbc/db"
name="jdbc/db"
type="javax.sql.DataSource"/>
<WatchedResource>/opt/jakarta/tomcat/conf/context.xml</WatchedResource>
</Context>
Hope this gives you something to start on anyway. Reply to rnf@....
Rick
Bijilal Poikayil wrote:
After this post I'll e-mail you directly because this is more of a
Tomcat problem than JayBird. I think we can sort it out for you though.
I see a couple of things that it might be. From your output below, I
see you are trying to log in with a user database realm provided by a
database on the Firebird server. Since you were able to log in as
manager this seems to be working. I'm puzzled because the JDBC realm
seems to have failed to load because of a bad username/password. Did you
set up your user name, password, and "manager" role in the in
conf/tomcat-users.xml?
If so this needs to be disabled to ue a jdbc realm. Check your
server.xml file and be sure you only have one realm tag.
The actual error you are getting is an authentication error trying to
log into Firebird.
It may be that your web app is trying to load with a security role
listed in the WEB-INF file of the web app that is not in the realm that
you specified.
If that part is OK, set yourself up as the role "admin" as well as
"manager" in Tomcat so that you can log into the admin tool and look at
the DataSources set up for Tomcat. The username/password may be
incorrect here too. Again, the DataSources should not be configured
directly in server.xml but in the admin tool so that you can add/modify
DataSources without restarting Tomcat.
To do that you need to go into the "Tomcat Administratorn" tool. This
is different from the manager, and is right above the selection for
"Tomcat Manager" on Tomcat's splash page.
You should see a DataSource for each of your databases there. I'm
assuming you are using DataSources in your web app and not trying to
open the database directly from within your servlet code or JSP page.
It sounds like you may be trying to set your web app's context in
$CATALINA_HOME/conf/server.xml directly. This is no longer recommended
for contexts in Tomcat. You set up your contexts in the META-INF
directory of your web app in a file called context.xml. It will look
something like:
<Context docBase="app" path="/app" >
<ResourceLink name="jdbc/db" global="jdbc/db"
type="javax.sql.DataSource"/>
</Context>
After Tomcat is running you can see your contexts by going to the directory:
$CATALINA_HOME/conf/Catalina/localhost (assuming localhost is the name of your host).
In that directory you should see a file with a ".xml" filename for each web application. Tomcat creates this file by reading the $CATALINA_HOME/webapps/web_app_name/META-INF/context.xml file of the web app and reading your entry there.
It should looks something like:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<ResourceLink
global="jdbc/db"
name="jdbc/db"
type="javax.sql.DataSource"/>
<WatchedResource>/opt/jakarta/tomcat/conf/context.xml</WatchedResource>
</Context>
Hope this gives you something to start on anyway. Reply to rnf@....
Rick
Bijilal Poikayil wrote:
>Rick,[Non-text portions of this message have been removed]
>
>Finally I figured out the Tomcat part it is working fine. But still
>the JDBC part seems to not working.
>
>Current software version I have:
>
>Webserver
>==========
>Server version: Apache Tomcat/5.5.17
>OS Name: Linux
>OS Version: 2.6.9-5.EL
>Architecture: i386
>JVM Version: 1.5.0_01-b08
>JVM Vendor: Sun Microsystems Inc.
>
>Firebird version:
>================
>SQL> show version;
>ISQL Version: LI-V1.5.3.4870 Firebird 1.5
>Firebird/linux Intel (access method), version "LI-V1.5.3.4870
>Firebird 1.5"
>Firebird/linux Intel (remote server), version "LI-V1.5.3.4870
>Firebird 1.5/tcp (hostname)/P10"
>Firebird/linux Intel (remote interface), version "LI-V1.5.3.4870
>Firebird 1.5/tcp (hostname)/P10"
>on disk structure version 10.1
>SQL>
>
>
>Jbird Version
>=============
>Using file - jaybird-full-2.0.1.jar extracted from JayBird-
>2.0.1JDK_1.5.zip
>
>Can you please suggest me what other setup I am missing here since I
>am pretty much on the new version of software now.
>Thanks a bunch for your help and time.
>
>Error stack from tomcat logs
>============================
>May 4, 2006 1:19:03 AM org.apache.catalina.realm.JDBCRealm
>authenticate
>SEVERE: Exception performing authentication
>org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544721.
>Unable to complete network request to host "localhost".
>Reason: Unable to complete network request to host "localhost".
> at org.firebirdsql.jdbc.FBDataSource.getConnection
>(FBDataSource.java:122)
> at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
> at org.apache.catalina.realm.JDBCRealm.open
>(JDBCRealm.java:699)
> at org.apache.catalina.realm.JDBCRealm.authenticate
>(JDBCRealm.java:344)
> at
>org.apache.catalina.authenticator.FormAuthenticator.authenticate
>(FormAuthenticator.java:257)
> at org.apache.catalina.authenticator.AuthenticatorBase.invoke
>(AuthenticatorBase.java:416)
> at org.apache.catalina.core.StandardHostValve.invoke
>(StandardHostValve.java:126)
> at org.apache.catalina.valves.ErrorReportValve.invoke
>(ErrorReportValve.java:105)
> at org.apache.catalina.core.StandardEngineValve.invoke
>(StandardEngineValve.java:107)
> at org.apache.catalina.connector.CoyoteAdapter.service
>(CoyoteAdapter.java:148)
> at org.apache.coyote.http11.Http11Processor.process
>(Http11Processor.java:869)
> at
>org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
>rocessConnection(Http11BaseProtocol.java:664)
> at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
>(PoolTcpEndpoint.java:527)
> at
>org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt
>(LeaderFollowerWorkerThread.java:80)
> at
>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
>(ThreadPool.java:684)
> at java.lang.Thread.run(Thread.java:595)
>at org.firebirdsql.gds.GDSException: Unable to complete network
>request to host "localhost".
> at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.connect
>(AbstractJavaGDSImpl.java:1947)
> at
>org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.isc_attach_database
>(AbstractJavaGDSImpl.java:386)
> at
>org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase
>(AbstractJavaGDSImpl.java:362)
> at org.firebirdsql.jca.FBManagedConnection.<init>
>(FBManagedConnection.java:89)
> at
>org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnectio
>n(FBManagedConnectionFactory.java:462)
> at
>org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection
>(FBStandAloneConnectionManager.java:69)
> at org.firebirdsql.jdbc.FBDataSource.getConnection
>(FBDataSource.java:119)
> at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
> at org.apache.catalina.realm.JDBCRealm.open
>(JDBCRealm.java:699)
> at org.apache.catalina.realm.JDBCRealm.authenticate
>(JDBCRealm.java:344)
> at
>org.apache.catalina.authenticator.FormAuthenticator.authenticate
>(FormAuthenticator.java:257)
> at org.apache.catalina.authenticator.AuthenticatorBase.invoke
>(AuthenticatorBase.java:416)
> at org.apache.catalina.core.StandardHostValve.invoke
>(StandardHostValve.java:126)
> at org.apache.catalina.valves.ErrorReportValve.invoke
>(ErrorReportValve.java:105)
> at org.apache.catalina.core.StandardEngineValve.invoke
>(StandardEngineValve.java:107)
> at org.apache.catalina.connector.CoyoteAdapter.service
>(CoyoteAdapter.java:148)
> at org.apache.coyote.http11.Http11Processor.process
>(Http11Processor.java:869)
> at
>org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
>rocessConnection(Http11BaseProtocol.java:664)
> at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
>(PoolTcpEndpoint.java:527)
> at
>org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt
>(LeaderFollowerWorkerThread.java:80)
> at
>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
>(ThreadPool.java:684)
> at java.lang.Thread.run(Thread.java:595)
>$
>
>
>Biji
>
>--- In Firebird-Java@yahoogroups.com, "Bijilal Poikayil"
><bijilal@...> wrote:
>
>
>>Hi Rick,
>>
>>Thanks for your reply. As you suggested I tried to install Tomcat
>>5.5.17. The install went fine and tomcat was able to run fine. I
>>
>>
>did
>
>
>>configure the manager role to login, which also worked.
>>
>>But when I added the context which I had on my Tomcat 5.5.9
>>
>>
>install
>
>
>>the directory that used to show up is not coming up now.
>>
>>This is how I have it set in the server.xml file, right above
>></Host> entry.
>>
>>++
>> <Context path="/picture" docBase="test" debug="0"
>>reloadable="true" />
>> </Host>
>>++
>>
>>Where "test" is a directory located as $CATALINA_HOME/webapps/test
>>
>>When I try to access www.mydomain.com/picture, I get the error
>>below. This used to work just fine with my Tomcat 5.5.9, but not
>>
>>
>on
>
>
>>5.5.17. I did bounce tomcat after these changes, but did not help.
>>
>>
>I
>
>
>>also read that you need to have the context entry in the
>>
>>
>context.xml
>
>
>>file for tomcat version 5.5.x, but not really clear on this.
>>++
>>HTTP Status 404 - /picture/
>>-------------------------------------------------------------------
>>
>>
>--
>
>
>>-----------
>>type Status report
>>message /picture
>>description The requested resource (/picture) is not available.
>>-------------------------------------------------------------------
>>
>>
>--
>
>
>>----------
>>Apache Tomcat/5.5.17
>>++
>>
>>I would like to keep Tomcat 5.5.17, but before I could test my
>>
>>
>JDBC
>
>
>>connection I need this context entry to work. Any one who has ran
>>into this before can you please suggest what is the best fix or
>>
>>
>work
>
>
>>around here. Appreciate every one valuble time.
>>
>>Thanks
>>Biji
>>
>>
>>--- In Firebird-Java@yahoogroups.com, Rick Fincher <rnf@> wrote:
>>
>>
>>>Hi All,
>>>
>>>I'm using 2.0.1 with Tomcat 5.9.12 with no problems. I had
>>>
>>>
>>already
>>
>>
>>>updated to Tomcat 5.5.12 from 5.5.9 when JayBird 2.0 was
>>>
>>>
>released
>
>
>>so I
>>
>>
>>>haven't tried it with Tomcat 5.5.9.
>>>
>>>If that is the problem, the update to Tomcat 5.5.12 is
>>>
>>>
>painless.
>
>
>>Or go
>>
>>
>>>to 5.5.17, the current stable release. All the settings are the
>>>
>>>
>>same.
>>
>>
>>>This is on Fedora Core 3 (Redhat).
>>>
>>>Rick
>>>
>>>
>>>Catalin Florean wrote:
>>>
>>>
>>>
>>>>Jaybird 2.0.1 did not work with my Tomcat/Firebird enviroment
>>>>
>>>>
>but
>
>
>>>>Jaybird 1.5.6 worked just fine.
>>>>I did not have the time to investigate the cause.
>>>>
>>>>I am waiting for the release of the new Firebird 2.0 to migrate
>>>>
>>>>
>my
>
>
>>>>database and have another try with Jaybird 2.
>>>>
>>>>Catalin Florean.
>>>>
>>>>On 5/3/06, Roman Rokytskyy <rrokytskyy@> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>>5. You should use Jaybird 1.5.6 JDBC driver.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>May I ask you what is the reason for such recommendation?
>>>>>
>>>>>Roman
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>[Non-text portions of this message have been removed]
>>>
>>>
>>>
>
>
>
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>