Help save net neutrality! Learn more.
Close

No database configured in JNDI

Help
MgfProject
2007-04-04
2013-04-09
  • MgfProject

    MgfProject - 2007-04-04

    Hi,
    i am trying to connected Tudu Lists v. 2.0-beta-1 to Oracle DB,
    the following is the configuration changes I have made in order to get it working ,
    i have create a data source in the application server for the tudu database:

    <Resource name="jdbc/tudu" auth="Container"
                  type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
                  url="jdbc:oracle:thin:@127.0.0.1:1521:mysid"
                  username="scott" password="tiger" maxActive="20" maxIdle="10"
                  maxWait="-1"/>

    but when i try to start tomcat I get the following warning,

    0    [Thread-0] WARN  tudu.domain.configuration.DataSourceFactory  - Initializing database connection pool.
    125  [Thread-0] WARN  tudu.domain.configuration.DataSourceFactory  - No database configured in JNDI at "java:/comp/envjdbc/tudu"
    2250 [Thread-0] WARN  tudu.domain.configuration.DataSourceFactory  - MySQL database could not be found
    3094 [Thread-0] WARN  tudu.domain.configuration.DataSourceFactory  - HSQLDB database started.

    Any Idea ?
    I have try anything a read the tomcat documentation but i don't found the solution.
    Thanks alessandro

     
    • Julien Dubois

      Julien Dubois - 2007-04-05

      Hello,

      First of all, Tudu Lists doesn't work with Oracle out of the box. It would probably be very easy to do, just a matter of configuring Hibernate to use the appropriate database dialect, and letting it generate the database schema at start-up time (like it does with HSQLDB).

      Concerning the JNDI configuration, what you did seems correct, but you can have a look at my configuration here :
      http://fisheye3.cenqua.com/browse/tudu/trunk/tudu/conf/tomcat/5.5/conf/Catalina/localhost/tudu.xml?r=248

      As you can see, I store it inside the conf/Catalina/localhost directory, do you do the same?

      Julien.

       
    • MgfProject

      MgfProject - 2007-04-06

      Hello ,
              i have create DB in Oracle manually and i have create the tudu.xml into Conf/Calatina/Localhost, this is the my    configuration :

      <Context docBase="${catalina.home}/webapps/tudu.war" reloadable="true"> 

         <Resource name="jdbc/tudu" auth="Container"
                    type="javax.sql.DataSource"
                    driverClassName="oracle.jdbc.OracleDriver"
                    url="jdbc:oracle:MIPSADMIN:@127.0.0.1:1521:ECOMM9"
                    username="scott"
                    password="tiger"
                    maxActive="20"
                    maxIdle="10"
                    maxWait="-1"/>

      </Context>

      but when i try to start tomcat I get the following error :

      INFO: Processing Context configuration file URL file:C:\Tomcat\conf\Catalina\localhost\manager.xml
      Apr 6, 2007 9:05:42 AM org.apache.catalina.core.StandardHostDeployer install
      INFO: Processing Context configuration file URL file:C:\Tomcat\conf\Catalina\localhost\tudu.xml
      Apr 6, 2007 9:05:42 AM org.apache.commons.digester.Digester startElement
      SEVERE: Begin event threw exception
      java.lang.NullPointerException
          at org.apache.catalina.startup.SetDocBaseRule.begin(SetDocBaseRule.java:126)
          at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
          at org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:65)
          at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
          at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
          at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
          at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
          at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
          at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
          at org.apache.commons.digester.Digester.parse(Digester.java:1567)
          at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)
          at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
          at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483)
          at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
          at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
          at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
          at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
          at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
          at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
          at org.apache.catalina.core.StandardService.start(StandardService.java:480)
          at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
          at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
      Apr 6, 2007 9:05:42 AM org.apache.catalina.startup.HostConfig deployDescriptors
      SEVERE: Error deploying configuration descriptor tudu.xml
      java.io.IOException: java.lang.NullPointerException
          at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:494)
          at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
          at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483)
          at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
          at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
          at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
          at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
          at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
          at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
          at org.apache.catalina.core.StandardService.start(StandardService.java:480)
          at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
          at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
      Apr 6, 2007 9:05:46 AM org.apache.catalina.core.StandardHostDeployer install
      INFO: Installing web application at context path /tudu from URL file:C:/Tomcat/webapps/tudu
      0    [Thread-0] WARN  tudu.domain.configuration.DataSourceFactory  - Initializing database connection pool.
      187  [Thread-0] WARN  tudu.domain.configuration.DataSourceFactory  - No database configured in JNDI at "java:/comp/envjdbc/tudu"
      1656 [Thread-0] WARN  tudu.domain.configuration.DataSourceFactory  - MySQL database could not be found

      Thanks alessandro

       
      • Julien Dubois

        Julien Dubois - 2007-04-10

        It seems like an error occured while reading your tudu.xml file. However, I can't find what's wrong with your file : have you tried opening it in an XML editor?
        Maybe it's a Tomcat problem, which version of Tomcat are you using?

         
    • MgfProject

      MgfProject - 2007-04-12

      Sorry I've created JNDI manually and I've removed tag "debug". I have recreated JNDI descriptor directly from Tomcat 5.0 and the first problem it's remained  :

      INFO: Processing Context configuration file URL file:C:\Tomcat\conf\Catalina\localhost\tudu.xml
      0    [Thread-0] WARN  tudu.domain.configuration.DataSourceFactory  - Initializing database connection pool.
      0    [Thread-0] WARN  tudu.domain.configuration.DataSourceFactory  - No database configured in JNDI at "java:/comp/envjdbc/tudu"
      1562 [Thread-0] WARN  tudu.domain.configuration.DataSourceFactory  - MySQL database could not be found
      2078 [Thread-0] WARN  tudu.domain.configuration.DataSourceFactory  - HSQLDB database started.
      16547 [Thread-0] WARN  tudu.service.impl.ConfigurationManagerImpl  - Spring context is started : org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplicationContext]; startup date [Thu Apr 12 09:12:43 CEST 2007]; root of context hierarchy; config locations [classpath:/tudu/domain/applicationContext-jpa.xml,classpath:/tudu/service/applicationContext.xml,classpath:/tudu/security/applicationContext-security.xml,/WEB-INF/spring/applicationContext-*]]
      16547 [Thread-0] WARN  tudu.service.impl.ConfigurationManagerImpl  - Testing Database.
      Hibernate: select role0_.role as role1_0_ from role role0_ where role0_.role=?
      16625 [Thread-0] WARN  tudu.service.impl.ConfigurationManagerImpl  - Database is empty : populating with default values.
      16625 [Thread-0] WARN  tudu.service.impl.ConfigurationManagerImpl  - Populating HSQLDB database.

      the file tudu.xml it's the following :

      <?xml version='1.0' encoding='utf-8'?>
      <Context debug="9" displayName="Tudu Lists DWR implementaion" docBase="tudu" path="/tudu" reloadable="true" workDir="work\Catalina\localhost\tudu">
        <Resource name="jdbc/tudu" type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/tudu">
            <parameter>
              <name>validationQuery</name>
              <value>select 1 from dual</value>
            </parameter>
            <parameter>
              <name>url</name>
              <value>jdbc:oracle:XXXX:@127.0.0.1:1521:YYYYY</value>
            </parameter>
            <parameter>
              <name>password</name>
              <value>tiger</value>
            </parameter>
            <parameter>
              <name>maxActive</name>
              <value>4</value>
            </parameter>
            <parameter>
              <name>maxWait</name>
              <value>5000</value>
            </parameter>
            <parameter>
              <name>driverClassName</name>
              <value>oracle.jdbc.OracleDriver</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>scott</value>
            </parameter>
            <parameter>
              <name>maxIdle</name>
              <value>2</value>
            </parameter>
          </ResourceParams>
      </Context>

      The name of "Resource name=jdbc/tudu" it's correct ?
      How to in the log en started search JNDI at "java:/comp/envjdbc/tudu" ?
      Any Idea ?

      Thanks alessandro

       

Log in to post a comment.