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
>
> ------------------------------------------------------------------------
> “This email and any files transmitted with it contain confidential, 
> proprietary, privileged information of Symphony Services Corp (India) 
> Pvt. Ltd. and are intended solely for the use of the recipient/s to 
> whom it is addressed. Any unauthorized notifying, copying or 
> distributing of this e-mail, directly or indirectly, and the contents 
> therein in full or part is prohibited by any entity who is not a 
> recipient. Any email received inadvertently or by mistake should be 
> deleted by the entity who is not a recipient thereof. You may be 
> pleased to notify the sender immediately by email and the email should 
> be deleted from your system”.
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ------------------------------------------------------------------------
>
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>   

-------------------------------------------------------------------------
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