> DataSource ds = null;
> Context initCtx = new InitialContext();
> Context envCtx = (Context)initCtx.lookup( "java:comp/env" );
> ds = (DataSource)envCtx.lookup( "jdbc/DB" );
>
>The problem is that returned datasource is always null.
I wish I could get that far. I am using a web.xml that is almost identical
to your own below and yet Tomcat will not start without reporting this XML
parsing error.
org.xml.sax.SAXParseException: Element "resource-ref" does not allow
"resource-ref-name" here.
>From: "Taavi Tiirik" <[EMAIL PROTECTED]>
>
>In web.xml I have following resource-ref defined:
>
> <resource-ref>
> <description>
> Resource reference to a factory for javax.sql.DataSource
> instances that may be used for talking to a particular
> database that is configured in the server.xml file.
> </description>
> <res-ref-name>jdbc/DB</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
My own web.xml is contains almost the same resource-ref
<resource-ref>
<description>
Resource reference to a factory for java.sql.Connection
instances that may be used for talking to a particular
database that is configured in the server.xml file.
</description>
<resource-ref-name>
jdbc/mydb
</resource-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
The error I get is an XML parsing error and the actual values are actually
irrelevant. I'm using Tomcat 4.0.1 on Windows 2000. How come nobody else is
reporting this error regardless if you're using Postgres, Oracle or mysql
org.xml.sax.SAXParseException: Element "resource-ref" does not allow
"resource-ref-name" here.
Also, IF I ever get this to work, will this also work on other java servers
like Websphere or will your own database pool manager be more cross platform
?
Thank you, Soefara.
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>