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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:11:03+00:00 2026-06-18T15:11:03+00:00

My project bases on Spring+JPA+Hibernate, and use Ant to manage build process before, now

  • 0

My project bases on Spring+JPA+Hibernate, and use Ant to manage build process before, now I am intending to use Gradle. While when run ‘gradle clean test’, I got a exception as below:

[2013-02-07 11:01:36,703][Test worker][WARN ][QuerySplitter] no persistent classes found for query class: from com.mpos.lottery.te.workingkey.domain.WorkingKey w where w.createDateStr=:createDateStr and w.gpeId=:gpeId

[2013-02-07 11:01:36,718][Test worker][ERROR][TEPortServlet] org.hibernate.QueryParameterException: could not locate named parameter [gpeId]; nested exception is java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: could not locate named parameter [gpeId]

I have ran that test case(doesn’t need jetty) in both eclipse and Ant, it passed, So i suspect that some incorrect configuration in gradle cause this exception.

Below is my gradle script:

apply plugin: 'war'
// 'war' plugin will apply 'java' plugin automatically
apply plugin: 'java'
apply plugin: 'eclipse'
// run web application, refer to http://gradle.org/docs/current/userguide/jetty_plugin.html
apply plugin: 'jetty'

compileJava.options.encoding = _sourcecode_encoding
compileTestJava.options.encoding = _sourcecode_encoding

// Properties added by the java plugin
sourceCompatibility="${_source_compatibility}"
targetCompatibility="${_target_compatibility}"
//Properties added by the 'war' plugin
webAppDirName="src/main/WWW"

configurations {
    provided {
        description = 'Non-exported comiple-time dependencies, it will be provided by container.'
    }
}

dependencies {
    provided files('lib/DEV/j2ee/servlet-api.jar')
    compile fileTree(dir: 'lib', include: '**/*.jar', exclude: 'DEV/**/*.jar')
    //compile sourceSets.main.output
    testCompile fileTree(dir:"lib", include:"DEV/**/*.jar")
}

sourceSets {
    main {
        compileClasspath = compileClasspath + configurations.provided
        //compileClasspath.collect().each({println it})
        resources {
            srcDir 'src/main/resource'
        }
    }
    test {
        resources {
            srcDir 'src/test/resource'
        }
    }
}

test {
    scanForTestClasses  = false
    classpath = configurations.provided + configurations.compile + configurations.testCompile + sourceSets.main.output + sourceSets.test.output
    classpath.each({println it})
    // customize test process
    include 'com/mpos/lottery/te/gameimpl/smsraffle/**/*Test.class'
}

I am new learner of Gradle and groovy, pls help me. Thanks in advance.

  • 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-06-18T15:11:04+00:00Added an answer on June 18, 2026 at 3:11 pm

    By default, Gradle uses separate output directories for classes and resources, which can cause problems with Hibernate/JPA. Try:

    sourceSets.main.output.resourcesDir = sourceSets.main.output.classesDir
    sourceSets.test.output.resourcesDir = sourceSets.test.output.classesDir
    

    You might not need the latter.

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

Sidebar

Related Questions

We are working on Java web project based on JPA 2, Hibernate, Spring 3
I am developing a GWT-Spring-Hibernate project and I want to use Spring Autowired annotation
I'm working with JPA(Hibernate) and spring project these days, I configured spring, jpa and
I'm trying to configure spring data auditing. I use Hibernate 4.1.6, hibernate-jpa 2.0, spring-data-jpa
In my Wicket+JPA/Hibernate+Spring project, much of the functionality is based around the Inbox page
I'm building a project based on Spring and Hibernate inspired to a Spring MVC
Before post this Question, I google to get Properties from Spring project(Its NOT web-based
I have a Spring project using Hibernate. The DB is generated based on the
In the project I am using JPA with Hibernate implementation. All the entities are
I am trying to migrate an existing Spring 3 JPA 2 Hibernate web application

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.