3 Replies Latest reply on Sep 28, 2007 6:21 PM by Andrew Rubinger

    Can't load @Service in JBoss 4.2.1

    Oskar Carlstedt Novice

      Hello!

      I asked this question in an earlier thread (http://www.jboss.com/index.html?module=bb&op=viewtopic&t=119784), but it is another topic so a new thread i better. So, the problem is when I deploy a simple POJO annotated @Service inside an ear-file.

      My implementation is as follows:
      ServiceReg.java

      @Service(objectName = "test:service=TEST")
      @Depends("jboss.ws:service=DeployerInterceptorEJB3")
      @Management(ServiceRegManagement.class)
      public class ServiceReg implements ServiceRegManagement {
      
       private String simpleProperty = null;
      
       public String getSimpleProperty() {
       return simpleProperty;
       }
      
       public void setSimpleProperty(String simpleProperty) {
       this.simpleProperty = simpleProperty;
       }
      
       // Lifecycle methods
       public void create() throws Exception {
       System.out
       .println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> RegService - Creating");
       }
      
       public void start() throws Exception {
       System.out
       .println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> RegService - Starting");
       }
      
       public void stop() {
       System.out
       .println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> RegService - Stopping");
       }
      
       public void destroy() {
       System.out
       .println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> RegService - Destroying");
       }
      
      }
      


      ServiceRegManagement.java
      public interface ServiceRegManagement {
      
      
       public String getSimpleProperty();
      
       public void setSimpleProperty(String simpleProperty);
      
      
       // Lifecycle methods
       void create() throws Exception;
      
       void start() throws Exception;
      
       void stop();
      
       void destroy();
      
      }
      


      When deploying these classes inside an ear file I get the following error from JBoss.
      11:16:25,931 INFO [EJBContainer] STARTED EJB: se.my.service.test.soapmessage.ServiceReg ejbName: Se
      rviceReg
      11:16:25,944 ERROR [STDERR] java.lang.RuntimeException: Problem registering @Management interface fo
      r @Service class se.my.service.test.soapmessage.ServiceReg
      11:16:25,946 ERROR [STDERR] at org.jboss.ejb3.service.ServiceContainer.registerManagementInterfa
      ce(ServiceContainer.java:560)
      11:16:25,948 ERROR [STDERR] at org.jboss.ejb3.service.ServiceContainer.start(ServiceContainer.ja
      va:155)
      11:16:25,949 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:16:25,950 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI
      mpl.java:39)
      11:16:25,952 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
      ccessorImpl.java:25)
      11:16:25,953 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      11:16:25,953 ERROR [STDERR] at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegat
      eWrapper.java:103)
      11:16:25,954 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMB
      eanSupport.java:289)
      11:16:25,955 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(Servi
      ceMBeanSupport.java:245)
      11:16:25,956 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      11:16:25,956 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
      ccessorImpl.java:25)
      11:16:25,967 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      11:16:25,968 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDisp
      atcher.java:155)
      11:16:25,969 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      11:16:25,970 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      11:16:25,980 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvo
      ker.java:264)
      11:16:25,981 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:6
      59)
      11:16:25,986 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceCon
      troller.java:978)
      11:16:25,987 ERROR [STDERR] at $Proxy0.start(Unknown Source)
      11:16:25,988 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:4
      17)
      11:16:25,988 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      11:16:25,989 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
      ccessorImpl.java:25)
      11:16:25,989 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      11:16:25,990 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDisp
      atcher.java:155)
      11:16:25,990 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      11:16:25,991 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      11:16:25,991 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvo
      ker.java:264)
      11:16:25,992 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:6
      59)
      11:16:25,992 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      11:16:25,993 ERROR [STDERR] at $Proxy80.start(Unknown Source)
      11:16:25,993 ERROR [STDERR] at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.
      java:120)
      11:16:25,994 ERROR [STDERR] at org.jboss.ejb3.Ejb3Deployment.registerEJBContainer(Ejb3Deployment
      .java:301)
      11:16:25,994 ERROR [STDERR] at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:362)
      11:16:25,995 ERROR [STDERR] at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
      11:16:25,995 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMB
      eanSupport.java:289)
      11:16:25,996 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(Servi
      ceMBeanSupport.java:245)
      11:16:25,996 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      11:16:25,997 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
      ccessorImpl.java:25)
      11:16:25,997 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      11:16:25,998 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDisp
      atcher.java:155)
      11:16:25,999 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      11:16:25,999 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      11:16:26,000 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvo
      ker.java:264)
      11:16:26,001 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:6
      59)
      11:16:26,002 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceCon
      troller.java:978)
      11:16:26,003 ERROR [STDERR] at $Proxy0.start(Unknown Source)
      11:16:26,004 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:4
      17)
      11:16:26,004 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      11:16:26,005 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
      ccessorImpl.java:25)
      11:16:26,005 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      11:16:26,006 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDisp
      atcher.java:155)
      11:16:26,007 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      11:16:26,007 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      11:16:26,008 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvo
      ker.java:264)
      11:16:26,009 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:6
      59)
      11:16:26,009 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      11:16:26,010 ERROR [STDERR] at $Proxy33.start(Unknown Source)
      11:16:26,010 ERROR [STDERR] at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
      11:16:26,011 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:16:26,011 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI
      mpl.java:39)
      11:16:26,011 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
      ccessorImpl.java:25)
      11:16:26,012 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      11:16:26,013 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDisp
      atcher.java:155)
      11:16:26,013 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      11:16:26,013 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInter
      ceptor.java:133)
      11:16:26,014 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      11:16:26,015 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(Mo
      delMBeanOperationInterceptor.java:142)
      11:16:26,016 ERROR [STDERR] at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterce
      ptor.java:97)
      11:16:26,016 ERROR [STDERR] at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(Interc
      eptorServiceMBeanSupport.java:238)
      11:16:26,017 ERROR [STDERR] at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(Deploye
      rInterceptor.java:87)
      11:16:26,017 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanIntercep
      tor.start(SubDeployerInterceptorSupport.java:188)
      11:16:26,018 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInt
      erceptor.java:95)
      11:16:26,019 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      11:16:26,019 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvo
      ker.java:264)
      11:16:26,020 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:6
      59)
      11:16:26,020 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      11:16:26,021 ERROR [STDERR] at $Proxy34.start(Unknown Source)
      11:16:26,021 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      11:16:26,021 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
      11:16:26,022 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      11:16:26,023 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      11:16:26,023 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
      11:16:26,024 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
      ccessorImpl.java:25)
      11:16:26,024 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      11:16:26,025 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDisp
      atcher.java:155)
      11:16:26,025 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      11:16:26,026 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInter
      ceptor.java:133)
      11:16:26,026 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      11:16:26,027 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(Mo
      delMBeanOperationInterceptor.java:142)
      11:16:26,028 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      11:16:26,028 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvo
      ker.java:264)
      11:16:26,029 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:6
      59)
      11:16:26,029 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      11:16:26,030 ERROR [STDERR] at $Proxy9.deploy(Unknown Source)
      11:16:26,030 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeplo
      ymentScanner.java:421)
      11:16:26,031 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploym
      entScanner.java:634)
      11:16:26,031 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThr
      ead.doScan(AbstractDeploymentScanner.java:263)
      11:16:26,033 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner.startServi
      ce(AbstractDeploymentScanner.java:336)
      11:16:26,034 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMB
      eanSupport.java:289)
      11:16:26,035 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(Servi
      ceMBeanSupport.java:245)
      11:16:26,035 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      11:16:26,036 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
      ccessorImpl.java:25)
      11:16:26,036 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      11:16:26,037 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDisp
      atcher.java:155)
      11:16:26,037 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      11:16:26,038 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      11:16:26,038 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvo
      ker.java:264)
      11:16:26,039 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:6
      59)
      11:16:26,039 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceCon
      troller.java:978)
      11:16:26,040 ERROR [STDERR] at $Proxy0.start(Unknown Source)
      11:16:26,041 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:4
      17)
      11:16:26,041 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      11:16:26,042 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
      ccessorImpl.java:25)
      11:16:26,042 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      11:16:26,043 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDisp
      atcher.java:155)
      11:16:26,043 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      11:16:26,044 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      11:16:26,044 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvo
      ker.java:264)
      11:16:26,045 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:6
      59)
      11:16:26,045 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      11:16:26,046 ERROR [STDERR] at $Proxy4.start(Unknown Source)
      11:16:26,047 ERROR [STDERR] at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
      11:16:26,047 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      11:16:26,048 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      11:16:26,049 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      11:16:26,050 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
      11:16:26,051 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:16:26,052 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI
      mpl.java:39)
      11:16:26,052 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
      ccessorImpl.java:25)
      11:16:26,053 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      11:16:26,053 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDisp
      atcher.java:155)
      11:16:26,062 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      11:16:26,062 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInter
      ceptor.java:133)
      11:16:26,063 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      11:16:26,064 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(Mo
      delMBeanOperationInterceptor.java:142)
      11:16:26,066 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      11:16:26,067 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvo
      ker.java:264)
      11:16:26,068 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:6
      59)
      11:16:26,069 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      11:16:26,070 ERROR [STDERR] at $Proxy5.deploy(Unknown Source)
      11:16:26,070 ERROR [STDERR] at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
      11:16:26,071 ERROR [STDERR] at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      11:16:26,071 ERROR [STDERR] at org.jboss.Main.boot(Main.java:200)
      11:16:26,072 ERROR [STDERR] at org.jboss.Main$1.run(Main.java:508)
      11:16:26,073 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
      11:16:26,075 ERROR [STDERR] Caused by: java.lang.NullPointerException
      11:16:26,075 ERROR [STDERR] at org.jboss.ejb3.service.ServiceContainer.registerManagementInterfa
      ce(ServiceContainer.java:539)
      11:16:26,076 ERROR [STDERR] ... 144 more
      11:16:26,082 INFO [EJBContainer] STOPPED EJB: se.nordnet.service.test.soapmessage.ServiceReg ejbNam
      e: ServiceReg
      


      I'm using JBoss 4.2.1.GA with JBossWS 2.0.1.GA.


      Thanks
      /Oskar