HI,
I was using the same build file I was using for castor 0.9.x. so I
retained the java task.
I tried changing it to ant task and got hit by same issue
L:\GC_Project\MessageObjectModel_WC>ant
Buildfile: build.xml
generate_njm_mom:
[echo] generating MOM...
[echo] L:\GC_Project\MessageObjectModel_WC/src
[castor-srcgen] Processing
L:\GC_Project\MessageObjectModel_WC\src\messageobjectmodel.xsd
BUILD FAILED
java.lang.NoSuchMethodError:
org.exolab.castor.mapping.xml.ClassMapping.setAccess(Lorg/exolab/castor/
mapping/xml/types/A
ccessType;)V
Total time: 24 seconds
L:\GC_Project\MessageObjectModel_WC>
Modified build file looks like this
<target name="generate_mom" >
<echo message="generating MOM..."/>
<delete dir="${code.build}"/>
<delete
dir="${code.src}/com/gwservices/cc/integration/mom/types"/>
<delete>
<fileset
dir="${code.src}/com/gwservices/cc/integration/mom" includes="*.java"/>
</delete>
<property name="workspace.target.dir"
value="${code.src}"/>
<property name="PATHELEMENT" refid="path.base"/>
<echo message="${code.src}"/>
<taskdef name="castor-srcgen"
classname="org.castor.anttask.CastorCodeGenTask"
classpathref="path.base" />
<castor-srcgen file="${code.src}/messageobjectmodel.xsd"
todir="${code.src}"
package="com.gwservices.cc.integration.mom"
types="j2"
warnings="true" />
</target>
<path id="path.base">
<fileset dir="${basedir}/lib">
<include name="castor-1.2.jar"/>
<include name="castor-1.2-codegen.jar"/>
<include name="commons-logging-1.0.4.jar"/>
<include name="castor-1.2-xml-schema.jar"/>
<include name="velocity-1.5.jar"/>
<include name="castor-1.2-anttasks.jar"/>
..
..
Thanks Ravi
-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 27, 2008 3:13 AM
To: [EMAIL PROTECTED]
Cc: dev@castor.codehaus.org
Subject: [castor-dev] Re: [castor-user] Re: [castor-dev] Error while
generating java source from XSD
Hi,
I have got a few more questions. As you are using Ant, why are you *not*
using the Ant task definition as documented at
http://castor.org/srcgen-anttask.html
I know that this does not help you to resolve your problem, but it might
reduce an unwanted dependency.
In addition, I can see that you are invoking the SourceGenerator class
directly, where you should be using the SourceGeneratorMain class (as
documented at http://castor.org/srcgen-cline.html).
Having said that, if that does not help, can you please create a new
Jira issue at
http://jira.codehaus.org/browse/CASTOR
and attach the Ant build file and everything else required to generate
the classes (excluding the JARs) ?
Thanks
Werner
Dayalan, Ravikumar wrote:
HI,
Sorry for the delayed response.
I use ant build. Here is my build path info.
<path id="path.base">
<fileset dir="${basedir}/lib">
<include name="castor-1.2.jar"/>
<include name="castor-1.2-codegen.jar"/>
<include name="commons-logging-1.0.4.jar"/>
<include name="castor-1.2-xml-schema.jar"/>
<include name="velocity-1.5.jar"/>
</fileset>
<fileset dir="${cc.toolkit.home}/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${env.commonlibs}">
<include name="*.jar"/>
</fileset>
<fileset dir="${env.commonlibs}/exclude">
<include name="*.jar" />
</fileset>
<pathelement path="${java.class.path}"/>
</path>
I tried using this jar also castor-1.2-xml.jar instead of
castor-1.2.jar but getting hit with same problem.
For additional information iam putting the invocation also. (See this
I took from the working version of Castor0.9
<property name="PATHELEMENT" refid="path.base"/>
<echo message="${code.src}"/>
<java
className="org.exolab.castor.builder.SourceGenerator" fork="true"
failonerror="true">
<arg value="verbose=true"/>
<arg value="-i"/>
<arg
value="${code.src}/mymessageobjectmodel.xsd"/>
<arg value="-dest"/>
<arg value="${code.src}"/>
<arg
value="-packagecom.gwservices.cc.integration.mom"/>
<!--
<arg value="-nodesc"/>
-->
<arg value="-nomarshall"/>
<classpath refid="path.base"/>
</java>
Thanks
Ravi
-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED]
Sent: Monday, February 25, 2008 12:26 AM
To: dev@castor.codehaus.org
Cc: [EMAIL PROTECTED]
Subject: [castor-user] Re: [castor-dev] Error while generating java
source from XSD
HI,
what Castor JARs do you have on your classpath ?
Regards
Werner
Dayalan, Ravikumar wrote:
Hi ,
I want to add one more point here..
The same code was working when i was using castor 0.9.x version. its
not
working in castor 1.2
any specifica reason ?
thanks
Ravi.
-----Original Message-----
*From:* Dayalan, Ravikumar [mailto:[EMAIL PROTECTED]
*Sent:* Friday, February 22, 2008 3:20 PM
*To:* dev@castor.codehaus.org; [EMAIL PROTECTED]
*Subject:* [castor-dev] Error while generating java source from
XSD
Hi,
Iam using castor 1.2 version , I am referring to the latest jars
as
given in the site.
But I am getting the following error?
Any help will be much appreciated.
[echo] generating NJM MOM...
[echo] L:\GC_Project\MessageObjectModel_WC/src
[java] -- Disabling generation of Marshaling framework
methods
(marshal, unmarshal, validate).
[java] java.lang.NoSuchMethodError:
org.exolab.castor.mapping.xml.ClassMapping.setAccess(Lorg/exolab/cast
o
r/mapping
/xml/types/AccessType;)V
[java] at
org.exolab.castor.mapping.xml.ClassMappingDescriptor$7.setValue(Class
M
appingDescriptor.java:276)
[java] at
org.exolab.castor.xml.handlers.EnumFieldHandler.setValue(EnumFieldHan
d
ler.java:235)
[java] at
org.exolab.castor.xml.UnmarshalHandler.setAttributeValueOnObject(Unma
r
shalHandler.java:3127)
[java] at
org.exolab.castor.xml.UnmarshalHandler.processAttribute(UnmarshalHand
l
er.java:3074)
[java] at
org.exolab.castor.xml.UnmarshalHandler.processAttributes(UnmarshalHan
d
ler.java:2862)
[java] at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.
j
ava:2388)
[java] at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.
j
ava:1418)
[java] at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
[java] at
org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown
Source)
[java] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement
(U
nknown
Source)
[java] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentD
is
patcher.dispatch(Unknown
Sour
ce)
[java] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unk
no
wn
Source)
[java] at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
[java] at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
[java] at
org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)
[java] at
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
[java] at
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
[java] at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:715)
[java] at
org.castor.mapping.MappingUnmarshaller.loadMappingInternal(MappingUnm
a
rshaller.java:245)
[java] at
org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmars
h
aller.java:153)
[java] at
org.castor.mapping.MappingUnmarshaller.getMappingLoader(MappingUnmars
h
aller.java:128)
[java] at
org.exolab.castor.xml.Unmarshaller.setMapping(Unmarshaller.java:541)
[java] at
org.exolab.castor.xml.schema.SimpleTypesFactory.loadTypesDefinitions(
S
impleTypesFactory.java:427)
[java] at
org.exolab.castor.xml.schema.SimpleTypesFactory.getType(SimpleTypesFa
c
tory.java:393)
[java] at
org.exolab.castor.xml.schema.SimpleTypesFactory.getBuiltInType(Simple
T
ypesFactory.java:205)
[java] at
org.exolab.castor.xml.schema.Schema.getSimpleType(Schema.java:1284)
[java] at
org.exolab.castor.xml.schema.Schema.getType(Schema.java:2120)
[java] at
org.exolab.castor.xml.schema.reader.ExtensionUnmarshaller.<init>(Exte
n
sionUnmarshaller.java:126)
[java] at
org.exolab.castor.xml.schema.reader.SimpleContentUnmarshaller.startEl
e
ment(SimpleContentUnmarshaller.
java:167)
[java] at
org.exolab.castor.xml.schema.reader.ComplexTypeUnmarshaller.startElem
e
nt(ComplexTypeUnmarshaller.java
:283)
[java] at
org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.startElement(S
c
hemaUnmarshaller.java:484)
[java] at
org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startElement(
S
ax2ComponentReader.java:255)
[java] at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
[java] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement
(U
nknown
Source)
[java] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentD
is
patcher.dispatch(Unknown
Sour
ce)
[java] at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unk
no
wn
Source)
[java] at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
[java] at
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
[java] at
org.apache.xerces.parsers.XMLParser.parse(Unknown
Source)
[java] at
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
[java] at
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
[java] at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenera
t
or.java:613)
[java] at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenera
t
or.java:548)
[java] at
org.exolab.castor.builder.SourceGeneratorMain.main(SourceGeneratorMai
n
.java:309)
[java] Exception in thread "main"
BUILD FAILED
Thanks
Ravi.
=========================================================
The information in this transmission is intended for official use
only and may contain information from NJM Insurance Group that is
privileged, confidential and exempt from disclosure under
applicable
law. It is intended for the exclusive use of the persons or
entities
to which it is addressed. If you are not an intended recipient or
the employee or agent responsible for delivering this
transmission
to an intended recipient, be aware that any disclosure,
dissemination, distribution or copying of this communication, or
the
use of its contents, is strictly prohibited. If you received this
transmission in error, please notify the sender by return e-mail
and
delete the material from any computer.
=========================================================
=========================================================
The information in this transmission is intended for official use
only and may contain information from NJM Insurance Group that is
privileged,
confidential and exempt from disclosure under applicable law. It is
intended for the exclusive use of the persons or entities to which it
is
addressed. If you are not an intended recipient or the employee or
agent
responsible for delivering this transmission to an intended
recipient,
be aware that any disclosure, dissemination, distribution or copying
of
this communication, or the use of its contents, is strictly
prohibited.
If you received this transmission in error, please notify the sender
by
return e-mail and delete the material from any computer.
=========================================================
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
=========================================================
The information in this transmission is intended for official use only
and may contain information from NJM Insurance Group that is
privileged, confidential and exempt from disclosure under applicable
law. It is intended for the exclusive use of the persons or entities
to which it is addressed. If you are not an intended recipient or the
employee or agent responsible for delivering this transmission to an
intended recipient, be aware that any disclosure, dissemination,
distribution or copying of this communication, or the use of its
contents, is strictly prohibited. If you received this transmission
in error, please notify the sender by return e-mail and delete the
material from any computer.
=========================================================
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
=========================================================
The information in this transmission is intended for official use only and may
contain information from NJM Insurance Group that is privileged, confidential
and exempt from disclosure under applicable law. It is intended for the
exclusive use of the persons or entities to which it is addressed. If you are
not an intended recipient or the employee or agent responsible for delivering
this transmission to an intended recipient, be aware that any disclosure,
dissemination, distribution or copying of this communication, or the use of its
contents, is strictly prohibited. If you received this transmission in error,
please notify the sender by return e-mail and delete the material from any
computer.
=========================================================
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email