Jarosław Pałka wrote:

Hello!!!

I have just started using AbstractMerlinTestCase and I have problem with
setting classpath from ant.
My build.xml contains following target:

<target name="unittest">
    <junit showoutput="true" fork="true" printsummary="yes">
        <batchtest>
            <formatter type="plain"/>
                <fileset dir="${build.classes.dir}">
                    <include name="**/tests/**"/>
                </fileset>
        </batchtest>
    </junit>
</target>

block.xml contains followin classloader definition:
<classloader>
    <classpath>
        <fileset dir="libs">
            <include name="hibernate-2.1.2.jar"/>
            <include name="commons-lang-2.0.jar"/>
            <include name="dom4j-1.3.jar"/>
            <include name="commons-logging-1.0.3.jar"/>
            <include name="commons-collections-2.1.jar"/>
            <include name="cglib-2.0-rc2.jar"/>
            <include name="hsqldb-1.7.1.jar"/>
            <include name="jta.jar"/>
            <include name="ehcache-0.6.jar"/>
            <include name="commons-beanutils-1.6.jar"/>
            <include name="odmg.jar"/>
            <include name="protomatter-1.1.8.jar"/>
            <include name="avalon-scratchpad-4.1.jar"/>
        </fileset>
    </classpath>
</classloader>

When I run this target I get NoClassDefFoundException.
Exception: org.apache.avalon.merlin.KernelException
Message: Kernel startup failure.

No suprise.


You placing classes the dependend on a bunch of stuff into the root classloader. When those classes look for dependent classes thay can only look up the tree and because you have put them right at top - none of the supporting classes can be found. You should include your test classes into the containers classloader declaration.

Cheers, Steve.

--

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/merlin/distributions/latest    |
|------------------------------------------------|

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to