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

  • Home
  • SEARCH
  • 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 7877861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:29:53+00:00 2026-06-03T03:29:53+00:00

I get this error when I try recreate tables in my database with hibernate.

  • 0

I get this error when I try recreate tables in my database with hibernate.

Exception in thread "main" java.lang.NoClassDefFoundError: classes/com/golf/model/Pupil (wrong name: com/golf/model/Pupil)

The problem is, that when I recreate my tables before I execute ant, I can create the tables in database without any problem. But after I execute with ant the build.xml file, I get this error.

My build.xml file is this:

<project name="Golf" default="deploy" basedir=".">

<property name="name" value="Golf"/>
<property name="version" value="1.0"/>
<property name="project" value="Golf"/>
<property environment="env"/>

<property name="build.compiler" value="classic"/>
<property name="build.dir" value="../bin"/>
<property name="build.src" value="${build.dir}/src"/>
<property name="build.src.web" value="${build.dir}/src"/>
<property name="build.dest" value="${build.dir}/classes"/>
<property name="build.dest.web" value="${build.dir}/classes"/>
<property name="build.web" value="${build.dir}/web"/>
<property name="build.web-inf" value="${build.dir}/web/WEB-INF"/>

<property name="src.java.dir" value="../src"/>
<property name="web.src.java.dir" value="../src"/>
<property name="lib.dir" value="../lib"/>
<property name="compilelib.dir" value="../compile-lib"/>
<property name="devetc.dir" value="../etc"/>
<property name="web.dir" value="../web"/>

<property name="deliver.class" value="${deliver.dir}/WEB-INF/classes"/>
<property name="deliver.lib" value="${deliver.dir}/WEB-INF/lib"/>

<property name="distribution.dir" value="../distribution"/>

<property name="war.file.name" value="golf.war"/>

<property name="year" value="2012"/>
<property name="ant.home" value="."/>
<property name="debug" value="on"/>
<property name="optimize" value="off"/>
<property name="deprecation" value="off"/>

<target name="env">
    <echo message="build.compiler = ${build.compiler}"/>
    <echo message="java.class.path = ${java.class.path}"/>
    <echo message="java.home = ${java.home}"/>
    <echo message="user.home = ${user.home}"/>
    <echo message="CATALINA.home = ${env.CATALINA_HOME}"/>
</target>


<patternset id="all.src.files">

    <!-- All java files -->
    <include name="**/*.java"/>

    <!-- All conf files -->
    <include name="**/*.xml"/>
    <include name="**/*.properties"/>

    <!-- All web files -->
    <include name="**/*.jpg"/>
    <include name="**/*.gif"/>
    <include name="**/*.js"/>
    <include name="**/*.jsp"/>
    <include name="**/*.html"/>

</patternset>

<target name="prepare" depends="env">

    <mkdir dir="${build.dir}"/>
    <mkdir dir="${build.dest}"/>
    <mkdir dir="${build.dest.web}"/>
    <mkdir dir="${build.src}"/>
    <mkdir dir="${build.web}"/>
    <mkdir dir="${build.web-inf}"/>
    <mkdir dir="${distribution.dir}"/>
    <mkdir dir="${web.src.java.dir}"/>
    <mkdir dir="${build.src.web}"/>

    <filter token="version" value="${version}"/>

    <copy todir="${build.src}" filtering="on">
        <fileset dir="${src.java.dir}" >
            <patternset refid="all.src.files"/>
        </fileset>
    </copy>

    <copy todir="${build.web}">
        <fileset dir="${web.dir}">
            <include name="**/*.*"/>
            <exclude name="**/*.bak"/>
        </fileset>
    </copy>

</target>
<target name="compile" depends="prepare">

    <javac srcdir="${build.src.web}"
        destdir="${build.dest.web}"
        debug="${debug}"
        deprecation="${deprecation}"
        optimize="${optimize}">

        <exclude name="**/package.html"/>
        <exclude name="**/overview.html"/>
        <classpath>
            <path>
                <fileset dir="${lib.dir}"/>
                <fileset dir="${compilelib.dir}"/>
            </path>
        </classpath>

    </javac>


    <copy todir="${build.web-inf}">
        <fileset dir="${devetc.dir}">
            <exclude name="**/*.bak"/>
        </fileset>
    </copy>


    <copy todir="${build.dest.web}">
        <fileset dir="${web.src.java.dir}">
            <include name="**/*.xml"/>
            <include name="**/*.properties"/>
            <exclude name="**/*.bak"/>
        </fileset>
    </copy>

</target>

<target name="deploy" depends="war">
    <copy todir="${env.CATALINA_HOME}/webapps">
        <fileset dir="${distribution.dir}">
            <include name="*.war"/>
        </fileset>
    </copy>

</target>

<target name="war" depends="compile">
    <war warfile="${distribution.dir}/${war.file.name}" webxml="${devetc.dir}/web.xml">
        <fileset dir="${build.web}">
            <exclude name="**/lib/*.*"/>
            <exclude name="**/classes/**/*.*"/>
            <exclude name="**/web.xml"/>
        </fileset>
        <lib dir="${lib.dir}"/>
        <classes dir="${build.dest.web}"/>
    </war>
</target>

<target name="clean">
    <delete dir="${build.dir}"/>
    <delete dir="${distribution.dir}"/>
    <mkdir dir="${build.dir}"/>
</target>


</project>
  • 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-03T03:29:54+00:00Added an answer on June 3, 2026 at 3:29 am

    For some reason, when I try to create the tables from Eclipse, Eclipse execute the class that is in the classes folder. That’s why the program thinks that the classes that I’m trying to map are classes/com… and not com/… If I change the build.dest and build.dest.web to {build.dir} it works perfectly.

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

Sidebar

Related Questions

i get this error when i try to create a database using rake command.
I get this error when I try to do anything with Java in command
I get this error when I try to use time_ago_in_words : Comparison of String
I get this error FB is not defined when i try to run this
When I try to go to this url: http://localhost:3000/lessons/18/pages , I get this error:
whenever I try to call my ejb from a client, I get this error
I get this wired error only when I try to access the web page
When I try to compile this project I get the following error. I would
If I try to implement my class on this file I get an error
I get this error when i try to call this function in Chrome 16.0.912.77

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.