• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compiling with Ant: Package does not exist

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have read most of the post here about PACKAGE DOES NOT EXIST but I still cant find a solution to my problem..please see below for a description of the problem

Environment:
Perforce, Eclipse-Europa, Ant 1.7


1.I am working on two different platforms with two different eclipse workspaces.
2.I build some of the code on platform x2 and import the jar into platform x1 in Eclipse and then compile with ant each time on both platforms.
3.I have a jar file call it x2.jar from platform x2 in which I have an Interface IX2.java that I want to use on the x1 side. Please don�t ask about this design, this is how I met the company code and I have to work with it like that.

Everything was compilling and working fine even after I had made code changes on both platforms, I was testing and after making more changes on the x2 side I cleaned and recompile fine on x2 side when I can to the x1 side, that�s when things started---This has been going on for days now and I�m getting worried!


Here is the Ant output

build-wsglogin:
[echo] ************************************************************
[echo] * Building wsglogin component..
[echo] ************************************************************

prepare:
[mkdir] Created dir: C:\projects\Platform1Shim\components\wsglogin\build
[mkdir] Created dir: C:\projects\Platform1Shim\stage\wsglogin
[mkdir] Created dir: C:\projects\Platform1Shim\stage\wsglogin-client
[mkdir] Created dir: C:\projects\Platform1Shim\components\wsglogin\build\classes

compile:
[javac] Compiling 12 source files to C:\projects\Platform1Shim\components\wsglogin\build\classes
[javac] C:\projects\Platform1Shim\components\wsglogin\server\client\GatewayLogin.java:12: package com.wsgatewaylogin does not exist �this package comes from the x2 branch
[javac] import com.wsgatewaylogin.IGateway;
[javac] ^
[javac] C:\projects\Platform1Shim\components\components\wsglogin\server\client\GatewayLogin.java:20: cannot find symbol
[javac] symbol: class IGateway


[javac] public class GatewayLogin implements IGateway{
[javac] ^
[javac] 2 errors

BUILD FAILED
C:\projects\Platform1Shim\build.xml:220: The following error occurred while executing this line:
C:\projects\Platform1Shim\src\components\wsglogin\build.xml:110: Compile failed; see the compiler error output for details.

Total time: 3 minutes 43 seconds



Here�s a part of build.xml on the x1 side showing line 110
I made new additions to the file while trying to solve the problem but it doesn�t help.

<?xml version="1.0"?>

<!-- ======================================================================= -->
<!-- build file -->
<!-- ======================================================================= -->

<project name="wsglogin" default="ejbjar" basedir=".">

<property file="../local.properties"/>
<property environment="env"/>

<property name="src.dir" value="${basedir}/src"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>
<property name="dev.root" value="../../.."/>
<property name="dist.dir" value="${dev.root}/stage/wsglogin"/>
<property name="client.dist.dir" value="${dev.root}/stage/wsglogin-client"/>
<property name="stage.dir" value="${dev.root}/stage"/>
<property name="conf.dir" value="${src.dir}/conf"/>
<property name="components.dir" value="../../components"/>
<property name="thirdparty.dir" value="../../../thirdparty"/>
<property name="p2.dir" value="../../../../../../Source-Branches/Platform2-1.1"/>
<property name="jboss.dir" value="${thirdparty.dir}/jboss-4.0.5/client"/>
<!-- <property name="jboss.home" value="C:/software/jboss-4.0.5.GA"/> -->

<!-- Build classpath -->
<path id="classpath">

<fileset dir="${dev.root}/stage/syncservice">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${p2.dir}/build/distribution"> --This is the location of the jar that has the package which cannot be found
<include name="**/*.jar"/>
<!-- new addition by me-->
<include name="core2-wsgatewaylogin.jar"/> --this is the name of that jar. I tried to force it to get seen but still no luck!
<!-- end new addition-->
</fileset>
<fileset dir="${p2.dir}/compile-lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${p2.dir}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${p2.dir}/lib/jboss">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${p2.dir}/lib/xfire">
<include name="**/*.jar"/>
</fileset>

<fileset dir="${p2.dir}/lib/axis">
<include name="**/*.jar"/>
</fileset>

<!-- new addition-->
<fileset dir="${thirdparty.dir}/bouncycastle/lib">
<include name ="bcprov-jdk14-116.jar"/>
</fileset>

<fileset dir="${thirdparty.dir}/apache/log4j/dist/lib">
<include name ="log4j.jar"/>
</fileset>

<fileset dir="${thirdparty.dir}/sun/j2ee/lib">
<include name ="j2ee.jar"/>
</fileset>
<!-- end new addition-->

<fileset dir="${thirdparty.dir}/junit/junit3.8.1">
<include name="**/*.jar"/>
</fileset>

<fileset dir="${jboss.dir}">
<include name="**/*.jar"/>
</fileset>

<!--
<fileset dir="${jboss.home}/client">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${jboss.home}/server/all/lib">
<include name="**/*.jar"/>
</fileset>
-->


<pathelement location="${build.classes.dir}"/>
</path>


<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${client.dist.dir}"/>
<mkdir dir="${build.classes.dir}"/>
</target>

<!-- =================================================================== -->
<!-- Compiles the source code -->
<!-- =================================================================== -->
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}"
destdir="${build.classes.dir}"
debug="on"
deprecation="on"
optimize="off"
includes="**"> line 110 is here�this is where the failure is occurring since the package cannot be found!
<classpath refid="classpath"/>
</javac>
</target>
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Two ideas:

- take a look into the jar file to see whether it actually contains the expected package in the correct folder structure

- run ant with the -v option (or was it -d?) to see whether ant finds the specified classpath.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic