Solved

Netbeans java

Posted on 2012-04-04
6
415 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
Comment Utility
I might add, the code in line 779 is generated by Netbeans.
0
 
LVL 12

Expert Comment

by:Sharon Seth
Comment Utility
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
Comment Utility
I don't have any idea how to go about that,  can you get me started?
Thanks.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 12

Accepted Solution

by:
Sharon Seth earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Found the problem thanks.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
The viewer will learn how to download, install, and customize fonts inside Adobe Illustrator CS6. To install and use a font: Go to dafont.com and download a premade font : Unzip it, and open it up by double-clicking: Press “Install This Font” in…
Viewers will learn key ranges in Sampler to make their sampled instruments sound more realistic Gather samples of various notes and drag them to Key Range panel: Set proper root key for each sample: Select all the samples with Command-A (or Ctrl…

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now