Morten, I think you might have misread my post: the jar seems to be built incorrectly. The jar is built with cmdline.Compile but the class com.schemasoft.Foo can't be loaded by java.
> -----Original Message----- > From: Morten Jorgensen [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 23, 2001 6:24 AM > To: [EMAIL PROTECTED] > Subject: Re: problem using a translet compiled and packaged to a jar > > > John, > > The produced JAR-file only contains the translet class(es) and any > auxiliary classes. You still need to initiate the transformation > through the main() method in org.apache.xalan.xsltc.cmdline.Transform > or in your own similar class. A translet class does not have a main() > method and cannot be run directly from the command line. > > Morten > > > John Howard wrote: > > > > Hi all, > > > > Is anyone else compiling and packaging translets to jars using > > cmdline.Compile? Can you then instance your translets? > > > > 1. When I try: > > > > java org.apache.xalan.xsltc.cmdline.Compile -j bar.jar -p > com.schemasoft -o > > Foo Foo.xsl > > java -classpath bar.jar com.schemasoft.Foo > > > > I get: > > > > Exception in thread "main" java.lang.NoClassDefFoundError: > > com/schemasoft/Foo > > > > 2. Whereas when I try: > > > > java org.apache.xalan.xsltc.cmdline.Compile -j bar.jar -o > Foo Foo.xsl > > java -classpath bar.jar Foo > > > > I get (indicating the packaging seems to work): > > Exception in thread "main" java.lang.NoClassDefFoundError: > > org/apache/xalan/xsltc/runtime/AbstractTranslet > > > > 3. For giggles I tried: > > > > java org.apache.xalan.xsltc.cmdline.Compile -p > com.schemasoft -o Foo Foo.xsl > > jar cf baz.jar com\ > > java -classpath baz.jar com.schemasoft.Foo > > > > And I get the healthy: > > > > Exception in thread "main" java.lang.NoClassDefFoundError: > > org/apache/xalan/xsltc/runtime/AbstractTranslet > > > > When I compare the jars produced from 2 and 3, the only > thing different is > > the manifest. XSLTC builds the manifest properly (Foo.class > has an entry) > > whereas the jar tool only writes header information. > > > > thanks, > > > > john >
