卡拉夫骆驼推土机问题

时间:2018-07-02 14:43:32

标签: apache-camel karaf

我们正在运行带有骆驼2.21.0的Karaf 4.1.5

我有一个非常简单的测试方法来进行推土机映射。

Caused by: java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl not found by dozer [501]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639) ~[?:?]
at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80) ~[?:?]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:?]
at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1927) ~[?:?]
at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:978) ~[?:?]
at org.apache.camel.core.osgi.utils.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:47) ~[?:?]
at org.apache.camel.core.osgi.utils.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:69) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:?]
at javax.el.FactoryFinder.newInstance(FactoryFinder.java:87) ~[?:?]
at javax.el.FactoryFinder.find(FactoryFinder.java:197) ~[?:?]
at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:197) ~[?:?]
at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:168) ~[?:?]
at org.dozer.loader.xml.ELEngine.<init>(ELEngine.java:44) ~[?:?]
at org.apache.camel.converter.dozer.MapperFactory.configureBeanContainer(MapperFactory.java:162) ~[?:?]
at org.apache.camel.converter.dozer.MapperFactory.parseConfiguration(MapperFactory.java:98) ~[?:?]
at org.apache.camel.converter.dozer.MapperFactory.create(MapperFactory.java:56) ~[?:?]
at org.apache.camel.component.dozer.DozerEndpoint.initDozerBeanContainerAndMapper(DozerEndpoint.java:151) ~[?:?]
at org.apache.camel.component.dozer.DozerEndpoint.doStart(DozerEndpoint.java:115) ~[?:?]

使用maven-bundle-plugin构建一个包(将其用于其他一些没有问题的路由)并进行部署:

Caused by: java.lang.ClassCastException: com.sun.el.ExpressionFactoryImpl cannot be cast to javax.el.ExpressionFactory
at org.apache.camel.converter.dozer.MapperFactory.configureBeanContainer(MapperFactory.java:154) ~[?:?]
at org.apache.camel.converter.dozer.MapperFactory.parseConfiguration(MapperFactory.java:98) ~[?:?]
at org.apache.camel.converter.dozer.MapperFactory.create(MapperFactory.java:56) ~[?:?]
at org.apache.camel.component.dozer.DozerEndpoint.initDozerBeanContainerAndMapper(DozerEndpoint.java:151) ~[?:?]
at org.apache.camel.component.dozer.DozerEndpoint.doStart(DozerEndpoint.java:115) ~[?:?]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) ~[?:?]
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75) ~[?:?]
at org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:241) ~[?:?]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) ~[?:?]
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75) ~[?:?]
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60) ~[?:?]
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:104) ~[?:?]
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:90) ~[?:?]
at org.apache.camel.processor.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1472) ~[?:?]
at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:44) ~[?:?]
at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:31) ~[?:?]

我尝试将必需的类添加到Import-Package:     *; com.sun.el

然后导致 java.lang.ClassCastException:com.sun.el.E​​xpressionFactoryImpl无法转换为javax.el.E​​xpressionFactor

{{1}}

似乎推土机试图加载com.sun.el.E​​xpressionFactoryImpl,但是周围已经有一个javax.el.E​​xpressionFactoryImpl。

谁能给我一些指导,为什么带有骆驼2.21.0和骆驼推土机的香草卡拉夫4.1.5无法正常工作?

1 个答案:

答案 0 :(得分:0)

解决方案是升级到骆驼 2.22.0 。 如果您将com.sun.el包含在maven-bundle-plugin的“导入包”中,则Karaf 4.1.5 plus带骆驼推土机的骆驼2.22.0可以使用

<Import-Package>*;com.sun.el</Import-Package>
相关问题