3 Replies Latest reply on Aug 5, 2010 3:06 AM by Heiko Braun

    Errai doesn't scan for services in war

    Marcin Misiewicz Newbie

      Hi

       

      I have an application packaged in ear. This is the structure of the ear directory (I deploy exploded archive) :

       

      drwxr-xr-x  lib
      drwxr-xr-x  META-INF
      drwxr-xr-x  businessClient.jar
      drwxr-xr-x  business.jar
      drwxr-xr-x  gui.war
      drwxr-xr-x  persistence.jar
      drwxr-xr-x  proxy.jar
      drwxr-xr-x  security.jar
      
      

       

      I have services both in business.jar and gui.war, but unfortunately errai recognize only services from business.jar. It doesn't recognize that gui.war also contains services. I have been trying to put ErraiApp.properties and ErraiService.properties to the main directory of war, to the WEB-INF directory and then to WEB-INF/classes. But none of them works.

       

      It seems that errai has some problems with searching for services within within war when it's packaged in the ear. Here are some logs :

       

      00:29:35,651 INFO  [org.jboss.resteasy.cdi.CdiInjectorFactory] Found BeanManager at java:comp/BeanManager
      00:29:36,646 INFO  [org.jboss.errai.bus.server.service.bootstrap.OrderedBootstrap] Bootstrap Errai
      00:29:36,666 INFO  [org.jboss.errai.bus.server.service.bootstrap.DefaultComponents] using dispatcher implementation: org.jboss.errai.bus.server.SimpleDispatcher
      00:29:36,685 INFO  [org.jboss.errai.bus.server.service.bootstrap.DefaultComponents] using session provider implementation: org.jboss.errai.bus.server.HttpSessionProvider
      00:29:36,701 INFO  [org.jboss.errai.bus.server.service.bootstrap.LoadExtensions] beging searching for Errai extensions ...
      00:29:36,708 INFO  [org.jboss.errai.bus.server.util.AbstractConfigBase] caching context '/home/misiek/dev/jboss-eas/server/default/deploy/smartoffice.ear/business.jar'
      

       

      As you can there are no information about caching context from gui.war.

       

      On the other hand when I move all services from business.jar to gui.war, remove ErraiApp.properties and ErraiService.properties from business.jar I get following exception :

       

      00:53:57,073 INFO  [org.jboss.resteasy.cdi.CdiInjectorFactory] Found BeanManager at java:comp/BeanManager
      00:53:58,528 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/smartoffice]] StandardWrapper.Throwable: com.google.inject.ProvisionException: Guice provision errors:
      
      1) Error injecting constructor, org.jboss.errai.bus.server.ErraiBootstrapFailure: Error reading from configuration. Did you include ErraiService.properties?
        at org.jboss.errai.bus.server.service.ErraiServiceConfiguratorImpl.<init>(ErraiServiceConfiguratorImpl.java:54)
        while locating org.jboss.errai.bus.server.service.ErraiServiceConfiguratorImpl
        while locating org.jboss.errai.bus.server.service.ErraiServiceConfigurator
          for parameter 1 at org.jboss.errai.bus.server.service.ErraiServiceImpl.<init>(ErraiServiceImpl.java:49)
        while locating org.jboss.errai.bus.server.service.ErraiServiceImpl<javax.servlet.http.HttpSession>
        while locating org.jboss.errai.bus.server.service.ErraiService<javax.servlet.http.HttpSession>
      
      1 error
           at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:767) [:]
           at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:789) [:]
           at org.jboss.errai.bus.server.servlet.AbstractErraiServlet.buildService(AbstractErraiServlet.java:77) [:1.1-SNAPSHOT]
           at org.jboss.errai.bus.server.servlet.AbstractErraiServlet.init(AbstractErraiServlet.java:61) [:1.1-SNAPSHOT]
           at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1208) [:6.0.0.20100721-M4]
           at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1108) [:6.0.0.20100721-M4]
           at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3628) [:6.0.0.20100721-M4]
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:3851) [:6.0.0.20100721-M4]
           at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310) [:6.0.0.20100721-M4]
           at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145) [:6.0.0.20100721-M4]
           at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461) [:6.0.0.20100721-M4]
           at org.jboss.web.deployers.WebModule.startModule(WebModule.java:116) [:6.0.0.20100721-M4]
           at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.0.0.20100721-M4]
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_20]
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_20]
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_20]
           at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_20]
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) [:6.0.0.Beta5]
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.Beta5]
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.Beta5]
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271) [:6.0.0.Beta5]
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670) [:6.0.0.Beta5]
           at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206) [:2.2.0.Alpha10]
           at $Proxy41.start(Unknown Source)     at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:53) [:2.2.0.Alpha10]
           at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:41) [:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:301) [:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.Alpha6]
           at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.Alpha6]
           at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.Alpha6]
           at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.20100721-M4]
           at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:130) [:0.1.0.Alpha1]
           at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:148) [:0.1.0.Alpha1]
           at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.1.0.Alpha1]
           at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.Alpha10]
           at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.Alpha10]
           at org.jboss.profileservice.dependency.ProfileServiceController.activate(ProfileServiceController.java:188) [:0.1.0.Alpha1]
           at org.jboss.profileservice.AbstractProfileService.activateProfile(AbstractProfileService.java:170) [:0.1.0.Alpha1]
           at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:117) [:0.1.0.Alpha1]
           at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:89) [:0.1.0.Alpha1]
           at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:97) [:0.1.0.Alpha1]
           at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:130) [:6.0.0.20100721-M4]
           at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.20100721-M4]
           at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
           at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
           at java.lang.Thread.run(Thread.java:619) [:1.6.0_20]
      

       

      As you can see it cannot find ErraiService.properties which is obviously present.

       

      Is it something wrong with my configuration or there is really problem with this ?

       

      Regards

      Marcin Misiewicz