You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by khozaima shakir <sk...@hotmail.com> on 2002/08/12 16:41:33 UTC

JDBC Realm Error --Can"t access database

Hi all, need help, please!
I am trying to set up JDBCRealm. I edit server.xml as:-
<Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
             driverName="org.gjt.mm.mysql.Driver"
          
connectionURL="jdbc:mysql://mysql.wpi.edu/EMSDATA?user=skhuzema;password=pPqrAb"
              userTable="USERS" userNameCol="USER_NAME"
userCredCol="USER_PASS"
          userRoleTable="USER_ROLES" roleNameCol="ROLE_NAME" />
When i restart the tomcat after this, i get error message as
Starting service Tomcat-Standalone
Apache Tomcat/4.0.4
Catalina.start: LifecycleException:  Exception opening database connection:
java.sql.SQLException: Invalid authorization specification: Access denied 
for user:'skhuzema;password@fla22-1.cs.WPI.EDU' (Using password: NO)
LifecycleException:  Exception opening database connection:
java.sql.SQLException: Invalid authorization specification: Access denied 
for user: 'skhuzema;password@fla22-1.cs.WPI.EDU' (Using password: NO)
        at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615)
        at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
        at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
        at 
org.apache.catalina.core.StandardService.start(StandardService.java:388)
        at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
      at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
        at java.lang.reflect.Method.invoke(Native Method)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)

The mysql database server is not on my local host (for tomcat). Does it look 
like the connection URL is not being parsed correctly? ( I tried changing 
the connectionURL string in server.xml and those were reflected in the error 
message and still got error as (Using Password: NO) Without setting up 
JDBCRealm, I can start the tomcat sucessfully and the servlet also access 
the database using the same url username and password....
can't figure out the fault... please help???!!!!!!!!!!!!
What other configs, do I need to do in addition to the one in server.xml, 
just to get tomcat started?
Khozaima





_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: JDBC Realm Error --Can"t access database

Posted by Andrew <an...@attbi.com>.
Try removing your username and password info from your connection string
and using the 'connectionName' and 'connectionPassword' attributes

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/realm-howto.html

- Andrew

> -----Original Message-----
> From: khozaima shakir [mailto:skhuzema@hotmail.com] 
> Sent: Monday, August 12, 2002 10:42 AM
> To: tomcat-user@jakarta.apache.org
> Subject: JDBC Realm Error --Can"t access database
> 
> 
> Hi all, need help, please!
> I am trying to set up JDBCRealm. I edit server.xml as:-
> <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
>              driverName="org.gjt.mm.mysql.Driver"
>           
> connectionURL="jdbc:mysql://mysql.wpi.edu/EMSDATA?user=skhuzem
> a;password=pPqrAb"
>               userTable="USERS" userNameCol="USER_NAME" 
> userCredCol="USER_PASS"
>           userRoleTable="USER_ROLES" roleNameCol="ROLE_NAME" 
> /> When i restart the tomcat after this, i get error message 
> as Starting service Tomcat-Standalone Apache Tomcat/4.0.4
> Catalina.start: LifecycleException:  Exception opening 
> database connection:
> java.sql.SQLException: Invalid authorization specification: 
> Access denied 
> for user:'skhuzema;password@fla22-1.cs.WPI.EDU' (Using password: NO)
> LifecycleException:  Exception opening database connection:
> java.sql.SQLException: Invalid authorization specification: 
> Access denied 
> for user: 'skhuzema;password@fla22-1.cs.WPI.EDU' (Using password: NO)
>         at 
> org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615)
>         at 
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
>         at 
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
>         at 
> org.apache.catalina.core.StandardService.start(StandardService
> .java:388)
>         at 
> org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
>         at 
> org.apache.catalina.startup.Catalina.start(Catalina.java:781)
>         at 
> org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
>       at 
> org.apache.catalina.startup.Catalina.process(Catalina.java:179)
>         at java.lang.reflect.Method.invoke(Native Method)
>        at 
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
> 
> The mysql database server is not on my local host (for 
> tomcat). Does it look 
> like the connection URL is not being parsed correctly? ( I 
> tried changing 
> the connectionURL string in server.xml and those were 
> reflected in the error 
> message and still got error as (Using Password: NO) Without 
> setting up 
> JDBCRealm, I can start the tomcat sucessfully and the servlet 
> also access 
> the database using the same url username and password....
> can't figure out the fault... please help???!!!!!!!!!!!!
> What other configs, do I need to do in addition to the one in 
> server.xml, 
> just to get tomcat started?
> Khozaima
> 
> 
> 
> 
> 
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>