views:

376

answers:

1

I've created a very simple "Enterprise Application" project with about 7 entity beans and one stateless session bean. I've also configured an instance of Glassfish v3 to run as my application server. Unfortunately, when I attempt to publish the EAR to Glassfish, I'm getting the following response:

SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
java.lang.NullPointerException
    at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:104)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
    at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:269)
    at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:79)
    at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:131)
    at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:129)
    at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:197)
    at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:206)
    at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:232)
    at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:129)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296)
    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:637)
+1  A: 

This NPE looks somehow close to Issue # 11387 (it's not exactly the same issue but it could be the same cause... or another bug in the deployment subcomponent). My suggestions would thus be to:

  1. Try with a recent nightly build (the mentioned issue has been fixed 3 days ago in the trunk and I didn't look closely enough to confirm it's completely unrelated).
  2. Fill a new issue with the stack trace and your ear ideally if the issue is still there.
Pascal Thivent
Where can I find the nightly builds? I checked http://download.java.net/glassfish/v3/nightly/ and the most recent build was from 2009-12-14.
bshacklett
@bshacklett Yeah, because v3 has been released. Nightly builds are for v3.1 now: http://download.java.net/glassfish/v3.1/nightly/
Pascal Thivent
@Pascal Thivent - Got it. Publishing is working for me now, so it looks like you were right on the money. Thank you. Do you have any idea how developing in this environment will affect deployment on a production v3 server? I'm guessing as long as I don't use any new features I should be in good shape?
bshacklett
@bshacklett Good. Regarding deployment on a production server, it's hard to say without testing and I'm not sure to get what you mean by "new features". Anyway, maybe 3.1 (with the bug fixes) will be out at this time. And BTW, the common way of recognizing a good answer is upvoting it ;)
Pascal Thivent
@Pascal Thivent - As for new features, I was guessing that 3.1 would support EJB3.1. Thanks for the etiquette tip. I thought marking the answer as accepted was just as good. I'll keep that in mind for the future.
bshacklett
@bashacklett GFv3 *is* a Java EE 6 container, it already supports EJB 3.1, JPA 2.0, Servlet 3.0, etc. So from a pure Java EE point of view, nothing with be added in GFv3.1, only "container features" like a JNDI browser (clustering was initially planned in 3.1 but this won't happen because of snoracle) and bug fixes. In other words, no need to worry about Java EE 6 features. And thanks for the upvote! (Just in case, have a look at http://meta.stackoverflow.com/questions/686/accepting-answer-without-upvoting).
Pascal Thivent