Mailing List
Home
Cocoon - MVC web framework based on XML/XSL
Maven - Project building tool
Ant - A Java building tool
Axis - Java SOAP implementation
Lucene - Full-featured text search engine APIs
Fop - Create PDF, PCL, PS, SVG, XML driven by XSL formatting objects.
Log4J - A log library
POI - Java Excel, Word and other Microsoft Office files manipulating library
Oracle database, Microsoft SQL server ...
MySQL - an open source database
Red Hat Linux Installation and Config discussions ...
Click here to subscribe to Jakatar mailing list
Subjects
log4j warning: No appenders could be found
java security AccessControlException: access denied (java io FilePermission clie
java lang InstantiationException: org apache tools ant Main
Apache Axis Tutorial
Struts <logic iterate >
log4j properties How to parse outpu to multiple files
configuring log4j with BEA Weblogic 8 1
How to use XSL FOP Java together
JSP precompile
Servlet File Download dialog problem (IE6,Adobe 6 0)
Proposal: Adding jar manifest classpath in jar and war plugins
Unsupported major minor version 48 0 problem while running the an
   telope task
java security AccessControlException: access denied (java io FilePermission
axis wsdl2java Ant Task usage
net sf hibernate MappingException: Error reading resource: test/User hbm xml
Building EAR ANT Script for websphere 5 0
CREATING WAR Files
jsp data into Excel
Classpath problem
Jboss 3 2 3+ vs Tomcat Axis Question
RE: How to include jars and add them into the MANIFEST MF/Class Path
attribute
Printing problem
InstantiationException
Couldn 't find trusted certificate
Please : How can one install ant 1 6 0 under Eclipse 2 1 ?
Excel: Too many different cell formats
Running junit tests fails
XDoclet, Struts and Maven: Where to start? SOLUTION
1 3 final: now giving me java io FileNotFoundException (Too many
open files)
AXIS: tomcat timeout ?
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Classpath problem

Classpath problem

2004-01-10       - By Christoph Schwitter

 Back
Reply:     1     2     3  

I use the very same classpath for compilation and running, but when
running some class is not found.

Compilation works fine, running gets the following error

[java] java.lang.NoClassDefFoundError:
ch/elscheff/config/provider/BadConfigurationFormatExcep
ion
[java] at ch.elscheff.tools.skiptext.Start.main(Unknown Source)
[java] Exception in thread "main "

That class is included in ConfigProvider.jar
(ch\elscheff\config\provider\BadConfigurationFormatExcepion.class

I do not understand why the same classpath once works with compile and
does not work with runonly target.

Full information is below.
Thanks for help

Christoph


build.xml includes

    <path id= "project.class.path " >
    <pathelement path= "${java.class.path} "/ >
    <fileset dir= "${lib_chsDir} " >
          <include name= "**/*.jar "/ >
       </fileset >
    <fileset dir= "${lib_extDir} " >
       <include name= "**/*.jar "/ >
       </fileset >
    </path >


    <target name= "compile " depends= "init "
   description= "Compile java source files " >
       <echo >Compiling java source files in ${srcDir} to          
{classDir} </echo >
       <mkdir dir= "${classDir} "/ >
    <javac srcdir= "${srcDir} "
      destdir= "${classDir} "
    includes= "**/*.java " >
       <classpath refid= "project.class.path "/ >
    </javac >    
    </target >


    <target name= "runonly " depends= "init "
         description= "Run the program from the jar file " >
       <java jar= "${projectName}.jar "
   fork= "true "
   failonerror= "true " >
    <classpath refid= "project.class.path "/ >
    </java >
    </target >    



Full output:


E:\MyFiles\Projects\SkipTextFromFileList >ant runonly -v
Apache Ant version 1.6.0 compiled on December 18 2003
Buildfile: build.xml
Detected Java version: 1.4 in: D:\Java\jdk142_02\jre
Detected OS: Windows XP
parsing buildfile E:\MyFiles\Projects\SkipTextFromFileList\build.xml
with URI = file:///E:/MyFiles/
rojects/SkipTextFromFileList/build.xml
Project base dir set to: E:\MyFiles\Projects\SkipTextFromFileList
[property] Loading E:\MyFiles\Projects\global.project.properties
Build sequence for target `runonly ' is [init, runonly]
Complete build sequence is [init, runonly, zipsrc, clean, importjar,
compile, javadoc, buildjar, ex
ortjar, zipdoc, zipall, complete, runapp, ]

init:
Override ignored for property DSTAMP
Override ignored for property TSTAMP
[echo] Project: SkipTextFromFileList
[echo] Date/time: 2004-01-10 11:41:52 433

runonly:
[java] Executing 'D:\Java\jdk142_02\jre\bin\java.exe ' with arguments:
[java] '-classpath '
[java]
'D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-launcher.jar;D:\Tools\ant_1_6\apache-ant-1.6
0\lib\ant-antlr.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-apache-bsf.jar;D:\Tools\ant_1_6\apach
-ant-1.6.0\lib\ant-apache-resolver.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-commons-logging.ja
;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-commons-net.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\an
-icontract.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-jai.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\
ib\ant-jakarta-bcel.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-jakarta-log4j.jar;D:\Tools\ant_1_
\apache-ant-1.6.0\lib\ant-jakarta-oro.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-jakarta-regexp.
ar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-javamail.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant
jdepend.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-jmf.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib
ant-jsch.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-junit.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\
ib\ant-netrexx.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-nodeps.jar;D:\Tools\ant_1_6\apache-ant
1.6.0\lib\ant-starteam.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-stylebook.jar;D:\Tools\ant_1_6
apache-ant-1.6.0\lib\ant-swing.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-trax.jar;D:\Tools\ant_
_6\apache-ant-1.6.0\lib\ant-vaj.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-weblogic.jar;D:\Tools
ant_1_6\apache-ant-1.6.0\lib\ant-xalan1.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant-xalan2.jar;D:
Tools\ant_1_6\apache-ant-1.6.0\lib\ant-xslp.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\ant.jar;D:\To
ls\ant_1_6\apache-ant-1.6.0\lib\xercesImpl.jar;D:\Tools\ant_1_6\apache-ant-1.6.0\lib\xml-apis.jar;D
\Java\jdk142_02\lib\tools.jar;E:\MyFiles\Projects\SkipTextFromFileList\lib_chs\ConfigProvider.jar '
[java] '-jar '
[java]
'E:\MyFiles\Projects\SkipTextFromFileList\SkipTextFromFileList.jar '
[java]
[java] The ' characters around the executable and arguments are
[java] not part of the command.
[java] Config file:
E:\MyFiles\Projects\SkipTextFromFileList\config\config.txt
[java] java.lang.NoClassDefFoundError:
ch/elscheff/config/provider/BadConfigurationFormatExcep
ion
[java] at ch.elscheff.tools.skiptext.Start.main(Unknown Source)
[java] Exception in thread "main "


BUILD FAILED
E:\MyFiles\Projects\SkipTextFromFileList\build.xml:142: Java returned: 1
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:118)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)
at org.apache.tools.ant.Task.perform(Task.java:401)
at org.apache.tools.ant.Target.execute(Target.java:338)
at org.apache.tools.ant.Target.performTasks(Target.java:365)
at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
at org.apache.tools.ant.Main.runBuild(Main.java:669)
at org.apache.tools.ant.Main.startAnt(Main.java:220)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)

Total time: 1 second


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)