Hi Markus,

can you please check if there is an existing issue about that in jira and if not create a new one. It would be great if you could attach a test case to reproduce the problem you found and a patch with your suggested fix to this issue.

Thanks for your help
Ralf


Markus Schlegel schrieb:
Hi
I wrote a Mapping for a custom XPDL file (has some vendor specific
additions in it).
Marshalling works ok, but when I tried tu unmarshal a marshaled file,
I got a "SaxException" stating that a Classdescriptor could not be
Found.
When I debugged the thing, I found out, that the namespaceMapping does
not work, if there are Elements with the same name used in different
Namespaces.
Take the Example:
<activity>
  ....
  <ns1:activity>
    ...
  </ns1:activity>
</activity>

On line 2549 of UnmarshalHandler.getInstanceType(..) the call to
"_cdResolver.resolveByXMLName(..)" returns the classDescriptor of
<activity>, even for <ns1:activity>, because the cache in
"XMLClassDescriptorResolverImpl" has exactly one entry when called and
therefore does not check if the Namespace matches.

I have now added a namespace-check to   UnmarshalHandler.getInstanceType(..).
Instead of :
(Line 2540)
                classDesc = _cdResolver.resolveByXMLName(type,
typeNamespaceURI, _loader);

                if (classDesc != null)
                    return classDesc.getJavaClass().getName();

I now have:
                classDesc = _cdResolver.resolveByXMLName(type,
typeNamespaceURI, _loader);

                if (classDesc != null) { //TODO must check for correct
namespace before...
                  if ((typeNamespaceURI == null) ||
(typeNamespaceURI.length() == 0) || classDesc.getNameSpaceURI() ==
null ||
                      (namespaceEquals(typeNamespaceURI,
classDesc.getNameSpaceURI()))) {
                    return classDesc.getJavaClass().getName();
                  }
                  classDesc=null;
                }


Cheers
Markus Schlegel

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

    http://xircles.codehaus.org/manage_email

--

Syscon Ingenieurbüro für Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
72127 Kusterdingen
Germany

Tel.   +49 7071 3690 52
Mobil: +49 173 9630135
Fax    +49 7071 3690 98

Internet: www.syscon.eu
E-Mail: [EMAIL PROTECTED]

Sitz der Gesellschaft: D-72127 Kusterdingen
Registereintrag: Amtsgericht Stuttgart, HRB 382295
Geschäftsleitung: Jens Joachim, Ralf Joachim

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

   http://xircles.codehaus.org/manage_email

Reply via email to