You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Alex Kaiser <ka...@textkernel.nl> on 2012/09/25 09:07:21 UTC

Error creating bean with name 'entityManagerFactory': "jpa " is not valid Specification

Hi,

I am grappling with an error running openjpa 2.2.0 with spring
3.2.1.RELEASE and spring data jpa 1.1.2.RELEASE, all from the maven
repository.
Any help would be very much appreciated as I can find nothing on this
problem on the web.

when running the unit tests I get the following error

org.springframework.beans.factory.BeanCreationException: Error creating
bean with name
'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0':
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'entityManagerFactory' defined in class path resource
[jpa/jpa.context.xml]: Invocation of init method failed; nested exception
is <openjpa-2.2.0-r422266:1244990 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: "jpa " is not valid
Specification. The correct format is <name> [<major>[.<minor>]] where
<name> is the name of the Specification, <major> is the integer major
version number and <minor> is a string.

at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:526)

... stack trace omitted ...

Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in class path
resource [jpa/jpa.context.xml]: Invocation of init method failed; nested
exception is <openjpa-2.2.0-r422266:1244990 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: "jpa " is not valid
Specification. The correct format is <name> [<major>[.<minor>]] where
<name> is the name of the Specification, <major> is the integer major
version number and <minor> is a string.

at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)

... stack trace omitted ...

Caused by: <openjpa-2.2.0-r422266:1244990 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: "jpa " is not valid
Specification. The correct format is <name> [<major>[.<minor>]] where
<name> is the name of the Specification, <major> is the integer major
version number and <minor> is a string.

at org.apache.openjpa.conf.Specification.<init>(Specification.java:64)
at
org.apache.openjpa.conf.SpecificationPlugin.setString(SpecificationPlugin.java:61)
at
org.apache.openjpa.conf.OpenJPAConfigurationImpl.setSpecification(OpenJPAConfigurationImpl.java:658)

... stack trace omitted ...

Alexander

Re: Error creating bean with name 'entityManagerFactory': "jpa " is not valid Specification

Posted by Alex Kaiser <ka...@textkernel.nl>.
Hi Francesco,

thanks you very much for your answer and example. I finally found my error.
I was missing the version="2.0" attribute in my persistence.xml on the
persistence tag.

Before I had:

<persistence
>   <persistence-unit name="sb30pu">
> ...


which causes the reported error, and now I have


> <persistence version="2.0"
>   <persistence-unit name="sb30pu">
> ...


and the error disappears!

Alexander

On Tue, Sep 25, 2012 at 9:17 AM, Francesco Chicchiriccò <ilgrosso@apache.org
> wrote:

> On 25/09/2012 09:15, Francesco Chicchiriccň wrote:
>
>> On 25/09/2012 09:07, Alex Kaiser wrote:
>>
>>> Hi,
>>>
>>
>> HI Alex,
>>
>>  I am grappling with an error running openjpa 2.2.0 with spring
>>> 3.2.1.RELEASE and spring data jpa 1.1.2.RELEASE, all from the maven
>>> repository.
>>>
>>
>> ...guess you are referring to Spring 3.1.2.RELEASE, isn't it?
>>
>>  Any help would be very much appreciated as I can find nothing on this
>>> problem on the web.
>>>
>>> when running the unit tests I get the following error
>>>
>>
>> Please take a look at [1]: I build this for a blog post about Spring
>> advanced support for Quartz, but as you may notice, it's basically coherent
>> with your environment.
>>
>> If this doesn't help, please point to your sources or, if not possible,
>> provide your Spring XML conf file and your persistence.xml
>>
>> Regards.
>>
>
> [1] https://github.com/ilgrosso/**SpringQuartzJPASample<https://github.com/ilgrosso/SpringQuartzJPASample>
>
>
>  org.springframework.beans.**factory.BeanCreationException: Error creating
>>> bean with name
>>> 'org.springframework.dao.**annotation.**PersistenceExceptionTranslatio**nPostProcessor#0':
>>>
>>> Initialization of bean failed; nested exception is
>>> org.springframework.beans.**factory.BeanCreationException: Error
>>> creating
>>> bean with name 'entityManagerFactory' defined in class path resource
>>> [jpa/jpa.context.xml]: Invocation of init method failed; nested exception
>>> is <openjpa-2.2.0-r422266:1244990 nonfatal user error>
>>> org.apache.openjpa.**persistence.ArgumentException: "jpa " is not valid
>>> Specification. The correct format is <name> [<major>[.<minor>]] where
>>> <name> is the name of the Specification, <major> is the integer major
>>> version number and <minor> is a string.
>>>
>>> at
>>> org.springframework.beans.**factory.support.**
>>> AbstractAutowireCapableBeanFac**tory.doCreateBean(**
>>> AbstractAutowireCapableBeanFac**tory.java:526)
>>>
>>> ... stack trace omitted ...
>>>
>>> Caused by: org.springframework.beans.**factory.BeanCreationException:
>>> Error
>>> creating bean with name 'entityManagerFactory' defined in class path
>>> resource [jpa/jpa.context.xml]: Invocation of init method failed; nested
>>> exception is <openjpa-2.2.0-r422266:1244990 nonfatal user error>
>>> org.apache.openjpa.**persistence.ArgumentException: "jpa " is not valid
>>> Specification. The correct format is <name> [<major>[.<minor>]] where
>>> <name> is the name of the Specification, <major> is the integer major
>>> version number and <minor> is a string.
>>>
>>> at
>>> org.springframework.beans.**factory.support.**
>>> AbstractAutowireCapableBeanFac**tory.initializeBean(**
>>> AbstractAutowireCapableBeanFac**tory.java:1422)
>>> at
>>> org.springframework.beans.**factory.support.**
>>> AbstractAutowireCapableBeanFac**tory.doCreateBean(**
>>> AbstractAutowireCapableBeanFac**tory.java:518)
>>>
>>> ... stack trace omitted ...
>>>
>>> Caused by: <openjpa-2.2.0-r422266:1244990 nonfatal user error>
>>> org.apache.openjpa.**persistence.ArgumentException: "jpa " is not valid
>>> Specification. The correct format is <name> [<major>[.<minor>]] where
>>> <name> is the name of the Specification, <major> is the integer major
>>> version number and <minor> is a string.
>>>
>>> at org.apache.openjpa.conf.**Specification.<init>(**
>>> Specification.java:64)
>>> at
>>> org.apache.openjpa.conf.**SpecificationPlugin.setString(**SpecificationPlugin.java:61)
>>>
>>> at
>>> org.apache.openjpa.conf.**OpenJPAConfigurationImpl.**setSpecification(**
>>> OpenJPAConfigurationImpl.java:**658)
>>>
>>> ... stack trace omitted ...
>>>
>>> Alexander
>>>
>>
> --
> Francesco Chicchiriccň
>
>
> ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
> http://people.apache.org/~**ilgrosso/<http://people.apache.org/~ilgrosso/>
>
>


-- 
Alexander Kaiser
Textkernel BV
Software Engineer
Tel: +31 20 494 2496
http://www.textkernel.nl

Re: Error creating bean with name 'entityManagerFactory': "jpa " is not valid Specification

Posted by Alex Kaiser <ka...@textkernel.nl>.
Hi,

I am not setting this anywhere. I actually wonder where it comes from.
I am using vanilla maven packages with only configuration in spring and
persistence.xml, where I don't set the spec anywhere.
I never set the specification programmatically. Something seems to be
setting it, but I don't know what.
So I probably have to debug this thing so I can see the call stack.

Alexander


On Tue, Sep 25, 2012 at 2:16 PM, garpinc <ga...@yahoo.com> wrote:

> looks like you're trying to set specification to jpa instead of a version
> number like 1.0.0 . I recommend leaving out that setting entirely as it
> should pick that up from persistence.xml anyway.
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Error-creating-bean-with-name-entityManagerFactory-jpa-is-not-valid-Specification-tp7581197p7581201.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>



-- 
Alexander Kaiser
Textkernel BV
Software Engineer
Tel: +31 20 494 2496
http://www.textkernel.nl

Re: Error creating bean with name 'entityManagerFactory': "jpa " is not valid Specification

Posted by garpinc <ga...@yahoo.com>.
looks like you're trying to set specification to jpa instead of a version
number like 1.0.0 . I recommend leaving out that setting entirely as it
should pick that up from persistence.xml anyway.



--
View this message in context: http://openjpa.208410.n2.nabble.com/Error-creating-bean-with-name-entityManagerFactory-jpa-is-not-valid-Specification-tp7581197p7581201.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Error creating bean with name 'entityManagerFactory': "jpa " is not valid Specification

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 25/09/2012 09:15, Francesco Chicchiriccò wrote:
> On 25/09/2012 09:07, Alex Kaiser wrote:
>> Hi,
>
> HI Alex,
>
>> I am grappling with an error running openjpa 2.2.0 with spring
>> 3.2.1.RELEASE and spring data jpa 1.1.2.RELEASE, all from the maven
>> repository.
>
> ...guess you are referring to Spring 3.1.2.RELEASE, isn't it?
>
>> Any help would be very much appreciated as I can find nothing on this
>> problem on the web.
>>
>> when running the unit tests I get the following error
>
> Please take a look at [1]: I build this for a blog post about Spring 
> advanced support for Quartz, but as you may notice, it's basically 
> coherent with your environment.
>
> If this doesn't help, please point to your sources or, if not 
> possible, provide your Spring XML conf file and your persistence.xml
>
> Regards.

[1] https://github.com/ilgrosso/SpringQuartzJPASample

>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean with name
>> 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0': 
>>
>> Initialization of bean failed; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean with name 'entityManagerFactory' defined in class path resource
>> [jpa/jpa.context.xml]: Invocation of init method failed; nested 
>> exception
>> is <openjpa-2.2.0-r422266:1244990 nonfatal user error>
>> org.apache.openjpa.persistence.ArgumentException: "jpa " is not valid
>> Specification. The correct format is <name> [<major>[.<minor>]] where
>> <name> is the name of the Specification, <major> is the integer major
>> version number and <minor> is a string.
>>
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:526) 
>>
>>
>> ... stack trace omitted ...
>>
>> Caused by: org.springframework.beans.factory.BeanCreationException: 
>> Error
>> creating bean with name 'entityManagerFactory' defined in class path
>> resource [jpa/jpa.context.xml]: Invocation of init method failed; nested
>> exception is <openjpa-2.2.0-r422266:1244990 nonfatal user error>
>> org.apache.openjpa.persistence.ArgumentException: "jpa " is not valid
>> Specification. The correct format is <name> [<major>[.<minor>]] where
>> <name> is the name of the Specification, <major> is the integer major
>> version number and <minor> is a string.
>>
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422) 
>>
>> at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518) 
>>
>>
>> ... stack trace omitted ...
>>
>> Caused by: <openjpa-2.2.0-r422266:1244990 nonfatal user error>
>> org.apache.openjpa.persistence.ArgumentException: "jpa " is not valid
>> Specification. The correct format is <name> [<major>[.<minor>]] where
>> <name> is the name of the Specification, <major> is the integer major
>> version number and <minor> is a string.
>>
>> at org.apache.openjpa.conf.Specification.<init>(Specification.java:64)
>> at
>> org.apache.openjpa.conf.SpecificationPlugin.setString(SpecificationPlugin.java:61) 
>>
>> at
>> org.apache.openjpa.conf.OpenJPAConfigurationImpl.setSpecification(OpenJPAConfigurationImpl.java:658) 
>>
>>
>> ... stack trace omitted ...
>>
>> Alexander

-- 
Francesco Chicchiriccò

ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/


Re: Error creating bean with name 'entityManagerFactory': "jpa " is not valid Specification

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 25/09/2012 09:07, Alex Kaiser wrote:
> Hi,

HI Alex,

> I am grappling with an error running openjpa 2.2.0 with spring
> 3.2.1.RELEASE and spring data jpa 1.1.2.RELEASE, all from the maven
> repository.

...guess you are referring to Spring 3.1.2.RELEASE, isn't it?

> Any help would be very much appreciated as I can find nothing on this
> problem on the web.
>
> when running the unit tests I get the following error

Please take a look at [1]: I build this for a blog post about Spring 
advanced support for Quartz, but as you may notice, it's basically 
coherent with your environment.

If this doesn't help, please point to your sources or, if not possible, 
provide your Spring XML conf file and your persistence.xml

Regards.

> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name
> 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0':
> Initialization of bean failed; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'entityManagerFactory' defined in class path resource
> [jpa/jpa.context.xml]: Invocation of init method failed; nested exception
> is <openjpa-2.2.0-r422266:1244990 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: "jpa " is not valid
> Specification. The correct format is <name> [<major>[.<minor>]] where
> <name> is the name of the Specification, <major> is the integer major
> version number and <minor> is a string.
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:526)
>
> ... stack trace omitted ...
>
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'entityManagerFactory' defined in class path
> resource [jpa/jpa.context.xml]: Invocation of init method failed; nested
> exception is <openjpa-2.2.0-r422266:1244990 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: "jpa " is not valid
> Specification. The correct format is <name> [<major>[.<minor>]] where
> <name> is the name of the Specification, <major> is the integer major
> version number and <minor> is a string.
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
>
> ... stack trace omitted ...
>
> Caused by: <openjpa-2.2.0-r422266:1244990 nonfatal user error>
> org.apache.openjpa.persistence.ArgumentException: "jpa " is not valid
> Specification. The correct format is <name> [<major>[.<minor>]] where
> <name> is the name of the Specification, <major> is the integer major
> version number and <minor> is a string.
>
> at org.apache.openjpa.conf.Specification.<init>(Specification.java:64)
> at
> org.apache.openjpa.conf.SpecificationPlugin.setString(SpecificationPlugin.java:61)
> at
> org.apache.openjpa.conf.OpenJPAConfigurationImpl.setSpecification(OpenJPAConfigurationImpl.java:658)
>
> ... stack trace omitted ...
>
> Alexander

-- 
Francesco Chicchiriccò

ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/