tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Wilkinson <w...@forethought.net>
Subject Re: DataSourceRealm with MySQL
Date Fri, 22 Aug 2003 14:31:37 GMT
I tried that because you had it in your July 31, 2003 message and I 
still get the same error.

Thanks for replying.

It seems like the DataSourceRealm can not be a managed bean.

Scott Stewart wrote:

> I believe the dataSourceName attribute in your <Realm> definition needs to
> exactly match the name given to your <Resource> element defined within your
> <GlobalNamingResources>.  Therefore, you may want to change your
> dataSourceName to just read "jdbc/authority".
> 
> Thanks,
> 
> Scott Stewart
> [Manager, Software Development]
> SStewart@csky.com
> 
> work:  (407) 515-8656
> cell  :  (407) 435-1036
> fax   :  (407) 515-9001
> 
> ClearSky Mobile Media, Inc.
> 56 E. Pine Street  Suite 200
> Orlando, FL  32801
> USA
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Steve Wilkinson [mailto:wsd2@forethought.net]
> Sent: Friday, August 22, 2003 8:13 AM
> To: tomcat-user@jakarta.apache.org
> Subject: DataSourceRealm with MySQL
> 
> 
> Hi,
> 
> I'm struggling with creating a DataSourceRealm with MySQL.
> I'm running Tomcat 4.1.27-LE-jdk14 on Windows2K
> 
> First, I can get the following example to work:
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how
> to.html
> 
> So, I don't think it's a MySQL thing.
> 
> I've tried the settings from Scott Stewart's email and it doesn't work:
> http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg99745.html
> 
> Here is my server.xml:
> 
> ------------------------------  server.xml -------------------------
> <Server port="8005" shutdown="SHUTDOWN" debug="0">
> 
> 
>   <Listener
>     className="org.apache.catalina.mbeans.ServerLifecycleListener"
>     debug="0"/>
>   <Listener
>   className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
>   debug="0"/>
> 
>   <GlobalNamingResources>
>     <Resource
>        name="jdbc/authority"
>        type="javax.sql.DataSource"
>        auth="Container"/>
> 
>     <ResourceParams name="jdbc/authority">
>       <parameter>
>         <name>username</name>
>         <value>mysql</value>
>       </parameter>
>       <parameter>
>         <name>password</name>
>         <value>mysql</value>
>       </parameter>
>       <parameter>
>         <name>driverClassName</name>
>         <value>com.mysql.jdbc.Driver</value>
>       </parameter>
>       <parameter>
>          <name>url</name>
>          <value>
>             jdbc:mysql://localhost:3306/authority?autoReconnect=true
>          </value>
>       </parameter>
>       <parameter>
>          <name>removeAbandoned</name>
>          <value>true</value>
>       </parameter>
>       <parameter>
>         <name>removeAbandonedTimeout</name>
>         <value>60</value>
>       </parameter>
>       <parameter>
>          <name>logAbandoned</name>
>          <value>true</value>
>       </parameter>
>       <parameter>
>          <name>maxActive</name>
>          <value>100</value>
>       </parameter>
>       <parameter>
>          <name>maxIdle</name>
>          <value>10000</value>
>       </parameter>
>       <parameter>
>          <name>maxWait</name>
>          <value>10000</value>
>       </parameter>
>     </ResourceParams>
> 
>      </GlobalNamingResources>
> 
>      <Service name="Tomcat-Standalone">
> 
>          <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
>              port="8080" minProcessors="5" maxProcessors="75"
>              enableLookups="true" redirectPort="8443"
>              acceptCount="100" debug="0" connectionTimeout="20000"
>              useURIValidationHack="false" disableUploadTimeout="true" />
> 
>          <Engine name="Standalone" defaultHost="localhost" debug="99">
> 
>              <Logger className="org.apache.catalina.logger.FileLogger"
>                  prefix="catalina_log." suffix=".txt"
>                  timestamp="true"/>
> 
>              <Realm className="org.apache.catalina.realm.DataSourceRealm"
>                  debug="99"
>                  dataSourceName="java:/comp/env/jdbc/authority"
>                  userTable="users"
>                  userNameCol="user_name"
>                  userCredCol="user_pass"
>                  userRoleTable="user_roles"
>                  roleNameCol="role_name"/>
> 
>              <Host name="localhost" debug="99" appBase="webapps"
>                  unpackWARs="true" autoDeploy="true">
> 
>                  <Valve
>                     className="org.apache.catalina.valves.AccessLogValve"
>                     directory="logs"  prefix="localhost_access_log."
>                     suffix=".txt"
>                     pattern="common" resolveHosts="false"/>
> 
>                  <Logger
>                    className="org.apache.catalina.logger.FileLogger"
>                    directory="logs"  prefix="localhost_log."
>                    suffix=".txt"
>                    timestamp="true"/>
> 
>              </Host>
> 
>          </Engine>
> 
>      </Service>
> 
> </Server>
> 
> ---------------------------------------------------------------------
> Here is the error message I get from Tomcat when I use my server.xml above:
> 
> ServerLifecycleListener: Can't create mbean for realm
> org.apache.catalina.realm.
> DataSourceRealm@1f66cff
> 
> Note, I was able to the the JDBCRealm working fine.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


Mime
View raw message