A workaround is this: copy the three jar files to ${MERLIN_HOME}/ext
This still does not explain the odd behavior.

All this is the same for version 3.3.0.

-broc

 > -----Original Message-----
 > From: Seib, Broc [mailto:[EMAIL PROTECTED] 
 > Sent: Wednesday, April 14, 2004 11:48 AM
 > To: Avalon framework users
 > Cc: Seib, Broc
 > Subject: Merlin 3.2.5 does not see jars in java's 
 > jre/lib/ext directory
 > 
 > 
 > I am running merlin 3.2.5 with java 1.3.1. At the end of the merlin
 > INSTALL.TXT file, there is a note for java 1.3.1 users, 
 > saying you need
 > to install the xml parsers that 1.3.1 lacks. (BTW, I think there is a
 > deadly typo in that section: "java.ext.dir" seems incorrect;
 > "java.ext.dirs" instead.) I have correctly installed the 
 > three xml jar
 > files to my jre/lib/ext directory. I also wrote a short java 
 > program to
 > prove that java is happy about the jars being "findable" in that
 > location.
 > 
 > However, when I try to execute the merlin "hello" tutorial 
 > (as below) I
 > get an error with merlin being unable to find a class, which 
 > I know is
 > correctly installed in the jre/lib/ext directory.
 > 
 > I can't figure out why merlin would see /ext differently 
 > than java. Any
 > ideas?
 > 
 > -broc
 > 
 > 
 > <merlin_fails_to_find_jars>
 > /home/pulsar/bseib/merlin/tutorial/hello$ merlin 
 > target/classes -execute
 > Starting Default Unix script
 > Starting Merlin 3.2.4.
 > ====================
 >              Platform: FreeBSD
 >             Java Home: /usr/local/jdk
 >           Merlin Home: /opt/merlin
 >       Security policy: /opt/merlin/bin/security.policy
 >           JVM Options:
 >         Bootstrap JAR: /opt/merlin/bin/lib/merlin-cli-3.2.4.jar
 >      Merlin Arguments:  target/classes -execute
 > 
 > ---- exception report
 > ----------------------------------------------------------
 > Exception: org.apache.avalon.merlin.KernelException
 > Message: Could not load the kernel directive:
 > file:/opt/merlin/config/kernel.xml
 > ---- cause
 > ---------------------------------------------------------------------
 > Exception: javax.xml.parsers.FactoryConfigurationError
 > Message: Provider 
 > org.apache.xerces.jaxp.SAXParserFactoryImpl not found
 > ---- stack trace
 > ---------------------------------------------------------------
 > javax.xml.parsers.FactoryConfigurationError: Provider
 > org.apache.xerces.jaxp.SAXParserFactoryImpl not found
 > javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFacto
 > ry.java:141
 > )
 > org.apache.avalon.framework.configuration.DefaultConfiguratio
 > nBuilder.<i
 > nit>(DefaultConfigurationBuilder.java:135)
 > org.apache.avalon.framework.configuration.DefaultConfiguratio
 > nBuilder.<i
 > nit>(DefaultConfigurationBuilder.java:118)
 > org.apache.avalon.merlin.impl.DefaultFactory.getKernelConfigu
 > ration(Defa
 > ultFactory.java:834)
 > org.apache.avalon.merlin.impl.DefaultFactory.create(DefaultFa
 > ctory.java:
 > 241)
 > org.apache.avalon.merlin.cli.Main.<init>(Main.java:329)
 > org.apache.avalon.merlin.cli.Main.main(Main.java:281)
 > -------------------------------------------------------------
 > -----------
 > --------
 > </merlin_fails_to_find_jars>
 > 
 > 
 > <excerpt_from_INSTALL>
 > Special Note for JRE 1.3 and earlier.
 > -------------------------------------
 > 
 > Some applications assume that XML parsing classes are 
 > available withing
 > the JRE.  This is not the case with JDK 1.3 and earlier.  To resolve
 > this
 > you can copy the following files to the JAVAHOME/lib/ext directory or
 > declare an alternative directory as a JVM argument under the
 > MERLIN_JVM_OPTS environment variable, i.e. 
 > -Djava.ext.dir=someDirectory
 > 
 >   system/xml-apis/jars/xml-apis-2.0.2.jar
 >   system/xml-apis/jars/xmlParserAPIs-2.0.2.jar
 >   system/xerces/jars/xerces-2.4.0.jar
 > 
 > </excerpt_from_INSTALL>
 > 
 > <test_code_to_prove_install_is_correct>
 > // Foo.java
 > // prove that this import statement does not fail
 > import org.apache.xerces.jaxp.SAXParserFactoryImpl;
 > 
 > class Foo {
 >         public static void main(String[] args) {
 > 
 >                 // i just want to see what java thinks where 
 > its ext dir
 > is
 >                 String key = "java.ext.dirs";
 >                 String extDirs =
 > System.getProperties().getProperty(key);
 >                 System.out.println(key+"="+extDirs);
 > 
 >                 // see if we can actually use something from
 > SAXParserFactoryImpl
 >                 // to prove it can be loaded from the ext dir
 >                 SAXParserFactoryImpl testObj = new
 > SAXParserFactoryImpl();
 >                 System.out.println("success creating 
 > object="+testObj);
 >         }
 > }
 > </test_code_to_prove_install_is_correct>
 > 
 > <running_the_test_code>
 > $ javac Foo.java
 > $ java Foo
 > java.ext.dirs=/usr/local/jdk1.3.1/jre/lib/ext
 > success creating
 > [EMAIL PROTECTED]
 > 
 > Then I moved the three jar files out of my /ext directory 
 > and reran and
 > got the errors I was expecting.
 > 
 > $ java Foo
 > java.ext.dirs=/usr/local/jdk1.3.1/jre/lib/ext
 > Exception in thread "main" java.lang.NoClassDefFoundError:
 > org/apache/xerces/jaxp/SAXParserFactoryImpl
 >         at Foo.main(Foo.java:11)
 > 
 > </running_the_test_code>
 > 
 > ---------------------------------------------------------------------
 > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > For additional commands, e-mail: [EMAIL PROTECTED]
 > 
 > 

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

Reply via email to