You are not logged in.

  • Login

Dear visitor, welcome to Coder Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, July 30th 2007, 2:28pm

Problem mit ANT-Script

Hi, ich habe ein komisches Problem bei einem Ant-Script.

Das funktioniert:
ant RNGBeans.clean
ant RNGBeans.gui.run

Das funktioniert nicht:
ant RNGBeans.clean
ant RNGBeans.test.run

Fehler:
Buildfile: build.xml

RNGBeans.compile:
[mkdir] Created dir: C:\Programme\Eclipse\workspace\RNGBeans\bin
[javac] Compiling 186 source files to
C:\Programme\Eclipse\workspace\RNGBean
s\bin
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.

RNGBeans.test.run:
[java] Exception in thread "main" java.lang.NullPointerException
[java] at
tudresden.rngbeans.test.RNGBeansTestSuite.main(Unknown Source
)
[java] Java Result: 1

BUILD SUCCESSFUL


Die Meldung "[javac] Note: Recompile with -Xlint:unchecked for details."
hat nur mit 4 Warnigs in meinem Code als Ursache. Ist also nicht das
Problem. Das Problem tritt auch mit allen anderen Testklassen auf. Ne Idee?


XML Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0" ?>
<project default="RNGBeans.gui.run">
 
        <property name="src" value="${basedir}/src" />
        <property name="bin" value="${basedir}/bin" />
        <property name="lib" value="${basedir}/lib" />
        <property name="doc" value="${basedir}/doc" />
        <property name="doc_zip" value="${basedir}/RNGBeansJavaDoc.zip" /> 
        <property name="jar" value="${basedir}/RNGBeans.jar" />
        <property name="manifest" value="${basedir}/manifest.txt" /> 
        <property name="cp.compile" value="${lib}/jing.jar:${lib}/junit-4.1.jar" />
        <property name="cp.run" value="${bin}:${lib}/jing.jar:${lib}/junit-4.1.jar" />
 
        <target name="RNGBeans.compile">
                <mkdir dir="${bin}" />
                <javac srcdir="${src}" destdir="${bin}" includes="**/*.java" classpath="${cp.compile}"/>
        </target>
 
        <target name="RNGBeans.gui.run" depends="RNGBeans.compile">
                <java classname="tudresden.rngbeans.gui.MainFrame" classpath="${cp.run}" fork="yes"/>
        </target>
 
        <target name="RNGBeans.relaxngclassgenerator.run" depends="RNGBeans.compile">
                <java classname="tudresden.rngbeans.codegen.RelaxNGClassGenerator" classpath="${cp.run}" fork="yes"/>
                <javac srcdir="${src}" destdir="${bin}" includes="**/*.java" classpath="${cp.compile}"/>
        </target>
 
        <target name="RNGBeans.testclassgenerator.run" depends="RNGBeans.compile">
                <java classname="tudresden.rngbeans.codegen.TestClassGenerator" classpath="${cp.run}" fork="yes"/>
                <javac srcdir="${src}" destdir="${bin}" includes="**/*.java" classpath="${cp.compile}"/>
        </target>
 
        <target name="RNGBeans.test.run" depends="RNGBeans.compile">
                <java classname="tudresden.rngbeans.test.RNGBeansTestSuite" classpath="${cp.run}" fork="yes"/>
                <javac srcdir="${src}" destdir="${bin}" includes="**/*.java" classpath="${cp.compile}"/>
        </target>
        <target name="RNGBeans.test.codegenerator.run" depends="RNGBeans.compile">
                <java classname="tudresden.rngbeans.test.CodeGeneratorTestCase" classpath="${cp.run}" fork="yes"/>
                <javac srcdir="${src}" destdir="${bin}" includes="**/*.java" classpath="${cp.compile}"/>
        </target>
        <target name="RNGBeans.test.instancevalidator.run" depends="RNGBeans.compile">
                <java classname="tudresden.rngbeans.test.InstanceValidatorTestCase" classpath="${cp.run}" fork="yes"/>
        </target>
        <target name="RNGBeans.test.modelvalidator.run" depends="RNGBeans.compile">
                <java classname="tudresden.rngbeans.test.ModelValidatorTestCase" classpath="${cp.run}" fork="yes"/>
        </target>
        <target name="RNGBeans.test.relaxngclasses.run" depends="RNGBeans.compile">
                <java classname="tudresden.rngbeans.test.RelaxNGTestCase" classpath="${cp.run}" fork="yes"/>
        </target>
        <target name="RNGBeans.test.typesystem.run" depends="RNGBeans.compile">
                <java classname="tudresden.rngbeans.test.TypeSystemTestCase" classpath="${cp.run}" fork="yes"/>
        </target>
 
        <target name="RNGBeans.clean">
                <delete failonerror="false" dir="${bin}" />
                <delete failonerror="false" dir="${doc}" />
                <delete failonerror="false" file="${jar}" />
                <delete failonerror="false" file="${doc_zip}" />
        </target>
 
        <target name="RNGBeans.jar" depends="RNGBeans.compile">
                <unjar dest="${bin}">
                        <fileset dir="." includes="${cp.compile}" />
                </unjar>
                <jar compress="true" destfile="${jar}" manifest="${manifest}">
                        <fileset dir="${bin}" />
                </jar>
        </target>
 
        <target name="RNGBeans.javadoc">
                <mkdir dir="${doc}" />
                <javadoc packagenames="tudresden.rngbeans,tudresden.rngbeans.codegen,tudresden.rngbeans.codegen.structure,tudresden.rngbeans.gui,tudresden.rngbeans.instancevalidator,tudresden.rngbeans.marshaler,tudresden.rngbeans.modelvalidator,tudresden.rngbeans.relaxng,tudresden.rngbeans.test,tudresden.rngbeans.test.testclasses,tudresden.rngbeans.typesystem,tudresden.rngbeans.typesystem.impl.rng,tudresden.rngbeans.typesystem.impl.xsd,tudresden.rngbeans.utilities"                 
                        header="RNGBeans"
                        windowtitle="RNGBeans - JavaDoc"
                        sourcepath="${src}"
                        classpath="${cp.run}"
                        destdir="${doc}"
                        author="true"
                        version="false"
                        use="false"
                        additionalparam="-linksource">
                        <link href="http://java.sun.com/j2se/1.5/docs/api/" />
                </javadoc>
                <zip destfile="${doc_zip}" basedir="${basedir}" includes="doc/**/*" />
        </target>
</project>

2

Monday, July 30th 2007, 6:21pm

Problem gefunden.
Die nicht-java-Files wurden nicht vom src- ins bin-Verzeichnis kopiert.

XML Code

1
2
3
4
5
<copy todir="${bin}">
            		<fileset dir="${src}">
				<exclude name="**/*.java"/>
			</fileset>
		</copy>

Social bookmarks