Discussion:
Castor XML Code Generator
Baba
2008-10-14 14:40:20 UTC
Permalink
Dear Castor User group,

I like to use the Castor XML Code Generator to generate java classes
of my xsd files. But every time I try to generate this classes I get
the exception "Exception in thread "main"
java.lang.NoClassDefFoundError:
org/exolab/castor/builder/SourceGeneratorMain" or if used the ant
example it is the following exception "Exception in thread "main"
java.lang.NoClassDefFoundError:
org/exolab/castor/xml/schema/ContentModelGroup at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:216)".
I used the command-line, a small self developed java program and the
ant example but every time I get this exception. I use the JRE
1.5.0_13, the new Castor 1.3 RC and Castor 1.2 generator.

What is the failure?

My aim is it to create an Eclipse project or an ant task which
generate the java classes of my xsd files. If somebody has a working
ant task or a running eclipse project and like to provide me with
information about configuration. I think it could be help me to get a
running system.

Greeting
Thomas

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Werner Guttmann
2008-10-14 20:24:48 UTC
Permalink
Hi,

have a look at

http://www.castor.org/dependencies.html

to get an overview what JARs are actually required to run e.g. the XML
code generator. It looks like you are missing some of the required
dependencies.

Regards
Werner
Post by Baba
Dear Castor User group,
I like to use the Castor XML Code Generator to generate java classes
of my xsd files. But every time I try to generate this classes I get
the exception "Exception in thread "main"
org/exolab/castor/builder/SourceGeneratorMain" or if used the ant
example it is the following exception "Exception in thread "main"
org/exolab/castor/xml/schema/ContentModelGroup at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:216)".
I used the command-line, a small self developed java program and the
ant example but every time I get this exception. I use the JRE
1.5.0_13, the new Castor 1.3 RC and Castor 1.2 generator.
What is the failure?
My aim is it to create an Eclipse project or an ant task which
generate the java classes of my xsd files. If somebody has a working
ant task or a running eclipse project and like to provide me with
information about configuration. I think it could be help me to get a
running system.
Greeting
Thomas
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Werner Guttmann
2008-10-14 20:26:38 UTC
Permalink
Actually,
Post by Baba
Dear Castor User group,
I like to use the Castor XML Code Generator to generate java classes
of my xsd files. But every time I try to generate this classes I get
the exception "Exception in thread "main"
org/exolab/castor/builder/SourceGeneratorMain" or if used the ant
example it is the following exception "Exception in thread "main"
org/exolab/castor/xml/schema/ContentModelGroup at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:216)".
I used the command-line, a small self developed java program and the
ant example but every time I get this exception. I use the JRE
1.5.0_13, the new Castor 1.3 RC and Castor 1.2 generator.
What is the failure?
My aim is it to create an Eclipse project or an ant task which
generate the java classes of my xsd files.
Have you seen the relevant section in the (new) reference giude that
describes how to use the Ant task for the XML code generator ?


If somebody has a working
Post by Baba
ant task or a running eclipse project and like to provide me with
information about configuration. I think it could be help me to get a
running system.
Greeting
Thomas
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Baba
2008-10-14 20:54:48 UTC
Permalink
Hi Werner,

thank you for your fast answer. Yes, I see the section about how to
use the Ant task for the xml code. But, what i missed is the part
which describes the base "init" of every ant target. If you can
provide me this information I try it again.

Greeting
Thomas
Post by Werner Guttmann
Actually,
Post by Baba
Dear Castor User group,
I like to use the Castor XML Code Generator to generate java classes
of my xsd files. But every time I try to generate this classes I get
the exception "Exception in thread "main"
org/exolab/castor/builder/SourceGeneratorMain" or if used the ant
example it is the following exception "Exception in thread "main"
org/exolab/castor/xml/schema/ContentModelGroup at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:216)".
I used the command-line, a small self developed java program and the
ant example but every time I get this exception. I use the JRE
1.5.0_13, the new Castor 1.3 RC and Castor 1.2 generator.
What is the failure?
My aim is it to create an Eclipse project or an ant task which
generate the java classes of my xsd files.
Have you seen the relevant section in the (new) reference giude that
describes how to use the Ant task for the XML code generator ?
If somebody has a working
Post by Baba
ant task or a running eclipse project and like to provide me with
information about configuration. I think it could be help me to get a
running system.
Greeting
Thomas
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Baba
2008-10-16 09:12:58 UTC
Permalink
Hi Werner and Castor User group,

I have some progress at the task "Generate Java Classes with castor"
but at the moment I get the following exception:
Could not create type castor-srcgen due to
org.castor.core.util.ConfigurationException: Failed to load
configuration: castor.core.properties

I include all dependencies and use this ant script:


<project name="CastorGenerator" default="castor:gen:src">
<path id="castor.class.path">
<fileset dir="${basedir}/lib">
<include name="*.jar" />
</fileset>
</path>

<target name="init">

</target>

<target name="castor:gen:src" depends="init" description="Generate
Java source files from XSD.">
<taskdef name="castor-srcgen"
classname="org.castor.anttask.CastorCodeGenTask"
classpathref="castor.class.path" />
<mkdir dir="generated" />
<castor-srcgen file="resources/xsd/kos-skript.xsd"
todir="generated-source"
package="org.castor.example.schema"
types="j2"
warnings="true" />
</target>

</project>


Where is the failure? What I have to configure at the "init" task?

Greeting
Thomas
Post by Baba
Hi Werner,
thank you for your fast answer. Yes, I see the section about how to
use the Ant task for the xml code. But, what i missed is the part
which describes the base "init" of every ant target. If you can
provide me this information I try it again.
Greeting
Thomas
Post by Werner Guttmann
Actually,
Post by Baba
Dear Castor User group,
I like to use the Castor XML Code Generator to generate java classes
of my xsd files. But every time I try to generate this classes I get
the exception "Exception in thread "main"
org/exolab/castor/builder/SourceGeneratorMain" or if used the ant
example it is the following exception "Exception in thread "main"
org/exolab/castor/xml/schema/ContentModelGroup at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:216)".
I used the command-line, a small self developed java program and the
ant example but every time I get this exception. I use the JRE
1.5.0_13, the new Castor 1.3 RC and Castor 1.2 generator.
What is the failure?
My aim is it to create an Eclipse project or an ant task which
generate the java classes of my xsd files.
Have you seen the relevant section in the (new) reference giude that
describes how to use the Ant task for the XML code generator ?
If somebody has a working
Post by Baba
ant task or a running eclipse project and like to provide me with
information about configuration. I think it could be help me to get a
running system.
Greeting
Thomas
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Werner Guttmann
2008-10-16 20:16:53 UTC
Permalink
Does your classpath include the JAR for castor-core ?

Werner
Post by Baba
Hi Werner and Castor User group,
I have some progress at the task "Generate Java Classes with castor"
Could not create type castor-srcgen due to
org.castor.core.util.ConfigurationException: Failed to load
configuration: castor.core.properties
<project name="CastorGenerator" default="castor:gen:src">
<path id="castor.class.path">
<fileset dir="${basedir}/lib">
<include name="*.jar" />
</fileset>
</path>
<target name="init">
</target>
<target name="castor:gen:src" depends="init" description="Generate
Java source files from XSD.">
<taskdef name="castor-srcgen"
classname="org.castor.anttask.CastorCodeGenTask"
classpathref="castor.class.path" />
<mkdir dir="generated" />
<castor-srcgen file="resources/xsd/kos-skript.xsd"
todir="generated-source"
package="org.castor.example.schema"
types="j2"
warnings="true" />
</target>
</project>
Where is the failure? What I have to configure at the "init" task?
Greeting
Thomas
Post by Baba
Hi Werner,
thank you for your fast answer. Yes, I see the section about how to
use the Ant task for the xml code. But, what i missed is the part
which describes the base "init" of every ant target. If you can
provide me this information I try it again.
Greeting
Thomas
Post by Werner Guttmann
Actually,
Post by Baba
Dear Castor User group,
I like to use the Castor XML Code Generator to generate java classes
of my xsd files. But every time I try to generate this classes I get
the exception "Exception in thread "main"
org/exolab/castor/builder/SourceGeneratorMain" or if used the ant
example it is the following exception "Exception in thread "main"
org/exolab/castor/xml/schema/ContentModelGroup at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:216)".
I used the command-line, a small self developed java program and the
ant example but every time I get this exception. I use the JRE
1.5.0_13, the new Castor 1.3 RC and Castor 1.2 generator.
What is the failure?
My aim is it to create an Eclipse project or an ant task which
generate the java classes of my xsd files.
Have you seen the relevant section in the (new) reference giude that
describes how to use the Ant task for the XML code generator ?
If somebody has a working
Post by Baba
ant task or a running eclipse project and like to provide me with
information about configuration. I think it could be help me to get a
running system.
Greeting
Thomas
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Baba
2008-10-17 09:06:54 UTC
Permalink
Hi,

next Day, next Try.......

The classpath includes following jar's:
ant.jar, castor-1.3rc1.jar, castor-1.3rc1-anttasks.jar,
castor-1.3rc1-codegen.jar,castor-1.3rc1-core.jar,
commons-collections-3.2.1.jar,
commons-lang-2.4.jar, commonslogging-1.1.1.jar, jakarta-oro-2.0.8.jar,
jakarta-regexp-1.5.jar, velocity-1.5.jar, velocity-dep-1.5.jar

This are the jars which i have found at the dependency category.

Now, castor throw this error: java.lang.NoClassDefFoundError:
org/exolab/castor/xml/schema/ContentModelGroup
Is this a move backward or forward? Because this is the same error at
the beginning of my experience with castor xml codeGen.

Greeting
Thomas


On Thu, Oct 16, 2008 at 10:16 PM, Werner Guttmann
Post by Werner Guttmann
Does your classpath include the JAR for castor-core ?
Werner
Post by Baba
Hi Werner and Castor User group,
I have some progress at the task "Generate Java Classes with castor"
Could not create type castor-srcgen due to
org.castor.core.util.ConfigurationException: Failed to load
configuration: castor.core.properties
<project name="CastorGenerator" default="castor:gen:src">
<path id="castor.class.path">
<fileset dir="${basedir}/lib">
<include name="*.jar" />
</fileset>
</path>
<target name="init">
</target>
<target name="castor:gen:src" depends="init" description="Generate
Java source files from XSD.">
<taskdef name="castor-srcgen"
classname="org.castor.anttask.CastorCodeGenTask"
classpathref="castor.class.path" />
<mkdir dir="generated" />
<castor-srcgen file="resources/xsd/kos-skript.xsd"
todir="generated-source"
package="org.castor.example.schema"
types="j2"
warnings="true" />
</target>
</project>
Where is the failure? What I have to configure at the "init" task?
Greeting
Thomas
Post by Baba
Hi Werner,
thank you for your fast answer. Yes, I see the section about how to
use the Ant task for the xml code. But, what i missed is the part
which describes the base "init" of every ant target. If you can
provide me this information I try it again.
Greeting
Thomas
Post by Werner Guttmann
Actually,
Post by Baba
Dear Castor User group,
I like to use the Castor XML Code Generator to generate java classes
of my xsd files. But every time I try to generate this classes I get
the exception "Exception in thread "main"
org/exolab/castor/builder/SourceGeneratorMain" or if used the ant
example it is the following exception "Exception in thread "main"
org/exolab/castor/xml/schema/ContentModelGroup at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:216)".
I used the command-line, a small self developed java program and the
ant example but every time I get this exception. I use the JRE
1.5.0_13, the new Castor 1.3 RC and Castor 1.2 generator.
What is the failure?
My aim is it to create an Eclipse project or an ant task which
generate the java classes of my xsd files.
Have you seen the relevant section in the (new) reference giude that
describes how to use the Ant task for the XML code generator ?
If somebody has a working
Post by Baba
ant task or a running eclipse project and like to provide me with
information about configuration. I think it could be help me to get a
running system.
Greeting
Thomas
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Joachim Grüneis
2008-10-17 09:47:57 UTC
Permalink
Hello,

the schema API is missing: castor-xml-schema-1.3rc1.jar
please add it

Regards
Joachim
Post by Baba
Hi,
next Day, next Try.......
ant.jar, castor-1.3rc1.jar, castor-1.3rc1-anttasks.jar,
castor-1.3rc1-codegen.jar,castor-1.3rc1-core.jar,
commons-collections-3.2.1.jar,
commons-lang-2.4.jar, commonslogging-1.1.1.jar, jakarta-oro-2.0.8.jar,
jakarta-regexp-1.5.jar, velocity-1.5.jar, velocity-dep-1.5.jar
This are the jars which i have found at the dependency category.
org/exolab/castor/xml/schema/ContentModelGroup
Is this a move backward or forward? Because this is the same error at
the beginning of my experience with castor xml codeGen.
Greeting
Thomas
On Thu, Oct 16, 2008 at 10:16 PM, Werner Guttmann
Post by Werner Guttmann
Does your classpath include the JAR for castor-core ?
Werner
Post by Baba
Hi Werner and Castor User group,
I have some progress at the task "Generate Java Classes with castor"
Could not create type castor-srcgen due to
org.castor.core.util.ConfigurationException: Failed to load
configuration: castor.core.properties
<project name="CastorGenerator" default="castor:gen:src">
<path id="castor.class.path">
<fileset dir="${basedir}/lib">
<include name="*.jar" />
</fileset>
</path>
<target name="init">
</target>
<target name="castor:gen:src" depends="init" description="Generate
Java source files from XSD.">
<taskdef name="castor-srcgen"
classname="org.castor.anttask.CastorCodeGenTask"
classpathref="castor.class.path" />
<mkdir dir="generated" />
<castor-srcgen file="resources/xsd/kos-skript.xsd"
todir="generated-source"
package="org.castor.example.schema"
types="j2"
warnings="true" />
</target>
</project>
Where is the failure? What I have to configure at the "init" task?
Greeting
Thomas
Post by Baba
Hi Werner,
thank you for your fast answer. Yes, I see the section about how to
use the Ant task for the xml code. But, what i missed is the part
which describes the base "init" of every ant target. If you can
provide me this information I try it again.
Greeting
Thomas
Post by Werner Guttmann
Actually,
Post by Baba
Dear Castor User group,
I like to use the Castor XML Code Generator to generate java classes
of my xsd files. But every time I try to generate this classes I get
the exception "Exception in thread "main"
org/exolab/castor/builder/SourceGeneratorMain" or if used the ant
example it is the following exception "Exception in thread "main"
org/exolab/castor/xml/schema/ContentModelGroup at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:216)".
I used the command-line, a small self developed java program and the
ant example but every time I get this exception. I use the JRE
1.5.0_13, the new Castor 1.3 RC and Castor 1.2 generator.
What is the failure?
My aim is it to create an Eclipse project or an ant task which
generate the java classes of my xsd files.
Have you seen the relevant section in the (new) reference giude that
describes how to use the Ant task for the XML code generator ?
If somebody has a working
Post by Baba
ant task or a running eclipse project and like to provide me with
information about configuration. I think it could be help me to get a
running system.
Greeting
Thomas
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Werner Guttmann
2008-10-17 10:28:07 UTC
Permalink
Hi Thomas,

it looks like we have to update the dependency pages as well. I think
the page misses a few items which have been created in the past few months.

As such, can you please create a new Jira issue asking us to update this
page to mirror status quo ?

Thanks
Werner

PS To address your issue, here'S the list of JARs you need
castor-1.3rc1-core.jar
castor-1.3rc1-xml.jar
castor-1.3rc1-schema.jar
castor-1.3rc1-codegen.jar
castor-1.3rc1-anttasks.jar

Having said that, have you ever considered to use Maven instead of Ant,
as Maven will cover dependency resolution for you and download the
required artifacts itself.
Post by Baba
Hi,
next Day, next Try.......
ant.jar, castor-1.3rc1.jar, castor-1.3rc1-anttasks.jar,
castor-1.3rc1-codegen.jar,castor-1.3rc1-core.jar,
commons-collections-3.2.1.jar,
commons-lang-2.4.jar, commonslogging-1.1.1.jar, jakarta-oro-2.0.8.jar,
jakarta-regexp-1.5.jar, velocity-1.5.jar, velocity-dep-1.5.jar
This are the jars which i have found at the dependency category.
org/exolab/castor/xml/schema/ContentModelGroup
Is this a move backward or forward? Because this is the same error at
the beginning of my experience with castor xml codeGen.
Greeting
Thomas
On Thu, Oct 16, 2008 at 10:16 PM, Werner Guttmann
Post by Werner Guttmann
Does your classpath include the JAR for castor-core ?
Werner
Post by Baba
Hi Werner and Castor User group,
I have some progress at the task "Generate Java Classes with castor"
Could not create type castor-srcgen due to
org.castor.core.util.ConfigurationException: Failed to load
configuration: castor.core.properties
<project name="CastorGenerator" default="castor:gen:src">
<path id="castor.class.path">
<fileset dir="${basedir}/lib">
<include name="*.jar" />
</fileset>
</path>
<target name="init">
</target>
<target name="castor:gen:src" depends="init" description="Generate
Java source files from XSD.">
<taskdef name="castor-srcgen"
classname="org.castor.anttask.CastorCodeGenTask"
classpathref="castor.class.path" />
<mkdir dir="generated" />
<castor-srcgen file="resources/xsd/kos-skript.xsd"
todir="generated-source"
package="org.castor.example.schema"
types="j2"
warnings="true" />
</target>
</project>
Where is the failure? What I have to configure at the "init" task?
Greeting
Thomas
Post by Baba
Hi Werner,
thank you for your fast answer. Yes, I see the section about how to
use the Ant task for the xml code. But, what i missed is the part
which describes the base "init" of every ant target. If you can
provide me this information I try it again.
Greeting
Thomas
Post by Werner Guttmann
Actually,
Post by Baba
Dear Castor User group,
I like to use the Castor XML Code Generator to generate java classes
of my xsd files. But every time I try to generate this classes I get
the exception "Exception in thread "main"
org/exolab/castor/builder/SourceGeneratorMain" or if used the ant
example it is the following exception "Exception in thread "main"
org/exolab/castor/xml/schema/ContentModelGroup at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:216)".
I used the command-line, a small self developed java program and the
ant example but every time I get this exception. I use the JRE
1.5.0_13, the new Castor 1.3 RC and Castor 1.2 generator.
What is the failure?
My aim is it to create an Eclipse project or an ant task which
generate the java classes of my xsd files.
Have you seen the relevant section in the (new) reference giude that
describes how to use the Ant task for the XML code generator ?
If somebody has a working
Post by Baba
ant task or a running eclipse project and like to provide me with
information about configuration. I think it could be help me to get a
running system.
Greeting
Thomas
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Baba
2008-10-17 11:54:18 UTC
Permalink
Hi,

Thank you. Now it works.

I have created the following Jira Issue
(http://jira.codehaus.org/browse/CASTOR-2557). It is correct?

Oh, this is a nice feature of Maven, but we have to use Ant instead of
Maven in our projects.

Greeting
Thomas


On Fri, Oct 17, 2008 at 12:28 PM, Werner Guttmann
Post by Werner Guttmann
Hi Thomas,
it looks like we have to update the dependency pages as well. I think
the page misses a few items which have been created in the past few months.
As such, can you please create a new Jira issue asking us to update this
page to mirror status quo ?
Thanks
Werner
PS To address your issue, here'S the list of JARs you need
castor-1.3rc1-core.jar
castor-1.3rc1-xml.jar
castor-1.3rc1-schema.jar
castor-1.3rc1-codegen.jar
castor-1.3rc1-anttasks.jar
Having said that, have you ever considered to use Maven instead of Ant,
as Maven will cover dependency resolution for you and download the
required artifacts itself.
Post by Baba
Hi,
next Day, next Try.......
ant.jar, castor-1.3rc1.jar, castor-1.3rc1-anttasks.jar,
castor-1.3rc1-codegen.jar,castor-1.3rc1-core.jar,
commons-collections-3.2.1.jar,
commons-lang-2.4.jar, commonslogging-1.1.1.jar, jakarta-oro-2.0.8.jar,
jakarta-regexp-1.5.jar, velocity-1.5.jar, velocity-dep-1.5.jar
This are the jars which i have found at the dependency category.
org/exolab/castor/xml/schema/ContentModelGroup
Is this a move backward or forward? Because this is the same error at
the beginning of my experience with castor xml codeGen.
Greeting
Thomas
On Thu, Oct 16, 2008 at 10:16 PM, Werner Guttmann
Post by Werner Guttmann
Does your classpath include the JAR for castor-core ?
Werner
Post by Baba
Hi Werner and Castor User group,
I have some progress at the task "Generate Java Classes with castor"
Could not create type castor-srcgen due to
org.castor.core.util.ConfigurationException: Failed to load
configuration: castor.core.properties
<project name="CastorGenerator" default="castor:gen:src">
<path id="castor.class.path">
<fileset dir="${basedir}/lib">
<include name="*.jar" />
</fileset>
</path>
<target name="init">
</target>
<target name="castor:gen:src" depends="init" description="Generate
Java source files from XSD.">
<taskdef name="castor-srcgen"
classname="org.castor.anttask.CastorCodeGenTask"
classpathref="castor.class.path" />
<mkdir dir="generated" />
<castor-srcgen file="resources/xsd/kos-skript.xsd"
todir="generated-source"
package="org.castor.example.schema"
types="j2"
warnings="true" />
</target>
</project>
Where is the failure? What I have to configure at the "init" task?
Greeting
Thomas
Post by Baba
Hi Werner,
thank you for your fast answer. Yes, I see the section about how to
use the Ant task for the xml code. But, what i missed is the part
which describes the base "init" of every ant target. If you can
provide me this information I try it again.
Greeting
Thomas
Post by Werner Guttmann
Actually,
Post by Baba
Dear Castor User group,
I like to use the Castor XML Code Generator to generate java classes
of my xsd files. But every time I try to generate this classes I get
the exception "Exception in thread "main"
org/exolab/castor/builder/SourceGeneratorMain" or if used the ant
example it is the following exception "Exception in thread "main"
org/exolab/castor/xml/schema/ContentModelGroup at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:216)".
I used the command-line, a small self developed java program and the
ant example but every time I get this exception. I use the JRE
1.5.0_13, the new Castor 1.3 RC and Castor 1.2 generator.
What is the failure?
My aim is it to create an Eclipse project or an ant task which
generate the java classes of my xsd files.
Have you seen the relevant section in the (new) reference giude that
describes how to use the Ant task for the XML code generator ?
If somebody has a working
Post by Baba
ant task or a running eclipse project and like to provide me with
information about configuration. I think it could be help me to get a
running system.
Greeting
Thomas
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Werner Guttmann
2008-10-29 09:04:33 UTC
Permalink
Post by Baba
Hi,
Thank you. Now it works.
I have created the following Jira Issue
(http://jira.codehaus.org/browse/CASTOR-2557). It is correct?
Oh, this is a nice feature of Maven, but we have to use Ant instead of
Maven in our projects.
Well, how about using the Ant tasks for Maven that allow you to have
dependencies resolved automatically, but use Ant for everything else ?
Post by Baba
Greeting
Thomas
On Fri, Oct 17, 2008 at 12:28 PM, Werner Guttmann
Post by Werner Guttmann
Hi Thomas,
it looks like we have to update the dependency pages as well. I think
the page misses a few items which have been created in the past few months.
As such, can you please create a new Jira issue asking us to update this
page to mirror status quo ?
Thanks
Werner
PS To address your issue, here'S the list of JARs you need
castor-1.3rc1-core.jar
castor-1.3rc1-xml.jar
castor-1.3rc1-schema.jar
castor-1.3rc1-codegen.jar
castor-1.3rc1-anttasks.jar
Having said that, have you ever considered to use Maven instead of Ant,
as Maven will cover dependency resolution for you and download the
required artifacts itself.
Post by Baba
Hi,
next Day, next Try.......
ant.jar, castor-1.3rc1.jar, castor-1.3rc1-anttasks.jar,
castor-1.3rc1-codegen.jar,castor-1.3rc1-core.jar,
commons-collections-3.2.1.jar,
commons-lang-2.4.jar, commonslogging-1.1.1.jar, jakarta-oro-2.0.8.jar,
jakarta-regexp-1.5.jar, velocity-1.5.jar, velocity-dep-1.5.jar
This are the jars which i have found at the dependency category.
org/exolab/castor/xml/schema/ContentModelGroup
Is this a move backward or forward? Because this is the same error at
the beginning of my experience with castor xml codeGen.
Greeting
Thomas
On Thu, Oct 16, 2008 at 10:16 PM, Werner Guttmann
Post by Werner Guttmann
Does your classpath include the JAR for castor-core ?
Werner
Post by Baba
Hi Werner and Castor User group,
I have some progress at the task "Generate Java Classes with castor"
Could not create type castor-srcgen due to
org.castor.core.util.ConfigurationException: Failed to load
configuration: castor.core.properties
<project name="CastorGenerator" default="castor:gen:src">
<path id="castor.class.path">
<fileset dir="${basedir}/lib">
<include name="*.jar" />
</fileset>
</path>
<target name="init">
</target>
<target name="castor:gen:src" depends="init" description="Generate
Java source files from XSD.">
<taskdef name="castor-srcgen"
classname="org.castor.anttask.CastorCodeGenTask"
classpathref="castor.class.path" />
<mkdir dir="generated" />
<castor-srcgen file="resources/xsd/kos-skript.xsd"
todir="generated-source"
package="org.castor.example.schema"
types="j2"
warnings="true" />
</target>
</project>
Where is the failure? What I have to configure at the "init" task?
Greeting
Thomas
Post by Baba
Hi Werner,
thank you for your fast answer. Yes, I see the section about how to
use the Ant task for the xml code. But, what i missed is the part
which describes the base "init" of every ant target. If you can
provide me this information I try it again.
Greeting
Thomas
Post by Werner Guttmann
Actually,
Post by Baba
Dear Castor User group,
I like to use the Castor XML Code Generator to generate java classes
of my xsd files. But every time I try to generate this classes I get
the exception "Exception in thread "main"
org/exolab/castor/builder/SourceGeneratorMain" or if used the ant
example it is the following exception "Exception in thread "main"
org/exolab/castor/xml/schema/ContentModelGroup at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMain.java:216)".
I used the command-line, a small self developed java program and the
ant example but every time I get this exception. I use the JRE
1.5.0_13, the new Castor 1.3 RC and Castor 1.2 generator.
What is the failure?
My aim is it to create an Eclipse project or an ant task which
generate the java classes of my xsd files.
Have you seen the relevant section in the (new) reference giude that
describes how to use the Ant task for the XML code generator ?
If somebody has a working
Post by Baba
ant task or a running eclipse project and like to provide me with
information about configuration. I think it could be help me to get a
running system.
Greeting
Thomas
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...