Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3452800
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:18:02+00:00 2026-05-18T09:18:02+00:00

I’m trying to configure a Grails 1.3.5 app to work with the default tomcat

  • 0

I’m trying to configure a Grails 1.3.5 app to work with the default tomcat instance built into Grails using JNDI. The app doesn’t use GORM. I want to connect to the datasources myself. I’m using a library for the model layer we use for other apps.

resources.xml

As well as the bean headers I have:

<import resource="data.xml" />
<import resource="service.xml" /> 

In data.xml I have:

<bean id="subjectJdbcDao"
    class="uk.co.xxx.dao.subjects.SubjectJdbcDao">
    <property name="dataSource" ref="jobDataSource"/>
</bean>

In resources.groovy I have:

def jobDataSource = new org.springframework.jdbc.datasource.DriverManagerDataSource('oracle.jdbc.driver.OracleDriver','jdbc:oracle:thin:@berlin:1521:casdev','cso','job')
   grails.naming.entries = ['jdbc/job':jobDataSource]

I’ve tried everything but can’t seem to get the data.xml file to find the jndi data sources. I keep getting this error:

    2010-11-22 17:09:38,855 ERROR [context.GrailsContextLoader] Error executing bootstraps: Error 
creating bean with name 'SubjectJdbcDao' defined in URL [file:grails-app/conf/spring/data.xml]: 
Cannot resolve reference to bean 'jobDataSource' while setting bean property 'dataSource'; nested 
exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 
'jobDataSource' is defined
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 
'SubjectJdbcDao' defined in URL [file:grails-app/conf/spring/data.xml]: Cannot resolve reference to 
bean 'jobDataSource' while setting bean property 'dataSource'; nested exception is 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'jobDataSource' is 
defined
        at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)

Does anyone know where I should put my datasource definitions so that they get picked up?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:18:03+00:00Added an answer on May 18, 2026 at 9:18 am

    Your datasource should be an instance of a org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup.

    If you run the tomcat embedded in grails, you will need to simulate your JNDI datasource by adding the following entry in Config.groovy:

    grails.naming.entries = ['jdbc/jobDataSource': [
        type: "javax.sql.DataSource", //required
        auth: "Container", // optional
        description: "Data source for ...",
        url: "jdbc:oracle:thin:@berlin:1521:casdev",
        username: "cso",
        password: "job",
        driverClassName: "oracle.jdbc.driver.OracleDriver",
        maxActive: "8", //and so on
        maxIdle: "4"
      ]
    ]
    

    If you want to run your application as a war and need an actual JNDI Datasource deployed and managed by tomcat, you need to create a tomcat context for your application:

    If your application is jobapp.war, you must put a jobapp.xml under TOMCAT_HOME/conf/Catalina/localhost/jobapp.xml

    This jobapp.xml should contain the following:

    <Context path="/jobapp">
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <Resource name="jdbc/jobDataSource"
        auth="Container" type="javax.sql.DataSource"
        username="cso"
        password="job"
        driverClassName="oracle.jdbc.driver.OracleDriver"
        url="jdbc:oracle:thin:@berlin:1521:casdev""
        defaultAutoCommit="false"
        <!--
            ... other parameters
        !-->     
              />
    

    I believe this should do the trick
    (make sure your drivers are available to your tomcat installation if you run it as a war)

    Regards,

    Vincent Giguère

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am using Paperclip to handle profile photo uploads in my app. They upload
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.