ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kenneth Burrell <turing...@yahoo.com>
Subject java.lang.NoClassDefFoundError: and j2sdk1.4
Date Wed, 04 Sep 2002 15:50:53 GMT
Hi
I'm trying to run the java task with j2sdk1.4 and the following error occurs:
java.lang.NoClassDefFoundError:
sun/reflect/SerializationConstructorAccessorImpl

This error does not occur when I run java from the command line with j2sdk1.4
(without Ant). I was not getting this error when using Ant with j2sdk1.3.1.
Since I can run from the command line, I assume the class is being found at
that point, but not when java is being invoked from Ant. I've also tried to run
different versions of Ant (1.4.1, 1.5, 1.5.1) with the same error. I've seen
mention of this error on Sun's web site as well. Has anyone else noticed this
behavior??

thanks

Here's the stack trace
[java] java.lang.NoClassDefFoundError:
sun/reflect/SerializationConstructorAccessorImpl
     [java] 	at sun.misc.Unsafe.defineClass(Native Method)
     [java] 	at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:45)
     [java] 	at
sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:381)
     [java] 	at java.security.AccessController.doPrivileged(Native Method)
     [java] 	at
sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:377)
     [java] 	at
sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:95)
     [java] 	at
sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:301)
     [java] 	at
java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1177)
     [java] 	at
java.io.ObjectStreamClass.access$1100(ObjectStreamClass.java:45)
     [java] 	at java.io.ObjectStreamClass$3.run(ObjectStreamClass.java:343)
     [java] 	at java.security.AccessController.doPrivileged(Native Method)
     [java] 	at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:329)
     [java] 	at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:249)
     [java] 	at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:325)
     [java] 	at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:249)
     [java] 	at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:325)
     [java] 	at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:249)
     [java] 	at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1010)
     [java] 	at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
     [java] 	at com.loomissayles.util.DeepCopier.deepCopy(Unknown Source)
     [java] 	at com.loomissayles.util.AbstractDataObj.getDeepCopy(Unknown
Source)
     [java] 	at com.loomissayles.dao.MasterTable.parsePortReturns(Unknown
Source)
     [java] 	at com.loomissayles.dao.MasterTable.parserDispatcher(Unknown
Source)
     [java] 	at com.loomissayles.dao.MasterTable.parserController(Unknown
Source)
     [java] 	at com.loomissayles.dao.MasterTable.load(Unknown Source)
     [java] 	at com.loomissayles.dao.MasterTable.start(Unknown Source)
     [java] 	at TestClientObjects.main(Unknown Source)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java] 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:324)
     [java] 	at
org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:208)
     [java] 	at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:150)
     [java] 	at org.apache.tools.ant.taskdefs.Java.run(Java.java:415)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:163)
     [java] 	at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
     [java] 	at org.apache.tools.ant.Task.perform(Task.java:317)
     [java] 	at org.apache.tools.ant.Target.execute(Target.java:309)
     [java] 	at org.apache.tools.ant.Target.performTasks(Target.java:334)
     [java] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
     [java] 	at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
     [java] 	at org.apache.tools.ant.Main.runBuild(Main.java:610)
     [java] 	at org.apache.tools.ant.Main.start(Main.java:196)
     [java] 	at org.apache.tools.ant.Main.main(Main.java:235)
     [java]  ** Execution time 11.86 seconds

Here's the script
<?xml version="1.0" ?>
<project name="EPInSite" default="main" basedir="." >

<!-- ===================================================================  --> 
<!-- EPI Client Tests - tests client java objects                         -->
<!-- Kenneth Burrell                                                      --> 
<!-- 2002-06-25                                                           --> 
<!-- ===================================================================  -->

<!-- ===================================================================  --> 
<!-- Global variables				                          --> 
<!-- ===================================================================  --> 
<target name="initGlobals" description="initialize script properties">
  <property name="buildDir"      value="classes"/>
  <property name="srcDir"        value="strader/com/loomissayles"/>
  <property name="libDir"        value="lib"/>
  <property name="configDir"     value="strader/conf"/>
  
  
  <tstamp>
    <format property="DSTAMP.NOW" pattern="yyyy-MM-dd HH:mm:ss"/>
  </tstamp>
  
  <!-- global classpath -->
  <path id="classpath">
    <pathelement location="classes"/>
    <pathelement location="${libDir}/xerces.jar"/>
    <pathelement location="${libDir}/xalan.jar"/>
    <pathelement location="${libDir}/jintegra.jar"/>
    <pathelement location="${libDir}/bbcontrol.jar"/>
    <pathelement location="${libDir}/msexcel.jar"/>
  </path>
</target>

<!-- ===================================================================  --> 
<!-- Compiles the EPI client code                                         --> 
<!-- ===================================================================  --> 
<target name="compile" depends="copyTestFile" 
  description="compiles source files">
  <javac srcdir="${srcDir}"
     destdir="${buildDir}"
     excludes="servlet/,db/">
     <classpath refid="classpath"/>
  </javac>
</target>


<!-- ===================================================================  --> 
<!-- Copy the test file into a directory that gets compiled               -->
<!-- ===================================================================  --> 
<target name="copyTestFile" depends="initGlobals">
  <copy file="STrader/TestClientObjects.java" todir="${srcDir}/dao" />
</target>




<!-- ===================================================================  --> 
<!-- Run the tests                                                        --> 
<!-- ===================================================================  -->
<target name="run"  depends="compile" description="run the test client" >
  <echo message="Run build at ${DSTAMP.NOW}"/>
  <java classname="TestClientObjects" >
    <!-- pass configuration directory from the command line -->
    <arg path="./${configDir}"/>
    <classpath refid="classpath"/>
  </java>
  <delete file="${srcDir}/dao/TestClientObjects.java"/>
</target>

<!-- ===================================================================  --> 
<!-- MAIN                                                                 --> 
<!-- ===================================================================  --> 
<target name="main" description="compile and run"
 depends="initGlobals,copyTestFile,compile,run" >
</target>

</project>

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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


Mime
View raw message