Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NullPointerException in PersistenceUnitUtil.getIdentifier()
NullPointerException in PersistenceUnitUtil.getIdentifier() [message #1766324] Tue, 20 June 2017 08:43 Go to next message
Lazar Kirchev is currently offline Lazar KirchevFriend
Messages: 30
Registered: July 2009
Location: Sofia, Bulgaria
Member
Hi everyone,

I noticed that using EntityManagerFactory.getPersistenceUnitUtil().getIdentifier() throws a NullPointerException if an EntityManager is not created.

I filed a bug about this - https://bugs.eclipse.org/bugs/show_bug.cgi?id=518398

What do you think about this problem?

Regards,
Lazar
Re: NullPointerException in PersistenceUnitUtil.getIdentifier() [message #1766362 is a reply to message #1766324] Tue, 20 June 2017 14:45 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Try using setting the deploy-on-startup property to true to see if it helps.

Also, when filing bugs, it helps to include the stack trace if there is one.
Re: NullPointerException in PersistenceUnitUtil.getIdentifier() [message #1766437 is a reply to message #1766362] Wed, 21 June 2017 13:44 Go to previous messageGo to next message
Lazar Kirchev is currently offline Lazar KirchevFriend
Messages: 30
Registered: July 2009
Location: Sofia, Bulgaria
Member
Thanks a lot Chris, the property helps. No NPE any more and the id of the entity is returned correctly.

Sorry for not adding the stacktrace. I now added it.
However, it does not say much more than the description.

Still do you think that this is a bug? Is it the expected behavior?
Re: NullPointerException in PersistenceUnitUtil.getIdentifier() [message #1766445 is a reply to message #1766437] Wed, 21 June 2017 14:10 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Calling JPA methods should trigger the deployment, so I'd say it was a bug, though one with a few simple workarounds.
Previous Topic:How to define xml name and plural name of a TAG
Next Topic:Persist vs Merge different exception handling
Goto Forum:
  


Current Time: Tue Mar 19 10:06:19 GMT 2024

Powered by FUDForum. Page generated in 0.02007 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top