This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 171668 - JpaController.getEntityManager return Null
Summary: JpaController.getEntityManager return Null
Status: RESOLVED DUPLICATE of bug 170402
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P3 blocker (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-08 00:09 UTC by halicorne
Modified: 2009-09-08 10:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
all information to reproduce it (1.41 MB, application/pdf)
2009-09-08 00:13 UTC, halicorne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description halicorne 2009-09-08 00:09:15 UTC
hi to all,

I’m a junior JPA programmer and a Netbeans short experienced user (but senior developper) I have the following problem using JPA’s wizards:

I have just installed Netbeans version 6.7.1


I have created a New project using 'Java J2EE' EJB module
I choose the default  option every time.
Then I add entities from database choosing "jdbc/sample" for connection, sample database and all classes, package : com.test.
Next I create a Persistant Unit (using default).
Before registering entities and choosing default options
Then, I create JPAController and choose all classes choosing default values
I create a new Java Class: and again default values, except for the package name using the same as above and I just to follow recommandations.
here is the code :
---
public class NewClass {

    public static void main(String p_arg[]){
    CustomerJpaController C=new CustomerJpaController();
    System.out.println("Test"+ C.getCustomerCount());
    }
}
---
Running this classe : I get the following error 
---
init:
deps-jar:
compile-single:
run-main:
Exception in thread "main" java.lang.NullPointerException
        at com.test.CustomerJpaController.getEntityManager(CustomerJpaController.java:34)
        at com.test.CustomerJpaController.getCustomerCount(CustomerJpaController.java:239)
        at com.test.NewClass.main(NewClass.java:15)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

---
and the JPAController function getEntityManager return allways null !!!

I have used all wizards, and it does not work properly. (Same on PC Vista, Linux ...)
I hope this help.

Halicorne.

Comment 1 halicorne 2009-09-08 00:13:12 UTC
Created attachment 87248 [details]
all information to reproduce it
Comment 2 Sergey Petrov 2009-09-08 10:47:09 UTC

*** This issue has been marked as a duplicate of 170402 ***