Skip to main content

Re: Declaring singleton EJB in ejb-jar.xml

1 reply [Last post]
mvatkina
Offline
Joined: 2005-04-04
Points: 0

This NPE shouldn't be result of marking a singleton as a startup or
not... The NPE is really strange as it means there is a null
MethodDescriptor element in the collection. Do you have
metadata-complete set to true in your DD?

-marina

On 6/26/13 12:10 PM, Shea, Daniel wrote:
>
> Sure, the error I'm getting is included below, I haven't been able to
> find much relevant documentation on it, aside from this JIRA which
> doesn't go into the specifics of resolution.
>
> https://java.net/jira/browse/GLASSFISH-7243
>
> Thanks,
>
> Dan
>
> Exception while loading the app : EJB Container initialization error
>
> java.lang.NullPointerException
>
> at
> com.sun.enterprise.deployment.MethodDescriptor.getMethodDescriptorsOfName(MethodDescriptor.java:479)
>
> at
> com.sun.enterprise.deployment.MethodDescriptor.doStyleConversion(MethodDescriptor.java:452)
>
> at
> com.sun.enterprise.deployment.EjbDescriptor.convertMethodContainerTransactionsOfStyle(EjbDescriptor.java:1064)
>
> at
> com.sun.enterprise.deployment.EjbDescriptor.convertMethodContainerTransactions(EjbDescriptor.java:1050)
>
> at
> com.sun.enterprise.deployment.EjbDescriptor.getContainerTransactionFor(EjbDescriptor.java:1017)
>
> at
> com.sun.ejb.containers.BaseContainer.findTxAttr(BaseContainer.java:3599)
>
> at
> com.sun.ejb.containers.BaseContainer.processTxAttrForScheduledTimeoutMethod(BaseContainer.java:3647)
>
> at
> com.sun.ejb.containers.BaseContainer.initializeInvocationInfo(BaseContainer.java:3568)
>
> at com.sun.ejb.containers.BaseContainer.(BaseContainer.java:782)
>
> at
> com.sun.ejb.containers.AbstractSingletonContainer.(AbstractSingletonContainer.java:141)
>
> at
> com.sun.ejb.containers.CMCSingletonContainer.(CMCSingletonContainer.java:77)
>
> at
> com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:115)
>
> at
> org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:230)
>
> at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:299)
>
> at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:105)
>
> at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
>
> at
> org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:264)
>
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
>
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
>
> at
> org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
>
> at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:214)
>
> at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:207)
>
> at
> org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
>
> at
> com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
>
> at
> com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
>
> at
> com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
>
> at
> com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
>
> at
> com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
>
> at
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>
> at
> com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
>
> at
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>
> at
> com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
>
> at
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>
> at
> com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
>
> at
> com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)
>
> at
> com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)
>
> at
> org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:148)
>
> at
> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
>
> at
> com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
>
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
>
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
>
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
>
> at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
>
> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
>
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
>
> 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)
>
> |#]
>
> *From:*Comerford, Sean
> *Sent:* Wednesday, June 26, 2013 3:08 PM
> *To:* ; users@glassfish.java.net
> *Cc:* Shea, Daniel
> *Subject:* Re: Declaring singleton EJB in ejb-jar.xml
>
> Hi Marina,
>
> That got us a little further but we're still having issues declaring
> the Singleton Startup via the xml descriptor.
>
> Dan can you reply with the error you're seeing?
>
> ---
>
> Sean Comerford
>
> ESPN.com Architecture & Platforms
>
> *From: *Marina Vatkina >
> *Reply-To: *"marina.vatkina...
> " >
> *Date: *Thu, 20 Jun 2013 14:34:16 -0400
> *To: *"users@glassfish.java.net "
> >
> *Cc: *Sean Comerford >
> *Subject: *Re: Declaring singleton EJB in ejb-jar.xml
>
> https://svn.java.net/svn/glassfish~svn/trunk/v2/appserv-tests/devtests/e...
>
>
> -marina
>
> On 6/20/13 11:21 AM, Comerford, Sean wrote:
>
> Our basketball MDB ingest application uses the
> metadata-complete="true" attribute b/c it includes a "common" jar
> that contains @MesssageDriven annotated classes we don't want to
> run in this particular app.
>
> Hence we specify in the ejb-jar.xml file which MDBs we want to run.
>
> We're having a problem figuring out how to declare an @Startup
> @Singleton bean via the ejb-jar.xml.
>
> Can someone point me to an example for that?
>
> ---
>
> Sean Comerford
>
> ESPN.com Architecture & Platforms
>

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mvatkina
Offline
Joined: 2005-04-04
Points: 0

Then check that it is indeed a complete DD and all your data is present.

-marina

On 6/26/13 12:47 PM, Shea, Daniel wrote:
>
> Yes, I do.
>
> *From:*Marina Vatkina [mailto:marina.vatkina...]
> *Sent:* Wednesday, June 26, 2013 3:35 PM
> *To:* Shea, Daniel
> *Cc:* Comerford, Sean; users@glassfish.java.net
> *Subject:* Re: Declaring singleton EJB in ejb-jar.xml
>
> This NPE shouldn't be result of marking a singleton as a startup or
> not... The NPE is really strange as it means there is a null
> MethodDescriptor element in the collection. Do you have
> metadata-complete set to true in your DD?
>
> -marina
>
> On 6/26/13 12:10 PM, Shea, Daniel wrote:
>
> Sure, the error I'm getting is included below, I haven't been able
> to find much relevant documentation on it, aside from this JIRA
> which doesn't go into the specifics of resolution.
>
> https://java.net/jira/browse/GLASSFISH-7243
>
> Thanks,
>
> Dan
>
> Exception while loading the app : EJB Container initialization error
>
> java.lang.NullPointerException
>
> at
> com.sun.enterprise.deployment.MethodDescriptor.getMethodDescriptorsOfName(MethodDescriptor.java:479)
>
> at
> com.sun.enterprise.deployment.MethodDescriptor.doStyleConversion(MethodDescriptor.java:452)
>
> at
> com.sun.enterprise.deployment.EjbDescriptor.convertMethodContainerTransactionsOfStyle(EjbDescriptor.java:1064)
>
> at
> com.sun.enterprise.deployment.EjbDescriptor.convertMethodContainerTransactions(EjbDescriptor.java:1050)
>
> at
> com.sun.enterprise.deployment.EjbDescriptor.getContainerTransactionFor(EjbDescriptor.java:1017)
>
> at
> com.sun.ejb.containers.BaseContainer.findTxAttr(BaseContainer.java:3599)
>
> at
> com.sun.ejb.containers.BaseContainer.processTxAttrForScheduledTimeoutMethod(BaseContainer.java:3647)
>
> at
> com.sun.ejb.containers.BaseContainer.initializeInvocationInfo(BaseContainer.java:3568)
>
> at com.sun.ejb.containers.BaseContainer.(BaseContainer.java:782)
>
> at
> com.sun.ejb.containers.AbstractSingletonContainer.(AbstractSingletonContainer.java:141)
>
> at
> com.sun.ejb.containers.CMCSingletonContainer.(CMCSingletonContainer.java:77)
>
> at
> com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:115)
>
> at
> org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:230)
>
> at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:299)
>
> at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:105)
>
> at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
>
> at
> org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:264)
>
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
>
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
>
> at
> org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
>
> at
> com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
>
> at
> org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:214)
>
> at
> org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:207)
>
> at
> org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
>
> at
> com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
>
> at
> com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
>
> at
> com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
>
> at
> com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
>
> at
> com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
>
> at
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>
> at
> com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
>
> at
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>
> at
> com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
>
> at
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
>
> at
> com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
>
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
>
> at
> com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)
>
> at
> com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)
>
> at
> org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:148)
>
> at
> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
>
> at
> com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
>
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
>
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
>
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
>
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
>
> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
>
> at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
>
> 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)
>
> |#]
>
>
> *From:*Comerford, Sean
> *Sent:* Wednesday, June 26, 2013 3:08 PM
> *To:* marina.vatkina...
> ; users@glassfish.java.net
>
> *Cc:* Shea, Daniel
> *Subject:* Re: Declaring singleton EJB in ejb-jar.xml
>
> Hi Marina,
>
> That got us a little further but we're still having issues
> declaring the Singleton Startup via the xml descriptor.
>
> Dan can you reply with the error you're seeing?
>
> ---
>
> Sean Comerford
>
> ESPN.com Architecture & Platforms
>
> *From: *Marina Vatkina >
> *Reply-To: *"marina.vatkina...
> " >
> *Date: *Thu, 20 Jun 2013 14:34:16 -0400
> *To: *"users@glassfish.java.net "
> >
> *Cc: *Sean Comerford >
> *Subject: *Re: Declaring singleton EJB in ejb-jar.xml
>
> https://svn.java.net/svn/glassfish~svn/trunk/v2/appserv-tests/devtests/e...
>
>
> -marina
>
> On 6/20/13 11:21 AM, Comerford, Sean wrote:
>
> Our basketball MDB ingest application uses the
> metadata-complete="true" attribute b/c it includes a "common"
> jar that contains @MesssageDriven annotated classes we don't
> want to run in this particular app.
>
> Hence we specify in the ejb-jar.xml file which MDBs we want to
> run.
>
> We're having a problem figuring out how to declare an @Startup
> @Singleton bean via the ejb-jar.xml.
>
> Can someone point me to an example for that?
>
> ---
>
> Sean Comerford
>
> ESPN.com Architecture & Platforms
>