Re: DataSourceRealm says "Name jdbc is not bound in this Context"
Dominik, that worked! Champion!!! My revised context.xml looks like this: On Mon, 07 Feb 2005 08:57:08 +0100, Dominik Drzewiecki <[EMAIL PROTECTED]> wrote: > Dan Washusen <[EMAIL PROTECTED]> wrote: > > Hi Sven, > > I can access the data source from within my code using the name > > "java:/comp/env/jdbc/MindDB" and everything works great. It's just > > that the Realm can't... I have found a few other posts to this list > > with the same problem and one of the email suggested that the Realm is > > configured before the DataSource causing an error to be thrown during > > realm initialisation (as the DataSource is missing). > > > > It looks like the "solution" is to move the DataSource configuration > > to the Global configuration area or to use the JBDCRealm. > > It is not necessary to make the datasource global. Try adding > localDataSource="true" to your context Realm definition. > Having consulted the docs for 4.1.x, 5.0.x and 5.5.x, t seems that this > flag is only allowed in the latest version of tomcat. There's a chance > though that it has been backported without having the docs updated. > > HTH, > /dd > > -- Jar-Jar makes the Ewoks look like f*%#ing Shaft! - Tim Bisley - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSourceRealm says "Name jdbc is not bound in this Context"
Dan Washusen <[EMAIL PROTECTED]> wrote: > Hi Sven, > I can access the data source from within my code using the name > "java:/comp/env/jdbc/MindDB" and everything works great. It's just > that the Realm can't... I have found a few other posts to this list > with the same problem and one of the email suggested that the Realm is > configured before the DataSource causing an error to be thrown during > realm initialisation (as the DataSource is missing). > > It looks like the "solution" is to move the DataSource configuration > to the Global configuration area or to use the JBDCRealm. It is not necessary to make the datasource global. Try adding localDataSource="true" to your context Realm definition. Having consulted the docs for 4.1.x, 5.0.x and 5.5.x, t seems that this flag is only allowed in the latest version of tomcat. There's a chance though that it has been backported without having the docs updated. HTH, /dd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSourceRealm says "Name jdbc is not bound in this Context"
Hi Sven, I can access the data source from within my code using the name "java:/comp/env/jdbc/MindDB" and everything works great. It's just that the Realm can't... I have found a few other posts to this list with the same problem and one of the email suggested that the Realm is configured before the DataSource causing an error to be thrown during realm initialisation (as the DataSource is missing). It looks like the "solution" is to move the DataSource configuration to the Global configuration area or to use the JBDCRealm. To some it up, given the number of emails I've found with this problem I believe it's a bug in Tomcat. Cheers, Dan On Sun, 6 Feb 2005 10:38:14 -0800 (PST), sven morales <[EMAIL PROTECTED]> wrote: > Hi, > This is an excerpt of my code, to get a Context. > Try and see if it works for you. > > 31 private void initDataSource () { > 32 try { > 33 Context initCtx = new InitialContext(); > 34 Context envCtx = (Context) > initCtx.lookup("java:comp/env"); > 35 dataSource = (DataSource) > envCtx.lookup("jdbc/Taglib"); > 36 } > 37 catch (NamingException e) { > 38 System.out.println("ERR: Unable to > Initialize Data Source (" + e + ")"); > 39 } > 40 } > > Configs of web.xml is similar to yours. However am not > sure if you need an additional parameter to > like so: > > 8 > 9 dataSource > 10 jdbc/Taglib > 11 > > Check the dtd description at > http://java.sun.com/j2ee/dtds/web-app_2.3.dtd for > further info. > > aka_sergio > > > --- Dan Washusen <[EMAIL PROTECTED]> wrote: > > > Hi All, > > I'm trying to get container managed authentication > > going under Tomcat > > 5.5 using the > > org.apache.catalina.realm.DataSourceRealm class. > > I've > > configured a DataSource using the name "jdbc/MindDB" > > and I can access > > that from within my app, but when the configured > > DataSourceRealm tries > > to access it I get > > "javax.naming.NameNotFoundException: Name jdbc is > > not bound in this Context". > > > > My context.xml looks like this: > > > > > docBase="D:/Development/Projects/mind/src/webapp" > > debug="5" reloadable="true"> > >> type="javax.sql.DataSource" > > maxActive="100" maxIdle="30" maxWait="1" > > username="mind" password="" > > driverClassName="org.postgresql.Driver" > > url="jdbc:postgresql://localhost/mind"/> > > > >> > className="org.apache.catalina.realm.DataSourceRealm" > > debug="99" > > dataSourceName="jdbc/MindDB" > > userTable="mind_user" userNameCol="alias" > > userCredCol="password" > > userRoleTable="mind_user_role" > > roleNameCol="name"/> > > > > > > And the relevant section of my web.xml looks like > > this: > > ... > > > > Mind DB > > Connection > > jdbc/MindDB > > javax.sql.DataSource > > Container > > > > ... > > > > I've also tried using the full name of > > "java:/comp/env/jdbc/MindDB" > > that works in my code but that just changes my error > > to > > "javax.naming.NameNotFoundException: Name java: is > > not bound in this > > Context". > > > > Any help would be greatly appreciated... > > > > Cheers, > > Dan > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > __ > Do you Yahoo!? > Yahoo! Mail - Easier than ever with enhanced search. Learn more. > http://info.mail.yahoo.com/mail_250 > -- Jar-Jar makes the Ewoks look like f*%#ing Shaft! - Tim Bisley - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSourceRealm says "Name jdbc is not bound in this Context"
Hi, This is an excerpt of my code, to get a Context. Try and see if it works for you. 31 private void initDataSource () { 32 try { 33 Context initCtx = new InitialContext(); 34 Context envCtx = (Context) initCtx.lookup("java:comp/env"); 35 dataSource = (DataSource) envCtx.lookup("jdbc/Taglib"); 36 } 37 catch (NamingException e) { 38 System.out.println("ERR: Unable to Initialize Data Source (" + e + ")"); 39 } 40 } Configs of web.xml is similar to yours. However am not sure if you need an additional parameter to like so: 8 9 dataSource 10 jdbc/Taglib 11 Check the dtd description at http://java.sun.com/j2ee/dtds/web-app_2.3.dtd for further info. aka_sergio --- Dan Washusen <[EMAIL PROTECTED]> wrote: > Hi All, > I'm trying to get container managed authentication > going under Tomcat > 5.5 using the > org.apache.catalina.realm.DataSourceRealm class. > I've > configured a DataSource using the name "jdbc/MindDB" > and I can access > that from within my app, but when the configured > DataSourceRealm tries > to access it I get > "javax.naming.NameNotFoundException: Name jdbc is > not bound in this Context". > > My context.xml looks like this: > > docBase="D:/Development/Projects/mind/src/webapp" > debug="5" reloadable="true"> >type="javax.sql.DataSource" > maxActive="100" maxIdle="30" maxWait="1" > username="mind" password="" > driverClassName="org.postgresql.Driver" > url="jdbc:postgresql://localhost/mind"/> > > className="org.apache.catalina.realm.DataSourceRealm" > debug="99" > dataSourceName="jdbc/MindDB" > userTable="mind_user" userNameCol="alias" > userCredCol="password" > userRoleTable="mind_user_role" > roleNameCol="name"/> > > > And the relevant section of my web.xml looks like > this: > ... > > Mind DB > Connection > jdbc/MindDB > javax.sql.DataSource > Container > > ... > > I've also tried using the full name of > "java:/comp/env/jdbc/MindDB" > that works in my code but that just changes my error > to > "javax.naming.NameNotFoundException: Name java: is > not bound in this > Context". > > Any help would be greatly appreciated... > > Cheers, > Dan > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DataSourceRealm says "Name jdbc is not bound in this Context"
Hi All, I'm trying to get container managed authentication going under Tomcat 5.5 using the org.apache.catalina.realm.DataSourceRealm class. I've configured a DataSource using the name "jdbc/MindDB" and I can access that from within my app, but when the configured DataSourceRealm tries to access it I get "javax.naming.NameNotFoundException: Name jdbc is not bound in this Context". My context.xml looks like this: And the relevant section of my web.xml looks like this: ... Mind DB Connection jdbc/MindDB javax.sql.DataSource Container ... I've also tried using the full name of "java:/comp/env/jdbc/MindDB" that works in my code but that just changes my error to "javax.naming.NameNotFoundException: Name java: is not bound in this Context". Any help would be greatly appreciated... Cheers, Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]