问题描述
我是 Fuse 世界的初学者,有些问题我无法解决,希望有人能帮助我。
我开发了 Redhate CodeRedy IDE 的 Fuse 项目(独立 - 在 EAP 和 spring Bean 上熔断 - spring DSL),这是我的 Camel 上下文 xml
1- jboss-camel-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<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 https://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring https://camel.apache.org/schema/spring/camel-spring.xsd">
<bean
class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer" id="bridgePropertyPlaceholder">
<property name="location" value="classpath:/properties/properties.properties"/>
</bean>
<camelContext id="spring-context" xmlns="http://camel.apache.org/schema/spring">
<route id="_route1">
<from id="_from1" uri="restlet:http://{{http.host}}:{{http.port}}/test"/>
<log id="_log1" message="Hello"/>
</route>
</camelContext>
</beans>
2- pom.xml
<?xml version="1.0" encoding="UTF-8"?
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>camel-test-spring</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Fuse on EAP Camel Spring Application</name>
<description>Fuse on EAP Camel Example using Spring</description>
<properties>
<version.jboss.arquillian>1.1.10.Final</version.jboss.arquillian>
<maven.compiler.source>1.8</maven.compiler.source>
<version.wildfly.arquillian>2.1.0.Final</version.wildfly.arquillian>
<server.config>standalone-camel.xml</server.config>
<version.maven.war.plugin>3.0.0</version.maven.war.plugin>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<version.wildfly.maven.plugin>1.2.0.Final</version.wildfly.maven.plugin>
<maven.compiler.target>1.8</maven.compiler.target>
<version.wildfly>7.1.0.GA-redhat-11</version.wildfly>
<version.maven.surefire.plugin>2.20.1</version.maven.surefire.plugin>
<jboss.home>${env.JBOSS_HOME}</jboss.home>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.maven.compiler.plugin>3.8.0</version.maven.compiler.plugin>
<fuse.version>7.8.0.fuse-sb2-780038-redhat-00001</fuse.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.redhat-fuse</groupId>
<artifactId>fuse-eap-bom</artifactId>
<version>7.8.0.fuse-sb2-780038-redhat-00001</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.23.2.fuse-780036-redhat-00001</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
<artifactId>jboss-servlet-api_3.1_spec</artifactId>
<version>1.0.0.Final-redhat-1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-restlet</artifactId>
<version>2.23.2.fuse-780036-redhat-00001</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>maven.restlet.org</id>
<name>maven.restlet.org</name>
<url>http://maven.restlet.org</url>
</repository>
<repository>
<id>jboss-public-repository</id>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>red-hat-ga-repository</id>
<url>https://maven.repository.redhat.com/ga</url>
</repository>
</repositories>
<build>
<testResources>
<testResource>
<filtering>true</filtering>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.maven.compiler.plugin}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>${version.maven.war.plugin}</version>
</plugin>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly.maven.plugin}</version>
<configuration>
<version>${version.wildfly}</version>
<serverConfig>${server.config}</serverConfig>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.maven.surefire.plugin}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>arq-managed</id>
<dependencies>
<dependency>
<groupId>org.restlet.jse</groupId>
<artifactId>org.restlet</artifactId>
<version>2.2-RC4</version>
</dependency>
<dependency>
<groupId>org.restlet.jse</groupId>
<artifactId>org.restlet.ext.simple</artifactId>
<version>2.2-RC4</version>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${version.wildfly.arquillian}</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>arq-remote</id>
<dependencies>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-remote</artifactId>
<version>${version.wildfly.arquillian}</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>jdk9+-build</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.3.0</version>
<exclusions>
<exclusion>
<artifactId>jaxb-api</artifactId>
<groupId>javax.xml.bind</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2.redhat-00001</version>
</dependency>
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-ws-Metadata_2.0_spec</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.1_spec</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.rmi</groupId>
<artifactId>jboss-rmi-api_1.0_spec</artifactId>
<version>1.0.5.Final-redhat-1</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>jdk12+-build</id>
<activation>
<jdk>[12,)</jdk>
</activation>
<properties>
<version.maven.war.plugin>3.2.2</version.maven.war.plugin>
</properties>
</profile>
</profiles>
</project>
现在我尝试在 EAP Fuse 服务器上部署此集成项目,但存在以下问题
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"LearningProject.war\".CamelContextActivationService.\"LearningProject.war\"" => "Cannot create camel context: LearningProject.war
Caused by: org.jboss.msc.service.StartException in anonymous service: Cannot start camel context: spring-context
Caused by: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route _route1: Route(_route1)[[From[restlet:http://{{http.host}}:{{http.por... because of Failed to resolve endpoint: restlet://http://localhost:8080/test due to: Cannot auto create component: restlet
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route _route1: Route(_route1)[[From[restlet:http://{{http.host}}:{{http.por... because of Failed to resolve endpoint: restlet://http://localhost:8080/test due to: Cannot auto create component: restlet
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: restlet://http://localhost:8080/test due to: Cannot auto create component: restlet
Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create component: restlet
Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create component: restlet
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.camel.component.restlet.RestletComponent': Bean instantiation via constructor Failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.restlet.RestletComponent]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/sun/net/httpserver/HttpHandler
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.restlet.RestletComponent]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/sun/net/httpserver/HttpHandler
Caused by: java.lang.NoClassDefFoundError: com/sun/net/httpserver/HttpHandler
Caused by: java.lang.classNotFoundException: com.sun.net.httpserver.HttpHandler from [Module \"deployment.LearningProject.war\" from Service Module Loader]"}}
我该如何解决这个问题???
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)