Hi - I am getting exactly the same issue in Fuse ESB though i installed the
xmlbeans 2.3.0.

Issue related to Object instantiating in Fuse ESB/SMX container. I have got
a POJO which deals with XLSX files in my bundle and I installed the POI
related depenency bundles in container.

Status of  POI bundles:

[ 288] [Active     ] [            ] [       ] [   60] Apache ServiceMix ::
Bundles :: poi (3.9.0.2)         // it pulls required dependencies 
[ 329] [Active     ] [            ] [       ] [   60]
wrap_mvn_org.apache.poi_ooxml-schemas_1.1 (0)


I could see all the required classes are importing by 288.  But it gets
stopped while initialising the XSSFWorkbook class with out any error.

But - If I try to initialise the bean in my blueprint.xml like below then
the below exception will be thrown. Not sure why 288 is not importing the
classes from bundle 329 though I wrapped it.  I suspect the osgi wrap is not
working or the issue may be with the version as it showing "0" for bundle
329.

<bean id ="xssfWorkbook"
class="org.apache.poi.xssf.usermodel.XSSFWorkbook"/>  

Error:
org.osgi.service.blueprint.container.ComponentDefinitionException: Error
when instanciating bean xssfWorkbook of class class
org.apache.poi.xssf.usermodel.XSSFWorkbook
at
org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:333)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_45]
at
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:649)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:356)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:255)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(BlueprintExtender.java:325)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.blueprint.container.BlueprintExtender.bundleChanged(BlueprintExtender.java:243)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.blueprint.container.BlueprintExtender$BlueprintBundleTrackerCustomizer.modifiedBundle(BlueprintExtender.java:471)[8:org.apache.aries.blueprint.core:1.0.1.fuse-71-047]
at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:198)[10:org.apache.aries.util:1.0.0]
at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:128)[10:org.apache.aries.util:1.0.0]
at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:468)[10:org.apache.aries.util:1.0.0]
at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:161)[10:org.apache.aries.util:1.0.0]
at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:117)[10:org.apache.aries.util:1.0.0]
at
org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4479)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.Felix$4.run(Felix.java:2019)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
org.apache.felix.framework.Felix$5.run(Felix.java:2061)[org.apache.felix.framework-4.0.3.fuse-71-047.jar:]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)[:1.6.0_45]
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_45]
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)[:1.6.0_45]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)[:1.6.0_45]
at java.lang.Thread.run(Thread.java:680)[:1.6.0_45]
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook
at
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook$Factory.newInstance(Unknown
Source)
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.onWorkbookCreate(XSSFWorkbook.java:307)[288:org.apache.servicemix.bundles.poi:3.9.0.2]
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:167)[288:org.apache.servicemix.bundles.poi:3.9.0.2]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)[:1.6.0_45]
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)[:1.6.0_45]
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)[:1.6.0_45]
at
java.lang.reflect.Constructor.newInstance(Constructor.java:513)[:1.6.0_45]
at
org.apache.aries.blueprint.utils.ReflectionUtils.newInstance(ReflectionUtils.java:329)
at
org.apache.aries.blueprint.container.BeanRecipe.newInstance(BeanRecipe.java:962)
at
org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:331)

**************************************************

I also tried by installing the below POI bundles individually rather using
servicemix POI bundle. But it does not give any error but won't initialise
the XSSFWorkbook class.

osgi:install -s wrap:mvn:org.apache.poi/poi/3.9
osgi:install -s wrap:mvn:org.apache.poi/poi-ooxml/3.9
osgi:install -s wrap:mvn:org.apache.poi/poi-ooxml-schemas/3.9
osgi:install -s wrap:mvn:org.apache.poi/poi-scratchpad/3.9
osgi:install -s wrap:mvn:org.apache.xmlbeans/xmlbeans/2.3.0

**********************************************************************
Note:  If I run my POJO locally it functions perfectly. 

Could you suggest me your views on the issue please?





--
View this message in context: 
http://servicemix.396122.n5.nabble.com/Apache-Poi-3-7-component-tp4912054p5717609.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to