【发布时间】:2015-12-06 12:48:25
【问题描述】:
我正在使用以下命令使用 maven 创建一个基于 spring 的包
mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes -DarchetypeArtifactId=camel-archetype-spring -DarchetypeVersion=2.15.3 -DgroupId=osgiSpring -DartifactId=osgiSpring -Dversion=1.0-SNAPSHOT -Dpackage=osgiSpring
然后我将这个 maven 项目导入到 Eclipse 中,只需将“camel-context.xml”更改为
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2005-2014 Red Hat, Inc.
Red Hat 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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="file:C:\input"/>
<to uri="file:C:\output"/>
</route>
</camelContext>
</beans>
之后我使用“mvn package”构建它,然后将生成的 jar 复制到 Apache Karafs 的部署文件夹中,但 karaf 似乎无法识别这个包。
当我使用 'mvn:camel run' 运行它时,它工作得很好。
它还适用于带有 Activator 的非基于弹簧的捆绑包。
【问题讨论】:
-
您可以在日志中发布错误吗?
-
如果我有一个我会的......正如我所说的,在将该 jar 复制到部署文件夹后绝对没有任何反应
-
好吧,没有日志,我所能建议的就是尝试这里所说的,在 wrap deployer karaf.apache.org/manual/latest-2.2.x/users-guide/deployer.html 可能问题是不适合 karaf 的工件,但无济于事它关于应该使用哪个工件。
标签: spring maven apache-camel osgi apache-karaf