[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlbeans-user
Subject: Re: Can't find package [SOLVED]
From: "Junia Porto" <juniaporto () gmail ! com>
Date: 2006-08-08 0:02:46
Message-ID: 26e2a6440608071702q72385aaci6ddf0f51a6025081 () mail ! gmail ! com
[Download RAW message or body]
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 <juniaporto@gmail.com>:
>
> 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
>
[Attachment #3 (text/html)]
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.<br><br><span style="color: rgb(153, 153, \
153);">Parameters parameters = new Parameters();</span><br style="color: rgb(153, \
153, 153);"> <span style="color: rgb(153, 153, 153);"> \
</span><br style="color: rgb(153, 153, 153);"><span style="color: \
rgb(153, 153, 153);"> File[] classpath = new \
File[4];</span><br style="color: rgb(153, 153, 153);"> <span style="color: rgb(153, \
153, 153);"> classpath[0] = new File( \
"C:/xmlbeans-2.1.0/lib/xbean.jar" );</span><br style="color: rgb(153, 153, \
153);"><span style="color: rgb(153, 153, 153);"> \
classpath[1] = new File( "C:/xmlbeans- 2.1.0/lib/jsr173_1.0_api.jar" \
);</span><br style="color: rgb(153, 153, 153);"><span style="color: rgb(153, 153, \
153);"> classpath[2] = new File( \
"C:/xmlbeans-2.1.0/lib/tools.jar" );</span><br style="color: rgb(153, 153, \
153);"> <span style="color: rgb(153, 153, 153);"> \
classpath[3] = new File( \
"C:/xmlbeans-2.1.0/lib/resolver.jar" );</span><br style="color: rgb(153, \
153, 153);"><span style="color: rgb(153, 153, 153);"> \
parameters.setClasspath (classpath);</span><br style="color: \
rgb(153, 153, 153);"><span style="color: rgb(153, 153, 153);"> \
</span><br style="color: rgb(153, 153, 153);"><span style="color: \
rgb(153, 153, 153);"> parameters.setOutputJar ( \
new File( "test.jar" ) );</span><br style="color: rgb(153, 153, \
153);"><span style="color: rgb(153, 153, 153);"> \
</span><br style="color: rgb(153, 153, 153);"><span style="color: rgb(153, 153, \
153);"> File[] xsdFiles = { getFile() \
}; </span><br style="color: rgb(153, 153, 153);"><span \
style="color: rgb(153, 153, 153);"> \
parameters.setXsdFiles( xsdFiles );</span><br style="color: rgb(153, 153, \
153);"><span style="color: rgb(153, 153, 153);"> \
</span><br style="color: rgb(153, 153, 153);"><span style="color: rgb(153, 153, \
153);"> parameters.setSrcDir( new File( \
SRC_DIR_PATH ) );</span><br style="color: rgb(153, 153, 153);"><span style="color: \
rgb(153, 153, 153);"> </span><br style="color: \
rgb(153, 153, 153);"><span style="color: rgb(153, 153, 153);"> \
parameters.setClassesDir( new File( CLASS_DIR_PATH ) );</span><br \
style="color: rgb(153, 153, 153);"><span style="color: rgb(153, 153, 153);"> \
</span><br style="color: rgb(153, 153, \
153);"><span style="color: rgb(153, 153, 153);"> \
SchemaCompiler.compile(parameters);</span><br><br><br><br><div><span \
class="gmail_quote">2006/8/6, Junia Porto <<a href="mailto:juniaporto@gmail.com"> \
juniaporto@gmail.com</a>>:</span><blockquote class="gmail_quote" \
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; \
padding-left: 1ex;"><div>Hello everyone<br><br>I'm new at xmlbeans, so I hope you can \
help. <br><br>I'm developing a application using Struts, Tomcat and XMLBeans. I'm \
using <span style="font-weight: bold;">SchemaCompiler.compile</span> 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.<br><br>
Can you help me with this?<br><br>Thanks a lot!<br></div><div><span \
class="sg"><br>Junia<br>
</span></div></blockquote></div><br>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic