<Realm className="org.apache.catalina.realm.JDBCRealm"
      driverName="org.gjt.mm.mysql.Driver"
   
connectionURL="jdbc:mysql://localhost/authority?user=dbuser&amp;password=dbpass"
       userTable="users" userNameCol="user_name" userCredCol="user_pass"
   userRoleTable="user_roles" roleNameCol="role_name"/>



 not Resource..but  Realm 
http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#JDBCRealm
for Hibernate:
specify the hibernate attributes in either hibernate.properties or 
hibernate.cfg.xml  (and place on classpath)

hibernate.connection.driver_classJDBC driver classhibernate.connection.urlJDBC 
URLhibernate.connection.usernamedatabase 
userhibernate.connection.passworddatabase user 
passwordhibernate.connection.pool_sizemaximum number of pooled connections
 configure each table in  /packagename/TableName.hbm.xml 
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/session-configuration.html
Bedankt,Martin-
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.

 > Date: Wed, 9 Jan 2013 22:25:23 +0100
> Subject: add database resource
> From: leon.m...@hccnet.nl
> To: users@tomcat.apache.org
> 
> I'm quite new with tomcat.
> I run 7.0.30.
> 
> I have succesfully installed an application, however i'm facing issues
> with the database connection.
> 
> As i understood i added the following code to server.xml
> 
> <Context path="/" debug="1" reloadable="true" crossContext="true"
>  antiJARLocking="true" antiResourceLocking="true">
>      <Resource
>          name="jdbc/atvd"
>          type="javax.sql.DataSource"
>          auth="container"
>          username="atvd"
>          password="atvd"
>          driverClassName="com.mysql.jdbc.Driver"
>          url="jdbc:mysql://localhost:3306/atvd12?autoReconnect=true" />
>  </Context>
> 
> Unfortunately I'm Getting below error.
> Don't get any special information from the log.
> 
> type Exception report
> 
> message Could not execute action
> 
> description The server encountered an internal error that prevented it
> from fulfilling this request.
> 
> exception
> javax.servlet.ServletException: Could not execute action
>       
> com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:196)
>       
> com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:182)
> 
> 
> 
> root cause
> java.lang.NullPointerException
>       
> nl.dolhuis.util.hibernate.HibernateSession.getSession(HibernateSession.java:25)
>       
> nl.dolhuis.util.hibernate.HibernateInterceptor.intercept(HibernateInterceptor.java:83)
>       
> com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
>       
> com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32)
>       
> com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
>       
> com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:119)
>       
> com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:183)
>       
> com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:182)
> 
> 
> 
> note The full stack trace of the root cause is available in the Apache
> Tomcat/7.0.30 logs.
> 
> Hopefully somebody knows what i'm doing wrong.
> 
> thanks in advance.
> 
> regards,
> 
> Léon
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
                                          

Reply via email to