You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Mikael Lindkvist <li...@gmail.com> on 2007/10/31 14:21:27 UTC

Problem with multiple Jars with schema classes

Hi,

Im  using datatypes defined in HL7 (Health Level 7) schemas. These schemas
contains a large number of datatypes that I have compiled (with "scomp" into
a jar e.g "hl7.jar".

Im  also using datatypes from other schemas that have been compiled into
other jars (with "scomp")  e.g "appX.jar". Many of these datatypes are
extensions of the hl7 datatypes so when I compile appX.jar I add  hl7.jar to
my classpath so that they are not included int appX.jar.

When I run my application (which has both hl7.jar and appX.jar in the
classpath) I get the error:
----------------------------------------------------------------------------------------------------
Exception in thread "main" java.lang.NullPointerException
    at org.apache.xmlbeans.impl.schema.SchemaPropertyImpl.getType(
SchemaPropertyImpl.java:92)
    at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createAttributeType(
SchemaTypeImpl.java:1042)
    at org.apache.xmlbeans.impl.values.XmlObjectBase.create_attribute_user(
XmlObjectBase.java:915)
    at org.apache.xmlbeans.impl.store.Xobj.getUser(Xobj.java:1657)
    at org.apache.xmlbeans.impl.store.Xobj.add_attribute_user(Xobj.java
:2254)
    at se.sll.gvd.common.hl7.datatypes.impl.IIImpl.setAssigningAuthorityName(Unknown
Source)
-------------------------------------------------------------------------------------------------

This only occurs when I am using datatypes defined in appX.jar that are
extensions of datatypes in hl7.jar.
If I compile all the schemas into one single jar-file everything works fine.


Is this a bug in XMLBeans ??? Can I only split schemas between jars when
there are no dependencies between the schemas ??

Im using XMLBeans ver 2.3.0

regards,

Mikael Lindkvist

RE: ignore multi definitions

Posted by Psoroulas John <ps...@telecom.ntua.gr>.
The refactor seems the best way Radu

Thanks for your help,

John

On Thu, November 1, 2007 17:29, Radu Preotiuc-Pietro wrote:
> John,
>
>
> Ideally, you would refactor the Schemas so there are no duplicates. But
> if you don't do this, you can use -allowmdef, just note the URI of those
> common Schema types. Your example did not have any "common" Schema types,
> which is why -allowmdef had no effect.
>
> Radu
>
>
>
> ________________________________
>
>
> From: Jacob Danner [mailto:jacob.danner@gmail.com]
> Sent: Thursday, November 01, 2007 7:21 AM
> To: user@xmlbeans.apache.org
> Subject: Re: ignore multi definitions
>
>
>
> You should look into the sfactor utility available in the bin
> directory. That utility will take common types and create a new xsd from
> them -jacobd
>
>
>
> On 11/1/07, Psoroulas John <ps...@telecom.ntua.gr> wrote:
>
>
> The real xsds that I want to process have common some
> common schema types,
>
> maybe a solution is to isolate these common types, and put them in a
> seperate xsd schema.
>
> Thanks Radu for help
>
>
> John
>
>
> On Wed, October 31, 2007 20:39, Radu Preotiuc-Pietro
> wrote:
> > Don't forget that "multiple definitions" means
> definitions for the same > name AND the same targetNamespace URI. In your
> case, since the > targetNamespace URIs are different ("urn:iso:foo1" and
> "urn:iso:foo2"),
> > then the types have different names so the "multiple definitions"
clause >
> doesn't apply. Why don't you just compile one of the Schemas if that's
> > what you want? >
> > Radu
> >
> >
> >> -----Original Message-----
> >> From: Psoroulas John
> [mailto:psoroulas@telecom.ntua.gr]
> >> Sent: Wednesday, October 31, 2007 9:37 AM
> >> To: user@xmlbeans.apache.org
> >> Subject: ignore multi definitions
> >>
> >>
> >> Hi,
> >>
> >>
> >> I have the following two very simple xsds
> >>
> >>
> >>
> >>
> >> ----------
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <xs:schema xmlns:xs="
> http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema> "
> >> xmlns="urn:iso:foo1"
> >>
> >>
> >> targetNamespace="urn:iso:foo1"
> elementFormDefault="qualified"> >> <xs:element name="Document"
> type="mytype1"/> >>
> >>
> >> <xs:complexType name="mytype2">
> >> <xs:sequence>
> >> <xs:element name="Id" type="xs:string"/>
> >> </xs:sequence>
> >> </xs:complexType>
> >>
> >>
> >> <xs:complexType name="mytype1">
> >> <xs:sequence>
> >> <xs:element name="Header" type="mytype2"/>
> >> </xs:sequence>
> >> </xs:complexType>
> >>
> >>
> >> </xs:schema>
> >> --------------
> >>
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <xs:schema
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> >> xmlns="urn:iso:foo2"
> >>
> >>
> >> targetNamespace="urn:iso:foo2"
> elementFormDefault="qualified"> >> <xs:element name="Document"
> type="mytype1"/> >>
> >>
> >> <xs:complexType name="mytype2">
> >> <xs:sequence>
> >> <xs:element name="Id" type="xs:string"/>
> >> </xs:sequence>
> >> </xs:complexType>
> >>
> >>
> >> <xs:complexType name="mytype1">
> >> <xs:sequence>
> >> <xs:element name="Header" type="mytype2"/>
> >> </xs:sequence>
> >> </xs:complexType>
> >>
> >>
> >> </xs:schema>
> >>
> >>
> >> --------------
> >>
> >>
> >>
> >>
> >> In the xsds above, the same types are defined
> (mytype1, mytype2).
> >>
> >>
> >> I want the xmlbeans compiler to ingnore
> multi-definitions in >>
> >>
> >> the above schmemas so as only one Mytype1 and Mytype2 classes to be >>
> generated >>
> >> (not Mytype1, Mytype12, Mytype2, Mytype22).
> >>
> >>
> >> I use the following command
> >>
> >>
> >> scomp -out foo.jar  -compiler C:\j2sdk1.4.2_13\bin\javac.exe -allowmdef
> >> "urn:iso:foo1 urn:iso:foo2" -mx 1024M *.xsd
> config.xsdconfig >>
> >>
> >>
> >> but has no effect >>
> >>
> >> I really appreciate any help
> >>
> >>
> >>
> >> Best regards
> >>
> >>
> >> John
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> the used config.xsdconfig file is >>
> >> <xb:config
> xmlns:xb="http://www.bea.com/2002/09/xbean/config">
> >> <xb:namespace uri="urn:iso:foo1">
> >> <xb:package>com.foo.types</xb:package>
> >> </xb:namespace>
> >> <xb:namespace uri="urn:iso:foo2">
> >> <xb:package>com.foo.types</xb:package>
> >> </xb:namespace>
> >> </xb:config>
> >>
> >>
> >>
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> user-unsubscribe@xmlbeans.apache.org >> For additional commands, e-mail:
> user-help@xmlbeans.apache.org >>
> >>
> >>
> >
> > Notice:  This email message, together with any
> attachments, may contain > information  of  BEA Systems,  Inc.,  its
> subsidiaries and  affiliated > entities,  that may be confidential,
> proprietary, copyrighted  and/or > legally privileged, and is intended
> solely for the use of the individual > or entity named in this message. If
> you are not the intended recipient, > and have received this message in
> error, please immediately return this > by email and then delete it. >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@xmlbeans.apache.org > For additional commands, e-mail:
> user-help@xmlbeans.apache.org >
> >
> >
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@xmlbeans.apache.org For additional commands, e-mail:
> user-help@xmlbeans.apache.org
>
>
>
>
>
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it.



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


RE: ignore multi definitions

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
John,
 
Ideally, you would refactor the Schemas so there are no duplicates. But
if you don't do this, you can use -allowmdef, just note the URI of those
common Schema types. Your example did not have any "common" Schema
types, which is why -allowmdef had no effect.
 
Radu


________________________________

	From: Jacob Danner [mailto:jacob.danner@gmail.com] 
	Sent: Thursday, November 01, 2007 7:21 AM
	To: user@xmlbeans.apache.org
	Subject: Re: ignore multi definitions
	
	
	You should look into the sfactor utility available in the bin
directory. That utility will take common types and create a new xsd from
them
	-jacobd
	
	
	On 11/1/07, Psoroulas John <ps...@telecom.ntua.gr> wrote: 

		The real xsds that I want to process have common some
common schema types,
		
		maybe a solution is to isolate these common types, and
put them in a
		seperate xsd schema.
		
		Thanks Radu for help
		
		John
		
		On Wed, October 31, 2007 20:39, Radu Preotiuc-Pietro
wrote:
		> Don't forget that "multiple definitions" means
definitions for the same
		> name AND the same targetNamespace URI. In your case,
since the 
		> targetNamespace URIs are different ("urn:iso:foo1" and
"urn:iso:foo2"),
		> then the types have different names so the "multiple
definitions" clause
		> doesn't apply. Why don't you just compile one of the
Schemas if that's 
		> what you want?
		>
		> Radu
		>
		>
		>> -----Original Message-----
		>> From: Psoroulas John
[mailto:psoroulas@telecom.ntua.gr]
		>> Sent: Wednesday, October 31, 2007 9:37 AM 
		>> To: user@xmlbeans.apache.org
		>> Subject: ignore multi definitions
		>>
		>>
		>> Hi,
		>>
		>>
		>> I have the following two very simple xsds 
		>>
		>>
		>>
		>>
		>> ----------
		>> <?xml version="1.0" encoding="UTF-8"?>
		>> <xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema> "
		>> xmlns="urn:iso:foo1"
		>>
		>>
		>> targetNamespace="urn:iso:foo1"
elementFormDefault="qualified">
		>> <xs:element name="Document" type="mytype1"/> 
		>>
		>>
		>> <xs:complexType name="mytype2">
		>> <xs:sequence>
		>> <xs:element name="Id" type="xs:string"/>
		>> </xs:sequence> 
		>> </xs:complexType>
		>>
		>>
		>> <xs:complexType name="mytype1">
		>> <xs:sequence>
		>> <xs:element name="Header" type="mytype2"/> 
		>> </xs:sequence>
		>> </xs:complexType>
		>>
		>>
		>> </xs:schema>
		>> --------------
		>>
		>>
		>> <?xml version="1.0" encoding="UTF-8"?> 
		>> <xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
		>> xmlns="urn:iso:foo2"
		>>
		>>
		>> targetNamespace="urn:iso:foo2"
elementFormDefault="qualified"> 
		>> <xs:element name="Document" type="mytype1"/>
		>>
		>>
		>> <xs:complexType name="mytype2">
		>> <xs:sequence>
		>> <xs:element name="Id" type="xs:string"/> 
		>> </xs:sequence>
		>> </xs:complexType>
		>>
		>>
		>> <xs:complexType name="mytype1">
		>> <xs:sequence>
		>> <xs:element name="Header" type="mytype2"/> 
		>> </xs:sequence>
		>> </xs:complexType>
		>>
		>>
		>> </xs:schema>
		>>
		>>
		>> --------------
		>>
		>>
		>>
		>> 
		>> In the xsds above, the same types are defined
(mytype1, mytype2).
		>>
		>>
		>> I want the xmlbeans compiler to ingnore
multi-definitions in
		>>
		>>
		>> the above schmemas so as only one Mytype1 and Mytype2
classes to be 
		>> generated
		>>
		>> (not Mytype1, Mytype12, Mytype2, Mytype22).
		>>
		>>
		>> I use the following command
		>>
		>>
		>> scomp -out foo.jar  -compiler
C:\j2sdk1.4.2_13\bin\javac.exe -allowmdef 
		>> "urn:iso:foo1 urn:iso:foo2" -mx 1024M *.xsd
config.xsdconfig
		>>
		>>
		>>
		>> but has no effect
		>>
		>>
		>> I really appreciate any help
		>> 
		>>
		>>
		>> Best regards
		>>
		>>
		>> John
		>>
		>>
		>>
		>>
		>>
		>>
		>>
		>>
		>> the used config.xsdconfig file is
		>>
		>> <xb:config
xmlns:xb="http://www.bea.com/2002/09/xbean/config">
		>> <xb:namespace uri="urn:iso:foo1"> 
		>> <xb:package>com.foo.types</xb:package>
		>> </xb:namespace>
		>> <xb:namespace uri="urn:iso:foo2">
		>> <xb:package>com.foo.types</xb:package> 
		>> </xb:namespace>
		>> </xb:config>
		>>
		>>
		>>
		>>
		>>
---------------------------------------------------------------------
		>> To unsubscribe, e-mail:
user-unsubscribe@xmlbeans.apache.org
		>> For additional commands, e-mail:
user-help@xmlbeans.apache.org
		>>
		>>
		>>
		>
		> Notice:  This email message, together with any
attachments, may contain
		> information  of  BEA Systems,  Inc.,  its subsidiaries
and  affiliated
		> entities,  that may be confidential,  proprietary,
copyrighted  and/or 
		> legally privileged, and is intended solely for the use
of the individual
		> or entity named in this message. If you are not the
intended recipient,
		> and have received this message in error, please
immediately return this 
		> by email and then delete it.
		>
		>
---------------------------------------------------------------------
		> To unsubscribe, e-mail:
user-unsubscribe@xmlbeans.apache.org 
		> For additional commands, e-mail:
user-help@xmlbeans.apache.org
		>
		>
		>
		
		
		
	
--------------------------------------------------------------------- 
		To unsubscribe, e-mail:
user-unsubscribe@xmlbeans.apache.org
		For additional commands, e-mail:
user-help@xmlbeans.apache.org 
		
		



Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

Re: ignore multi definitions

Posted by Jacob Danner <ja...@gmail.com>.
You should look into the sfactor utility available in the bin directory.
That utility will take common types and create a new xsd from them
-jacobd

On 11/1/07, Psoroulas John <ps...@telecom.ntua.gr> wrote:
>
> The real xsds that I want to process have common some common schema types,
>
> maybe a solution is to isolate these common types, and put them in a
> seperate xsd schema.
>
> Thanks Radu for help
>
> John
>
> On Wed, October 31, 2007 20:39, Radu Preotiuc-Pietro wrote:
> > Don't forget that "multiple definitions" means definitions for the same
> > name AND the same targetNamespace URI. In your case, since the
> > targetNamespace URIs are different ("urn:iso:foo1" and "urn:iso:foo2"),
> > then the types have different names so the "multiple definitions" clause
> > doesn't apply. Why don't you just compile one of the Schemas if that's
> > what you want?
> >
> > Radu
> >
> >
> >> -----Original Message-----
> >> From: Psoroulas John [mailto:psoroulas@telecom.ntua.gr]
> >> Sent: Wednesday, October 31, 2007 9:37 AM
> >> To: user@xmlbeans.apache.org
> >> Subject: ignore multi definitions
> >>
> >>
> >> Hi,
> >>
> >>
> >> I have the following two very simple xsds
> >>
> >>
> >>
> >>
> >> ----------
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> >> xmlns="urn:iso:foo1"
> >>
> >>
> >> targetNamespace="urn:iso:foo1" elementFormDefault="qualified">
> >> <xs:element name="Document" type="mytype1"/>
> >>
> >>
> >> <xs:complexType name="mytype2">
> >> <xs:sequence>
> >> <xs:element name="Id" type="xs:string"/>
> >> </xs:sequence>
> >> </xs:complexType>
> >>
> >>
> >> <xs:complexType name="mytype1">
> >> <xs:sequence>
> >> <xs:element name="Header" type="mytype2"/>
> >> </xs:sequence>
> >> </xs:complexType>
> >>
> >>
> >> </xs:schema>
> >> --------------
> >>
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> >> xmlns="urn:iso:foo2"
> >>
> >>
> >> targetNamespace="urn:iso:foo2" elementFormDefault="qualified">
> >> <xs:element name="Document" type="mytype1"/>
> >>
> >>
> >> <xs:complexType name="mytype2">
> >> <xs:sequence>
> >> <xs:element name="Id" type="xs:string"/>
> >> </xs:sequence>
> >> </xs:complexType>
> >>
> >>
> >> <xs:complexType name="mytype1">
> >> <xs:sequence>
> >> <xs:element name="Header" type="mytype2"/>
> >> </xs:sequence>
> >> </xs:complexType>
> >>
> >>
> >> </xs:schema>
> >>
> >>
> >> --------------
> >>
> >>
> >>
> >>
> >> In the xsds above, the same types are defined (mytype1, mytype2).
> >>
> >>
> >> I want the xmlbeans compiler to ingnore multi-definitions in
> >>
> >>
> >> the above schmemas so as only one Mytype1 and Mytype2 classes to be
> >> generated
> >>
> >> (not Mytype1, Mytype12, Mytype2, Mytype22).
> >>
> >>
> >> I use the following command
> >>
> >>
> >> scomp -out foo.jar  -compiler C:\j2sdk1.4.2_13\bin\javac.exe -allowmdef
> >> "urn:iso:foo1 urn:iso:foo2" -mx 1024M *.xsd config.xsdconfig
> >>
> >>
> >>
> >> but has no effect
> >>
> >>
> >> I really appreciate any help
> >>
> >>
> >>
> >> Best regards
> >>
> >>
> >> John
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> the used config.xsdconfig file is
> >>
> >> <xb:config  xmlns:xb="http://www.bea.com/2002/09/xbean/config">
> >> <xb:namespace uri="urn:iso:foo1">
> >> <xb:package>com.foo.types</xb:package>
> >> </xb:namespace>
> >> <xb:namespace uri="urn:iso:foo2">
> >> <xb:package>com.foo.types</xb:package>
> >> </xb:namespace>
> >> </xb:config>
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> >> For additional commands, e-mail: user-help@xmlbeans.apache.org
> >>
> >>
> >>
> >
> > Notice:  This email message, together with any attachments, may contain
> > information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> > entities,  that may be confidential,  proprietary,  copyrighted  and/or
> > legally privileged, and is intended solely for the use of the individual
> > or entity named in this message. If you are not the intended recipient,
> > and have received this message in error, please immediately return this
> > by email and then delete it.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> > For additional commands, e-mail: user-help@xmlbeans.apache.org
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>

RE: ignore multi definitions

Posted by Psoroulas John <ps...@telecom.ntua.gr>.
The real xsds that I want to process have common some common schema types,

maybe a solution is to isolate these common types, and put them in a
seperate xsd schema.

Thanks Radu for help

John

On Wed, October 31, 2007 20:39, Radu Preotiuc-Pietro wrote:
> Don't forget that "multiple definitions" means definitions for the same
> name AND the same targetNamespace URI. In your case, since the
> targetNamespace URIs are different ("urn:iso:foo1" and "urn:iso:foo2"),
> then the types have different names so the "multiple definitions" clause
> doesn't apply. Why don't you just compile one of the Schemas if that's
> what you want?
>
> Radu
>
>
>> -----Original Message-----
>> From: Psoroulas John [mailto:psoroulas@telecom.ntua.gr]
>> Sent: Wednesday, October 31, 2007 9:37 AM
>> To: user@xmlbeans.apache.org
>> Subject: ignore multi definitions
>>
>>
>> Hi,
>>
>>
>> I have the following two very simple xsds
>>
>>
>>
>>
>> ----------
>> <?xml version="1.0" encoding="UTF-8"?>
>> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns="urn:iso:foo1"
>>
>>
>> targetNamespace="urn:iso:foo1" elementFormDefault="qualified">
>> <xs:element name="Document" type="mytype1"/>
>>
>>
>> <xs:complexType name="mytype2">
>> <xs:sequence>
>> <xs:element name="Id" type="xs:string"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>>
>> <xs:complexType name="mytype1">
>> <xs:sequence>
>> <xs:element name="Header" type="mytype2"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>>
>> </xs:schema>
>> --------------
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns="urn:iso:foo2"
>>
>>
>> targetNamespace="urn:iso:foo2" elementFormDefault="qualified">
>> <xs:element name="Document" type="mytype1"/>
>>
>>
>> <xs:complexType name="mytype2">
>> <xs:sequence>
>> <xs:element name="Id" type="xs:string"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>>
>> <xs:complexType name="mytype1">
>> <xs:sequence>
>> <xs:element name="Header" type="mytype2"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>>
>> </xs:schema>
>>
>>
>> --------------
>>
>>
>>
>>
>> In the xsds above, the same types are defined (mytype1, mytype2).
>>
>>
>> I want the xmlbeans compiler to ingnore multi-definitions in
>>
>>
>> the above schmemas so as only one Mytype1 and Mytype2 classes to be
>> generated
>>
>> (not Mytype1, Mytype12, Mytype2, Mytype22).
>>
>>
>> I use the following command
>>
>>
>> scomp -out foo.jar  -compiler C:\j2sdk1.4.2_13\bin\javac.exe -allowmdef
>> "urn:iso:foo1 urn:iso:foo2" -mx 1024M *.xsd config.xsdconfig
>>
>>
>>
>> but has no effect
>>
>>
>> I really appreciate any help
>>
>>
>>
>> Best regards
>>
>>
>> John
>>
>>
>>
>>
>>
>>
>>
>>
>> the used config.xsdconfig file is
>>
>> <xb:config  xmlns:xb="http://www.bea.com/2002/09/xbean/config">
>> <xb:namespace uri="urn:iso:foo1">
>> <xb:package>com.foo.types</xb:package>
>> </xb:namespace>
>> <xb:namespace uri="urn:iso:foo2">
>> <xb:package>com.foo.types</xb:package>
>> </xb:namespace>
>> </xb:config>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
>>
>>
>
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>
>



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


RE: ignore multi definitions

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
Don't forget that "multiple definitions" means definitions for the same
name AND the same targetNamespace URI. In your case, since the
targetNamespace URIs are different ("urn:iso:foo1" and "urn:iso:foo2"),
then the types have different names so the "multiple definitions" clause
doesn't apply. Why don't you just compile one of the Schemas if that's
what you want?

Radu

> -----Original Message-----
> From: Psoroulas John [mailto:psoroulas@telecom.ntua.gr] 
> Sent: Wednesday, October 31, 2007 9:37 AM
> To: user@xmlbeans.apache.org
> Subject: ignore multi definitions
> 
> Hi,
> 
> I have the following two very simple xsds
> 
> 
> 
> ----------
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> xmlns="urn:iso:foo1"
> 						
> targetNamespace="urn:iso:foo1" elementFormDefault="qualified">
> 	<xs:element name="Document" type="mytype1"/>
> 
> 	<xs:complexType name="mytype2">
> 		<xs:sequence>
> 			<xs:element name="Id" type="xs:string"/>
> 		</xs:sequence>
> 	</xs:complexType>
> 
> 	<xs:complexType name="mytype1">
> 		<xs:sequence>
> 			<xs:element name="Header" type="mytype2"/>
> 		</xs:sequence>
> 	</xs:complexType>
> 
> </xs:schema>
> --------------
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> xmlns="urn:iso:foo2"
> 						
> targetNamespace="urn:iso:foo2" elementFormDefault="qualified">
> 	<xs:element name="Document" type="mytype1"/>
> 
> 	<xs:complexType name="mytype2">
> 		<xs:sequence>
> 			<xs:element name="Id" type="xs:string"/>
> 		</xs:sequence>
> 	</xs:complexType>
> 
> 	<xs:complexType name="mytype1">
> 		<xs:sequence>
> 			<xs:element name="Header" type="mytype2"/>
> 		</xs:sequence>
> 	</xs:complexType>
> 
> </xs:schema>
> 
> --------------
> 
> 
> 
> In the xsds above, the same types are defined (mytype1, mytype2).
> 
> I want the xmlbeans compiler to ingnore multi-definitions in
> 
> the above schmemas so as only one Mytype1 and Mytype2 classes 
> to be generated
> 
> (not Mytype1, Mytype12, Mytype2, Mytype22).
> 
> I use the following command
> 
> scomp -out foo.jar  -compiler C:\j2sdk1.4.2_13\bin\javac.exe  
> -allowmdef
> "urn:iso:foo1 urn:iso:foo2" -mx 1024M *.xsd config.xsdconfig
> 
> 
> but has no effect
> 
> 
> I really appreciate any help
> 
> 
> Best regards
> 
> John
> 
> 
> 
> 
> 
> 
> 
> the used config.xsdconfig file is
> 
> <xb:config  xmlns:xb="http://www.bea.com/2002/09/xbean/config">
>         		<xb:namespace uri="urn:iso:foo1">
>             		<xb:package>com.foo.types</xb:package>
>         		</xb:namespace>
>         		<xb:namespace uri="urn:iso:foo2">
>             		<xb:package>com.foo.types</xb:package>
>         		</xb:namespace>
> </xb:config>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 

Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.

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


ignore multi definitions

Posted by Psoroulas John <ps...@telecom.ntua.gr>.
Hi,

I have the following two very simple xsds



----------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:iso:foo1"
						targetNamespace="urn:iso:foo1" elementFormDefault="qualified">
	<xs:element name="Document" type="mytype1"/>

	<xs:complexType name="mytype2">
		<xs:sequence>
			<xs:element name="Id" type="xs:string"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="mytype1">
		<xs:sequence>
			<xs:element name="Header" type="mytype2"/>
		</xs:sequence>
	</xs:complexType>

</xs:schema>
--------------

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:iso:foo2"
						targetNamespace="urn:iso:foo2" elementFormDefault="qualified">
	<xs:element name="Document" type="mytype1"/>

	<xs:complexType name="mytype2">
		<xs:sequence>
			<xs:element name="Id" type="xs:string"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="mytype1">
		<xs:sequence>
			<xs:element name="Header" type="mytype2"/>
		</xs:sequence>
	</xs:complexType>

</xs:schema>

--------------



In the xsds above, the same types are defined (mytype1, mytype2).

I want the xmlbeans compiler to ingnore multi-definitions in

the above schmemas so as only one Mytype1 and Mytype2 classes to be generated

(not Mytype1, Mytype12, Mytype2, Mytype22).

I use the following command

scomp -out foo.jar  -compiler C:\j2sdk1.4.2_13\bin\javac.exe  -allowmdef
"urn:iso:foo1 urn:iso:foo2" -mx 1024M *.xsd config.xsdconfig


but has no effect


I really appreciate any help


Best regards

John







the used config.xsdconfig file is

<xb:config  xmlns:xb="http://www.bea.com/2002/09/xbean/config">
        		<xb:namespace uri="urn:iso:foo1">
            		<xb:package>com.foo.types</xb:package>
        		</xb:namespace>
        		<xb:namespace uri="urn:iso:foo2">
            		<xb:package>com.foo.types</xb:package>
        		</xb:namespace>
</xb:config>



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


RE: Problem with multiple Jars with schema classes

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
This very much looks like a bug in XMLBeans. If you have a consistent
repro (which you seem to have) it would be great to open a JIRA issue
(http://issues.apache.org/jira/secure/BrowseProject.jspa?id=10436) and
put the repro there, so we can track this. If you do not have a JIRA
account, you can post the Schemas (or ideally a subset of the Schemas
enough to reproduce the problem) to the list, and we will transfer them
to JIRA.
 
In the meantime, I would say that compiling both Schemas at the same
time is the workaround. Also, splitting Schemas in two jars when there
are dependencies between Schemas does work, but apparently only in 99.9%
of the cases.
 
Thanks,
Radu


________________________________

	From: Mikael Lindkvist [mailto:lindkvist.mikael@gmail.com] 
	Sent: Wednesday, October 31, 2007 6:21 AM
	To: user@xmlbeans.apache.org
	Subject: Problem with multiple Jars with schema classes
	
	
	Hi,
	
	Im  using datatypes defined in HL7 (Health Level 7) schemas.
These schemas contains a large number of datatypes that I have compiled
(with "scomp" into a jar e.g "hl7.jar". 
	
	Im  also using datatypes from other schemas that have been
compiled into other jars (with "scomp")  e.g "appX.jar". Many of these
datatypes are extensions of the hl7 datatypes so when I compile appX.jar
I add  hl7.jar to my classpath so that they are not included int
appX.jar.
	
	When I run my application (which has both hl7.jar and appX.jar
in the classpath) I get the error:
	
------------------------------------------------------------------------
----------------------------
	Exception in thread "main" java.lang.NullPointerException 
	    at
org.apache.xmlbeans.impl.schema.SchemaPropertyImpl.getType(SchemaPropert
yImpl.java:92)
	    at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createAttributeType(Schem
aTypeImpl.java:1042)
	    at
org.apache.xmlbeans.impl.values.XmlObjectBase.create_attribute_user
(XmlObjectBase.java:915)
	    at
org.apache.xmlbeans.impl.store.Xobj.getUser(Xobj.java:1657)
	    at
org.apache.xmlbeans.impl.store.Xobj.add_attribute_user(Xobj.java:2254)
	    at
se.sll.gvd.common.hl7.datatypes.impl.IIImpl.setAssigningAuthorityName
(Unknown Source)
	
------------------------------------------------------------------------
-------------------------
	
	This only occurs when I am using datatypes defined in appX.jar
that are extensions of datatypes in hl7.jar.
	If I compile all the schemas into one single jar-file everything
works fine. 
	
	Is this a bug in XMLBeans ??? Can I only split schemas between
jars when there are no dependencies between the schemas ??
	
	Im using XMLBeans ver 2.3.0
	
	regards,
	
	Mikael Lindkvist
	


Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.