部署Apache Camel应用程序时发出警告

时间:2014-09-04 12:17:47

标签: java glassfish apache-camel

当我将应用程序部署到GlassFish时,我看到以下警告:

WARN  AnnotationTypeConverterLoader  - Ignoring converter type: org.apache.activemq.camel.converter.ActiveMQMessageConverter as a dependent class could not be found: java.lang.NoClassDefFoundError: org/apache/camel/Processor java.lang.NoClassDefFoundError: org/apache/camel/Processor

该应用程序似乎按预期工作,但这个警告让我烦恼。我的POM中有以下内容:

    <properties>
         <camel-version>2.13.2</camel-version>
    </properties>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-core</artifactId>
        <version>${camel-version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-test</artifactId>
        <version>${camel-version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-aws</artifactId>
        <version>${camel-version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring</artifactId>
        <version>${camel-version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-jsonpath</artifactId>
        <version>${camel-version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-sql</artifactId>
        <version>${camel-version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-jms</artifactId>
        <version>${camel-version}</version>
    </dependency>

有谁知道可能导致此警告的原因?

这里是完整的堆栈跟踪:

[2014-09-18T16:10:46.762+0100] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=65 _ThreadName=Thread-13] [timeMillis: 1411053046762] [levelValue: 800] [[
  2014-09-18 16:10:46,760 [min-listener(5)] WARN  AnnotationTypeConverterLoader  - Ignoring converter type: org.apache.activemq.camel.converter.ActiveMQMesfooConverter as a dependent class could not be found: java.lang.NoClassDefFoundError: org/apache/camel/Processor
java.lang.NoClassDefFoundError: org/apache/camel/Processor
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
    at java.lang.Class.getDeclaredMethods(Class.java:1855)
    at org.apache.camel.impl.converter.AnnotationTypeConverterLoader.loadConverterMethods(AnnotationTypeConverterLoader.java:262)
    at org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:130)
    at org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:538)
    at org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:47)
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
    at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:2042)
    at org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:989)
    at org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:950)
    at org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:1244)
    at org.apache.camel.util.EndpointHelper.setProperties(EndpointHelper.java:249)
    at org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.java:272)
    at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:547)
    at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:123)
    at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:514)
    at org.apache.camel.builder.BuilderSupport.endpoint(BuilderSupport.java:347)
    at org.apache.camel.builder.BuilderSupport.deadLetterChannel(BuilderSupport.java:465)
    at com.foo.adapter.queue.consumer.builder.ConsumerRouteBuilder.configure(ConsumerRouteBuilder.java:44)
    at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:322)
    at org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:276)
    at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:262)
    at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:679)
    at org.apache.camel.core.xml.AbstractCamelContextFactoryBean.installRoutes(AbstractCamelContextFactoryBean.java:761)
    at org.apache.camel.core.xml.AbstractCamelContextFactoryBean.setupRoutes(AbstractCamelContextFactoryBean.java:311)
    at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:312)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:776)
    at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:485)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5362)
    at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:743)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5898)
    at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:356)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
    at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
    at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
    at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:196)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:173)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: org.apache.camel.Processor
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 82 more]]

2 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,我得到的错误是一样的。 我的错误是:

{
  "A": [
    {
      "sch_id": "738",
      "date": "1,7,15,25",
      "amount": "5000",
      "tenure": "1",
      "user_id": "1"
    },
    {
      "sch_id": "738",
      "date": "1,7,15,25",
      "amount": "5000",
      "tenure": "1",
      "user_id": "1"
    },
    {
      "sch_id": "738",
      "date": "1,7,15,25",
      "amount": "5000",
      "tenure": "1",
      "user_id": "1"
    }
  ]
}

你有与我的相同类型的错误:

Ignoring converter type: org.apache
.activemq.camel.converter.ActiveMQMessageConverter as a dependent class could not be found: java.lang.NoClassDefFoundErr
or: org/apache/camel/Processor

因此,要解决此问题,您需要添加 org.apache.activemq.camel.converter.ActiveMQMesfooConverter jar及其相关jar。

希望这会有所帮助......

答案 1 :(得分:0)

如果未安装camel-jms,而不是类路径等,则会发生此错误。

您是否可以验证camel-jms是否已正确解析和安装?检查一下罐子是不是以某种方式腐败了?

我在我的Play项目中遇到此问题,并将以下内容添加到build.sbt解决了问题:

"org.apache.camel" % "camel-jms" % "2.15.3",