RE: JNDI, DataSource & SingleSignOn but one question!
Hi, No problem ;) I've already updated the Tomcat docs to be VERY explicit on this, and the update will show up on jakarta.apache.org with the next release. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Keith Bottner [mailto:[EMAIL PROTECTED] >Sent: Thursday, August 12, 2004 12:07 PM >To: 'Tomcat Users List' >Subject: RE: JNDI, DataSource & SingleSignOn but one question! > >Thank you, Thank you, Thank you, Thank you, Thank you! > >That did it! > >-Original Message- >From: Shapira, Yoav [mailto:[EMAIL PROTECTED] >Sent: Thursday, August 12, 2004 10:52 AM >To: Tomcat Users List >Subject: RE: JNDI, DataSource & SingleSignOn but one question! > > >Hi, >You need a in your Context to make GlobalNamingResources >available to your webapps. You also need the resource-ref in web.xml per >the Spec (and this is well documented), but you already found that out. > > >Yoav Shapira >Millennium Research Informatics > > >>-Original Message- >>From: Keith Bottner [mailto:[EMAIL PROTECTED] >>Sent: Thursday, August 12, 2004 11:44 AM >>To: [EMAIL PROTECTED] >>Subject: JNDI, DataSource & SingleSignOn but one question! >> >>Ok, I read the archives, I read past mailings and I still can't get >this to >>work. So here it goes. >> >>I have a DataSource that I define in the >section of >>the server.xml. >> >>I also define a (specifically a DataSourceRealm) in the > >>section of the server.xml that references the >>section item that I defined above. >> >>In the section of the server.xml I define a SingleSignOn valve. >> >>That ALL WORKS FINE! Here is where it gets weird. So I sign on and then >>later when I am executing a Servlet I try this: >> >>First I had to add a resource-ref into my web.xml that references the >>Global naming resource, otherwise when I call lookup it throws a can't >>find >naming >>exception. >> >>Then my servlet code >> >>Context initCtx = new InitialContext(); >>Context envCtx = (Context) initCtx.lookup("java:comp/env"); >> >>DataSource datasource = (DataSource) envCtx.lookup("jdbc/postgres"); >>conn = datasource.getConnection(); >> >>Everything works until I call the getConnection() at which time an >>exception is thrown that says: >> >>Cannot create JDBC driver of class '' for connect URL 'null' >> >>Now I know the connection works because the SingleSignOn works! >> >>In addition if I use code like this: >> >>StandardServer server = (StandardServer) ServerFactory.getServer(); >>Context env = server.getGlobalNamingContext(); >> >>DataSource dataSource = (DataSource) env.lookup("jdbc/postgres"); conn >>= dataSource.getConnection(); >> >>The connection is create properly with no exceptions. >> >>So Why is there a discrepancy between the two methods and how can I get >>this to work so that I can share the same data pool connections I am >>using >to >>sign on as I am throughout the remainder of the application? >> >>Thanks in advance for any ideas, I need to fix this something bad! >> >>Keith >> >> >>- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JNDI, DataSource & SingleSignOn but one question!
Thank you, Thank you, Thank you, Thank you, Thank you! That did it! -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, August 12, 2004 10:52 AM To: Tomcat Users List Subject: RE: JNDI, DataSource & SingleSignOn but one question! Hi, You need a in your Context to make GlobalNamingResources available to your webapps. You also need the resource-ref in web.xml per the Spec (and this is well documented), but you already found that out. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Keith Bottner [mailto:[EMAIL PROTECTED] >Sent: Thursday, August 12, 2004 11:44 AM >To: [EMAIL PROTECTED] >Subject: JNDI, DataSource & SingleSignOn but one question! > >Ok, I read the archives, I read past mailings and I still can't get this to >work. So here it goes. > >I have a DataSource that I define in the section of >the server.xml. > >I also define a (specifically a DataSourceRealm) in the >section of the server.xml that references the >section item that I defined above. > >In the section of the server.xml I define a SingleSignOn valve. > >That ALL WORKS FINE! Here is where it gets weird. So I sign on and then >later when I am executing a Servlet I try this: > >First I had to add a resource-ref into my web.xml that references the >Global naming resource, otherwise when I call lookup it throws a can't >find naming >exception. > >Then my servlet code > >Context initCtx = new InitialContext(); >Context envCtx = (Context) initCtx.lookup("java:comp/env"); > >DataSource datasource = (DataSource) envCtx.lookup("jdbc/postgres"); >conn = datasource.getConnection(); > >Everything works until I call the getConnection() at which time an >exception is thrown that says: > >Cannot create JDBC driver of class '' for connect URL 'null' > >Now I know the connection works because the SingleSignOn works! > >In addition if I use code like this: > >StandardServer server = (StandardServer) ServerFactory.getServer(); >Context env = server.getGlobalNamingContext(); > >DataSource dataSource = (DataSource) env.lookup("jdbc/postgres"); conn >= dataSource.getConnection(); > >The connection is create properly with no exceptions. > >So Why is there a discrepancy between the two methods and how can I get >this to work so that I can share the same data pool connections I am >using to >sign on as I am throughout the remainder of the application? > >Thanks in advance for any ideas, I need to fix this something bad! > >Keith > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JNDI, DataSource & SingleSignOn but one question!
Hi, You need a in your Context to make GlobalNamingResources available to your webapps. You also need the resource-ref in web.xml per the Spec (and this is well documented), but you already found that out. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Keith Bottner [mailto:[EMAIL PROTECTED] >Sent: Thursday, August 12, 2004 11:44 AM >To: [EMAIL PROTECTED] >Subject: JNDI, DataSource & SingleSignOn but one question! > >Ok, I read the archives, I read past mailings and I still can't get this to >work. So here it goes. > >I have a DataSource that I define in the section of >the server.xml. > >I also define a (specifically a DataSourceRealm) in the >section of the server.xml that references the >section item that I defined above. > >In the section of the server.xml I define a SingleSignOn valve. > >That ALL WORKS FINE! Here is where it gets weird. So I sign on and then >later when I am executing a Servlet I try this: > >First I had to add a resource-ref into my web.xml that references the >Global >naming resource, otherwise when I call lookup it throws a can't find naming >exception. > >Then my servlet code > >Context initCtx = new InitialContext(); >Context envCtx = (Context) initCtx.lookup("java:comp/env"); > >DataSource datasource = (DataSource) envCtx.lookup("jdbc/postgres"); >conn = datasource.getConnection(); > >Everything works until I call the getConnection() at which time an >exception >is thrown that says: > >Cannot create JDBC driver of class '' for connect URL 'null' > >Now I know the connection works because the SingleSignOn works! > >In addition if I use code like this: > >StandardServer server = (StandardServer) ServerFactory.getServer(); >Context env = server.getGlobalNamingContext(); > >DataSource dataSource = (DataSource) env.lookup("jdbc/postgres"); >conn = dataSource.getConnection(); > >The connection is create properly with no exceptions. > >So Why is there a discrepancy between the two methods and how can I get >this >to work so that I can share the same data pool connections I am using to >sign on as I am throughout the remainder of the application? > >Thanks in advance for any ideas, I need to fix this something bad! > >Keith > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]