I figured it out. The classpath in the Parameters was wrong. Here is an example how to do it, in case someone needs to know.

Parameters parameters = new Parameters();
       
        File[] classpath = new File[4];
        classpath[0] = new File( "C:/xmlbeans-2.1.0/lib/xbean.jar" );
        classpath[1] = new File( "C:/xmlbeans- 2.1.0/lib/jsr173_1.0_api.jar" );
        classpath[2] = new File( "C:/xmlbeans-2.1.0/lib/tools.jar" );
        classpath[3] = new File( "C:/xmlbeans-2.1.0/lib/resolver.jar" );
        parameters.setClasspath (classpath);
       
        parameters.setOutputJar ( new File( "test.jar" ) );
       
        File[] xsdFiles =  { getFile() };   
        parameters.setXsdFiles( xsdFiles );
       
        parameters.setSrcDir( new File( SRC_DIR_PATH ) );
       
        parameters.setClassesDir( new File( CLASS_DIR_PATH ) );
       
        SchemaCompiler.compile(parameters);



2006/8/6, Junia Porto < [EMAIL PROTECTED]>:
Hello everyone

I'm new at xmlbeans, so I hope you can help.

I'm developing a application using Struts, Tomcat and XMLBeans. I'm using SchemaCompiler.compile to generate the jar file for the schema on the fly. It does generate the .java files, but after that I get 100 errors saying  "package org.apache.xmlbeans does not exist". In Tomcat directory, at WEB-INF\lib, there are all jar files that comes with XMLBeans. It seems it can't find the xbean.jar, but it is there, so I don't know what's wrong.

Can you help me with this?

Thanks a lot!

Junia

Reply via email to