Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7196691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:49:36+00:00 2026-05-28T20:49:36+00:00

There are many questions about this PersistenceException, but I have not seen some, where

  • 0

There are many questions about this PersistenceException, but I have not seen some, where the specific line of code throws this exception only sometimes (but not randomly:-).

So, do you have any idea, why once my simple app finds the provider ok, but then later it won’t?

NetBeans IDE 7.0.1, NetBeans Platform app, using persistence link library and Derby embbed.

I was trying this CRUD creatable capabilities “tutorial” by Geertjan, but i get the PersistenceException when saving new Trip:

at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
at org.mv.mm.api.TripSearchDAO.createTransactionalEntityManager(TripSearchDAO.java:61)
at org.mv.mm.api.TripSearchDAO.create(TripSearchDAO.java:41)
at org.mv.mm.api.TripQuery$3.create(TripQuery.java:69)
[catch] at org.mv.mm.api.TripType.create(TripType.java:64)

But in “search” method of DAO class, there is this private method createTransactionalEntityManager called too and EntityManager correctly created. Why it might be?


Ok, the problem is similar like many others here (well, I have not solved it, but I will try again tomorrow). It fails every time. I have mislooked the try catch block, so I did not noticed the exception. It occurs every time the Persistence.createEntityManagerFactory(“TripPU”).createEntityManager() is called.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:49:37+00:00Added an answer on May 28, 2026 at 8:49 pm

    And the real solution to the real problem is also found: Really do check in those cases the name of your persistence unit in persistence.xml (like TripPU) if it is correct to the calling Persistence.createEntityManagerFactory(“TripPU”).createEntityManager();

    The PU is not same as the DB entity, so the tutorials might you confuse when you try to do a bit different example (different tables etc.).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen many questions about the above topics but none that address this.
There seem to be many questions asked about this subject here on stackoverflow, but
I know there are many questions about jQuery slideToggle flickering but I haven't seen
I know there are many questions and answers about this, but I am looking
I have gone through many questions already asked about this problem but i didn't
I know there are many questions about this but none of them helped my
ok I am well aware there are many other questions about this, but I
There are lots of questions about this but I've not been able to solve
There are many questions about escaping single and double quotes but I have had
First of all I have seen that there are many questions about unrecognized selector

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.