-
Apr 14th, 2010, 05:23 AM
#1
Using an EJB as a remote destination
Greetings,
as a try, I wanted to use an EJB as a remote destination for BlazeDS (well, I don't know if it's out of topic for this forum).
In order to do that, I created a flex-servlet-context.xml with this partial content:
<bean id="_messageBroker" class="org.springframework.flex.core.MessageBroker FactoryBean"/>
<flex:remoting-destination ref="myService2" />
<flex:remoting-destination ref="ejbService" />
flex-servlet-context.xml is the configuration file for my blazeDS servlet.
Then, I created an xml configuration file for spring, and the following is its partial content:
<bean id="myService2" class="org.moonlight.service.MioService2">
<property name="dao" ref="myDAO"/>
</bean>
<bean id="ejbService" lazy-init="true"
class="org.springframework.ejb.access.LocalStatele ssSessionProxyFactoryBean">
<property name="jndiName" value="ejb/stringServices"/>
<property name="businessInterface" value="org.moonlight.ejb.stateless.StatelessString ServicesRemote"/>
</bean>
The 'myService2' works perfectly if I remove the ejb; instead, when I configure the EJB bean, I get the following error:
2010-04-02 15:18:07,717 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/trySpring]] (HDScanner) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.flex.remoting.RemotingDestina tionExporter#0': Cannot resolve reference to bean '_messageBroker' while setting bean property 'messageBroker'; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named '_messageBroker' is defined
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:106)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1299)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1061)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:511)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 89)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:286 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:188)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:543)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:730)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:387)
at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:270)
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47)
at org.apache.catalina.core.StandardContext.contextLi stenerStart(StandardContext.java:3926)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4447)
at org.jboss.web.tomcat.service.deployers.TomcatDeplo yment.performDeployInternal(TomcatDeployment.java: 315)
at org.jboss.web.tomcat.service.deployers.TomcatDeplo yment.performDeploy(TomcatDeployment.java:145)
at org.jboss.web.deployers.AbstractWarDeployment.star t(AbstractWarDeployment.java:462)
at org.jboss.web.deployers.WebModule.startModule(WebM odule.java:116)
at org.jboss.web.deployers.WebModule.start(WebModule. java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invok e(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation .java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Ab stractMBeanInvoker.java:271)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:670)
at org.jboss.system.microcontainer.ServiceProxy.invok e(ServiceProxy.java:206)
at $Proxy41.start(Unknown Source)
at org.jboss.system.microcontainer.StartStopLifecycle Action.installAction(StartStopLifecycleAction.java :53)
at org.jboss.system.microcontainer.StartStopLifecycle Action.installAction(StartStopLifecycleAction.java :41)
at org.jboss.dependency.plugins.action.SimpleControll erContextAction.simpleInstallAction(SimpleControll erContextAction.java:62)
...
at org.jboss.dependency.plugins.AbstractController.re solveContexts(AbstractController.java:1213)
at org.jboss.dependency.plugins.AbstractController.re solveContexts(AbstractController.java:1107)
at org.jboss.dependency.plugins.AbstractController.ch ange(AbstractController.java:918)
at org.jboss.dependency.plugins.AbstractController.ch ange(AbstractController.java:633)
at org.jboss.system.ServiceController.doChange(Servic eController.java:671)
at org.jboss.system.ServiceController.start(ServiceCo ntroller.java:443)
at org.jboss.system.deployers.ServiceDeployer.start(S erviceDeployer.java:189)
at org.jboss.system.deployers.ServiceDeployer.deploy( ServiceDeployer.java:102)
at org.jboss.system.deployers.ServiceDeployer.deploy( ServiceDeployer.java:49)
at org.jboss.deployers.spi.deployer.helpers.AbstractS impleRealDeployer.internalDeploy(AbstractSimpleRea lDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractR ealDeployer.deploy(AbstractRealDeployer.java:55)
at org.jboss.deployers.plugins.deployers.DeployerWrap per.deploy(DeployerWrapper.java:179)
at org.jboss.deployers.plugins.deployers.DeployersImp l.doDeploy(DeployersImpl.java:1660)
at org.jboss.deployers.plugins.deployers.DeployersImp l.doInstallParentFirst(DeployersImpl.java:1378)
at org.jboss.deployers.plugins.deployers.DeployersImp l.doInstallParentFirst(DeployersImpl.java:1399)
at org.jboss.deployers.plugins.deployers.DeployersImp l.doInstallParentFirst(DeployersImpl.java:1431)
at org.jboss.deployers.plugins.deployers.DeployersImp l.install(DeployersImpl.java:1319)
at org.jboss.dependency.plugins.AbstractControllerCon text.install(AbstractControllerContext.java:378)
at org.jboss.dependency.plugins.AbstractController.in stall(AbstractController.java:2029)
at org.jboss.dependency.plugins.AbstractController.in crementState(AbstractController.java:1050)
at org.jboss.dependency.plugins.AbstractController.ex ecuteOrIncrementStateDirectly(AbstractController.j ava:1289)
at org.jboss.dependency.plugins.AbstractController.re solveContexts(AbstractController.java:1213)
at org.jboss.dependency.plugins.AbstractController.re solveContexts(AbstractController.java:1107)
at
...
at org.jboss.system.server.profileservice.repository. MainDeployerAdapter.process(MainDeployerAdapter.ja va:117)
at org.jboss.system.server.profileservice.hotdeploy.H DScanner.scan(HDScanner.java:409)
at org.jboss.system.server.profileservice.hotdeploy.H DScanner.run(HDScanner.java:294)
at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndRe set(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(Future Task.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.access$101(ScheduledThreadPoolE xecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.runPeriodic(ScheduledThreadPool Executor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.run(ScheduledThreadPoolExecutor .java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named '_messageBroker' is defined
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanDefinition(DefaultListab leBeanFactory.java:490)
...........
... 82 more
I'm sure I missed something, but I'm a newbie.
Can you give me some advice?
Thank you.
-
Apr 18th, 2010, 12:05 PM
#2
Wish I could help. I am a newbie too...lol!!
Website Design & Development is my hobby
Minutes of Meeting is my product
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules