You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by "KARR, DAVID (ATTSI)" <dk...@att.com> on 2010/05/20 03:30:31 UTC

Schema version problem upgrading to JPA 2.0

I think I noticed some talk about this before, but I can't find it in
the archives now.

I tried to upgrade to version 2.0.0 today.  The upgrade with no changes
worked fine.  Now I'm trying to modify it to use the small number of 2.0
features that I'm attempting to use.

When I changed the "schemaLocation" attribute to point to the 2.0 xsd
(I'm really surprised the namespace didn't change), then Eclipse
complained that I had to change the "version" attribute also, which I
did (to 2.0).  I then added several "order-column" elements where I was
previously using the OpenJPA OrderColumn annotation.  When I attempted
to build this, I got schema validation errors, claiming that there was
no "order-column" element (even though Eclipse validates this).  If I
temporarily changed the "version" attribute value back to "1.0", then I
could get through that part of the build, even though Eclipse is now
complaining.  I haven't attempted to run the app in this state.

What am I missing?

RE: Schema version problem upgrading to JPA 2.0

Posted by "KARR, DAVID (ATTSI)" <dk...@att.com>.
> -----Original Message-----
> From: C N Davies [mailto:cnd@cndavies.com]
> Sent: Wednesday, May 19, 2010 6:52 PM
> To: users@openjpa.apache.org
> Subject: RE: Schema version problem upgrading to JPA 2.0
> 
> I had some issues like this when I switched, it ended up being that I
> had
> class files that had been compiled under 1.2.x still in my deployment
> directory. I blew the directory away and rebuilt and off I went.
> 
> Chris

Thanks, but that's not it.  I'm doing a "clean" before every build.
Considering the error I get at build/enhancement time is a schema
validation error on the orm.xml file, I don't see how that could be
possibly be related to leftover class files.

> -----Original Message-----
> From: KARR, DAVID (ATTSI) [mailto:dk068x@att.com]
> Sent: Thursday, 20 May 2010 11:31 AM
> To: users@openjpa.apache.org
> Subject: Schema version problem upgrading to JPA 2.0
> 
> I think I noticed some talk about this before, but I can't find it in
> the archives now.
> 
> I tried to upgrade to version 2.0.0 today.  The upgrade with no
changes
> worked fine.  Now I'm trying to modify it to use the small number of
> 2.0
> features that I'm attempting to use.
> 
> When I changed the "schemaLocation" attribute to point to the 2.0 xsd
> (I'm really surprised the namespace didn't change), then Eclipse
> complained that I had to change the "version" attribute also, which I
> did (to 2.0).  I then added several "order-column" elements where I
was
> previously using the OpenJPA OrderColumn annotation.  When I attempted
> to build this, I got schema validation errors, claiming that there was
> no "order-column" element (even though Eclipse validates this).  If I
> temporarily changed the "version" attribute value back to "1.0", then
I
> could get through that part of the build, even though Eclipse is now
> complaining.  I haven't attempted to run the app in this state.
> 
> What am I missing?


RE: Schema version problem upgrading to JPA 2.0

Posted by C N Davies <cn...@cndavies.com>.
I had some issues like this when I switched, it ended up being that I had
class files that had been compiled under 1.2.x still in my deployment
directory. I blew the directory away and rebuilt and off I went.

Chris


-----Original Message-----
From: KARR, DAVID (ATTSI) [mailto:dk068x@att.com] 
Sent: Thursday, 20 May 2010 11:31 AM
To: users@openjpa.apache.org
Subject: Schema version problem upgrading to JPA 2.0

I think I noticed some talk about this before, but I can't find it in
the archives now.

I tried to upgrade to version 2.0.0 today.  The upgrade with no changes
worked fine.  Now I'm trying to modify it to use the small number of 2.0
features that I'm attempting to use.

When I changed the "schemaLocation" attribute to point to the 2.0 xsd
(I'm really surprised the namespace didn't change), then Eclipse
complained that I had to change the "version" attribute also, which I
did (to 2.0).  I then added several "order-column" elements where I was
previously using the OpenJPA OrderColumn annotation.  When I attempted
to build this, I got schema validation errors, claiming that there was
no "order-column" element (even though Eclipse validates this).  If I
temporarily changed the "version" attribute value back to "1.0", then I
could get through that part of the build, even though Eclipse is now
complaining.  I haven't attempted to run the app in this state.

What am I missing?


RE: Schema version problem upgrading to JPA 2.0

Posted by "KARR, DAVID (ATTSI)" <dk...@att.com>.
> -----Original Message-----
> From: KARR, DAVID (ATTSI)
> Sent: Wednesday, May 19, 2010 7:08 PM
> To: users@openjpa.apache.org
> Subject: RE: Schema version problem upgrading to JPA 2.0
> 
> > -----Original Message-----
> > From: KARR, DAVID (ATTSI)
> > Sent: Wednesday, May 19, 2010 6:31 PM
> > To: users@openjpa.apache.org
> > Subject: Schema version problem upgrading to JPA 2.0
> >
> > I think I noticed some talk about this before, but I can't find it
in
> > the archives now.
> >
> > I tried to upgrade to version 2.0.0 today.  The upgrade with no
> changes
> > worked fine.  Now I'm trying to modify it to use the small number of
> > 2.0
> > features that I'm attempting to use.
> >
> > When I changed the "schemaLocation" attribute to point to the 2.0
xsd
> > (I'm really surprised the namespace didn't change), then Eclipse
> > complained that I had to change the "version" attribute also, which
I
> > did (to 2.0).  I then added several "order-column" elements where I
> was
> > previously using the OpenJPA OrderColumn annotation.  When I
> attempted
> > to build this, I got schema validation errors, claiming that there
> was
> > no "order-column" element (even though Eclipse validates this).  If
I
> > temporarily changed the "version" attribute value back to "1.0",
then
> I
> > could get through that part of the build, even though Eclipse is now
> > complaining.  I haven't attempted to run the app in this state.
> >
> > What am I missing?
> 
> I noticed that in the openjpa jar file, there are two schema files,
> "orm-xsd.rsrc" and "orm_2_0-xsd.rsrc".  The first is the 1.x schema,
> and
> the second is clearly the 2.x schema.  I'm really wondering more about
> the fact that the namespace is the same between them.  That can't be
> right.  I wonder what would happen if I removed the 1.x schema from
the
> jar file?

I suppose this is why the "version" attribute is changing, but it's not
working.


Re: Schema version problem upgrading to JPA 2.0

Posted by Donald Woods <dw...@apache.org>.
geronimo-jpa_3.0_spec-1.x or geronimo-jpa_1.0_spec-1.x is the JPA 1.0
Spec API from Geronimo.  The first releases of the spec jar used 3.0,
due to JPA 1.0 being defined in the EJB 3.0 spec....

geronimo-jpa_2.0_spec-1.x is the JPA 2.0 Spec API, which is the level
required by OpenJPA 2.x.


-Donald


On 5/20/10 12:21 PM, KARR, DAVID (ATTSI) wrote:
>> -----Original Message-----
>> From: Michael Dick [mailto:michael.d.dick@gmail.com]
>> Sent: Thursday, May 20, 2010 3:39 AM
>> To: users@openjpa.apache.org
>> Subject: Re: Schema version problem upgrading to JPA 2.0
>>
>> Going back a couple of emails - the namespace is right - it's that way
>> in
>> the JPA spec.
>>
>> Are you just compiling your entities, or is one of the OpenJPA ant
>> tasks
>> causing the error? If it's just compiling I'd guess it's the
> meta-model
>> generator which is parsing orm.xml.
>>
>> The problem might not be in meta-model generation - but you might be
>> able to
>> work around it by specifying -proc:none as a compiler argument.
> 
> I appear to have some mess in my build script that is causing multiple
> versions of jars to be deployed in the WAR file.  I'm still trying to
> straighten that out.  I'm now having the following issue when I deploy
> to WebLogic 10.3.3:
> 
> ClassCastException:
> org.apache.openjpa.persistence.PersistenceProviderImpl cannot be cast to
> javax.persistence.spi.PersistenceProvider
> 
> I may have to retrace my steps all the way back to 1.2.2 to figure out
> what's wrong here.
> 
> What is the significance of the "geronimo-jpa_3.0_spec-1.0.jar" in the
> 1.2.2 distribution, as opposed to "geronimo-jpa_2.0_spec-1.0.jar" in the
> 2.0.0 distribution?
> 
>> On Wed, May 19, 2010 at 9:24 PM, KARR, DAVID (ATTSI) <dk...@att.com>
>> wrote:
>>
>>>> -----Original Message-----
>>>> From: KARR, DAVID (ATTSI)
>>>> Sent: Wednesday, May 19, 2010 7:08 PM
>>>> To: users@openjpa.apache.org
>>>> Subject: RE: Schema version problem upgrading to JPA 2.0
>>>>
>>>>> -----Original Message-----
>>>>> From: KARR, DAVID (ATTSI)
>>>>> Sent: Wednesday, May 19, 2010 6:31 PM
>>>>> To: users@openjpa.apache.org
>>>>> Subject: Schema version problem upgrading to JPA 2.0
>>>>>
>>>>> I think I noticed some talk about this before, but I can't find
>> it
>>> in
>>>>> the archives now.
>>>>>
>>>>> I tried to upgrade to version 2.0.0 today.  The upgrade with no
>>>> changes
>>>>> worked fine.  Now I'm trying to modify it to use the small
> number
>> of
>>>>> 2.0
>>>>> features that I'm attempting to use.
>>>>>
>>>>> When I changed the "schemaLocation" attribute to point to the
> 2.0
>>> xsd
>>>>> (I'm really surprised the namespace didn't change), then Eclipse
>>>>> complained that I had to change the "version" attribute also,
>> which
>>> I
>>>>> did (to 2.0).  I then added several "order-column" elements
> where
>> I
>>>> was
>>>>> previously using the OpenJPA OrderColumn annotation.  When I
>>>> attempted
>>>>> to build this, I got schema validation errors, claiming that
>> there
>>>> was
>>>>> no "order-column" element (even though Eclipse validates this).
>> If
>>> I
>>>>> temporarily changed the "version" attribute value back to "1.0",
>>> then
>>>> I
>>>>> could get through that part of the build, even though Eclipse is
>> now
>>>>> complaining.  I haven't attempted to run the app in this state.
>>>>>
>>>>> What am I missing?
>>>>
>>>> I noticed that in the openjpa jar file, there are two schema
> files,
>>>> "orm-xsd.rsrc" and "orm_2_0-xsd.rsrc".  The first is the 1.x
>> schema,
>>>> and
>>>> the second is clearly the 2.x schema.  I'm really wondering more
>> about
>>>> the fact that the namespace is the same between them.  That can't
>> be
>>>> right.  I wonder what would happen if I removed the 1.x schema
> from
>>> the
>>>> jar file?
>>>
>>> I tried renaming the 1.x schema file in the jar, adding ".save" to
>> the
>>> name to hide it.  That gets me past the build/enhancement.  I
>> deployed
>>> the app, then ran a request.  That failed with the following:
>>>
>>> Caused by: org.xml.sax.SAXException: zip:.../orm.xml [Location:
> Line:
>> 5,
>>> C: 19]: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value
>> '2.0'
>>> of attribute 'version' of element 'entity-mappings' is not valid
> with
>>> respect to the corresponding attribute use. Attribute 'version' has
> a
>>> fixed value of '1.0'.
>>>
> 

RE: Schema version problem upgrading to JPA 2.0

Posted by C N Davies <cn...@cndavies.com>.
You can set the classpath on a per server basis in weblogic, why not just do
that so you can specifically tell weblogic what class you want your app to
load with rather than let it use its default.

The other thing I have done to sort these types of isues out is to create a
basic app with a 2 functions  1) report it's classpath, 2) it takes a FQ
class name and reports where it found it in the class path. These two
functions helo you understand what is going on. But my first point I think
is the first thing to do.

Chris


-----Original Message-----
From: KARR, DAVID (ATTSI) [mailto:dk068x@att.com] 
Sent: Friday, 21 May 2010 2:43 AM
To: users@openjpa.apache.org
Subject: RE: Schema version problem upgrading to JPA 2.0

> -----Original Message-----
> From: KARR, DAVID (ATTSI)
> Sent: Thursday, May 20, 2010 9:21 AM
> To: users@openjpa.apache.org
> Subject: RE: Schema version problem upgrading to JPA 2.0
> 
> > -----Original Message-----
> > From: Michael Dick [mailto:michael.d.dick@gmail.com]
> > Sent: Thursday, May 20, 2010 3:39 AM
> > To: users@openjpa.apache.org
> > Subject: Re: Schema version problem upgrading to JPA 2.0
> >
> > Going back a couple of emails - the namespace is right - it's that
> way
> > in
> > the JPA spec.
> >
> > Are you just compiling your entities, or is one of the OpenJPA ant
> > tasks
> > causing the error? If it's just compiling I'd guess it's the
> meta-model
> > generator which is parsing orm.xml.
> >
> > The problem might not be in meta-model generation - but you might be
> > able to
> > work around it by specifying -proc:none as a compiler argument.
> 
> I appear to have some mess in my build script that is causing multiple
> versions of jars to be deployed in the WAR file.  I'm still trying to
> straighten that out.  I'm now having the following issue when I deploy
> to WebLogic 10.3.3:
> 
> ClassCastException:
> org.apache.openjpa.persistence.PersistenceProviderImpl cannot be cast
> to
> javax.persistence.spi.PersistenceProvider
> 
> I may have to retrace my steps all the way back to 1.2.2 to figure out
> what's wrong here.
> 
> What is the significance of the "geronimo-jpa_3.0_spec-1.0.jar" in the
> 1.2.2 distribution, as opposed to "geronimo-jpa_2.0_spec-1.0.jar" in
> the
> 2.0.0 distribution?

Depending on how I configure WEB-INF/lib, I also get:

NoSuchMethodError:
javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/pers
istence/ValidationMode;.

This method is in "geronimo-jpa_2.0_spec-1.0.jar" and
"openjpa-all-2.0.0.jar", but not in "geronimo-jpa_3.0_spec-1.0.jar".

I think it's possible the only reason I got this to work with OpenJPA
1.2.2 is because WebLogic incorporates the version used in the "3.0"
jar.  Now that I'm trying to use the new version that adds that method
to the SPI, a conflict is appearing.

> > On Wed, May 19, 2010 at 9:24 PM, KARR, DAVID (ATTSI)
<dk...@att.com>
> > wrote:
> >
> > > > -----Original Message-----
> > > > From: KARR, DAVID (ATTSI)
> > > > Sent: Wednesday, May 19, 2010 7:08 PM
> > > > To: users@openjpa.apache.org
> > > > Subject: RE: Schema version problem upgrading to JPA 2.0
> > > >
> > > > > -----Original Message-----
> > > > > From: KARR, DAVID (ATTSI)
> > > > > Sent: Wednesday, May 19, 2010 6:31 PM
> > > > > To: users@openjpa.apache.org
> > > > > Subject: Schema version problem upgrading to JPA 2.0
> > > > >
> > > > > I think I noticed some talk about this before, but I can't
find
> > it
> > > in
> > > > > the archives now.
> > > > >
> > > > > I tried to upgrade to version 2.0.0 today.  The upgrade with
no
> > > > changes
> > > > > worked fine.  Now I'm trying to modify it to use the small
> number
> > of
> > > > > 2.0
> > > > > features that I'm attempting to use.
> > > > >
> > > > > When I changed the "schemaLocation" attribute to point to the
> 2.0
> > > xsd
> > > > > (I'm really surprised the namespace didn't change), then
> Eclipse
> > > > > complained that I had to change the "version" attribute also,
> > which
> > > I
> > > > > did (to 2.0).  I then added several "order-column" elements
> where
> > I
> > > > was
> > > > > previously using the OpenJPA OrderColumn annotation.  When I
> > > > attempted
> > > > > to build this, I got schema validation errors, claiming that
> > there
> > > > was
> > > > > no "order-column" element (even though Eclipse validates
this).
> > If
> > > I
> > > > > temporarily changed the "version" attribute value back to
> "1.0",
> > > then
> > > > I
> > > > > could get through that part of the build, even though Eclipse
> is
> > now
> > > > > complaining.  I haven't attempted to run the app in this
state.
> > > > >
> > > > > What am I missing?
> > > >
> > > > I noticed that in the openjpa jar file, there are two schema
> files,
> > > > "orm-xsd.rsrc" and "orm_2_0-xsd.rsrc".  The first is the 1.x
> > schema,
> > > > and
> > > > the second is clearly the 2.x schema.  I'm really wondering more
> > about
> > > > the fact that the namespace is the same between them.  That
can't
> > be
> > > > right.  I wonder what would happen if I removed the 1.x schema
> from
> > > the
> > > > jar file?
> > >
> > > I tried renaming the 1.x schema file in the jar, adding ".save" to
> > the
> > > name to hide it.  That gets me past the build/enhancement.  I
> > deployed
> > > the app, then ran a request.  That failed with the following:
> > >
> > > Caused by: org.xml.sax.SAXException: zip:.../orm.xml [Location:
> Line:
> > 5,
> > > C: 19]: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value
> > '2.0'
> > > of attribute 'version' of element 'entity-mappings' is not valid
> with
> > > respect to the corresponding attribute use. Attribute 'version'
has
> a
> > > fixed value of '1.0'.
> > >


RE: Schema version problem upgrading to JPA 2.0

Posted by "KARR, DAVID (ATTSI)" <dk...@att.com>.
> -----Original Message-----
> From: KARR, DAVID (ATTSI)
> Sent: Thursday, May 20, 2010 9:21 AM
> To: users@openjpa.apache.org
> Subject: RE: Schema version problem upgrading to JPA 2.0
> 
> > -----Original Message-----
> > From: Michael Dick [mailto:michael.d.dick@gmail.com]
> > Sent: Thursday, May 20, 2010 3:39 AM
> > To: users@openjpa.apache.org
> > Subject: Re: Schema version problem upgrading to JPA 2.0
> >
> > Going back a couple of emails - the namespace is right - it's that
> way
> > in
> > the JPA spec.
> >
> > Are you just compiling your entities, or is one of the OpenJPA ant
> > tasks
> > causing the error? If it's just compiling I'd guess it's the
> meta-model
> > generator which is parsing orm.xml.
> >
> > The problem might not be in meta-model generation - but you might be
> > able to
> > work around it by specifying -proc:none as a compiler argument.
> 
> I appear to have some mess in my build script that is causing multiple
> versions of jars to be deployed in the WAR file.  I'm still trying to
> straighten that out.  I'm now having the following issue when I deploy
> to WebLogic 10.3.3:
> 
> ClassCastException:
> org.apache.openjpa.persistence.PersistenceProviderImpl cannot be cast
> to
> javax.persistence.spi.PersistenceProvider
> 
> I may have to retrace my steps all the way back to 1.2.2 to figure out
> what's wrong here.
> 
> What is the significance of the "geronimo-jpa_3.0_spec-1.0.jar" in the
> 1.2.2 distribution, as opposed to "geronimo-jpa_2.0_spec-1.0.jar" in
> the
> 2.0.0 distribution?

Depending on how I configure WEB-INF/lib, I also get:

NoSuchMethodError:
javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/pers
istence/ValidationMode;.

This method is in "geronimo-jpa_2.0_spec-1.0.jar" and
"openjpa-all-2.0.0.jar", but not in "geronimo-jpa_3.0_spec-1.0.jar".

I think it's possible the only reason I got this to work with OpenJPA
1.2.2 is because WebLogic incorporates the version used in the "3.0"
jar.  Now that I'm trying to use the new version that adds that method
to the SPI, a conflict is appearing.

> > On Wed, May 19, 2010 at 9:24 PM, KARR, DAVID (ATTSI)
<dk...@att.com>
> > wrote:
> >
> > > > -----Original Message-----
> > > > From: KARR, DAVID (ATTSI)
> > > > Sent: Wednesday, May 19, 2010 7:08 PM
> > > > To: users@openjpa.apache.org
> > > > Subject: RE: Schema version problem upgrading to JPA 2.0
> > > >
> > > > > -----Original Message-----
> > > > > From: KARR, DAVID (ATTSI)
> > > > > Sent: Wednesday, May 19, 2010 6:31 PM
> > > > > To: users@openjpa.apache.org
> > > > > Subject: Schema version problem upgrading to JPA 2.0
> > > > >
> > > > > I think I noticed some talk about this before, but I can't
find
> > it
> > > in
> > > > > the archives now.
> > > > >
> > > > > I tried to upgrade to version 2.0.0 today.  The upgrade with
no
> > > > changes
> > > > > worked fine.  Now I'm trying to modify it to use the small
> number
> > of
> > > > > 2.0
> > > > > features that I'm attempting to use.
> > > > >
> > > > > When I changed the "schemaLocation" attribute to point to the
> 2.0
> > > xsd
> > > > > (I'm really surprised the namespace didn't change), then
> Eclipse
> > > > > complained that I had to change the "version" attribute also,
> > which
> > > I
> > > > > did (to 2.0).  I then added several "order-column" elements
> where
> > I
> > > > was
> > > > > previously using the OpenJPA OrderColumn annotation.  When I
> > > > attempted
> > > > > to build this, I got schema validation errors, claiming that
> > there
> > > > was
> > > > > no "order-column" element (even though Eclipse validates
this).
> > If
> > > I
> > > > > temporarily changed the "version" attribute value back to
> "1.0",
> > > then
> > > > I
> > > > > could get through that part of the build, even though Eclipse
> is
> > now
> > > > > complaining.  I haven't attempted to run the app in this
state.
> > > > >
> > > > > What am I missing?
> > > >
> > > > I noticed that in the openjpa jar file, there are two schema
> files,
> > > > "orm-xsd.rsrc" and "orm_2_0-xsd.rsrc".  The first is the 1.x
> > schema,
> > > > and
> > > > the second is clearly the 2.x schema.  I'm really wondering more
> > about
> > > > the fact that the namespace is the same between them.  That
can't
> > be
> > > > right.  I wonder what would happen if I removed the 1.x schema
> from
> > > the
> > > > jar file?
> > >
> > > I tried renaming the 1.x schema file in the jar, adding ".save" to
> > the
> > > name to hide it.  That gets me past the build/enhancement.  I
> > deployed
> > > the app, then ran a request.  That failed with the following:
> > >
> > > Caused by: org.xml.sax.SAXException: zip:.../orm.xml [Location:
> Line:
> > 5,
> > > C: 19]: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value
> > '2.0'
> > > of attribute 'version' of element 'entity-mappings' is not valid
> with
> > > respect to the corresponding attribute use. Attribute 'version'
has
> a
> > > fixed value of '1.0'.
> > >

RE: Schema version problem upgrading to JPA 2.0

Posted by "KARR, DAVID (ATTSI)" <dk...@att.com>.
> -----Original Message-----
> From: Michael Dick [mailto:michael.d.dick@gmail.com]
> Sent: Thursday, May 20, 2010 3:39 AM
> To: users@openjpa.apache.org
> Subject: Re: Schema version problem upgrading to JPA 2.0
> 
> Going back a couple of emails - the namespace is right - it's that way
> in
> the JPA spec.
> 
> Are you just compiling your entities, or is one of the OpenJPA ant
> tasks
> causing the error? If it's just compiling I'd guess it's the
meta-model
> generator which is parsing orm.xml.
> 
> The problem might not be in meta-model generation - but you might be
> able to
> work around it by specifying -proc:none as a compiler argument.

I appear to have some mess in my build script that is causing multiple
versions of jars to be deployed in the WAR file.  I'm still trying to
straighten that out.  I'm now having the following issue when I deploy
to WebLogic 10.3.3:

ClassCastException:
org.apache.openjpa.persistence.PersistenceProviderImpl cannot be cast to
javax.persistence.spi.PersistenceProvider

I may have to retrace my steps all the way back to 1.2.2 to figure out
what's wrong here.

What is the significance of the "geronimo-jpa_3.0_spec-1.0.jar" in the
1.2.2 distribution, as opposed to "geronimo-jpa_2.0_spec-1.0.jar" in the
2.0.0 distribution?

> On Wed, May 19, 2010 at 9:24 PM, KARR, DAVID (ATTSI) <dk...@att.com>
> wrote:
> 
> > > -----Original Message-----
> > > From: KARR, DAVID (ATTSI)
> > > Sent: Wednesday, May 19, 2010 7:08 PM
> > > To: users@openjpa.apache.org
> > > Subject: RE: Schema version problem upgrading to JPA 2.0
> > >
> > > > -----Original Message-----
> > > > From: KARR, DAVID (ATTSI)
> > > > Sent: Wednesday, May 19, 2010 6:31 PM
> > > > To: users@openjpa.apache.org
> > > > Subject: Schema version problem upgrading to JPA 2.0
> > > >
> > > > I think I noticed some talk about this before, but I can't find
> it
> > in
> > > > the archives now.
> > > >
> > > > I tried to upgrade to version 2.0.0 today.  The upgrade with no
> > > changes
> > > > worked fine.  Now I'm trying to modify it to use the small
number
> of
> > > > 2.0
> > > > features that I'm attempting to use.
> > > >
> > > > When I changed the "schemaLocation" attribute to point to the
2.0
> > xsd
> > > > (I'm really surprised the namespace didn't change), then Eclipse
> > > > complained that I had to change the "version" attribute also,
> which
> > I
> > > > did (to 2.0).  I then added several "order-column" elements
where
> I
> > > was
> > > > previously using the OpenJPA OrderColumn annotation.  When I
> > > attempted
> > > > to build this, I got schema validation errors, claiming that
> there
> > > was
> > > > no "order-column" element (even though Eclipse validates this).
> If
> > I
> > > > temporarily changed the "version" attribute value back to "1.0",
> > then
> > > I
> > > > could get through that part of the build, even though Eclipse is
> now
> > > > complaining.  I haven't attempted to run the app in this state.
> > > >
> > > > What am I missing?
> > >
> > > I noticed that in the openjpa jar file, there are two schema
files,
> > > "orm-xsd.rsrc" and "orm_2_0-xsd.rsrc".  The first is the 1.x
> schema,
> > > and
> > > the second is clearly the 2.x schema.  I'm really wondering more
> about
> > > the fact that the namespace is the same between them.  That can't
> be
> > > right.  I wonder what would happen if I removed the 1.x schema
from
> > the
> > > jar file?
> >
> > I tried renaming the 1.x schema file in the jar, adding ".save" to
> the
> > name to hide it.  That gets me past the build/enhancement.  I
> deployed
> > the app, then ran a request.  That failed with the following:
> >
> > Caused by: org.xml.sax.SAXException: zip:.../orm.xml [Location:
Line:
> 5,
> > C: 19]: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value
> '2.0'
> > of attribute 'version' of element 'entity-mappings' is not valid
with
> > respect to the corresponding attribute use. Attribute 'version' has
a
> > fixed value of '1.0'.
> >

Re: Schema version problem upgrading to JPA 2.0

Posted by Michael Dick <mi...@gmail.com>.
Going back a couple of emails - the namespace is right - it's that way in
the JPA spec.

Are you just compiling your entities, or is one of the OpenJPA ant tasks
causing the error? If it's just compiling I'd guess it's the meta-model
generator which is parsing orm.xml.

The problem might not be in meta-model generation - but you might be able to
work around it by specifying -proc:none as a compiler argument.

Regards,
-mike



On Wed, May 19, 2010 at 9:24 PM, KARR, DAVID (ATTSI) <dk...@att.com> wrote:

> > -----Original Message-----
> > From: KARR, DAVID (ATTSI)
> > Sent: Wednesday, May 19, 2010 7:08 PM
> > To: users@openjpa.apache.org
> > Subject: RE: Schema version problem upgrading to JPA 2.0
> >
> > > -----Original Message-----
> > > From: KARR, DAVID (ATTSI)
> > > Sent: Wednesday, May 19, 2010 6:31 PM
> > > To: users@openjpa.apache.org
> > > Subject: Schema version problem upgrading to JPA 2.0
> > >
> > > I think I noticed some talk about this before, but I can't find it
> in
> > > the archives now.
> > >
> > > I tried to upgrade to version 2.0.0 today.  The upgrade with no
> > changes
> > > worked fine.  Now I'm trying to modify it to use the small number of
> > > 2.0
> > > features that I'm attempting to use.
> > >
> > > When I changed the "schemaLocation" attribute to point to the 2.0
> xsd
> > > (I'm really surprised the namespace didn't change), then Eclipse
> > > complained that I had to change the "version" attribute also, which
> I
> > > did (to 2.0).  I then added several "order-column" elements where I
> > was
> > > previously using the OpenJPA OrderColumn annotation.  When I
> > attempted
> > > to build this, I got schema validation errors, claiming that there
> > was
> > > no "order-column" element (even though Eclipse validates this).  If
> I
> > > temporarily changed the "version" attribute value back to "1.0",
> then
> > I
> > > could get through that part of the build, even though Eclipse is now
> > > complaining.  I haven't attempted to run the app in this state.
> > >
> > > What am I missing?
> >
> > I noticed that in the openjpa jar file, there are two schema files,
> > "orm-xsd.rsrc" and "orm_2_0-xsd.rsrc".  The first is the 1.x schema,
> > and
> > the second is clearly the 2.x schema.  I'm really wondering more about
> > the fact that the namespace is the same between them.  That can't be
> > right.  I wonder what would happen if I removed the 1.x schema from
> the
> > jar file?
>
> I tried renaming the 1.x schema file in the jar, adding ".save" to the
> name to hide it.  That gets me past the build/enhancement.  I deployed
> the app, then ran a request.  That failed with the following:
>
> Caused by: org.xml.sax.SAXException: zip:.../orm.xml [Location: Line: 5,
> C: 19]: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0'
> of attribute 'version' of element 'entity-mappings' is not valid with
> respect to the corresponding attribute use. Attribute 'version' has a
> fixed value of '1.0'.
>

RE: Schema version problem upgrading to JPA 2.0

Posted by "KARR, DAVID (ATTSI)" <dk...@att.com>.
> -----Original Message-----
> From: KARR, DAVID (ATTSI)
> Sent: Wednesday, May 19, 2010 7:08 PM
> To: users@openjpa.apache.org
> Subject: RE: Schema version problem upgrading to JPA 2.0
> 
> > -----Original Message-----
> > From: KARR, DAVID (ATTSI)
> > Sent: Wednesday, May 19, 2010 6:31 PM
> > To: users@openjpa.apache.org
> > Subject: Schema version problem upgrading to JPA 2.0
> >
> > I think I noticed some talk about this before, but I can't find it
in
> > the archives now.
> >
> > I tried to upgrade to version 2.0.0 today.  The upgrade with no
> changes
> > worked fine.  Now I'm trying to modify it to use the small number of
> > 2.0
> > features that I'm attempting to use.
> >
> > When I changed the "schemaLocation" attribute to point to the 2.0
xsd
> > (I'm really surprised the namespace didn't change), then Eclipse
> > complained that I had to change the "version" attribute also, which
I
> > did (to 2.0).  I then added several "order-column" elements where I
> was
> > previously using the OpenJPA OrderColumn annotation.  When I
> attempted
> > to build this, I got schema validation errors, claiming that there
> was
> > no "order-column" element (even though Eclipse validates this).  If
I
> > temporarily changed the "version" attribute value back to "1.0",
then
> I
> > could get through that part of the build, even though Eclipse is now
> > complaining.  I haven't attempted to run the app in this state.
> >
> > What am I missing?
> 
> I noticed that in the openjpa jar file, there are two schema files,
> "orm-xsd.rsrc" and "orm_2_0-xsd.rsrc".  The first is the 1.x schema,
> and
> the second is clearly the 2.x schema.  I'm really wondering more about
> the fact that the namespace is the same between them.  That can't be
> right.  I wonder what would happen if I removed the 1.x schema from
the
> jar file?

I tried renaming the 1.x schema file in the jar, adding ".save" to the
name to hide it.  That gets me past the build/enhancement.  I deployed
the app, then ran a request.  That failed with the following:

Caused by: org.xml.sax.SAXException: zip:.../orm.xml [Location: Line: 5,
C: 19]: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0'
of attribute 'version' of element 'entity-mappings' is not valid with
respect to the corresponding attribute use. Attribute 'version' has a
fixed value of '1.0'.

RE: Schema version problem upgrading to JPA 2.0

Posted by "KARR, DAVID (ATTSI)" <dk...@att.com>.
> -----Original Message-----
> From: Jeremy Bauer [mailto:techhusky@gmail.com]
> Sent: Thursday, May 20, 2010 10:20 AM
> To: users@openjpa.apache.org
> Subject: Re: Schema version problem upgrading to JPA 2.0
> 
> Hi David,
> 
> Based on the version and schemaLocation attributes (primarily
version),
> OpenJPA should provide the proper rsrc file to the XML parser so that
> it can
> validate the orm using the correct version of the schema.  (ie.
> version="1.0" - orm-xsd.rsrc ; version="2.0" - orm_2_0-xsd.rsrc)  The
> specification uses the same namespace for both versions so that you
can
> move
> from one version to the next with minimal changes.
> 
> If you are still experiencing this problem can you provide a stripped
> down
> version of your war or ear file?  I don't have WebLogic, but given a
> template, I could try to reproduce the issue on another app server.

My problem is down to a conflict with the OpenJPA implementation in
WebLogic.  I can use OpenJPA 1.2.2 in WebLogic 10.3.x, but not 2.0.0.
This is because I'm attempting to use a different SPI version than what
is used inside WebLogic.  Solving this isn't as simple as just fixing
the classpath.  I can tell WebLogic to "prefer" my application packages,
but this creates other problems.

I posted a note about this with the WebLogic-specific details (some of
them, at least) at
<http://forums.oracle.com/forums/thread.jspa?threadID=1075480&tstart=0>.
I've also created an Oracle support ticket.  Perhaps they can help.

> 
> -Jeremy
> 
> On Wed, May 19, 2010 at 9:08 PM, KARR, DAVID (ATTSI) <dk...@att.com>
> wrote:
> 
> > > -----Original Message-----
> > > From: KARR, DAVID (ATTSI)
> > > Sent: Wednesday, May 19, 2010 6:31 PM
> > > To: users@openjpa.apache.org
> > > Subject: Schema version problem upgrading to JPA 2.0
> > >
> > > I think I noticed some talk about this before, but I can't find it
> in
> > > the archives now.
> > >
> > > I tried to upgrade to version 2.0.0 today.  The upgrade with no
> > changes
> > > worked fine.  Now I'm trying to modify it to use the small number
> of
> > > 2.0
> > > features that I'm attempting to use.
> > >
> > > When I changed the "schemaLocation" attribute to point to the 2.0
> xsd
> > > (I'm really surprised the namespace didn't change), then Eclipse
> > > complained that I had to change the "version" attribute also,
which
> I
> > > did (to 2.0).  I then added several "order-column" elements where
I
> > was
> > > previously using the OpenJPA OrderColumn annotation.  When I
> attempted
> > > to build this, I got schema validation errors, claiming that there
> was
> > > no "order-column" element (even though Eclipse validates this).
If
> I
> > > temporarily changed the "version" attribute value back to "1.0",
> then
> > I
> > > could get through that part of the build, even though Eclipse is
> now
> > > complaining.  I haven't attempted to run the app in this state.
> > >
> > > What am I missing?
> >
> > I noticed that in the openjpa jar file, there are two schema files,
> > "orm-xsd.rsrc" and "orm_2_0-xsd.rsrc".  The first is the 1.x schema,
> and
> > the second is clearly the 2.x schema.  I'm really wondering more
> about
> > the fact that the namespace is the same between them.  That can't be
> > right.  I wonder what would happen if I removed the 1.x schema from
> the
> > jar file?
> >

Re: Schema version problem upgrading to JPA 2.0

Posted by Jeremy Bauer <te...@gmail.com>.
Hi David,

Based on the version and schemaLocation attributes (primarily version),
OpenJPA should provide the proper rsrc file to the XML parser so that it can
validate the orm using the correct version of the schema.  (ie.
version="1.0" - orm-xsd.rsrc ; version="2.0" - orm_2_0-xsd.rsrc)  The
specification uses the same namespace for both versions so that you can move
from one version to the next with minimal changes.

If you are still experiencing this problem can you provide a stripped down
version of your war or ear file?  I don't have WebLogic, but given a
template, I could try to reproduce the issue on another app server.

-Jeremy

On Wed, May 19, 2010 at 9:08 PM, KARR, DAVID (ATTSI) <dk...@att.com> wrote:

> > -----Original Message-----
> > From: KARR, DAVID (ATTSI)
> > Sent: Wednesday, May 19, 2010 6:31 PM
> > To: users@openjpa.apache.org
> > Subject: Schema version problem upgrading to JPA 2.0
> >
> > I think I noticed some talk about this before, but I can't find it in
> > the archives now.
> >
> > I tried to upgrade to version 2.0.0 today.  The upgrade with no
> changes
> > worked fine.  Now I'm trying to modify it to use the small number of
> > 2.0
> > features that I'm attempting to use.
> >
> > When I changed the "schemaLocation" attribute to point to the 2.0 xsd
> > (I'm really surprised the namespace didn't change), then Eclipse
> > complained that I had to change the "version" attribute also, which I
> > did (to 2.0).  I then added several "order-column" elements where I
> was
> > previously using the OpenJPA OrderColumn annotation.  When I attempted
> > to build this, I got schema validation errors, claiming that there was
> > no "order-column" element (even though Eclipse validates this).  If I
> > temporarily changed the "version" attribute value back to "1.0", then
> I
> > could get through that part of the build, even though Eclipse is now
> > complaining.  I haven't attempted to run the app in this state.
> >
> > What am I missing?
>
> I noticed that in the openjpa jar file, there are two schema files,
> "orm-xsd.rsrc" and "orm_2_0-xsd.rsrc".  The first is the 1.x schema, and
> the second is clearly the 2.x schema.  I'm really wondering more about
> the fact that the namespace is the same between them.  That can't be
> right.  I wonder what would happen if I removed the 1.x schema from the
> jar file?
>

RE: Schema version problem upgrading to JPA 2.0

Posted by "KARR, DAVID (ATTSI)" <dk...@att.com>.
> -----Original Message-----
> From: KARR, DAVID (ATTSI)
> Sent: Wednesday, May 19, 2010 6:31 PM
> To: users@openjpa.apache.org
> Subject: Schema version problem upgrading to JPA 2.0
> 
> I think I noticed some talk about this before, but I can't find it in
> the archives now.
> 
> I tried to upgrade to version 2.0.0 today.  The upgrade with no
changes
> worked fine.  Now I'm trying to modify it to use the small number of
> 2.0
> features that I'm attempting to use.
> 
> When I changed the "schemaLocation" attribute to point to the 2.0 xsd
> (I'm really surprised the namespace didn't change), then Eclipse
> complained that I had to change the "version" attribute also, which I
> did (to 2.0).  I then added several "order-column" elements where I
was
> previously using the OpenJPA OrderColumn annotation.  When I attempted
> to build this, I got schema validation errors, claiming that there was
> no "order-column" element (even though Eclipse validates this).  If I
> temporarily changed the "version" attribute value back to "1.0", then
I
> could get through that part of the build, even though Eclipse is now
> complaining.  I haven't attempted to run the app in this state.
> 
> What am I missing?

I noticed that in the openjpa jar file, there are two schema files,
"orm-xsd.rsrc" and "orm_2_0-xsd.rsrc".  The first is the 1.x schema, and
the second is clearly the 2.x schema.  I'm really wondering more about
the fact that the namespace is the same between them.  That can't be
right.  I wonder what would happen if I removed the 1.x schema from the
jar file?

RE: Schema version problem upgrading to JPA 2.0

Posted by "KARR, DAVID (ATTSI)" <dk...@att.com>.
> -----Original Message-----
> From: Michael Dick [mailto:michael.d.dick@gmail.com]
> Sent: Wednesday, May 19, 2010 6:55 PM
> To: users@openjpa.apache.org
> Subject: Re: Schema version problem upgrading to JPA 2.0
> 
> On the surface this sounds like Eclipse is getting confused (if I've
> read
> your email correctly it's Eclipse's builder that's confused).
> 
> Have you tried the usual suspected for Eclipse (clean project,
refresh,
> rebuild)?

I don't get the errors in Eclipse.  I'm running "ant" from the command
line outside of Eclipse, and it fails with the schema validation error.
If I temporarily set the "version" value back to "1.0" (which Eclipse
now complains about), that gets past the schema validation error just in
that orm.xml file.

> On Wed, May 19, 2010 at 8:30 PM, KARR, DAVID (ATTSI) <dk...@att.com>
> wrote:
> 
> > I think I noticed some talk about this before, but I can't find it
in
> > the archives now.
> >
> > I tried to upgrade to version 2.0.0 today.  The upgrade with no
> changes
> > worked fine.  Now I'm trying to modify it to use the small number of
> 2.0
> > features that I'm attempting to use.
> >
> > When I changed the "schemaLocation" attribute to point to the 2.0
xsd
> > (I'm really surprised the namespace didn't change), then Eclipse
> > complained that I had to change the "version" attribute also, which
I
> > did (to 2.0).  I then added several "order-column" elements where I
> was
> > previously using the OpenJPA OrderColumn annotation.  When I
> attempted
> > to build this, I got schema validation errors, claiming that there
> was
> > no "order-column" element (even though Eclipse validates this).  If
I
> > temporarily changed the "version" attribute value back to "1.0",
then
> I
> > could get through that part of the build, even though Eclipse is now
> > complaining.  I haven't attempted to run the app in this state.
> >
> > What am I missing?
> >

Re: Schema version problem upgrading to JPA 2.0

Posted by Michael Dick <mi...@gmail.com>.
On the surface this sounds like Eclipse is getting confused (if I've read
your email correctly it's Eclipse's builder that's confused).

Have you tried the usual suspected for Eclipse (clean project, refresh,
rebuild)?

-mike

On Wed, May 19, 2010 at 8:30 PM, KARR, DAVID (ATTSI) <dk...@att.com> wrote:

> I think I noticed some talk about this before, but I can't find it in
> the archives now.
>
> I tried to upgrade to version 2.0.0 today.  The upgrade with no changes
> worked fine.  Now I'm trying to modify it to use the small number of 2.0
> features that I'm attempting to use.
>
> When I changed the "schemaLocation" attribute to point to the 2.0 xsd
> (I'm really surprised the namespace didn't change), then Eclipse
> complained that I had to change the "version" attribute also, which I
> did (to 2.0).  I then added several "order-column" elements where I was
> previously using the OpenJPA OrderColumn annotation.  When I attempted
> to build this, I got schema validation errors, claiming that there was
> no "order-column" element (even though Eclipse validates this).  If I
> temporarily changed the "version" attribute value back to "1.0", then I
> could get through that part of the build, even though Eclipse is now
> complaining.  I haven't attempted to run the app in this state.
>
> What am I missing?
>