Why is my xml JAXB namespace set to ns1 by default?

I created a war file from my web application using NetBeans 7.2 (on Windows 7!), Which works correctly during the testing phase with the GlassFish 3.1.2 server in the NetBeans context.

The specific namespace in the file is package-info.javacorrectly added to my XML file.

However, when I deploy the war file on a separately running GlassFish server on a Linux machine, is the default namespace set to ns1 and NOT, which is defined in the package-info.java file?

What am I doing wrong?

Regards, Gerard

+5
source share
1 answer

Why is my xml JAXB namespace set to ns1 by default?

ns1 - , . . , . foo foo, bar bar.

<a:foo xmlns:a="FOO" xmlns:b="BAR>
    <b:bar>Hello World</b:bar>
</a:foo>
<ns1:foo xmlns:ns1="FOO" xmlns:ns2="BAR>
    <ns2:bar>Hello World</ns2:bar>
</ns1:foo>
<foo xmlns="FOO" xmlns:b="BAR>
    <b:bar>Hello World</b:bar>
</foo>

?

. A JAXB (JSR-222) , @XmlSchema. EclipseLink JAXB (MOXy) JAXB RI. / JAXB NetBeans 7.2 , / JAXB, GlassFish 3.1.2, .

, , NamespacePrefixMapper, .

+5

All Articles