lyyb2001

          只是為方便自己找記錄而已
          posts - 57, comments - 27, trackbacks - 0, articles - 5
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 ::  :: 管理

          cxf webservice客戶端程序在eclipse里面運行的好好的,但是一旦用mvn assembly:assembly將依賴和主代碼打成一個可運行的jar時,調用就會出現如下錯誤:


          Exception in thread "main" org.apache.cxf.service.factory.ServiceConstructionException: Could not resolve a binding for null

          at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(AbstractWSDLBasedEndpointFactory.java:352)

          at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:259)

          at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:144)

          at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)

          at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157)

          at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)

          at com.nabf.start.NABFClient.main(NABFClient.java:30)

          Caused by: org.apache.cxf.BusException: No binding factory for namespace http://schemas.xmlsoap.org/soap/ registered.

          at org.apache.cxf.bus.managers.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:93)

          at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(AbstractWSDLBasedEndpointFactory.java:339)

          ... 6 more

          而用mV clean package dependency:copy-dependencies -DoutputDirectory=target/lib啟動的時候加載lib包下所有的文件也不會出現錯誤

          解決辦法:在pom.xml的build中添加如下,然后執行mV clean package,打出來的包就含有依賴包,且問題解決。原因?

                                      <plugin>

          <groupId>org.apache.maven.plugins</groupId>

          <artifactId>maven-shade-plugin</artifactId>

          <version>1.6</version>

          <configuration>

          <archive>

          <manifest>

          <addClasspath>true</addClasspath>

          <mainClass>com.nabf.start.NABFClient</mainClass>

          </manifest>

          </archive>

          </configuration>

          <executions>

          <execution>

          <phase>package</phase>

          <goals>

          <goal>shade</goal>

          </goals>

          <configuration>

          <transformers>

          <transformer

          implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">

          <resource>META-INF/cxf/bus-extensions.txt</resource>

          </transformer>

          </transformers>

          </configuration>

          </execution>

          </executions>

          </plugin> 




          @import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

          Lyyb2001
          主站蜘蛛池模板: 墨竹工卡县| 无棣县| 乳山市| 阿合奇县| 沐川县| 临武县| 桓台县| 盐源县| 北京市| 林甸县| 平顶山市| 海晏县| 新化县| 毕节市| 武隆县| 陆川县| 肥城市| 贵溪市| 晋中市| 灵寿县| 和静县| 万盛区| 闽清县| 昔阳县| 永寿县| 济南市| 阿城市| 邮箱| 永城市| 搜索| 梧州市| 铁力市| 巴中市| 镇赉县| 淳化县| 靖州| 湘乡市| 砚山县| 永宁县| 锡林郭勒盟| 麟游县|