I'm configuring a DatasourceRealm
in Tomcat 6 configuring everything in META-INF/context.xml
. web.xml
seems to be configured correctly since login prompt is showing up.
Can someone help?
context.xml
<Context >
<Resource name="jdbc/auth" description="authentication" type="javax.sql.DataSource"
auth="Container" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
maxActive="25" maxIdle="10" maxWait="10000"
url="jdbc:sqlserver://SQLSERVER;databaseName=db;integratedSecurity=true"
validationQuery="select 1" />
<Realm className="org.apache.catalina.realm.DataSourceRealm"
dataSourceName="jdbc/auth" userTable="WebUsers" userNameCol="username"
userCredCol="password" userRoleTable="WebUserRoles" roleNameCol="role"
localDataSource="true"/>
</Context>
Stack
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
I figured out the issue. Under $CATALINA_BASE\conf\Catalina\localhost, there was another [App Name].xml file that was older (it did not have the localDatasource="true" flag) and did not have the same configuration I posted. I removed that file and redeployed my war. It worked after that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With