Werner-
I'll see what I can do about fetching the CVS version and testing it
out. But seeing as the error occurs at the instantiation of the (XML)
Unmarshaller rather than at loadMapping() your last comment may hit the
nail on the head.
Thanks,
Stephen
Werner Guttmann wrote:
Stephen,
afair, we haved fixed either exactly this issue or a similar in CVS already. Could you try and report back to us whether this has been resolved ?
Werner
PS It could be that this has been fixed at the <sql> level only, though ?
-----Ursprüngliche Nachricht-----
Von: Stephen Bash [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. August 2005 18:01
An: [email protected]
Betreff: [castor-dev] [XML] Regression Issue with Transient Fields
Everyone-
I know I'm a little slow finding to be finding what appears to be a
regression issue with 0.9.7 now, but I figure better late than never right?
Last week I went back to a project I hadn't touched in a while, and the
mapping file (used for XML marshalling and unmarshalling) had a few
fields labeled as transient. When I went to run the code, I received a
NPE when I attempted to create an Unmarshaller using new Unmarshaller(
mappingObj ) (see below for full trace).
I finally traced it down to the fact that I had not specified types for
the transient fields in the mapping file:
<field name="names" transient="true" />
versus:
<field name="names" transient="true" type="string"
collection="array" />
I honestly prefer the former (from my perspective, Castor shouldn't
waste clock cycles -- or programmer keystrokes -- on a field it doesn't
care about), but if this behavior was changed for a reason, I'd be
interested to hear it. (BTW, the latter form is not backward compatible
with 0.9.6 either, so it seems to be an all or nothing game)
I ran the same code with castor-0.9.7.jar and castor-0.9.6-xml.jar. In
0.9.6 the code runs fine, in 0.9.7 I get the exception. I'm running in
Eclipse 3.1 on JDK 1.4.2 on WinXP Pro.
Thanks everyone, and I'm happy to hear any comments anyone has.
Stephen
The exception:
java.lang.NullPointerException
at
org.exolab.castor.mapping.loader.CollectionHandlers.hasHandler(CollectionHandlers.java:128)
at
org.exolab.castor.xml.XMLMappingLoader.createFieldDesc(XMLMappingLoader.java:515)
at
org.exolab.castor.mapping.loader.MappingLoader.createFieldDescs(MappingLoader.java:639)
at
org.exolab.castor.mapping.loader.MappingLoader.createDescriptor(MappingLoader.java:462)
at
org.exolab.castor.xml.XMLMappingLoader.createDescriptor(XMLMappingLoader.java:227)
at
org.exolab.castor.mapping.loader.MappingLoader.loadMapping(MappingLoader.java:282)
at org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:292)
at org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:247)
at org.exolab.castor.xml.Unmarshaller.setMapping(Unmarshaller.java:475)
at org.exolab.castor.xml.Unmarshaller.<init>(Unmarshaller.java:246)
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------