Solve the jar package conflict when integration of existing projects and cxf ws Functions

Source: Internet
Author: User

Simplify and adjust the original document management project, and provide WebService interfaces for other applications of the customer. WS uses cxf to provide simple functions, but the jar provided by the original project conflicts with the package on which cxf depends. First, in the integration process, remove some jar files used by cxf to be used in the project. After the project compilation is normal, adjust the function slimming.

 

The whole slimming process did not use the cxf tool to generate the WSDL file and then generate the client service, but simply wrote a client call. It can transmit information through WS and access the documentation platform through the returned connection for document operations. However, since the WS service needs to be provided to the customer, the WSDL file must be provided.

 

The integration of the project to obtain the WSDL file produces a series of problems, but there is no such error in another independent ws project. The record during integration is of great help to the subsequent work. After removing some jar packages, it is easy to understand that the original project conflicts with the newly added ws dependency jar. First, make sure that either side of the two is not referenced, and then try to use one of them to run the project, which will cause problems. Because the backend of the project depends on the filenet product, some jar files cannot be replaced easily. Later debugging found that these jar packages are provided by different manufacturers and have different paths, even some jar packages change the classes (classes in different jar packages) that the original cxf generates the WSDL ).

 

Because these conflicts are generated using cxf to generate the WSDL, instead of other functional development or running processes, you only need to exclude these temporarily problematic jar projects, then, retrieve the jar (excluded) required by the application of the original document.

 

A local experiment project can create a WSDL. Download the source code from the cxf official website and debug its logic. The jar used in this process, different from the jar generated during the WSDL debugging process in a problematic project, the cxf dependency is replaced or the jar cannot be used at all, until it enters the correct jar environment according to the normal logic.

 

Now the project can generate the WSDL file. Restore the jar on which the original project depends, deploy it, generate a client based on the WSDL, and test the call. The following is an example of an error log.

 

[Info] 09:20:10. 984-loading configuration resource: filenetbuild. Properties

[Info] 09:20:13. 390-an exception has occurred while processing a getobjects request. thegetobjects request is being retried (1) of (1) times.

Javax. xml. rpc. jaxrpcexception: COM. Sun. xml. messaging. SAAJ. Soap. Name. nameimpl cannot becast to com. Taobao inet. SAAJ. Soap. nameimpl

At com. filenet. apiimpl. WSI. clientheaderprocessor. handleoutput (Clientheaderprocessor. Java: 141)

At org. systinet. Wasp. handler. waspgenerichandler. handlerequest (Waspgenerichandler. Java: 68)

At com. systinet. jaxrpc. rpc. handler. handlerchainimpl. handlerequest (Handlerchainimpl. Java: 167)

Atcom. systinet. Wasp. rpc. handler. clienthandlerchaininvoker. processoutput (Clienthandlerchaininvoker. Java: 100)

Atcom. systinet. Wasp. Client. xmlinvocationhelperimpl. invokehandlers (Xmlinvocationhelperimpl. Java: 760)

Atcom. systinet. Wasp. Client. xmlinvocationhelperimpl. invokehandlers (Xmlinvocationhelperimpl. Java: 742)

Atcom. systinet. Wasp. Client. xmlinvocationhelperimpl. processhandlers (Xmlinvocationhelperimpl. Java: 576)

At com. systinet. Wasp. Client. xmlinvocationhelperimpl. processmessage (Xmlinvocationhelperimpl. Java: 510)

At com. systinet. Wasp. Client. xmlinvocationhelperimpl. _ call (Xmlinvocationhelperimpl. Java: 144)

At com. systinet. Wasp. Client. xmlinvocationhelperimpl. Call (Xmlinvocationhelperimpl. Java: 75)

At org. systinet. Wasp. Client. xmlinvocationhelper. Call (Xmlinvocationhelper. Java: 18)

At com. systinet. Wasp. rpc. waspcallimpl. Invoke (Waspcallimpl. Java: 501)

At com. systinet. Wasp. rpc. waspcallimpl. Invoke (Waspcallimpl. Java: 459)

At com. Alibaba inet. Wasp. Client. clientproxy. _ invoke (Clientproxy. Java: 476)

At com. Alibaba inet. Wasp. Client. clientproxy. Invoke (Clientproxy. Java: 111)

At $ proxy62.getobjects (unknown source)

At com. filenet. apiimpl. WSI. clientport40.getobjects (Clientport40.java: 36)

Bytes ---------------------------------------------------------------------------------------------------------------------------

Debug] 2012/11/27 14:25:02. 062-http session @ sessioncontextutils. getsubject (): org. Apache. Catalina. session. standardsessionfacade @ deea66

[Warn] 14:25:07. 984-interceptor for {http://ws.util.rise.ibm.com/?documentinterfaceimplservicehas thrown exception, unwinding now

Org. Apache. cxf. frontend. wsdlqueryexception: Exception occurred while trying to process http: // localhost: 8080/documentinterface

At org. Apache. cxf. frontend. wsdlgetutils. getdocument (Wsdlgetutils. Java: 265)

At org. Apache. cxf. frontend. wsdlgetinterceptor. getdocument (Wsdlgetinterceptor. Java: 158)

At org. Apache. cxf. frontend. wsdlgetinterceptor. handlemessage (Wsdlgetinterceptor. Java: 110)

At org. Apache. cxf. phase. phaseinterceptorchain. dointercept (Phaseinterceptorchain. Java: 262)

At org. Apache. cxf. Transport. chaininitiationobserver. onmessage (Chaininitiationobserver. Java: 121)

At org. Apache. cxf. Transport. http. abstracthttpdestination. Invoke (Abstracthttpdestination. Java: 236)

Atorg. Apache. cxf. Transport. servlet. servletcontroller. invokedestination (Servletcontroller. Java: 213)

At org. Apache. cxf. Transport. servlet. servletcontroller. Invoke (Servletcontroller. Java: 193)

At org. Apache. cxf. Transport. servlet. cxfnonspringservlet. Invoke (Cxfnonspringservlet. Java: 130)

Atorg. Apache. cxf. Transport. servlet. abstracthttpservlet. handlerequest (Abstracthttpservlet. Java: 221)

At org. Apache. cxf. Transport. servlet. abstracthttpservlet. doget (Abstracthttpservlet. Java: 146)

At javax. servlet. http. httpservlet. Service (Httpservlet. Java: 617)

At org. Apache. cxf. Transport. servlet. abstracthttpservlet. Service (Abstracthttpservlet. Java: 197)

At org. Apache. Catalina. Core. applicationfilterchain. internaldofilter (Applicationfilterchain. Java: 290)

At org. Apache. Catalina. Core. applicationfilterchain. dofilter (Applicationfilterchain. Java: 206)

At com. IBM. Rise. util. containbasefilter. dofilter (Containbasefilter. Java: 91)

Atorg. Apache. Catalina. Core. applicationfilterchain. internaldofilter (Applicationfilterchain. Java: 235)

At org. Apache. Catalina. Core. applicationfilterchain. dofilter (Applicationfilterchain. Java: 206)

At com. IBM. Rise. util. utf8filter. dofilter (Utf8filter. Java: 25)

Atorg. Apache. Catalina. Core. applicationfilterchain. internaldofilter (Applicationfilterchain. Java: 235)

At org. Apache. Catalina. Core. applicationfilterchain. dofilter (Applicationfilterchain. Java: 206)

At org. Apache. Catalina. Core. standardwrappervalve. Invoke (Standardwrappervalve. Java: 233)

At org. Apache. Catalina. Core. standardcontextvalve. Invoke (Standardcontextvalve. Java: 191)

At org. Apache. Catalina. Core. standardhostvalve. Invoke (Standardhostvalve. Java: 127)

At org. Apache. Catalina. Valves. errorreportvalve. Invoke (Error reportvalve. Java: 102)

At org. Apache. Catalina. Core. standardenginevalve. Invoke (Standardenginevalve. Java: 109)

At org. Apache. Catalina. connector. coyoteadapter. Service (Coyoteadapter. Java: 298)

At org. Apache. Coyote. http11.http11processor. Process (Http11processor. Java: 859)

Atorg. Apache. Coyote. http11.http11protocol $ http11connectionhandler. Process (Http11protocol. Java: 588)

At org.apache.tomcat.util.net. jioendpoint $ worker. Run (Jioendpoint. Java: 489)

At java. Lang. thread. Run (Thread. Java: 662)

Caused:Java. Lang. runtimeexception: Problem creating schema implementation

Atorg. Apache. cxf. wsdl11.servicewsdlbuilder. getschemaimplementation (Servicewsdlbuilder. Java: 291)

At org. Apache. cxf. wsdl11.servicewsdlbuilder. buildtypes (Servicewsdlbuilder. Java: 307)

At org. Apache. cxf. wsdl11.servicewsdlbuilder. Build (Servicewsdlbuilder. Java: 200)

At org. Apache. cxf. frontend. wsdlgetutils. getdocument (Wsdlgetutils. Java: 186)

... 30 more

Caused:Wsdlexception: Faultcode = configuration_error: No Java extensiontype found to representa '{http://www.w3.org/2001/xmlschema}schema' element in the context of a' javax. WSDL. types '.:

At javax. WSDL. Extensions. extensionregistry. createextension (Extensionregistry. Java: 335)

Atorg. Apache. cxf. wsdl11.servicewsdlbuilder. getschemaimplementation (Servicewsdlbuilder. Java: 289)

... 33 more

 

 

 

Bytes ---------------------------------------------------------------------------------------------------------------------------

Missing argument: classname

 

Usage: java2ws-DB |-databinding <databindingname>-frontend |-Fe <jaxws or simple>-WSDL-wrapperbean-client-server-ant-o |-output <output-File>- d <resource-directory>-S <source-directory>-classdir <compile-classes-directory>-CP |-classpath <class-path>-soap12-T <target-namespace >-beans <pathname of the bean definition file.> *-servicename <service-Name>-portname <port-Name>-A |-address <addh SS>-createxsdimports-H | -? |-Help-version |-v-verbose |-v-Quiet |-q <classname>

 

Javatows error: org. Apache. cxf. Tools. Common. toolexception: org. Apache. cxf. Tools. Common. toolspec. parser. badusageexception: missingargument: classname

 

Refer:

How to resolve jar package conflicts in WebSphere

Http://www.ibm.com/developerworks/cn/websphere/library/techarticles/haoaili/0512/

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.