This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Context help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Context help" Watch "Context help" New topic
Author

Context help

Vinicius Carvalho
Ranch Hand

Joined: Dec 07, 2004
Posts: 61
Hello there! I'm trying to configure my DataSource Realm, but it's throwing an naming exception:

<Context path="/springremoting" docBase="${catalina.home}/webapps/springremoting">
<ResourceLink name="jdbc/remotingDS" global="jdbc/remotingDS" type="javax.sql.DataSource" />

<Realm className="org.apache.catalina.realm.DataSourceRealm" debug="99"
dataSourceName="jdbc/remotingDS"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name"/>

</Context>


--- web.xml ---
<resource-ref>
<res-ref-name>jdbc/remotingDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

It's throwing a javax.naming.NameNotFoundException : Name jdbc is not bound in this context.

I also tried java:comp/env/jdbc

Regards
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Context help