Hi!!!

Is there any documentation or place where I can find description of
classloader hierarchy in merlin? Maybe it will help me solve this issue.

Thanks,
Jarek
----- Original Message ----- 
From: "Jarosław Pałka" <[EMAIL PROTECTED]>
To: "Avalon framework users" <[EMAIL PROTECTED]>
Sent: Wednesday, March 03, 2004 5:38 PM
Subject: Re: Ant,JUnit and AbstractMerlinTestCase


I got very strange results :(

I removed mrt-service-impl.jar from block.xml classpath, I got
com.mrt.AbstractService NotClassDefFoundException, which is ok.
I put mrt-service-impl.jar again on block classpath and added cglib.jar to
CLASSPATH variable,net.sf.cglib.reflect class was loaded successfully but
then I got following exception
which is very strange for me because com.mrt.BussinessServiceException class
is placed in mrt-service-impl.jar from which com.mrt.AbstractService was
successfully loaded.

1)
testSave(com.mrt.vend.impl.tests.LocationDAOServiceTest)java.lang.Exception:
---- exception
report ----------------------------------------------------------

Exception: org.apache.avalon.merlin.KernelException
Message: Install failure:
file:/C:/projekty/mrt-vend2/src/conf/block-locationdao
-test.xml
---- 
cause ---------------------------------------------------------------------

Exception: org.apache.avalon.composition.model.ModelException
Message: Could not create classloader.
---- 
cause ---------------------------------------------------------------------

Exception: org.apache.avalon.composition.model.ModelException
Message: Unexpected error while attempting to scan directory:
file:/C:/projekty/
mrt-vend2/build/classes/
---- 
cause ---------------------------------------------------------------------

Exception: org.apache.avalon.composition.model.ModelException
Message: Component type
[com.mrt.vend.client.desktop.command.location.CreateLoca
tionCommandImpl] contains a reference to the class [com/mrt/AbstractService]
whi
ch does not exist in the classloader.
---- stack
trace ---------------------------------------------------------------

org.apache.avalon.composition.model.ModelException: Component type
[com.mrt.vend
.client.desktop.command.location.CreateLocationCommandImpl] contains a
reference
 to the class [com/mrt/AbstractService] which does not exist in the
classloader.

org.apache.avalon.composition.model.impl.Scanner.getComponentClass(Scanner.j
ava:
538)
org.apache.avalon.composition.model.impl.Scanner.addType(Scanner.java:376)
org.apache.avalon.composition.model.impl.Scanner.scanFile(Scanner.java:365)
org.apache.avalon.composition.model.impl.Scanner.scanDirectoryContent(Scanne
r.ja
va:354)
org.apache.avalon.composition.model.impl.Scanner.scanDirectoryContent(Scanne
r.ja
va:350)
org.apache.avalon.composition.model.impl.Scanner.scanDirectoryContent(Scanne
r.ja
va:350)
org.apache.avalon.composition.model.impl.Scanner.scanDirectoryContent(Scanne
r.ja
va:350)
org.apache.avalon.composition.model.impl.Scanner.scanDirectoryContent(Scanne
r.ja
va:350)
org.apache.avalon.composition.model.impl.Scanner.scanDirectoryContent(Scanne
r.ja
va:350)
org.apache.avalon.composition.model.impl.Scanner.scanDirectoryContent(Scanne
r.ja
va:350)
org.apache.avalon.composition.model.impl.Scanner.scanDirectoryContent(Scanne
r.ja
va:350)
org.apache.avalon.composition.model.impl.Scanner.scanDirectory(Scanner.java:
210)

org.apache.avalon.composition.model.impl.Scanner.scanURL(Scanner.java:191)
org.apache.avalon.composition.model.impl.Scanner.scan(Scanner.java:170)
org.apache.avalon.composition.model.impl.DefaultClassLoaderModel.<init>(Defa
ultC
lassLoaderModel.java:235)
org.apache.avalon.composition.model.impl.DefaultClassLoaderModel.createClass
Load
erModel(DefaultClassLoaderModel.java:129)
org.apache.avalon.composition.model.impl.DefaultContainmentModel.createConta
inme
ntModel(DefaultContainmentModel.java:634)
org.apache.avalon.composition.model.impl.DefaultContainmentModel.createConta
inme
ntModel(DefaultContainmentModel.java:597)
org.apache.avalon.composition.model.impl.DefaultContainmentModel.createConta
inme
ntModel(DefaultContainmentModel.java:844)
org.apache.avalon.composition.model.impl.DefaultContainmentModel.addContainm
entM
odel(DefaultContainmentModel.java:376)
org.apache.avalon.composition.model.impl.DefaultContainmentModel.addModel(De
faul
tContainmentModel.java:370)
org.apache.avalon.merlin.impl.DefaultFactory.create(DefaultFactory.java:488)
org.apache.avalon.merlin.unit.AbstractMerlinTestCase.setUp(AbstractMerlinTes
tCas
e.java:198)
junit.framework.TestCase.runBare(TestCase.java:125)
junit.framework.TestResult$1.protect(TestResult.java:106)
junit.framework.TestResult.runProtected(TestResult.java:124)
junit.framework.TestResult.run(TestResult.java:109)
junit.framework.TestCase.run(TestCase.java:118)
junit.framework.TestSuite.runTest(TestSuite.java:208)
junit.framework.TestSuite.run(TestSuite.java:203)
junit.textui.TestRunner.doRun(TestRunner.java:116)
junit.textui.TestRunner.doRun(TestRunner.java:109)
junit.textui.TestRunner.run(TestRunner.java:72)
junit.textui.TestRunner.run(TestRunner.java:57)
com.mrt.vend.impl.tests.LocationDAOServiceTest.main(LocationDAOServiceTest.j
ava:
34)
----------------------------------------------------------------------------
----


        at
org.apache.avalon.merlin.unit.AbstractMerlinTestCase.setUp(AbstractMe
rlinTestCase.java:210)
        at
com.mrt.vend.impl.tests.LocationDAOServiceTest.main(LocationDAOServic
eTest.java:34)

FAILURES!!!
Tests run: 1,  Failures: 0,  Errors: 1
----- Original Message ----- 
From: "Stephen McConnell" <[EMAIL PROTECTED]>
To: "Avalon framework users" <[EMAIL PROTECTED]>
Sent: Wednesday, March 03, 2004 5:23 PM
Subject: Re: Ant,JUnit and AbstractMerlinTestCase


Jarosław Pałka wrote:
> Thanks,
> It almost works, there is only exception in class from cglib.jar (used by
> hibernate), it is included in classpath but merlin cannot find it.

Merlin has found the class but the class cannot be properly constructed.
  This is typically because the class is referencing another class that
is unknown with the classloader hierarchy.  My guess is the the cglib is
doing something that requires classes in the system classloader.  A
solution to this problem may be to move the cglib jar file from the
block definition to the classpath used to run the unit test.  But this
itself could be problematic as ant creates its own classloader above the
system classloader.

What happens when you run the block directly using merlin from the
command line?

Stephen.

>     [junit] Exception: java.lang.NoClassDefFoundError
>     [junit] Message: net/sf/cglib/reflect/FastClass


-- 

|------------------------------------------------|
| 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]


----------------------------------------------------------------------
Portal INTERIA.PL zaprasza... >>> http://link.interia.pl/f17cb






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


---------------------------------------------------------------------
Najwiekszy serwis aukcyjny w Internecie? Sprawdz!
>>> http://www.aukcje.interia.pl/ <<<






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

Reply via email to