I try to use the Advanced JDBC Component by Spargic in Servicemix. When I
deploy the Component I get the following error:
<
loc-message>org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Class that bean class
[org.spagic.smx.components.jdbcquery.JDBCAdvancedQueryComponent] depends on not
found
Offending resource: file
[C:\apache-servicemix-3.2.2\data\smx\service-assemblies\tutorial-jdbc-sa\version_20\sus\servicemix-lwcontainer\tutorial-adv_jdbc-su\servicemix.xml]
Bean ''; nested exception is java.lang.NoClassDefFoundError:
org/springframework/jdbc/CannotGetJdbcConnectionException</loc-message>
Has someone an idea? In the following the steps I have done to configure it.
First I copied:
commons-dbutils-1.1.jar and mysql-connector-java-5.0.7-bin.jar to the lib/
directory
and spagic-advanced-jdbc-2.3.0.jar to the lib/optional directory of Servicemix
(like in Spagic).
In jndi.xml I added:
<entry key="java:comp/env/jdbc/servicemixDB">
<!-- <bean id="mysql-ds"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"> -->
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost/NameInfo"/>
<property name="user" value="user"/>
<property name="password" value="password"/>
</bean>
</entry>
Then I created a servicemix.xml file that looks like this:
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:foo="http://servicemix.apache.org/foo"
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://servicemix.apache.org/config/1.0
http://servicemix.apache.org/schema/servicemix-core-3.2.2.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!-- This is the Spring configuration of a datasource defined in
SERVICE_MIX_HOME/conf/jndi.xml -->
<bean id="mySql" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/servicemixDB"/>
</bean>
<classpath>
<location>.</location>
</classpath>
<sm:serviceunit id="jbi">
<!-- Put lw components here -->
<!-- Note that JDBC Endpoint declare a property ref to the dataSource
defined by the bean above -->
<!-- ####################### myJDBCdbAndrea ######################## -->
<sm:activationSpecs>
<sm:activationSpec componentName="myJdbcQueryadvJdbcDatasource2"
service="foo:myJdbcQueryadvJdbcDatasource2"
destinationService="foo:myScreenOutputadvJdbcDatasource2">
<sm:component>
<bean
class="org.spagic.smx.components.jdbcquery.JDBCAdvancedQueryComponent">
<property name="connConfig">
<bean
class="org.spagic.smx.components.jdbcquery.JDBCConnectionConfig">
<property name="datasource" ref="mysql"/>
</bean>
</property>
<property name="queryConfig">
<bean
class="org.spagic.smx.components.jdbcquery.JDBCQueryConfig">
<property name="query" value="SELECT * FROM user where
SecondName like $name" />
<property name="enrichMessage" value="TRUE" />
<property name="xmlEnvelope" value="Customer" />
<property name="queryParams">
<list>
<bean
class="org.spagic.smx.components.jdbcquery.QueryParameterConfig" >
<property name="placeHolder" value="name" />
<property name="outputParam" value="FALSE" />
<property name="XPath" value="/nameinfo/givenName" />
<property name="paramType" value="java.lang.String" />
</bean>
</list>
</property>
</bean>
</property>
</bean>
</sm:component>
</sm:activationSpec>
</sm:activationSpecs>
</sm:serviceunit>
</beans>
With mvn install I created my Service Assembly.
--
Dipl.-Ing. Berndt Sevcik
TU Wien
Institut für Computertechnik
Gußhausstraße 27-29/384 - 1040 Wien
Tel.: +43 1 58801 38436
Mail: [EMAIL PROTECTED]
URL: http://www.ict.tuwien.ac.at