Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Mysterious service problem
Mysterious service problem [message #733651] Wed, 05 October 2011 05:59 Go to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
Hello everyone.

I have a weird problem related to a registered OSGi service that I have been poring over for a day now without finding my bug. I am wondering if anybody can spot the problem or give me a hint on how to continue to pursue it.

I have an OSGi service which I register with the registry via SpringDM. When I start things up, I can see the service being ready and available.

I then start 3 bundles which require this service: two of them find it (again via SpringDM) without a problem, but the third one claims the bean representing the service cannot be found and produces and exception.

All Spring declarative clauses and java code in the clients is exactly the same in the three cases.

Any high level hints on how to pursue this further?

TIA,
B.
Re: Mysterious service problem [message #733659 is a reply to message #733651] Wed, 05 October 2011 06:39 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
This sounds like a Spring DM bug, so it would be worth asking on the Gemini forum, but could you post the stack trace here in case it gives any clues.
Re: Mysterious service problem [message #733690 is a reply to message #733659] Wed, 05 October 2011 08:39 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
I can see that the DefaultListableBeanFactory class has a couple of service type beans in its beanDefinitionMap, but none of them has my given name, rather something like "org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean#0".

What am I missing here?

Anyway, so much for my musings. Here's the exception stack trace, Glyn:

Exception in thread "region-dm-1" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountopening' defined in URL [bundleentry://99.fwk518144827/META-INF/spring/workbench.accounts.accountopening-context.xml]: Cannot resolve reference to bean 'winmanService' while setting bean property 'winmanService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'winmanService' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'winmanService' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 20 more

Thanks!

[Updated on: Wed, 05 October 2011 09:06]

Report message to a moderator

Re: Mysterious service problem [message #733720 is a reply to message #733690] Wed, 05 October 2011 10:08 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
It is all working now.

I am not quite sure what the issue was, possibly some prior version of the bundle in question being stuck somewhere?

I just did two things:

1) I switched the clean flag on in my Virgo launch configuration (I thought it already was on, but apparently not)

2) I manually removed all application bundles from my Virgo installation and started it up in "virgin" configuration.

After having done these two things and having reloaded the necessary app bundles, it all started behaving properly.

Thanks anyway!
B.
Re: Mysterious service problem [message #733721 is a reply to message #733720] Wed, 05 October 2011 10:12 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
BTW, what does the "Start server with -clean option" correspond to exactly in the launch configuration?

I have checked the configuration and I can see the command line arg " -Fosgi.clean=true", but the arg always appears, regardless of the value of the flag in the Overview page of the Virgo editor.

Thanks,
B.
Re: Mysterious service problem [message #733735 is a reply to message #733721] Wed, 05 October 2011 10:37 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Glad your problem went away. It's always worth having a set of "dance steps" to try doing in those mystery situations to get back to the cleanest state possible.

osgi.clean cleans the Equinox state which is necessary for Virgo's current restart processing.

-clean in the shell scripts deletes the work directory, but I'm not sure precisely what the tooling does, presumably something similar.
Re: Mysterious service problem [message #733742 is a reply to message #733735] Wed, 05 October 2011 10:54 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
Thanks for the explanation, Glyn. I like the concept of "dance steps", that's exactly what it feels like! Very Happy
Re: Mysterious service problem [message #733753 is a reply to message #733742] Wed, 05 October 2011 11:01 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Some more dance steps in case you haven't been to classes.
Re: Mysterious service problem [message #734266 is a reply to message #733753] Fri, 07 October 2011 06:32 Go to previous message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-Schwartz
Messages: 448
Registered: July 2009
Senior Member
Very good, thanks! Razz
Previous Topic:Setting a Bundle cosuming Spring AOP
Next Topic:How to use locally cached bundles
Goto Forum:
  


Current Time: Fri Aug 01 10:17:00 EDT 2014

Powered by FUDForum. Page generated in 0.03572 seconds