You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Olivier Lamy (Commented) (JIRA)" <ji...@apache.org> on 2012/03/12 13:21:38 UTC

[jira] [Commented] (MTOMCAT-125) mvn tomcat7:run got "javax.naming.NameNotFoundException: Name jdbc is not bound in this Context"

    [ https://issues.apache.org/jira/browse/MTOMCAT-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13227456#comment-13227456 ] 

Olivier Lamy commented on MTOMCAT-125:
--------------------------------------

Do you have more logs ? (especially container start )
How do you add dependency on your jdbc driver when you use the plugin ?
                
> mvn tomcat7:run got "javax.naming.NameNotFoundException: Name jdbc is not bound in this Context"
> ------------------------------------------------------------------------------------------------
>
>                 Key: MTOMCAT-125
>                 URL: https://issues.apache.org/jira/browse/MTOMCAT-125
>             Project: Apache Tomcat Maven Plugin
>          Issue Type: Bug
>          Components: tomcat7
>    Affects Versions: 2.0-beta-1
>         Environment: JDK 7, Tomcat 7.0.25, tomcat7-maven-plugin/2.0-beta-1
>            Reporter: guofeng zhang
>            Assignee: Olivier Lamy
>
> I configured the datatsource as global naming datasource in server.xml,
>   <GlobalNamingResources>
> <Resource
>        auth="Container"
>        maxPoolSize="100" minPoolSize="10"
>        name="jdbc/iviewDS"
>        testQuery="select count(*) from T_ROLE"
>        factory="......"
>        type="javax.sql.DataSource"
>        uniqueResourceName="jdbc/iviewDS"/>
> The server.xml is copied to src\main\tomcatconf, (this also copyied by the plugin to target\tomcat\conf, so it is used).
> then in webapp/META-INF/context.xml, I have:
>    <ResourceLink 
>         name="jdbc/iviewDS"
>         global="jdbc/iviewDS"
>         type="javax.sql.DataSource"
>     />
> And in web.xml:
>                 <resource-ref>
>                                 <description>datasoruce</description>
>                                 <res-ref-name>jdbc/iviewDS</res-ref-name>
>                                 <res-type>javax.sql.DataSource</res-type>
>                                 <res-auth>Container</res-auth>
>                 </resource-ref>
> In my code, I lookup the datasource using 'java:/comp/env/jdbc/iviewDS'.
> This works well when I deploy the app into tomcat/app directory.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org