Hello

Im having problems creating a DataSource in a StandAlone Tomcat 4.0.1
with Windows XP. The InitialContext find the DataSource but it cames
null

This is the Code:

<%
        InitialContext ctxinit = new InitialContext();          
%>
<%= ctxinit.lookup("java:/comp/env/jdbc/testDB") %> << NULL

In the web application deployment descriptor (web.xml) i have this code:

  <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>
    <res-ref-name>jdbc/testDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>

In the server.xml file:

<Context path="/test" docBase="test/" debug="1" privileged="true"
reloadable="true" useNaming="true">
        
<Resource name="jdbc/testDB" auth="Container"
type="javax.sql.DataSource" description="Default Database for
Applications" />
                
<ResourceParams name="jdbc/testDB">
        <parameter>
                <name>driverClassName</name>
                <value>oracle.jdbc.driver.OracleDriver</value>
        </parameter>
        <parameter>
                <name>driverName</name>
                <value>jdbc:oracle:thin:@dir</value>
        </parameter>
        <parameter>
                <name>user</name>
                <value>usuario1</value>
        </parameter>
        <parameter>
                <name>password</name>
                <value>password1</value>
        </parameter>
</ResourceParams>          
</Context>        

When i use debug level 1 in the context the logs seems normal:

XmlMapper: org.apache.catalina.core.StandardContext.setSessionTimeout(
30)
XmlMapper: org.apache.catalina.core.StandardContext.addMimeMapping(
html, text/html)
XmlMapper: org.apache.catalina.core.StandardContext.addMimeMapping( txt,
text/plain)
XmlMapper: org.apache.catalina.core.StandardContext.addWelcomeFile(
index.jsp)
XmlMapper: org.apache.catalina.core.StandardContext.addWelcomeFile(
index.html)
XmlMapper: new null org.apache.catalina.deploy.ContextResource
resource-ref ContextResource[name=null, scope=Shareable]
XmlMapper: org.apache.catalina.deploy.ContextResource.setDescription(
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.)
XmlMapper: org.apache.catalina.deploy.ContextResource.setName(
jdbc/testDB)
XmlMapper: org.apache.catalina.deploy.ContextResource.setType(
javax.sql.DataSource)
XmlMapper: org.apache.catalina.deploy.ContextResource.setAuth(
Container)
XmlMapper: Calling org.apache.catalina.core.StandardContext.addResource
ContextResource[name=jdbc/testDB, 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.,
type=javax.sql.DataSource, auth=Container, scope=Shareable]
XmlMapper: pop resource-ref org.apache.catalina.deploy.ContextResource:
ContextResource[name=jdbc/testDB, 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.,
type=javax.sql.DataSource, auth=Container, scope=Shareable]

 



--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to