NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

deployment problem nullpointerexception from NB 6.8 to GFv3

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
theshowmecanuck



Joined: 31 Jan 2010
Posts: 15

PostPosted: Mon Feb 08, 2010 6:02 am    Post subject: deployment problem nullpointerexception from NB 6.8 to GFv3 Reply with quote

(apologies... accidentally posted to netbeans user forum first instead of java ee forum)

I was working on a java ee6 tutorial using nb6.8 and gfv3. I did a clean and build and then deploy and the application deployed (ejb and war modules... enterprise app). I could see the app in the server.

I then did another clean and build and tried to deploy again and received an error. I checked and there was no app deployed on the server. Here is the error from the server log. I'm hoping someone here will have some insight for me.

SEVERE: Exception while deploying the app
java.lang.NullPointerException
at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:780)
at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:1862)
at com.sun.enterprise.deployment.Application.visit(Application.java:1756)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:774)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:253)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:222)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:145)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:78)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:612)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:554)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)

---------------------

The output from the build and deploy commands in netbeans provided this:

Initial deploying CustomerApp to G:\Projects\CustomerApp\dist\gfdeploy\CustomerApp
Completed initial distribution of CustomerApp
deploy?path=G:\Projects\CustomerApp\dist\gfdeploy\CustomerApp&name=CustomerApp&force=true failed on GlassFish v3
G:\Projects\CustomerApp\nbproject\build-impl.xml:293: The module has not been deployed.
BUILD FAILED (total time: 4 seconds)
Back to top
theshowmecanuck



Joined: 31 Jan 2010
Posts: 15

PostPosted: Tue Feb 09, 2010 4:29 pm    Post subject: I've found the answer myself Reply with quote

So I'll be one of the few and tell people what I figured out. The answer was based on what I found on one post to a forum on the internet that refers to the error "java.lang.NullPointerException" and the top line of the stack trace:

"com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:780)"

The poster said that they encountered this error when trying to deploy an enterprise (EAR) app to glassfish when it didn't have any EJBs in it. Their solution so they could test the web side of their app was to create a dummy EJB.

Well I had an EJB and I was calling it from the web app. So eventually after a lot of other thing I tried, I cleaned and built the web app on its own in NetBeans. Previously I was doing a clean and build from the top of the project itself... i.e. right clicking on the enterprise application node and selecting clean and build. This reported that the project built just fine.

HOWEVER, when I built the web app by itself it reported an ejb link error, and the build failed. Very strange that the build from the enterprise app didn't do this. Perhaps the build from the enterprise app only assembles the enterprise app from the ejb and web tiers, and assumes those have already been built with no errors. If not, this is a bug. If so, this should be labeled better because it is counter-intuitive to they way the GUI is laid out.

Anyway, after hunting around I realized that I had configured the ejb link in the XML config for a managed bean. I had also put an annotation in the managed bean when declaring the session bean. While I thought that any configuration from JEE 5 and on was supposed to simply override any annotation (that does the same functionality), evidently I was wrong, or wrong in this case.

I deleted the references to the managed bean from the config XML and the build of the web app completed cleanly. When I built the enterprise app it deployed just fine to the glassfish server, and after a few minor bug fixes, what I intended to build worked.

That's my story and I'm sticking to it.

Regards.
Back to top
jsy



Joined: 29 Apr 2010
Posts: 1
Location: Kazakhstan

PostPosted: Thu Apr 29, 2010 10:11 pm    Post subject: 2 theshowmecanuck: Thank you very much for your answer Reply with quote

I got the same error and broke my head with it. Happily I've found your decision and it helped me, so I would like to appreciate your insistence on resolving this problem.

In my case that was a web app refusing to deploy to GFv3 as from NetBeans 6.8 and directly from GF Administration Console. The server log' message is more than vague:

javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=31;_ThreadName=Thread-1;|Exception while deploying the app
java.lang.NullPointerException at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:780)

Finally it needs only to delete all the <ejb-local-ref> from the web.xml configuration file and - voila - it works fine.

With all my regards.
Back to top
OsakaVG



Joined: 02 May 2010
Posts: 1

PostPosted: Sun May 02, 2010 11:21 pm    Post subject: Reply with quote

jsy,

Thanks for that. Removing the reference to the EJB in the web.xml was all that I needed. As I was working my way through the tutorial as a first foray into Glassfish (at least as far as EJB3 is concerned) I wouldn't have got that one without some prompting.

D
Back to top
s-a-m



Joined: 26 Nov 2010
Posts: 1

PostPosted: Fri Nov 26, 2010 12:58 pm    Post subject: Reply with quote

I experienced identical problem today and thanks to you solved it. I have to add that I opened something like 100 pages while searching for answer and there was no answer to be found until I stumbled upon this thread.

Just want to thank you for posting solution and saving a truckload of my nerves and time. U rock.
Back to top
fvdnabee



Joined: 28 Jul 2011
Posts: 1

PostPosted: Thu Jul 28, 2011 12:28 pm    Post subject: Reply with quote

I too experienced the NPE, however this was during my own project and not during the javaee6 tutorial.
My stacktrace(so that others with the same problem might find this thread as well):
Code:
Exception while deploying the app [BronchoLab-ear]|#]

The log message is null.
java.lang.NullPointerException
   at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:779)
   at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:2004)
   at com.sun.enterprise.deployment.Application.visit(Application.java:1780)
   at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:799)
   at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:277)
   at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:240)
   at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:170)
   at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:93)
   at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:826)
   at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:768)
   at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:368)
   at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
   at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
   at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
   at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
   at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
   at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
   at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
   at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
   at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:465)
   at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:222)
   at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
   at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
   at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
   at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
   at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
   at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
   at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
   at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
   at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
   at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
   at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
   at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
   at java.lang.Thread.run(Thread.java:662)


Removing the <ejb-local-ref> entries in web.xml solved the NPE for me.
Apparently when I use netbeans to inject an EJB(ALT-Insert > Call enterprise bean) into a servlet it adds these ejb-local-ref entries to the web.xml instead of just using the simpler @EJB annotation(which doesn't require any configuration in web.xml).
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo