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 7547763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:32:08+00:00 2026-05-30T09:32:08+00:00

Grails 1.3.7 I get this strange error when I try to invoke my named

  • 0

Grails 1.3.7

I get this strange error when I try to invoke my named query. It is defined as follows;

containsQuery { query ->
 or{
  ilike("name", '%' + query + '%')
  ilike("description", '%' + query + '%')
  tokens{
    ilike("token", '%' + query + '%')
  }
}

the error I get is:

Error 500: Executing action [list] of controller [net.turkino.tokenadmin.reg.ItemController] caused exception: duplicate association path: tokens
Servlet: grails
URI: /grails/item/list.dispatch
Exception Message: duplicate association path: tokens 
Caused by: duplicate association path: tokens 
Class: ItemController 
At Line: [75] 

and 75th line is:

items = itemQueryResult.listDistinct(params)

where itemQueryResult is

itemQueryResult = Item.belongsToOwner(SecurityUtils.subject.principal).containsQuery(params.q)

what is the problem? Am I not allowed to use tokens in my namedQuery ?

UPDATE: info about domain classes involved:

class Item{
 ... // a lot of fields
 static hasMany = [ tokens:TokenTag]
    static belongsTo = [owner: User]
    static mappedBy = [ tokens: 'item' ]
    static mapping = { tokens lazy:false }

... // constraints to fields, named queries etc.

static namedQueries = {
 belongsToOwner { email ->
   owner{
    eq("email", email)
   }
  }
  ....
 }
}

class TokenTag{
   ... // fields
   String token 
   String tokenAsQRString
   Item item
   ... // other fields

   static belongsTo = [tagSheet:TokenTagSheet]

   ...
}
  • 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-30T09:32:10+00:00Added an answer on May 30, 2026 at 9:32 am

    I located a JIRA issue http://jira.grails.org/browse/GRAILS-7324 which might explain this behavior. This was fixed in 2.0-M2. Possibly you have a sort parameter ‘tokens’ or ‘tokens.token’ in ‘params’.

    You could possibly remove the sort parameter and see if it resolves your issue. If you absolutely need to sort by ‘tokens’, consider upgrading the Grails version or patch up the current version with the fix in the above issue.

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

Sidebar

Related Questions

When I run grails install-dependency , I get this. java.lang.LinkageError: loader constraint violation: loader
Im new to grails and I try to get a database entry. The database
I try to execute raw SQL in Grails with this code: class PlainSqlService {
I am trying to add data to a database, in grails but get this
After installing export plugin i can not run grails application and get this java.lang.LinkageError:
I am working with a Grails web application and I get so many strange
This error has been popping up lately since I started evaluating Grails 2.0.0.RC3. I
I have a strange bug with Grails. I want to get back some persisted
I'm trying to get a one-to-many relationship working with grails/gorm. I don't understand how
I have been trying for 4 days to get app-engine and grails working together

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.