Version 1

    Hi all

     

    I'm quite newbie in the world of EJB's , and, even I suppose the EJB is not being found , I have this problem that I have no idea to solve . I'm facing a legacy code, so , I don't have the knowledge of where is everything, so I beg to be patient if something it's so obvious .

     

    The piece of code where the exception appears is the following one :

     

    @Override

    public <T> T getObjectFromGeneralComponent(String key, Class<T> clazz) {

            return configurationService.getObject(key, generalComponent, clazz);

    }

     

    the method uses a configurationService variable that is a proxy for an EJBLocator :

     

    Proxy for remote EJB StatelessEJBLocator{appName='core-configuration-management', moduleName='SystemConfigurationService', distinctName='', beanName='SystemConfigurationFileService', view='interface eu.ohim.fsp.core.configuration.SystemConfigurationServiceLocal'} )

     

    and this EJB configuration : 

     

    <jee:local-slsb id="systemConfigurationService"

      business-interface="eu.ohim.fsp.core.configuration.SystemConfigurationServiceInterface"

      jndi-name="${configuration.jndi.local.name}" resource-ref="false"

            cache-home="false" lookup-home-on-startup="false"

            environment-ref="jndiProperties" />

     

    that is in an EJB config file. The jndi-name argument is

     

    configuration.jndi.local.name=ejb:core-configuration-management/SystemConfigurationService//SystemConfigurationFileService!eu.ohim.fsp.core.configuration.SystemConfigurationServiceLocal

     

    and I'm sure that the configuration EJB is loaded because in the log Service appears as bean loaded

     

    jbossLog.PNG

    but it's not getting to the method . I receive the following stacktrace

     

    6:44:50,499 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-1) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'importService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private eu.ohim.fsp.tmefiling.ui.service.interfaces.LogoServiceInterface eu.ohim.fsp.tmefiling.ui.service.ImportService.logoService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logoService' defined in "/D:/devel/apps/jboss-as-7.1.1.Final/bin/content/fsp-tm-efiling.war/WEB-INF/classes/eu/ohim/fsp/tmefiling/ui/service/LogoService.class": Invocation of init method failed; nested exception is eu.ohim.fsp.common.FSPException: Failed to call the service

      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) [spring-context.jar:3.1.1.RELEASE]

      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) [spring-context.jar:3.1.1.RELEASE]

      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) [spring-web.jar:3.1.1.RELEASE]

      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) [spring-web.jar:3.1.1.RELEASE]

      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web.jar:3.1.1.RELEASE]

      at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]

      at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]

    Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private eu.ohim.fsp.tmefiling.ui.service.interfaces.LogoServiceInterface eu.ohim.fsp.tmefiling.ui.service.ImportService.logoService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logoService' defined in "/D:/devel/apps/jboss-as-7.1.1.Final/bin/content/fsp-tm-efiling.war/WEB-INF/classes/eu/ohim/fsp/tmefiling/ui/service/LogoService.class": Invocation of init method failed; nested exception is eu.ohim.fsp.common.FSPException: Failed to call the service

      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284) [spring-beans.jar:3.1.1.RELEASE]

      ... 21 more

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logoService' defined in "/D:/devel/apps/jboss-as-7.1.1.Final/bin/content/fsp-tm-efiling.war/WEB-INF/classes/eu/ohim/fsp/tmefiling/ui/service/LogoService.class": Invocation of init method failed; nested exception is eu.ohim.fsp.common.FSPException: Failed to call the service

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478) [spring-beans.jar:3.1.1.RELEASE]

      ... 23 more

    Caused by: eu.ohim.fsp.common.FSPException: Failed to call the service

      at eu.ohim.fsp.tmefiling.ui.ExceptionInterceptor.handleExceptionService(ExceptionInterceptor.java:41) [classes:]

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_07]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_07]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_07]

      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_07]

      at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) [spring-aop.jar:3.1.1.RELEASE]

      at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:603) [spring-aop.jar:3.1.1.RELEASE]

      at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:59) [spring-aop.jar:3.1.1.RELEASE]

      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop.jar:3.1.1.RELEASE]

      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) [spring-aop.jar:3.1.1.RELEASE]

      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop.jar:3.1.1.RELEASE]

      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) [spring-aop.jar:3.1.1.RELEASE]

      at $Proxy50.getFileuploadConfiguration(Unknown Source) at eu.ohim.fsp.tmefiling.ui.service.LogoService.afterPropertiesSet(LogoService.java:69) [classes:]

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) [spring-beans.jar:3.1.1.RELEASE]

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) [spring-beans.jar:3.1.1.RELEASE]

      ... 33 more

    Caused by: java.lang.IllegalStateException: No EJB receiver available for handling [appName:core-configuration-management,modulename:SystemConfigurationService,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@d9e285

      at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

      at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

      at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

      at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

      at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

      at $Proxy79.getObject(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_07]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_07]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_07]

      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_07]

      at org.springframework.ejb.access.LocalSlsbInvokerInterceptor.invokeInContext(LocalSlsbInvokerInterceptor.java:71) [spring-context.jar:3.1.1.RELEASE]

      at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.invoke(AbstractSlsbInvokerInterceptor.java:189) [spring-context.jar:3.1.1.RELEASE]

      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop.jar:3.1.1.RELEASE]

      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) [spring-aop.jar:3.1.1.RELEASE]

      at $Proxy36.getObject(Unknown Source) at eu.ohim.fsp.tmefiling.ui.service.ConfigurationServiceDelegator.getObjectFromGeneralComponent(ConfigurationServiceDelegator.java:252) [classes:]

      at eu.ohim.fsp.tmefiling.ui.service.ConfigurationServiceDelegator.getFileuploadConfiguration(ConfigurationServiceDelegator.java:292) [classes:]

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_07]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_07]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_07]

      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_07]

      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) [spring-aop.jar:3.1.1.RELEASE]

      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) [spring-aop.jar:3.1.1.RELEASE]

      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) [spring-aop.jar:3.1.1.RELEASE]

      at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55) [spring-aop.jar:3.1.1.RELEASE]

      ... 41 more

     

    LogoService is the class that can't be instantiated due this errors .

     

    I'm a bit lost . Does anybody see something it's wrong ? or something I should check ? maybe there's something missing . I don't know . I hope you can help me . I'm almost sure the problem is that the EJB is not being found , but how can I solve this issue ? .

     

    Regards