`

servicemix 3安装及cxf-bc组件代理webservice服务

阅读更多
目录
1.servicemix安装

2.eclipse创建webservice服务

3.eclipse创建集成插件(servicemix-cxf-bc和servicemix-service-assembly)

4.部署集成

5.遇到问题及总结


正文
1.servicemix安装
下载servicemix:
http://archive.apache.org/dist/servicemix/servicemix-3/3.4.1/apache-servicemix-3.4.1.zip

解压到某个路径下,如:D:\service\apache-servicemix-3.4.1

配置系统变量 SERVICEMIX_HOME=D:\service\apache-servicemix-3.4.1

进入bin目录下,运行servicemix.bat便可启动servicemix





2.eclipse创建webservice服务HelloWorld
具体见:http://newjava-sina-cn.iteye.com/blog/2358505



3.eclipse创建集成插件
本实例用到的maven版本为3.3.1,由于maven服务器在国外比较慢。这里首先将私服设置为阿里云,速度相比国外服务器快很多。
具体可见:http://newjava-sina-cn.iteye.com/blog/2358139

3.1 配置maven servicemix的archetype
如果没有servicemix的archetype,需配置本地archetype

配置servicemix的archetypes:
windows->Preferences->maven->archetypes  添加本地archetypes

具体配置内容见附件:<servicemix的archetype配置>



默认情况下,servicemix-project-root版本只有最新版
取消勾选左下方的show the last version of archetype only即可看到其他版本



3.2 创建名为servicemix-cxf-bc-demo的servicemix-project-root




3.3 在根项目下创建名为cxf-bc-su-demo的servicemix-cxf-bc-service-unit
3.3.1 创建servicemix-cxf-bc-service-unit






如果出现以下错误:
Could not resolve archetype org.apache.servicemix.tooling:servicemix-cxf-bc-service-unit:2013.01 from any of the configured repositories
查看repo/org/apache/servicemix/tooling/servicemix-cxf-bc-service-unit/2013.01文件夹下面是否有未下载完或中断的文件,如下



删除2013.01文件夹,重新创建maven module,成功下载jar




创建成功后,可能pom.xml的jbi-maven-plugin插件处肯能报:
Plugin execution not covered by lifecycle configuration: org.apache.servicemix.tooling:jbi-maven-plugin:3.2.3:generate-jbi-service-assembly-descriptor (execution: default-generate-jbi-service-assembly-descriptor, phase: generate-resources)

解决如下:
配置windows-preferences-maven-lifecycle mappings,打开文件设置如下,如果有其他内容,添加

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
    <pluginExecutions>
   
        <pluginExecution>
            <pluginExecutionFilter>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>jbi-maven-plugin</artifactId>
                <goals>
                    <goal>generate-depends-file</goal>
<goal>generate-jbi-service-unit-descriptor</goal>
<goal>generate-jbi-service-assembly-descriptor</goal>
                </goals>
                <versionRange>[3.2.3,)</versionRange>
            </pluginExecutionFilter>
            <action>
                <ignore />
            </action>
        </pluginExecution>
       
    </pluginExecutions>
</lifecycleMappingMetadata> 

配置完成后,点击"reload workspace lifecycle mapping metadata"



3.3.2 配置代理路径及属性
删除src/main/resources/service.wsdl文件,将HelloWorld项目下WebContent/wsdl/HelloWorld.wsdl文件拷贝到cxf-bc-su-demo/resources目录下,并修改如下:
原配置:
<wsdl:service name="HelloWorldService">  
  
      <wsdl:port binding="impl:HelloWorldSoapBinding" name="HelloWorld">  
  
         <wsdlsoap:address location="http://localhost:8080/HelloWorld/services/HelloWorld"/>  
  
      </wsdl:port>  
  
   </wsdl:service>  


修改后:
<wsdl:service name="HelloWorldServiceProxy">  
  
      <wsdl:port binding="impl:HelloWorldSoapBinding" name="HelloWorldProxy">  
  
         <wsdlsoap:address location="http://localhost:8193/HelloWorld/"/>  
  
      </wsdl:port>  
  
   </wsdl:service>


修改resources目录下的xbean.xml文件如下
<cxfbc:consumer wsdl="classpath:HelloWorld.wsdl"  
        service="ws:HelloWorldServiceProxy" endpoint="ws:HelloWorldProxy"
        targetEndpoint="ws:HelloWorld" targetService="ws:HelloWorldService" />  

    <cxfbc:provider  
        wsdl="http://localhost:8080/HelloWorld/services/HelloWorld?wsdl"  
        service="ws:HelloWorldService" endpoint="ws:HelloWorld" />

并在xbean.xml中添加webservice的命名空间,否则启动时找不到服务
xmlns:ws="http://ws.bill.com"






3.4 在根项目下创建名为cxf-bc-sa-demo的servicemix-service-assembly
3.4.1 创建servicemix-service-assembly






3.4.2 配置pom.xml
添加如下依赖:
<dependency>
     <groupId>org.apache.servicemix.samples</groupId>
     <artifactId>cxf-bc-su-demo</artifactId>
     <version>0.0.1-SNAPSHOT</version>
     <type>jbi-service-unit</type>
    </dependency>

4. 部署集成
在项目跟目录下,执行mvn install
如果BUILD SUCCESS  刷新后,将servicemix-cxf-bc-demo/cxf-bc-sa-demo/target/cxf-bc-sa-demo-0.0.1-SNAPSHOT.jar拷贝到ServiceMix-Home/hotdeloy目录下

右键压缩文件打开 cxf-bc-sa-demo-0.0.1-SNAPSHOT.jar ,如果里面只有一个zip文件。将servicemix-cxf-bc-demo/cxf-bc-su-demo/target/cxf-bc-su-demo-0.0.1-SNAPSHOT.jar拷贝至ServiceMix-Home/hotdeloy目录下,并拖入cxf-bc-sa-demo-0.0.1-SNAPSHOT.jar中




启动servicemix.bat,并访问http://localhost:8193/HelloWorld/?wsdl





5.遇到问题及总结
1.Plugin execution not covered by lifecycle configuration
通过网上拼凑起来的知识点来看,是由于m2e不能识别第三方插件的goal(如:generate-jbi-service-unit-descriptor等),m2e能够自动识别一些常见的goal(如:compile,install等),所以不用在windows-preferences-maven-lifecycle mappings做配置

但是这个错,并不影响最终的mvn install。所以个人以为,不配置也可以,请读者自己调试

2.对于第一个问题,也可以在<plugins/>标签外,套一层<pluginManagement/>,此时pom.xml前面几行可能报org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration) pom.xml
具体解决方案可参看:
http://stackoverflow.com/questions/37555557/m2e-error-in-mavenarchiver-getmanifest



相关博客:
servicemix 7安装使用及camel-cxf代理webservice:
http://newjava-sina-cn.iteye.com/blog/2359797



参考网站:
http://blog.csdn.net/xue1225go/article/details/4922018

http://blog.163.com/xh_ding/blog/static/1939032892015222368827

http://www.xuehuile.com/blog/c2505fa6aeb3417eae8b680df1d99ec5.html

http://stackoverflow.com/questions/21076179/pkix-path-building-failed-and-unable-to-find-valid-certification-path-to-requ





  • 大小: 45.5 KB
  • 大小: 68.8 KB
  • 大小: 48.8 KB
  • 大小: 17.6 KB
  • 大小: 15.5 KB
  • 大小: 118.8 KB
  • 大小: 65.8 KB
  • 大小: 52 KB
  • 大小: 52 KB
  • 大小: 48.3 KB
  • 大小: 41.6 KB
  • 大小: 41.9 KB
  • 大小: 62.8 KB
  • 大小: 83.9 KB
  • 大小: 77.7 KB
  • 大小: 62.5 KB
  • 大小: 50.9 KB
  • 大小: 74 KB
  • 大小: 66.1 KB
  • 大小: 77.2 KB
  • 大小: 32.6 KB
  • 大小: 41.7 KB
  • 大小: 52.4 KB
  • 大小: 73.5 KB
  • 大小: 56.7 KB
  • 大小: 89.9 KB
  • 大小: 41.1 KB
分享到:
评论

相关推荐

    servicemix 7安装使用及camel-cxf代理webservice

    【标题】:“servicemix 7安装使用及camel-cxf代理webservice”涉及的知识点主要涵盖Apache ServiceMix 7的安装配置、Apache Camel和Apache CXF的集成使用,以及如何利用它们来代理Web服务。 Apache ServiceMix是...

    org.apache.servicemix.bundles.spring-jdbc-3.2.8.RELEASE_2.zip

    Apache ServiceMix 是一个基于 OSGi 的企业级服务混合体,它整合了多个开源组件,如 Spring、CXF、Camel 等,提供了一个灵活的平台来构建和部署分布式应用程序。Spring JDBC 是 Spring 框架的一部分,专门用于简化 ...

    CXF-WebService-开发指南、技术文档.docx

    【CXF WebService 开发指南】 CXF(Commons eXtensible Framework)是一个开源的Java框架,主要用于构建和开发Web服务。它提供了强大的服务实现和客户端调用能力,支持多种协议和规范,如JAX-WS、JAX-RS等。本指南...

    apache-cxf-3.3.4

    XF支持的特性非常广泛,但特性主要在以下一些方面: 支持的Web服务标准包括: SOAP ...ServiceMix或其他JBI容器 Geronimo或其他Java EE容器 Tomcat或其他Servlet容器 OSGi 引用OSGi远程服务实现

    org.apache.servicemix.bundles.spring-aspects-3.2.8.RELEASE_2.zip

    aspects-3.2.8.RELEASE_2.zip"指示了这是一个与Apache ServiceMix相关的软件包,特别地,它包含了Spring框架的一个特定版本——3.2.8.RELEASE的面向切面编程(AOP)组件。Apache ServiceMix是一个基于Java的全面集成...

    org.apache.servicemix.bundles.spring-test-3.2.8.RELEASE_2.zip

    Apache ServiceMix是基于Java的全面企业级服务总线(ESB),它集成了许多开放源代码Java技术,如Spring、CXF和ActiveMQ等。而"spring-test"模块则是Spring框架的一部分,用于支持对Spring应用进行单元测试和集成测试...

    org.apache.servicemix.bundles.spring-beans-3.2.7.RELEASE_1.zip

    smaller-dev-server.zip,一个开发服务器,利用较小的程序为本地

    org.apache.servicemix.bundles.xmlbeans-2.4.0_1.jar

    org.apache.servicemix.bundles.xmlbeans-2.4.0_1.jar

    servicemix-core-3.3.2-javadoc

    2. **接口与类**:Javadoc文档列出了所有公开的接口和类,如`ServiceReference`表示服务引用,`BundleContext`代表了OSGi容器的上下文,`Component`是服务组件的基类。每个接口和类都详细描述了其功能、构造函数、...

    servicemix代理web service

    - 安装Servicemix和CXF组件。 - 使用CXF工具生成服务客户端或服务器端代码。 - 配置Servicemix的XML配置文件,指定服务代理的行为。 - 将服务部署到Servicemix,通过命令行或管理界面启动服务。 - 测试代理服务...

    Servicemix做代理服务器发布WebService

    Servicemix做代理服务器发布WebService,Login登录实际代码。对应博客中ServiceMix做代理服务器发布WebService(附带案例源码) 该篇例子,需要的可以去看看,这个是源码。

    cxf 3.2的jar包集合

    CXF这个名字是“CXF = XFire + ServiceMix”的缩写,它结合了两个早期的开源项目,旨在提供一个强大的、全面的、易用的服务开发和集成平台。 在“cxf 3.2的jar包集合”中,我们主要关注的是Apache CXF 3.2.0版本的...

    org.apache.servicemix.bundles.juel-2.1.3_1.zip

    标题中的"org.apache.servicemix.bundles.juel-2.1.3_1.zip"是一个开源项目的压缩包,它包含的是Apache ServiceMix中的JUEL(Java Unified Expression Language)库的特定版本。JUEL是一个开源的Java实现,遵循JSR ...

    apache-servicemix-4.4-fuseesb第五部分

    3. **Apache ActiveMQ**:作为 Java 消息服务(JMS)提供商,ActiveMQ 在 ServiceMix 中负责处理消息传递。它确保了高可用性和可伸缩性,支持多种消息模式。 4. **JBI(Java Business Integration)**:ServiceMix ...

    org.apache.servicemix.bundles.aws-java-sdk-1.4.1_1.zip

    Apache ServiceMix是企业级的OSGi应用服务器,它允许开发者集成和运行各种服务和组件。AWS Java SDK则是亚马逊提供的用于开发人员用Java语言与AWS服务进行交互的工具包。这个特定的版本1.4.1_1可能包含了针对...

    org.apache.servicemix.bundles.solr-solrj-4.6.1_1.zip

    Apache ServiceMix是一个基于OSGi的全面集成平台,它允许开发者部署和管理各种服务和组件,包括Solr。 描述中提到的"kitei-policy.zip"暗示了这是一个与Kitei项目相关的政策或规则集合。Kitei(可能是"Kite ...

Global site tag (gtag.js) - Google Analytics