Announcement Announcement Module
Collapse
No announcement yet.
Problem configuring JNDI datasource Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem configuring JNDI datasource

    I have a fresh install of tcServer 6.0. Based on various docs and threads, I have tried a number of ways to configure my JNDI datasource to no effect. Hoping someone can help.

    I have successfully created an instance called 'insight'. Here are my other settings:

    $TC_HOME/insight/conf/server.xml:
    Code:
    ...
      <GlobalNamingResources>
        <Resource name="jdbc/mydb-dev"
                  auth="Container"
                  type="javax.sql.DataSource"
                  username="username"
                  password="mypass"
                  driverClassname="oracle.jdbc.driver.OracleDriver"
                  url="my-working-jdbc-url"
                  maxActive="20"
                  maxIdle="10"
                  maxWait="-1"/>
    ...
    $TC_HOME/insight/conf/context.xml:
    Code:
    ...
    <ResourceLink global="jdbc/mydb-dev" name="jdbc/mydb-dev"/>
    ...
    $TC_HOME/insight/webapps/myapp/WEB-INF/web.xml:
    Code:
    <resource-ref>
     <description>Oracle Datasource example</description>
     <res-ref-name>"jdbc/mydb-dev"</res-ref-name>
     <jndi-name>jdbc/mydb-dev</jndi-name>
     <res-type>javax.sql.DataSource</res-type>
     <res-auth>Container</res-auth>
    </resource-ref>
    Spring config:
    Code:
        <bean id="jndiDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiName">
                <value>jdbc/mydb-dev</value>
            </property>
            <property name="resourceRef" value="true" />
        </bean>
    Error from tc Server on startup:
    Code:
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jndiDataSource' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
    I hope someone can point me in the right direction - this is driving me nuts

    Thanks - Gregg

  • #2
    For starters remove the "from the resource name

    Code:
     <res-ref-name>"jdbc/mydb-dev"</res-ref-name>

    Comment


    • #3
      Yeah initially I had no quotes - put them in because the error message only had "jdbc" as the name of the resource it couldn't find. So I tried a hail mary. Doesn't work either way.

      Comment


      • #4
        Have the same problem

        Cant configure tomcat with oracle jdni database in spring roo ...

        i getting the same exception :

        INFO: Initializing Spring root WebApplicationContext
        2010-07-16 16:37:50,636 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
        org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'transactionManager' defined in file [/home/aalfaro/workspace-sts/roo/misoc/target/classes/META-INF/spring/applicationContext.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in file [/home/aalfaro/workspace-sts/roo/misoc/target/classes/META-INF/spring/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'dataSource': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context ...

        Comment

        Working...
        X