Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Exception when trying to use spring namespace handler in virgo
Exception when trying to use spring namespace handler in virgo [message #946856] Tue, 16 October 2012 15:10 Go to next message
Yousef Fadila is currently offline Yousef FadilaFriend
Messages: 14
Registered: October 2012
Junior Member
Hi

I have an OSGi bundle that extends the blueprint tags.I used to deploy it on equinox with spring framework and it works .

but deploying the same bundle on virgo doesn't work.

I got this exception :
<AG0000E> Application context creation failure for bundle 'com.att.tlv.bundles.svc-bundle' version '1.0.0'. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'service-lifecycle-module-id': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert value of type 'org.eclipse.gemini.blueprint.blueprint.container.SpringBlueprintContainer' to required type 'org.osgi.service.blueprint.container.BlueprintContainer'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.eclipse.gemini.blueprint.blueprint.container.SpringBlueprintContainer] to required type [org.osgi.service.blueprint.container.BlueprintContainer]: no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
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.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:60)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:325)
at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:290)
at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137)
at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert value of type 'org.eclipse.gemini.blueprint.blueprint.container.SpringBlueprintContainer' to required type 'org.osgi.service.blueprint.container.BlueprintContainer'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.eclipse.gemini.blueprint.blueprint.container.SpringBlueprintContainer] to required type [org.osgi.service.blueprint.container.BlueprintContainer]: no matching editors or conversion strategy found
at org.springframework.beans.SimpleTypeConverter.convertIfNecessary(SimpleTypeConverter.java:58)
at org.eclipse.gemini.blueprint.blueprint.container.SpringBlueprintConverterService.convert(SpringBlueprintConverterService.java:136)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:141)
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:447)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:499)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:493)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1371)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
... 16 common frames omitted
Caused by: java.lang.IllegalStateException: Cannot convert value of type [org.eclipse.gemini.blueprint.blueprint.container.SpringBlueprintContainer] to required type [org.osgi.service.blueprint.container.BlueprintContainer]: no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:93)
at org.springframework.beans.SimpleTypeConverter.convertIfNecessary(SimpleTypeConverter.java:49)
... 25 common frames omitted








Any Idea?

Yousef,

[Updated on: Sun, 21 October 2012 09:45]

Report message to a moderator

Re: Exception when trying to use spring namespace handler in virgo [message #952260 is a reply to message #946856] Sun, 21 October 2012 09:48 Go to previous messageGo to next message
Yousef Fadila is currently offline Yousef FadilaFriend
Messages: 14
Registered: October 2012
Junior Member
can this be caused because both user and kernel region have
org.eclipse.gemini.blueprint.core_1.0.0.RELEASE
org.eclipse.gemini.blueprint.extender_1.0.0.RELEASE
org.eclipse.gemini.blueprint.io_1.0.0.RELEASE

loaded?

and this error is actually a class cast exception ??

how could I affect the jars loaded in kernel?

Yousef
Re: Exception when trying to use spring namespace handler in virgo [message #968246 is a reply to message #952260] Fri, 02 November 2012 10:07 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
It's normal to have two copies of Gemini Blueprint in the kernel and user regions, respectively, so that shouldn't be the root cause.

When you say your bundle "extends the blueprint tags" what do you mean? Are you just using Blueprint "normally" or are you really adding to the Blueprint implementation, in which case you should be adding to the one in the user region.
Re: Exception when trying to use spring namespace handler in virgo [message #974734 is a reply to message #946856] Wed, 07 November 2012 09:30 Go to previous messageGo to next message
Yousef Fadila is currently offline Yousef FadilaFriend
Messages: 14
Registered: October 2012
Junior Member
Hi
doing some debugs I found that the blueprint container I got by injection is the one loaded by kernel, (have different class loader). casting failed in class cast exception.

moving to virgo nano web solve this problem for me but I am missing a lot of the tomcat server features,

Any idea?

Yousef
Re: Exception when trying to use spring namespace handler in virgo [message #974778 is a reply to message #974734] Wed, 07 November 2012 10:09 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Yousef Fadila wrote on Wed, 07 November 2012 09:30
Hi
doing some debugs I found that the blueprint container I got by injection is the one loaded by kernel, (have different class loader). casting failed in class cast exception.

That's really strange. Please could you raise a bug and attach a bundle I could use to reproduce that behaviour locally? On the face of it, it looks like a Virgo bug, so I'd like to dig into the issue to see if that's really the case.
Quote:

moving to virgo nano web solve this problem for me but I am missing a lot of the tomcat server features,

Any idea?

Yousef

Re: Exception when trying to use spring namespace handler in virgo [message #974919 is a reply to message #974778] Wed, 07 November 2012 12:46 Go to previous messageGo to next message
Yousef Fadila is currently offline Yousef FadilaFriend
Messages: 14
Registered: October 2012
Junior Member
I post a sample app in other post, here is it again
http://host4il.com/virgo/blueprint-test.zip

all what the app done is injecting the blueprint container,

maybe it worth you test it locally before raising a bug If I am the only one complain about this.

hope to hear from you soon.
Re: Exception when trying to use spring namespace handler in virgo [message #975116 is a reply to message #974919] Wed, 07 November 2012 16:08 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
After adding the EBR Maven repos to the pom.xml, I built your test bundle, started a fresh Virgo kernel, dropped the bundle in pickup and it started fine. serviceability/logs/log.log contains the bundle's output:

[2012-11-07 16:05:29.572] INFO  region-dm-1                  System.out                                                        bpc = org.eclipse.gemini.blueprint.blueprint.container.SpringBlueprintContainer 
[2012-11-07 16:05:29.572] INFO  region-dm-1                  System.out                                                        Beannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 


So the question now is: what are you doing differently?
Re: Exception when trying to use spring namespace handler in virgo [message #986421 is a reply to message #975116] Tue, 20 November 2012 11:24 Go to previous message
Yousef Fadila is currently offline Yousef FadilaFriend
Messages: 14
Registered: October 2012
Junior Member
Thanks for your efforts

This works for me too.. sorry I share with you a wrong test file. I will share another one that actually uses the blueprint container which works for me in equinox and failed in Virgo.


Previous Topic:cipango on virgo jetty server
Next Topic:Write log message in a single file - virgo - common - logging
Goto Forum:
  


Current Time: Fri Apr 26 06:15:44 GMT 2024

Powered by FUDForum. Page generated in 0.03175 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top