Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32566 > unrolled thread

I can not successfully call Persistence.createEntityManagerFactory

Started byCecil Westerhof <Cecil@decebal.nl>
First post2015-09-09 15:23 +0200
Last post2015-09-11 21:36 -0400
Articles 3 — 2 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  I can not successfully call Persistence.createEntityManagerFactory Cecil Westerhof <Cecil@decebal.nl> - 2015-09-09 15:23 +0200
    Re: I can not successfully call Persistence.createEntityManagerFactory Cecil Westerhof <Cecil@decebal.nl> - 2015-09-11 18:39 +0200
      Re: I can not successfully call Persistence.createEntityManagerFactory Arne Vajhøj <arne@vajhoej.dk> - 2015-09-11 21:36 -0400

#32566 — I can not successfully call Persistence.createEntityManagerFactory

FromCecil Westerhof <Cecil@decebal.nl>
Date2015-09-09 15:23 +0200
SubjectI can not successfully call Persistence.createEntityManagerFactory
Message-ID<87egi7u3pa.fsf@Equus.decebal.nl>
I have to implement some JPA functionalities. It is fairly new to me,
so it is no wonder that things go wrong.

I am trying to call:
    emf = Persistence.createEntityManagerFactory("this-persistence-unit");

In my persistence.xml the name of persistence-unit is
'this-persistence-unit'.

But the call gives:
    javax.persistence.PersistenceException: Explicit persistence provider
    error(s) occurred for "this-persistence-unit" after trying the
    com.ibm.websphere.persistence.PersistenceProviderImpl returned:
    <openjpa-2.1.2-SNAPSHOT-r422266:1530146 nonfatal general error> org.
    at org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource
    (XMLMetaDataParser.java:424)

So I am doing something wrong. Does anyone have an idea what it could
be that I am doing wrong?

I am using the same persistence.xml as is used in another project. But
they do not have any idea how persistence is implemented, so they
cannot help me. :'-(

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [next] | [standalone]


#32578

FromCecil Westerhof <Cecil@decebal.nl>
Date2015-09-11 18:39 +0200
Message-ID<87613gucz4.fsf@Equus.decebal.nl>
In reply to#32566
On Wednesday  9 Sep 2015 15:23 CEST, Cecil Westerhof wrote:

> I have to implement some JPA functionalities. It is fairly new to
> me, so it is no wonder that things go wrong.
>
> I am trying to call: emf =
> Persistence.createEntityManagerFactory("this-persistence-unit");
>
> In my persistence.xml the name of persistence-unit is
> 'this-persistence-unit'.
>
> But the call gives: javax.persistence.PersistenceException: Explicit
> persistence provider error(s) occurred for "this-persistence-unit"
> after trying the
> com.ibm.websphere.persistence.PersistenceProviderImpl returned:
> <openjpa-2.1.2-SNAPSHOT-r422266:1530146 nonfatal general error> org.
> at org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource
> (XMLMetaDataParser.java:424)
>
> So I am doing something wrong. Does anyone have an idea what it
> could be that I am doing wrong?
>
> I am using the same persistence.xml as is used in another project.
> But they do not have any idea how persistence is implemented, so
> they cannot help me. :'-(

It turned out there files where not correct: I needed to change quite
a few things. Why they do not get errors is a mystery for me.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [next] | [standalone]


#32580

FromArne Vajhøj <arne@vajhoej.dk>
Date2015-09-11 21:36 -0400
Message-ID<msvvj1$mi1$1@speranza.aioe.org>
In reply to#32578
On 9/11/2015 12:39 PM, Cecil Westerhof wrote:
> On Wednesday  9 Sep 2015 15:23 CEST, Cecil Westerhof wrote:
>> I have to implement some JPA functionalities. It is fairly new to
>> me, so it is no wonder that things go wrong.
>>
>> I am trying to call: emf =
>> Persistence.createEntityManagerFactory("this-persistence-unit");
>>
>> In my persistence.xml the name of persistence-unit is
>> 'this-persistence-unit'.
>>
>> But the call gives: javax.persistence.PersistenceException: Explicit
>> persistence provider error(s) occurred for "this-persistence-unit"
>> after trying the
>> com.ibm.websphere.persistence.PersistenceProviderImpl returned:
>> <openjpa-2.1.2-SNAPSHOT-r422266:1530146 nonfatal general error> org.
>> at org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource
>> (XMLMetaDataParser.java:424)

>> I am using the same persistence.xml as is used in another project.
>> But they do not have any idea how persistence is implemented, so
>> they cannot help me. :'-(
>
> It turned out there files where not correct: I needed to change quite
> a few things. Why they do not get errors is a mystery for me.

JPA may use a different persistence.xml than what they think.

Arne

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web