quality@glassfish.java.net

Re: Nasty null pointer exception on deploy

From: Richard Kolb <rjdkolb_at_gmail.com>
Date: Thu, 17 Dec 2009 17:46:17 +0200

Hi Hong

2009/12/17 Hong Zhang <Hong.Zhang_at_sun.com>

>
> I was able to reproduce the problem with the application you attached.
>
>

great that is easy to reproduce,


I will look into it further and update the issue tracker with my findings (I
> probably cannot get to it today, but I should be able to look at it
> tomorrow). It will be helpful if you can also share the sources for this
> application.
>

Not a problem, it is a Netbeans generated maven project.
I will get it off my other laptop as soon as I can.



> From the stack trace, it seems it was not able to find a suitable
> archivist to process the metadata for this application and that caused the
> NPE. I need to find out why it could not find a suitable archivist, but I
> agree with you this NPE is pretty bad and we need to provide a better error
> message regardless of whether the application was packaged properly or not.
>

That would be great.

Why this issue worries me is that Netbeans 6.8 seems to hit this problem
regularly when creating a Maven EJB project.

You can try it out yourself in NetBeans 6.8.

1) create a Maven EJB project
2) create entity classes from database using the wizard. I used a Oracle 11g
database.
3) in the wizard create a new persistence unit using the Eclipse Link 2.0
default
4) deploy the application
5) application does not deploy and you need to check the logs to find this
NPE


>
> Thanks for reporting the problem and attaching the test case.
>

Not a problem, will try get the sources now. Hope there is a work around of
sorts.
As I said , if I remove the provider from the persistence.xml it works and
if I re-add after a successful deploy it works. (even if I undeploy and then
redeploy)
regards
Richard.