You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Nitin (JIRA)" <xm...@xml.apache.org> on 2009/08/14 21:22:14 UTC

[jira] Commented: (XMLBEANS-346) Getting ClassCastException if the same root element exist in different XSD

    [ https://issues.apache.org/jira/browse/XMLBEANS-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743373#action_12743373 ] 

Nitin commented on XMLBEANS-346:
--------------------------------

Hi, I am also hitting the same issue in the Latest Version of the XML Beans.
Please let me know if this isue is Resolved.

Is there any other option to make this work without changing the Namespace.

We cannot afford to change the Namespace as Server XML ae not getting parsed coreectly by changing the Namespace.

Best Regards,
Nitin

> Getting ClassCastException if the same root element exist in different XSD
> --------------------------------------------------------------------------
>
>                 Key: XMLBEANS-346
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-346
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: XmlObject
>    Affects Versions: Version 2.2
>         Environment: Windows xp operating system , jdk 1.4, WebLogic Server. 
>            Reporter: rajasekhar juluri
>
> HI All!
>    
>    I created the below XSD with two different packages.
>    1)   Package structure as follows      
>             -> test.xmlbeans.one 
>             -> test.xmlbeans.two
>      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
> 	<xs:element name="cXML">
> 		<xs:complexType>
> 			<xs:sequence>
> 				<xs:element ref="HEADER"/>
> 			
> 			</xs:sequence>
> 			
> 		</xs:complexType>
> 	</xs:element>
> 	
> 	<xs:element name="HEADER">
> 	       <xs:complexType>
> 	                <xs:sequence>	
> 		        	<xs:element ref="From"/>
> 				<xs:element ref="To"/>
> 				<xs:element ref="Sender"/>
> 			</xs:sequence>
> 		</xs:complexType>
> 	</xs:element>
>      </xs:schema> 
>   
>    2)   jar file generated successfully. While executing the below program i found ClassCastException.  
>        
>     java.lang.ClassCastException: test.xmlbeans.one.CXMLDocumentImpl
>                at test.xmlbeans.two.CXMLDocument$Factory.parse(CXMLDocument.java)              
>  
>        
>        This is the sample program 
>             
>            class TextXMlBeans{
>                 public static void main(String arg[]) trhows Exception{
>                 test.xmlbeans.two.CXMLDocument cxml = test.xmlbeans.two.CXMLDocument.Factory.parse(new File(fileName), opt);
>              
>                }
>              }
>  
> Thanks,
> Rajasekhar

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org