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.
264 Active [ ] [ ]
60 wrap_mvn_org.slf4j_slf4j-log4j13_1.0.1 (0)
294 Active [ ] [ ]
60 wrap_mvn_org.quickfixj.jmx_quickfixj-core_1.5.0 (0)
326 Active [ ] [ ]
60 wrap_mvn_org.hamcrest_hamcrest-core_1.2.1 (0)
327 Active [ ] [ ]
60 wrap_mvn_org.apache.mina_mina-core_1.1.7 (0)
328 Active [ ] [ ]
60 wrap_mvn_org.quickfixj_quickfixj-all_1.5.0 (0)
329 Active [ ] [ ]
60 wrap_mvn_junit_junit_4.8.2 (0)
345 Active [ ] [ ]
60 camel-quickfix (2.6.0.fuse-01-09)
347 Resolved [ ] [ ]
60 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:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fix.test</groupId>
<artifactId>fixmsg</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>fixmsg</name>
<description>Fix Message testing.</description>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<servicemix.osgi.import>
org.apache.camel.component.quickfixj,org.apache.camel.component.quickfixj.converter,org.apache.camel.component.quickfixj*,
*
</servicemix.osgi.import>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-quickfix</artifactId>
<version>2.6.0-fuse-01-09</version>
<type>bundle</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Import-Package>org.apache.activemq.camel.component,org.apache.camel,org.apache.camel.component,org.apache.camel.component.jms,org.apache.camel.model,,org.apache.camel.spring,org.springframework.context,org.springframework.context.support,org.apache.camel.component.quickfixj,org.apache.camel.component.quickfixj.converter</Import-Package>
<Implementation-Title>Fix Message Test Implementaion</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
My Spring context:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<!-- lets configure the Camel ActiveMQ to use the ActiveMQ broker declared above -->
<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="brokerURL" value="tcp://localhost:61616"/>
</bean>
<!-- quickfix component -->
<bean id="quickfix" class="org.apache.camel.component.quickfixj.QuickfixjComponent">
<property name="engineSettings">
<util:map>
<entry key="quickfix:fixmsg" value-ref="quickfixjSettings"/>
</util:map>
</property>
</bean>
<!-- quickfix settings -->
<bean id="quickfixjSettings"
class="org.apache.camel.component.quickfixj.QuickfixjSettingsFactory">
<property name="defaultSettings">
<util:map>
<entry key="SocketConnectProtocol" value="VM_PIPE"/>
<entry key="SocketAcceptProtocol" value="VM_PIPE"/>
<entry key="UseDataDictionary" value="N"/>
</util:map>
</property>
<property name="sessionSettings">
<util:map>
<entry key="FIX.4.2:INITIATOR->ACCEPTOR">
<util:map>
<entry key="ConnectionType" value="initiator"/>
<entry key="SocketConnectHost" value="testhost.com"/>
<entry key="SocketConnectPort" value="8919"/>
</util:map>
</entry>
<entry key="FIX.4.2:ACCEPTOR->INITIATOR">
<util:map>
<entry key="ConnectionType" value="acceptor"/>
<entry key="SocketAcceptPort" value="8919"/>
</util:map>
</entry>
</util:map>
</property>
</bean>
<!-- lets configure the Camel ActiveMQ to use the ActiveMQ broker declared above -->
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="jms:queue:fix" />
<!-- bean method in charge to transform message into a QuickFix.Message --><!--
<bean ref="fixService" method="createFixMessage"/>
--><!-- Quickfix engine who will send the FIX messages to the gateway -->
<to uri="quickfix:META-INF/client.cfg"/>
</route>
<route>
<!-- QuickFix engine who will receive the message from FIX gateway -->
<from uri="quickfix:META-INF/server.cfg"/>
<!-- bean method parsing the QuickFix.Message -->
<!--<bean ref="fixService" method="parseFixMessage"/>
--><to uri="jms:queue:fix"/>
</route>
</camelContext>
</beans>
Edited by: vsathyamurthy on Apr 25, 2011 6:50 PM
Edited by: vsathyamurthy on Apr 25, 2011 6:52 PM