users@glassfish.java.net

RE: Declaring singleton EJB in ejb-jar.xml

From: Shea, Daniel <Daniel.Shea_at_espn.com>
Date: Wed, 26 Jun 2013 19:47:45 +0000

Yes, I do.

From: Marina Vatkina [mailto:marina.vatkina_at_oracle.com]
Sent: Wednesday, June 26, 2013 3:35 PM
To: Shea, Daniel
Cc: Comerford, Sean; users_at_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.<init>(BaseContainer.java:782)
                at com.sun.ejb.containers.AbstractSingletonContainer.<init>(AbstractSingletonContainer.java:141)
                at com.sun.ejb.containers.CMCSingletonContainer.<init>(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_at_oracle.com<mailto:marina.vatkina_at_oracle.com>; users_at_glassfish.java.net<mailto:users_at_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 <marina.vatkina_at_oracle.com<mailto:marina.vatkina_at_oracle.com>>
Reply-To: "marina.vatkina_at_oracle.com<mailto:marina.vatkina_at_oracle.com>" <marina.vatkina_at_oracle.com<mailto:marina.vatkina_at_oracle.com>>
Date: Thu, 20 Jun 2013 14:34:16 -0400
To: "users_at_glassfish.java.net<mailto:users_at_glassfish.java.net>" <users_at_glassfish.java.net<mailto:users_at_glassfish.java.net>>
Cc: Sean Comerford <Sean.Comerford_at_espn.com<mailto:Sean.Comerford_at_espn.com>>
Subject: Re: Declaring singleton EJB in ejb-jar.xml
https://svn.java.net/svn/glassfish~svn/trunk/v2/appserv-tests/devtests/ejb/ejb31/full/schema/descriptor/ejb-jar.xml<https://svn.java.net/svn/glassfish%7Esvn/trunk/v2/appserv-tests/devtests/ejb/ejb31/full/schema/descriptor/ejb-jar.xml>
-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