7 Replies Latest reply on Apr 27, 2011 3:39 AM by davsclaus

    camel-quickfix (2.6.0.fuse-01-09) not working

    vsathyamurthy

      Hello Folks,

       

         I am trying to run camel-quickfix with my example bundle. However I could not make it working. Any help would be ,uch appreciated.

       

      wrap_mvn_org.slf4j_slf4j-log4j13_1.0.1 (0)

      wrap_mvn_org.quickfixj.jmx_quickfixj-core_1.5.0 (0)

      wrap_mvn_org.hamcrest_hamcrest-core_1.2.1 (0)

      wrap_mvn_org.apache.mina_mina-core_1.1.7 (0)

      wrap_mvn_org.quickfixj_quickfixj-all_1.5.0 (0)

      wrap_mvn_junit_junit_4.8.2 (0)

      camel-quickfix (2.6.0.fuse-01-09)

      fixmsg (0.0.1.SNAPSHOT)

      karaf@root> start 347

      karaf@root> Exception in thread "SpringOsgiExtenderThread-10" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quickfix' defined in URL bundleentry://347.fwk2550265/META-INF/spring/fix-context.xml: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class or

      g.apache.camel.component.quickfixj.QuickfixjComponent

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)

              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:136)

              at java.lang.Thread.run(Thread.java:619)

      Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.camel.component.quickfixj.QuickfixjComponent

              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

              at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

              at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)

              at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)

              ... 15 more

       

      The below is my pom.xml of example for using quickfix component:

       

       

                <!-- bean method in charge to transform message into a QuickFix.Message ><!

                 

                ><! Quickfix engine who will send the FIX messages to the gateway -->

                 

       

      Edited by: vsathyamurthy on Apr 25, 2011 6:50 PM

       

      Edited by: vsathyamurthy on Apr 25, 2011 6:52 PM

        • 1. Re: camel-quickfix (2.6.0.fuse-01-09) not working
          ffang

          Hi,

           

          Could you post here the output of

           

          osgi:headers 347

           

          seems your customer bundle didn't import necessary package.

           

          Freeman

          • 2. Re: camel-quickfix (2.6.0.fuse-01-09) not working
            njiang

            Hi,

             

            It looks like your are using the wrap bundle, did you have a change to use the servicemix wrap one "org.apache.servicemix.bundles/org.apache.servicemix.bundles.quickfix/1.5.0_1"

             

            Willem

            • 3. Re: camel-quickfix (2.6.0.fuse-01-09) not working
              vsathyamurthy

              Hello Freeman,

               

                Here is the headers for 347.

               

              fixmsg (347)

              -


              Manifest-Version = 1.0

              Bnd-LastModified = 1303755206376

              Tool = Bnd-0.0.238

              Built-By = e513788

              Implementation-Version = 0.0.1-SNAPSHOT

              Build-Jdk = 1.5.0_22

              Implementation-Title = Fix Message Test Implementaion

              Created-By = Apache Maven Bundle Plugin

               

              Bundle-Name = fixmsg

              Bundle-Description = Fix Message testing.

              Bundle-SymbolicName = fix.test.fixmsg

              Bundle-Version = 0.0.1.SNAPSHOT

              Bundle-ManifestVersion = 2

               

              Import-Package =

                      org.apache.activemq.camel.component,

                      org.apache.camel,

                      org.apache.camel.component,

                      org.apache.camel.component.jms,

                      org.apache.camel.component.quickfixj;version=2.6.0.fuse-01-09,

                      org.apache.camel.component.quickfixj.converter;version=2.6.0.fuse-01-09,

                      org.apache.camel.model,

                      org.apache.camel.spring,

                      org.springframework.context,

                      org.springframework.context.support

              Export-Package =

                      fix.test.fixmsg

              • 4. Re: camel-quickfix (2.6.0.fuse-01-09) not working
                vsathyamurthy

                How to do servicemix wrap and what it is different from requilar wrap?

                 

                thanks

                Venkat

                • 5. Re: camel-quickfix (2.6.0.fuse-01-09) not working
                  vsathyamurthy

                  I tried apache servicemix quickfixj-all, and then install camel-quickfix features. no luck.

                   

                  Apache ServiceMix :: Bundles :: quickfixj-all (1.5.0.1)

                  camel-quickfix (2.6.0.fuse-01-09)

                  fixmsg (0.0.1.SNAPSHOT)

                  karaf@root> start 350

                  karaf@root> Exception in thread "SpringOsgiExtenderThread-16" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quickfix' defined in URL bundleentry://350.fwk2550265/META-INF/spring/fix-context.xml: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class or

                  g.apache.camel.component.quickfixj.QuickfixjComponent

                          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)

                          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)

                          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)

                          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:136)

                          at java.lang.Thread.run(Thread.java:619)

                  Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.camel.component.quickfixj.QuickfixjComponent

                          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

                          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

                          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

                          at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)

                          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)

                          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)

                          ... 15 more

                   

                  thanks

                  Venkat

                  • 6. Re: camel-quickfix (2.6.0.fuse-01-09) not working
                    ffang

                    Hi,

                     

                    Servicemix wrapped bundle OSGi-fied those jars which aren't OSGi friendly, through adding some OSGi metadata.

                     

                    You can do similar with wrap command, but simply use wrap only add some very basic OSGi metadata, in some complicated case, it's not enough, you have to append extra OSGi metadata directive file to the wrap command, which isn't a easy thing for end user.

                    Also, although you can use wrap command in development time, we don't recemmond that way during production run time, you should use the way provided by servicemix wrapped bundle.

                     

                    Freeman

                    • 7. Re: camel-quickfix (2.6.0.fuse-01-09) not working
                      davsclaus

                      Hi

                       

                      I have created a ticket at Apache to include an unit test in OSGi for QuickFix

                      https://issues.apache.org/jira/browse/CAMEL-3904

                       

                      Some frameworks are not too OSGi friendly so it can be a bit tricky to get it working. I guess QuickFix may be one of them.