Solved

Netbeans java

Posted on 2012-04-04
6
424 Views
Last Modified: 2012-06-21
Below is an error I get when I compile the attached program I have written.  I have not looked at the code for a few weeks as I had a question about a problem in the code and the advice I followed produced the error below.  I get the error when I try to run the program from Netbeans.  I am using Netbeans to write the program.  I have absolutely no idea how to get back where I was.  Before following the instructions, which I don't remember everything was working.  I was simply trying to add another function.  Any ideas anyone?

run:
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named null:  The following providers:
oracle.toplink.essentials.PersistenceProvider
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
Returned null to createEntityManagerFactory.

      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:154)
      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
      at diyjdj.DiyDjMain.initComponents(DiyDjMain.java:779)
      at diyjdj.DiyDjMain.<init>(DiyDjMain.java:747)
      at diyjdj.Main.main(Main.java:19)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)


I have no idea what is going on in line 779.  The source code is attached.  Thanks!
diy-dj.java
0
Comment
Question by:sargent240
  • 4
  • 2
6 Comments
 

Author Comment

by:sargent240
ID: 37809239
I might add, the code in line 779 is generated by Netbeans.
0
 
LVL 12

Expert Comment

by:Sharon Seth
ID: 37810179
java.beans.Beans.isDesignTime() is evaluating to false and the code at that line is specifically using an entity manager called Null. Can you see if you can set isDesignTime() to True ?
0
 

Author Comment

by:sargent240
ID: 37811828
I don't have any idea how to go about that,  can you get me started?
Thanks.
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 12

Accepted Solution

by:
Sharon Seth earned 500 total points
ID: 37822480
Set the following property somewhere before you hit line 779 , maybe set it in your main()
java.beans.Beans.setDesignTime(true) .

I am  assuming this would skip the code that tries to create an entity manager factory. If you are able to go beyond this point , we will look at what needs to be done next
0
 

Author Comment

by:sargent240
ID: 37842888
sharonseth,

Been buried with a couple things last few days.  Will be looking at our suggestion over the weekend.  Thanks for the suggestion.  I'll keep you posted
0
 

Author Closing Comment

by:sargent240
ID: 37913229
Found the problem thanks.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to create a new project within Adobe Encore and the basic layout of the software.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question