java - Spring / Tomcat - Error in DataSource (NameNotFoundException) -


i trying connect spring mvc 4 application sql local bbdd.

this files:

spring mvcconfiguration file:

@bean public datasource datasource() throws exception {      context cts = new initialcontext();      datasource dts = (datasource) cts.lookup("java:/comp/env/jdbc/etielabbdd");       return dts; } 

tomcat context.xml:

<resourcelink name="jdbc/etielabbdd"             global="jdbc/bbdd"             auth="container"             type="javax.sql.datasource" /> 

tomcat server xml:

<resource name="jdbc/bbdd" global="jdbc/bbdd" auth="container" type="javax.sql.datasource"      username="xxxxxx"      password="xxxxxx"      driverclassname="com.mysql.jdbc.driver"      url="jdbc:mysql://localhost:3306/confluenceuseunicode=true&amp;characterencoding=utf8"      maxactive="15"      maxidle="7"      defaulttransactionisolation="read_committed"      validationquery="select 1" /> 

and, when start tomcat, error appears:

javax.naming.namenotfoundexception: name jdbc/bbdd not bound in context 

i 2 days trying solve error no solution. idea? thanks.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -