ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy Truelove" <>
Subject RE: Classloader Problems
Date Sun, 07 Apr 2002 15:05:22 GMT
Sorry.. I'm running it from ant, through a JUnit test.  I've also ran it
straight from ant without a JUnit test, with the same results.  Here are the
relavent parts of the build file:

 <path id="classpath.path">
  <pathelement location="${outputDir}" />
  <pathelement path="${sun.boot.class.path}"/>
  <fileset dir="lib">
   <include name="*.jar" />
<!-- this is the JUnit Testcase, with a main() to run it -->
<property name="current.test" value="my.package.BasicDataSourceTest" />

   <target name="compile">
     <javac srcdir="${sourceDir}" destdir="${outputDir}">
   <path refid="classpath.path"/>

   <target name="test" depends="compile">
  <java classname="${current.test}">
    <path refid="classpath.path"/>

Like I said earlier, the compile target works fine, but the class is
unavailable at runtime.  As a side note, that fix that I had mentioned no
longer works; it causes class conflicts in other areas
("java.lang.IllegalAccessError: class
sun.reflect.GeneratedConstructorAccessor1 cannot access its superclass
sun.reflect.ConstructorAccessorImpl" when I call a JDBC
DriverManager.getConnection() )

Again, I appreciate the help.


----- Original Message -----
From: "Adam Murdoch" <>
To: "Ant Users List" <>; "Roy Truelove"
Sent: Sunday, April 07, 2002 3:26 AM
Subject: Re: Classloader Problems

On Sun, 7 Apr 2002 09:35, Roy Truelove wrote:
> ...
> Driver tester = new sun.jdbc.odbc.JdbcOdbcDriver();
> ...

Where are you running this code?  In a task?  An app?  A Junit test?  And
are you running it from ant?


----- Original Message -----
From: "Roy Truelove" <>
To: <>
Sent: Saturday, April 06, 2002 7:35 PM
Subject: Classloader Problems

> Hey folks,
> I'm having a bit of what I think is a ClassLoader problem.  Here is my
> problem code :
> ...
> Driver tester = new sun.jdbc.odbc.JdbcOdbcDriver();
> ...
> I'm using this code instead of Class.forName() to see if the compiler can
> find the class.  The code compiles fine, but the class is not available at
> runtime.  I've made sure that my rt.jar has this class, and that I only
> 1 JRE in my path.  I *did* find a workaround for this problem, but what I
> had to do was add this :
> <pathelement path="${sun.boot.class.path}"/>
> to my classpath element.  I know that's not right; if someone can tell me
> I'm doing something wrong, please let me know.
> (please respond to list and to personal email; I don't have the quota to
> able to subscribe to the list)
> Thanks in advance,
> Roy

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message