[resolved] NoClassDefFoundError when using Spring-Redis in Route

One Star

[resolved] NoClassDefFoundError when using Spring-Redis in Route

Hi all,
I'm having trouble, using Redis in my Route. So far I only have one cMessagingEndpoint component to avoid any other possiblie mistakes. I have added Spring-Redis to my dependency List and My URI is "spring-redis:/ip : port?auth=password".
I wanted to run this route to see if there are errors and here we go:
This is my console window output:
: org.apache.camel.main.MainSupport - Apache Camel 2.13.2 starting
: org.springframework.context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@140d59d0: startup date ; root of context hierarchy
: org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource
: org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5f6f1c5d: defining beans ; root of factory hierarchy
connecting to socket on port 3574
connected
: org.apache.camel.spring.SpringCamelContext - Apache Camel 2.13.2 (CamelContext: Test-ctx) is starting
: org.apache.camel.management.ManagedManagementStrategy - JMX is enabled
: org.apache.camel.impl.converter.DefaultTypeConverter - Loaded 179 type converters
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/dao/support/PersistenceExceptionTranslator
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.camel.component.redis.RedisComponent.createEndpoint(RedisComponent.java:31)
at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:123)
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:514)
at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:71)
at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:190)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:88)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:888)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:175)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:780)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:2068)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1816)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1683)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1651)
at org.apache.camel.main.Main.doStart(Main.java:110)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.main.MainSupport.run(MainSupport.java:147)
at test.test_0_1.Test.run(Test.java:204)
at test.test_0_1.Test.runJobInTOS(Test.java:290)
at test.test_0_1.Test.main(Test.java:251)
Caused by: java.lang.ClassNotFoundException: org.springframework.dao.support.PersistenceExceptionTranslator
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 35 more

I have no idea how to fix this. Every kind of helt is welcome Smiley Wink
Thx

Accepted Solutions
One Star

Re: [resolved] NoClassDefFoundError when using Spring-Redis in Route

There was missconfiguration for generated camel-spring-*-alldep Studio dependencies;
As workaround add spring-tx-3.2.4.RELEASE.jar using cConfig component (required only for Studio run)

All Replies
One Star

Re: [resolved] NoClassDefFoundError when using Spring-Redis in Route

There was missconfiguration for generated camel-spring-*-alldep Studio dependencies;
As workaround add spring-tx-3.2.4.RELEASE.jar using cConfig component (required only for Studio run)