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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:18:38+00:00 2026-05-12T14:18:38+00:00

I am trying to make an ant script for an EJB project. I am

  • 0

I am trying to make an ant script for an EJB project. I am using Jboss for this.
I am new to both EJB and Ant and am having problems in getting the beans to compile from ant. It gives me number of errors of the kind
package javax.persistence does not exist
@MappedSuperclass – Cannot find symbol

I created it as an eclipse project initially, and added the jboss runtime through eclipse. Do I need to copy all the jars in a lib folder and include them in the classpath for the beans to compile or is there a better way to do this?

  • 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-12T14:18:39+00:00Added an answer on May 12, 2026 at 2:18 pm

    Try setting classpath in Ant appropriately. It ignores any system CLASSPATH or Eclipse setting that you have.

    Here’s an Ant build.xml that you can start with:

    <?xml version="1.0" encoding="UTF-8"?>
    <project name="spring-finance" basedir="." default="package">
    
        <property name="version" value="1.6"/>
        <property name="haltonfailure" value="no"/>
    
        <property name="out" value="out"/>
    
        <property name="production.src" value="src/main/java"/>
        <property name="production.lib" value="src/main/webapp/WEB-INF/lib"/>
        <property name="production.resources" value="src/main/resources"/>
        <property name="production.classes" value="${out}/production/${ant.project.name}"/>
    
        <property name="test.src" value="src/test/java"/>
        <property name="test.lib" value="src/test/lib"/>
        <property name="test.resources" value="src/test/resources"/>
        <property name="test.classes" value="${out}/test/${ant.project.name}"/>
    
        <property name="exploded" value="out/exploded/${ant.project.name}"/>
        <property name="exploded.classes" value="${exploded}/WEB-INF/classes"/>
        <property name="exploded.lib" value="${exploded}/WEB-INF/lib"/>
    
        <property name="reports.out" value="${out}/reports"/>
        <property name="junit.out" value="${reports.out}/junit"/>
    
        <property name="web.src" value="src/main/webapp"/>
        <property name="web.lib" value="${web.src}/WEB-INF/lib"/>
        <property name="web.classes" value="${web.src}/WEB-INF/classes"/>
    
        <path id="production.class.path">
            <pathelement location="${production.classes}"/>
            <pathelement location="${production.resources}"/>
            <fileset dir="${production.lib}">
                <include name="**/*.jar"/>
                <exclude name="**/junit*.jar"/>
                <exclude name="**/*test*.jar"/>
            </fileset>
        </path>
    
        <path id="test.class.path">
            <path refid="production.class.path"/>
            <pathelement location="${test.classes}"/>
            <pathelement location="${test.resources}"/>
            <fileset dir="${test.lib}">
                <include name="**/junit*.jar"/>
                <include name="**/*test*.jar"/>
            </fileset>
        </path>
    
        <available file="${out}" property="outputExists"/>
    
        <target name="clean" description="remove all generated artifacts" if="outputExists">
            <delete dir="${out}" includeEmptyDirs="true"/>
        </target>
    
        <target name="create" description="create the output directories" unless="outputExists">
            <mkdir dir="${production.classes}"/>
            <mkdir dir="${test.classes}"/>
            <mkdir dir="${junit.out}"/>
            <mkdir dir="${exploded.classes}"/>
            <mkdir dir="${exploded.lib}"/>
        </target>
    
        <target name="compile" description="compile all .java source files" depends="create">
            <!-- Debug output
                    <property name="production.class.path" refid="production.class.path"/>
                    <echo message="${production.class.path}"/>
            -->
            <javac srcdir="src" destdir="${out}/production/${ant.project.name}" debug="on" source="${version}">
                <classpath refid="production.class.path"/>
                <include name="**/*.java"/>
                <exclude name="**/*Test.java"/>
            </javac>
            <javac srcdir="${test.src}" destdir="${out}/test/${ant.project.name}" debug="on" source="${version}">
                <classpath refid="test.class.path"/>
                <include name="**/*Test.java"/>
            </javac>
        </target>
    
        <target name="test" description="run all unit tests" depends="compile">
            <!-- Debug output
                    <property name="test.class.path" refid="test.class.path"/>
                    <echo message="${test.class.path}"/>
            -->
            <junit printsummary="yes" haltonfailure="${haltonfailure}">
                <classpath refid="test.class.path"/>
                <formatter type="xml"/>
                <batchtest fork="yes" todir="${junit.out}">
                    <fileset dir="${test.src}">
                        <include name="**/*Test.java"/>
                    </fileset>
                </batchtest>
            </junit>
            <junitreport todir="${junit.out}">
                <fileset dir="${junit.out}">
                    <include name="TEST-*.xml"/>
                </fileset>
                <report todir="${junit.out}" format="frames"/>
            </junitreport>
        </target>
    
        <target name="exploded" description="create exploded deployment" depends="test">
            <copy todir="${exploded}">
                <fileset dir="${web.src}"/>
            </copy>
            <copy todir="${exploded}/WEB-INF">
                <fileset dir="${web.src}/WEB-INF"/>
            </copy>
            <copy todir="${exploded.classes}">
                <fileset dir="${production.classes}"/>
            </copy>
            <copy todir="${exploded.lib}">
                <fileset dir="${production.lib}"/>
            </copy>
        </target>
    
        <target name="jar" description="create jar file" depends="test">
            <jar destfile="${out}/${ant.project.name}.jar" basedir="${production.classes}" includes="**/*.class"/>
        </target>
    
        <target name="war" description="create war file" depends="exploded">
            <war basedir="${exploded}" webxml="${exploded}/WEB-INF/web.xml" destfile="${out}/${ant.project.name}.war"/>
        </target>
    
        <target name="package" description="create package for deployment" depends="test">
            <antcall target="war"/>
        </target>
    
    </project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 385k
  • Answers 385k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I thought I'd share my solution for others to reference.… May 14, 2026 at 11:24 pm
  • Editorial Team
    Editorial Team added an answer Google uses a table to display their search box. The… May 14, 2026 at 11:24 pm
  • Editorial Team
    Editorial Team added an answer What jars you've imported from ? Apache client is part… May 14, 2026 at 11:24 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.