我有Spring Boot应用程序,我希望将它作为捆绑包部署在服务组合上。该应用程序使用soap服务,我想通过servicemix访问它们。
这是我的pom:
<modelVersion>4.0.0</modelVersion>
<groupId>com.myorg.cxf</groupId>
<artifactId>cxf-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>cxf-demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.1.11</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.8.11</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.bundlerepository</artifactId>
<version>2.0.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>CXF</Bundle-SymbolicName>
<Private-Package>com.myorg.cxf.cxfdemo*</Private-Package>
<Import-Package>
org.apache.felix.shell,
</Import-Package>
<Export-Package>
org.apache.felix.shell,
com.myorg.cxf.cxfdemo.service.MeterImpl,
org.springframework.boot,
com.myorg.cxf
</Export-Package>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
这是我公开服务的方式:
@Configuration
public class WebServiceConfig {
@Autowired
private Bus bus;
@Bean
public Endpoint endpointMeter() {
EndpointImpl endpoint = new EndpointImpl(bus, new MeterImpl());
endpoint.publish("/Meter");
return endpoint;
}}
这是我的应用程序属性:
server.port=8181
server.address=192.1.1.1
cxf.path=/cxf
现在,当我启动程序localy时,我可以看到我的服务处于活动状态:
所以现在当我尝试访问服务组合上的服务而不是看到我的服务时,我看到没有找到服务。
我的问题是:我的捆绑是否正确? 为什么我看不到我的服务在服务组合上是活跃的。