JIBX: Classes generated from maven codegen plugin : No unmarshaller for element

前端 未结 2 720
名媛妹妹
名媛妹妹 2021-01-28 00:09

I use Jibx CodeGen maven Plugin to generate java sources and binding from xsd files. I want to maintain several versions of the xsd in the same applications so I plan to generat

相关标签:
2条回答
  • 2021-01-28 00:14

    Marc,

    Take a look at the example in the JiBX schema library for the

    Opentravel schema Library

    It is very similar to your problem Many schemas with the same namespace need to be bound to different java packages.

    Also, I would suggest that you use a newer version of JiBX, such as 1.2.6

    Cheers!

    Don

    0 讨论(0)
  • 2021-01-28 00:38

    I finally found the answer. I was missing namepace declaration in the xml I wanted to consume. It works with a correctly shaped one as the following one :

        <?xml version="1.0" encoding="UTF-8" ?>
            <foo:foo xmlns:foo="http://www.example.jibx.org/generated/v30/foo"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.example.jibx.org/generated/v30/foo foo-3.0.xsd">
                <generic>
                    <type>12345</type>
                    <isValid>1</isValid>
                </generic>
                <specific>
                    <label>Label example</label>
                    <dateFoo>01/01/2015</dateFoo>
                </specific>
            </foo:foo>
    
    0 讨论(0)
提交回复
热议问题