ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Lochart" <dloch...@capecomputing.com>
Subject Re: InstantiationException
Date Thu, 22 Jan 2004 19:29:41 GMT
Lets see.

First of all are you familiar with the optional package?  Thereare optional
tasks for running ejbc for weblogic
in ant without having to "shell out to java" to do it.

Secondly I think you are right, its the environment.  My suggestoin would be
to figure out what your classpath is
on windows and then unix and see what the difference is.

That is what I would do.  To see the windows classpath you should be able to
place an <echoproperties/> target call into
your build script or simply run ant with -verbose or -debug.  Also with ant
1.6 there is an ant -diagnostics option which
should help you too.

good luck

Doug


Now I've gained some understanding
Of the only world that we see.
Things that I once dreamed of
Have become reality.

These walls that still surround me
Still contain the same old me,
Just one more who's searching for
A world that ought to be.


----- Original Message ----- 
From: "Conway, Ken" <Ken.Conway@qwest.com>
To: "Ant Users List" <user@ant.apache.org>
Sent: Thursday, January 22, 2004 2:15 PM
Subject: RE: InstantiationException


Thanks for the reply Doug. . .

I'll fill in some more detail.  I've tried doing what you've suggested
regarding using a <classpath> in the ant build file.  Here's the
example:

      <java classname="weblogic.ejbc" fork="true">
         <arg value="-classpath"/>
     <arg path="${projectclasspath}"/>
         <arg value="${deploy.dir}/${ejb}.temp.jar"/>
         <arg value="${deploy.dir}/${ejb}.jar"/>
         <classpath path="${ejbcpath}"/>
      </java>


where projectclasspath is a path containing all of the relavent classes
for the ejb compile and ejbcpath is the path to the weblogic.jar.

When I run ant with my environment CLASSPATH not set, life is grand on a
Windows 2003 Server but, on my HP Unix box, life goes south.  I get a
ClassDefNotFoundException.

If I run weblogic.ejbc from the command line (with my environment
CLASSPATH set) as follows:

Java weblogic.ejbc input.jar output.jar

Everything works fine.  So therein lies the reason for my question.  It
seems that there is some difference in my HP Envrionment that is
preventing me from running the ant task properly but, I know that it
will work if the environment CLASSPATH is set.

Ken

-----Original Message-----
From: Doug Lochart [mailto:dlochart@capecomputing.com]
Sent: Thursday, January 22, 2004 11:59 AM
To: Ant Users List
Subject: Re: InstantiationException

You probably run into problems with your build because you are not
creating
a <classpath> and using it in your scripts.
If you are doing this then maybe its a custom task that your build
depends
on that isn't getting loaded.  If thats the case
put the jar of your custome task in the ANT_HOME/lib directory and voila
..
magic happens =)

If thats not it please give more info on why the build is failing.  You
should try NOT to set a CLASSPATH when
you use ant ... it is so not necessary.

Doug



Now I've gained some understanding
Of the only world that we see.
Things that I once dreamed of
Have become reality.

These walls that still surround me
Still contain the same old me,
Just one more who's searching for
A world that ought to be.
----- Original Message ----- 
From: "Conway, Ken" <Ken.Conway@qwest.com>
To: <user@ant.apache.org>
Sent: Thursday, January 22, 2004 1:33 PM
Subject: InstantiationException


Can anyone tell me what I need to do to run ant 1.6.0 with a CLASSPATH
set.



Current if I try to do so, the following exception occurs:



java.lang.InstantiationException: org.apache.tools.ant.Main

        at java.lang.Class.newInstance0(Native Method)

        at java.lang.Class.newInstance(Unknown Source)

        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:214)

        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)



Of course, when I unset the CLASSPATH ant runs but I then run into
problems with my build process.



Ken Conway





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message