Exception seen while TomEE start up

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Exception seen while TomEE start up

Dignesh
Hi,
I am using TomEE 7.0.2.

To get a defined startup order we use an application.xml including <initialize-in-order>true</initialize-in-order> tag.
We are using Jersey as JAX-RS provider.
We have written a custom class in a war (B.war) which extends the resource config of jersey.we are doing an ejb look up from the custom class, which is failing. - Reason my beans are not initailzed at this moment.
My webApp (B.war) will be initialised only after the beans are initialised.
Looks like openejb is matching the resource config during the start up and I see the below error in my log file. After this error I see my beans are initialised.



media ->  09:33:05,535 ERROR [BaseServices] Unhandled exception:javax.naming.NameNotFoundException: Name [java:global/dignesh/dignesh-ejb/SystemBean!com.dignesh.system.interfaces.SystemServiceLocal] is not bound in this Context. Unable to find [java:global].
media ->  09:33:05,568 ERROR [LogUtils]
Exception Stack Trace:
com.dignesh.common.exception.CustomException: An error occurred attempting to execute an ejb call.
        at com.dignesh.common.services.BaseServices.executeEjbMethod(BaseServices.java:247)
        at com.dignesh.system.services.SystemServices.retreivesetting(SystemServices.java:142)
        at com.dignesh.common.prefs.TPrefJApi.getValue(TPrefJApi.java:307)
        at com.dignesh.common.prefs.Tpef.TPrefGetString(Tpef.java:106)
        at com.dignesh.common.prefs.Settings.getPreference(Settings.java:103)
        at dignesh.learning.restapi.core.RestAPIApplication.<init>(RestAPIApplication.java:42)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at java.lang.Class.newInstance(Class.java:374)
        at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:2237)
        at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:2022)
        at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:383)
        at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:420)
        at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:1037)
        at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:856)
        at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:547)
        at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:634)
        at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:503)
        at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:482)
        at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
        at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:247)
        at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:168)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:395)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:108)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:606)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:629)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
Caused by: javax.naming.NameNotFoundException: Name [java:global/dignesh/dignesh-ejb/SystemBean!com.dignesh.system.interfaces.SystemServiceLocal] is not bound in this Context. Unable to find [java:global].



Reply | Threaded
Open this post in threaded view
|

Re: Exception seen while TomEE start up

Romain Manni-Bucau
Hi

Application needs to be instantiated during scanning (before actual
deployment) to be able to enrich the getClasses even without cdi. just
don't use the constructor but a lazy init there.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-03-25 5:16 GMT+01:00 Dignesh <[hidden email]>:

> Hi,
> I am using TomEE 7.0.2.
>
> To get a defined startup order we use an application.xml including
> <initialize-in-order>true</initialize-in-order> tag.
> We are using Jersey as JAX-RS provider.
> We have written a custom class in a war (B.war) which extends the resource
> config of jersey.we are doing an ejb look up from the custom class, which
> is
> failing. - Reason my beans are not initailzed at this moment.
> My webApp (B.war) will be initialised only after the beans are initialised.
> Looks like openejb is matching the resource config during the start up and
> I
> see the below error in my log file. After this error I see my beans are
> initialised.
>
>
>
> media ->  09:33:05,535 ERROR [BaseServices] Unhandled
> exception:javax.naming.NameNotFoundException: Name
> [java:global/dignesh/dignesh-ejb/SystemBean!com.dignesh.system.interfaces.
> SystemServiceLocal]
> is not bound in this Context. Unable to find [java:global].
> media ->  09:33:05,568 ERROR [LogUtils]
> Exception Stack Trace:
> com.dignesh.common.exception.CustomException: An error occurred attempting
> to execute an ejb call.
>         at
> com.dignesh.common.services.BaseServices.executeEjbMethod(
> BaseServices.java:247)
>         at
> com.dignesh.system.services.SystemServices.retreivesetting(
> SystemServices.java:142)
>         at com.dignesh.common.prefs.TPrefJApi.getValue(TPrefJApi.java:307)
>         at com.dignesh.common.prefs.Tpef.TPrefGetString(Tpef.java:106)
>         at
> com.dignesh.common.prefs.Settings.getPreference(Settings.java:103)
>         at
> dignesh.learning.restapi.core.RestAPIApplication.<init>(
> RestAPIApplication.java:42)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(
> NativeConstructorAccessorImpl.java:57)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:45)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>         at java.lang.Class.newInstance(Class.java:374)
>         at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(
> AnnotationDeployer.java:2237)
>         at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(
> AnnotationDeployer.java:2022)
>         at
> org.apache.openejb.config.AnnotationDeployer.deploy(
> AnnotationDeployer.java:383)
>         at
> org.apache.openejb.config.ConfigurationFactory$Chain.
> deploy(ConfigurationFactory.java:420)
>         at
> org.apache.openejb.config.ConfigurationFactory.configureApplication(
> ConfigurationFactory.java:1037)
>         at
> org.apache.openejb.config.ConfigurationFactory.configureApplication(
> ConfigurationFactory.java:856)
>         at
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(
> ConfigurationFactory.java:547)
>         at
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(
> ConfigurationFactory.java:634)
>         at
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(
> Assembler.java:503)
>         at
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:482)
>         at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
>         at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
>         at
> org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:247)
>         at
> org.apache.tomee.catalina.ServerListener.lifecycleEvent(
> ServerListener.java:168)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(
> LifecycleBase.java:94)
>         at
> org.apache.catalina.util.LifecycleBase.setStateInternal(
> LifecycleBase.java:395)
>         at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:108)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:606)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:629)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
> Caused by: javax.naming.NameNotFoundException: Name
> [java:global/dignesh/dignesh-ejb/SystemBean!com.dignesh.system.interfaces.
> SystemServiceLocal]
> is not bound in this Context. Unable to find [java:global].
>
>
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Exception-seen-while-TomEE-start-up-tp4681375.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>