Hi Dennis,

I am also new to JiBX and getting the same problem. I checked the solution
you have given Surjit below. But in my case, the namespaces seem to be the
same in the XML, yet I am getting the problem.

I have a WSDL and some XSDs. Using these, I am trying to generate the stubs
using the instrucitons given at this link:
http://ws.apache.org/axis2/1_3/userguide-creatingclients-jibx.html

Upto step 9, everything works. The binding.xml is getting created in step 4.
But at step 10, it is giving me following error:

Error: Default namespace conflict on mapping reference; on structure element
at
(line 35, col 145, in binding.xml)
Error: Default namespace conflict on mapping reference; on structure element
at
(line 43, col 155, in binding.xml)
Error running binding compiler
org.jibx.runtime.JiBXException: Binding binding.xml is unusable because of
valid
ation errors
        at org.jibx.binding.Utility.loadBinding(Utility.java:346)
        at org.jibx.binding.Utility.loadFileBinding(Utility.java:413)
        at org.jibx.binding.Compile.compile(Compile.java:296)
        at org.jibx.binding.Compile.main(Compile.java:385)

I have attached the XML.

Can you please help?

Thanks in advance,
CNN


Hi Surjit,

The reason for the error is that the abstract <mapping> you're 
referencing with the <structure> element is using a different default 
namespace than the <mapping> that contains the <structure>. The easiest 
way to avoid the problem is probably by adding a prefix for the 
http://bpma.hyperion.com/datatypes namespace (in the SessionInfo 
abstract mapping).

In theory JiBX could generate namespace declarations to handle this 
case, but it'd be very ugly. To do what you're telling it to do it would 
need to define the http://bpma.hyperion.com/datatypes namespace as the 
default (with xmlns='http://bpma.hyperion.com/datatypes') on every 
element within the SessionInfo mapping. My assumption was that users 
would not create this kind of structure deliberately, hence the error. 
It's unfortunate that the current Xsd2Jibx code is generating this usage 
now.

- Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Konjengbam Singh wrote:
>
> Hi,
>
> I m new to jibx. Please pardon me if I m asking something very simple.
>
> I got the below exception when I try to perform the binding.
>
> Exception is:
>
> Error: Default namespace conflict on mapping reference; on structure 
> element at (line 11, col 136, in binding.xml)
>
> Error: Default namespace conflict on mapping reference; on structure 
> element at (line 19, col 154, in binding.xml)
>
> Error running binding compiler
>
> org.jibx.runtime.JiBXException: Binding binding.xml is unusable 
> because of validation errors
>
> at org.jibx.binding.Utility.loadBinding(Utility.java:346)
>
> at org.jibx.binding.Utility.loadFileBinding(Utility.java:413)
>
> at org.jibx.binding.Compile.compile(Compile.java:296)
>
> at org.jibx.binding.Compile.main(Compile.java:385)
>
> The Binding.xml looks like this:
>
> N.B. This binding file was auto generated when I ran the xsd2jibx on 
> my xsd.
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <binding>
>
> <mapping name="CreateSession" class="com.hyperion.bpma.CreateSession">
>
> <namespace uri="http://bpma.hyperion.com/"; default="elements"/>
>
> <value name="userName" field="userName" usage="optional"/>
>
> <value name="password" field="password" usage="optional"/>
>
> <value name="connectionString" field="connectionString" usage="optional"/>
>
> </mapping>
>
> <mapping name="CreateSessionResponse" 
> class="com.hyperion.bpma.CreateSessionResponse">
>
> <namespace uri="http://bpma.hyperion.com/"; default="elements"/>
>
> <structure name="CreateSessionResult" field="createSessionResult" 
> usage="optional" type="com.hyperion.bpma.datatypes.SessionInfo"/>
>
> </mapping>
>
> <mapping name="CreateSessionFromToken" 
> class="com.hyperion.bpma.CreateSessionFromToken">
>
> <namespace uri="http://bpma.hyperion.com/"; default="elements"/>
>
> <value name="token" field="token" usage="optional"/>
>
> </mapping>
>
> <mapping name="CreateSessionFromTokenResponse" 
> class="com.hyperion.bpma.CreateSessionFromTokenResponse">
>
> <namespace uri="http://bpma.hyperion.com/"; default="elements"/>
>
> <structure name="CreateSessionFromTokenResult" 
> field="createSessionFromTokenResult" usage="optional" 
> type="com.hyperion.bpma.datatypes.SessionInfo"/>
>
> </mapping>
>
> <mapping name="CloseSession" class="com.hyperion.bpma.CloseSession">
>
> <namespace uri="http://bpma.hyperion.com/"; default="elements"/>
>
> <value name="sessionID" field="sessionID" usage="required"/>
>
> </mapping>
>
> <mapping name="CloseSessionResponse" 
> class="com.hyperion.bpma.CloseSessionResponse">
>
> <namespace uri="http://bpma.hyperion.com/"; default="elements"/>
>
> </mapping>
>
> <mapping name="GetRegistrationFile" 
> class="com.hyperion.bpma.GetRegistrationFile">
>
> <namespace uri="http://bpma.hyperion.com/"; default="elements"/>
>
> <value name="sessionId" field="sessionId" usage="required"/>
>
> <value name="product" field="product" usage="optional"/>
>
> <value name="productVersion" field="productVersion" usage="optional"/>
>
> <value name="fileName" field="fileName" usage="optional"/>
>
> </mapping>
>
> <mapping name="GetRegistrationFileResponse" 
> class="com.hyperion.bpma.GetRegistrationFileResponse">
>
> <namespace uri="http://bpma.hyperion.com/"; default="elements"/>
>
> <value name="GetRegistrationFileResult" 
> field="getRegistrationFileResult" usage="optional"/>
>
> </mapping>
>
> <mapping name="SessionInfo" 
> class="com.hyperion.bpma.datatypes.SessionInfo" abstract="true">
>
> <namespace uri="http://bpma.hyperion.com/datatypes"; default="elements"/>
>
> <value name="SessionID" field="sessionID" usage="required"/>
>
> <value name="UserName" field="userName" usage="optional"/>
>
> <value name="ErrorCode" field="errorCode" usage="required"/>
>
> <value name="ErrorDescription" field="errorDescription" usage="optional"/>
>
> <value name="ExpirationTimestamp" field="expirationTimestamp" 
> usage="required"/>
>
> </mapping>
>
> </binding>
>
> Thanking you in advance.
>
> Surjit
>
http://www.nabble.com/file/p12508304/binding.xml binding.xml 
-- 
View this message in context: 
http://www.nabble.com/Binding-binding.xml-is-unusable-because-of-validation-errors-tf3994546.html#a12508304
Sent from the jibx-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to