users@jaxb.java.net

InstantiationException when unmarshalling fpml instance document

From: Hunter Stern <vonrosen2000_at_yahoo.com>
Date: Mon, 29 May 2006 22:07:41 -0700 (PDT)

It appears this problem was caused by a
misconfiguration in the tool I used (Visual Slick Edit
10). Running in Eclipse everything is fine, thanks
for your support.

Hunter

Hunter Stern wrote:
> Hi,
>
> Using the new code you provided I get the following
> from toString() which shows the the
> com.riskman.fpml.DataDocument class, but I still get
> the same error.
>
> ..
> javax.xml.bind.UnmarshalException: unrecognized type
> name: DataDocument

Hmm, I'm at loss. If you can create a test case for me
to look into,
that would be great.

> My instance doc is actually fpml 4.1 so it doesn't
> start with that, it starts with:
>
> <FpML version="4-1" xsi:type="DataDocument"
>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://www.fpml.org/2004/FpML-4-1">
>
> When I tried to compile the fpml 4.0 schema I get:
>
> compiling a schema...
> [ERROR] A class/interface with the same name
> "com.riskman.fpml.Equity" is alread
> y in use. Use a class customization to resolve this
> conflict.
> line 164 of
>
file:/C:/downloads/critical/riskmansite/fpml4.0/fpml-asset-4-0.xsd
>
> Is there a binding file I need to use?

Our test uses this:

<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
               
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                version="1.0">
   <jaxb:bindings schemaLocation="./fpml-eqd-4-0.xsd"
node="/xsd:schema/xsd:complexType[@name='Equity']">
     <jaxb:class name="EquityType" />
   </jaxb:bindings>
</jaxb:bindings>


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com