Search code examples
oracle-adfjdeveloper

package oracle.jbo.server does not exist when running ant in jdeveloper


I have a project to mantain, this project was developed in an old PC (that sadly is not working anymore), now my boss told me to generate an ear using the ant xml that was being used in the old machine.

When I run the ant I see these errors:

Buildfile: D:\JDeveloper\COBLIN-WEB\Branches\QA\Framework-CRE\Common-ViewController\framework-ant.xml

init-framework:

compile-framework-model:
    [javac] Compiling 23 source files to D:\JDeveloper\COBLIN-WEB\branches\QA\Framework-CRE\Common-Model\classes
    [javac] D:\JDeveloper\COBLIN-WEB\branches\QA\Framework-CRE\Common-Model\src\bo\com\cre\framework\model\adf\entity\BaseEntityCache.java:2: package oracle.jbo.server does not exist
    [javac] import oracle.jbo.server.EntityCache;
    [javac]                         ^
    [javac] D:\JDeveloper\COBLIN-WEB\branches\QA\Framework-CRE\Common-Model\src\bo\com\cre\framework\model\adf\entity\BaseEntityCache.java:4: cannot find symbol
    [javac] symbol: class EntityCache
    [javac] public class BaseEntityCache extends EntityCache{
    [javac]                                      ^
    [javac] D:\JDeveloper\COBLIN-WEB\branches\QA\Framework-CRE\Common-Model\src\bo\com\cre\framework\model\adf\entity\BaseEntityDefImpl.java:2: package oracle.jbo.server does not exist
    [javac] import oracle.jbo.server.EntityDefImpl;
    [javac]                         ^
    [javac] D:\JDeveloper\COBLIN-WEB\branches\QA\Framework-CRE\Common-Model\src\bo\com\cre\framework\model\adf\entity\BaseEntityDefImpl.java:4: cannot find symbol
    [javac] symbol: class EntityDefImpl
    [javac] public class BaseEntityDefImpl extends EntityDefImpl{
    [javac]         


....

The class mentioned in the first error is:

 package bo.com.cre.framework.model.adf.entity;
import oracle.jbo.server.EntityCache;

public class BaseEntityCache extends EntityCache{
    public BaseEntityCache() {
        super();
    }
}

The XML run with ant:

    <?xml version="1.0" encoding="windows-1252" ?>
<project xmlns="antlib:org.apache.tools.ant" name="Framework" default="all" basedir=".">
  <property file="framework-ant.properties"/>
  <property file="${coblin.home}/${deploy.config.dir}/libs-ant.properties"/>

  <import file="${coblin.home}/${deploy.config.dir}/libs-ant.xml"/>
  <path id="classpath-framework">
      <pathelement location="${coblin.home}/${framework.model.dir}/classes"/>
      <path refid="classpath"/>
  </path>
  <!-- info para compilar framwork -->
  <target name="all-framework" description="Build the project" depends="clean-framework,compile-framework-model,compile-framework-view,jar-framework"/>
  <target name="jar-framework" description="generate common-model.jar,  common-view-controller.jar">
        <jar destfile="${coblin.home}/${coblin.lib.dir}/common-model.jar" basedir="${coblin.home}/${framework.model.dir}/classes">
            <manifest>
                <attribute name="Manifest-Version" value="1.0"/>
            </manifest>
        </jar>
        <jar destfile="${coblin.home}/${coblin.lib.dir}/common-view-controller.jar" basedir="${coblin.home}/${framework.view.dir}/classes">
            <manifest>
                <attribute name="Manifest-Version" value="1.0"/>
            </manifest>
        </jar>
  </target>
  <target name="init-framework">
    <tstamp/>
    <mkdir dir="${coblin.home}/${framework.model.dir}/classes"/>
    <mkdir dir="${coblin.home}/${framework.view.dir}/classes"/>
  </target>
  <target name="clean-framework" description="Clean the project Framework">
    <delete includeemptydirs="true" quiet="true">
      <fileset dir="${coblin.home}/${framework.model.dir}/classes" includes="**/*"/>
      <fileset dir="${coblin.home}/${framework.view.dir}/classes" includes="**/*"/>
    </delete>
  </target>
  <target name="compile-framework-model" description="Compile Java source files of Framework" depends="init-framework">
    <javac destdir="${coblin.home}/${framework.model.dir}/classes" classpathref="classpath-framework" debug="${javac.debug}" nowarn="${javac.nowarn}"
           deprecation="${javac.deprecation}" encoding="Cp1252" source="1.6" target="1.6">
      <src path="${coblin.home}/${framework.model.dir}/src"/>
    </javac>
    <copy todir="${coblin.home}/${framework.model.dir}/classes">
      <fileset dir="${coblin.home}/${framework.model.dir}/src">
        <patternset refid="copy.patterns"/>
      </fileset>
    </copy>
  </target>

If I compile and run the project from Jdeveloper it runs ok, but I need to generate the ear

What shoulkd I do?


Solution

  • You need to add the libraries needed to compile to the ANT environment. I guess they are in one of the imported files, but the once included are out of date. Have you changed JDev version?

    Anyway, you can create a new ANT build file from the project. This will generate the includes of the libraries used in the project. Then you look for the libraries in your ANT files and exchange them to the libraries in the newly generated ANT build file.

    Timo