我正在尝试使用 Java 中的肥皂 Web 服务,它仅适用于 Eclipse IDE,但在导入 JBPM 项目时不起作用。我得到的错误是:
无法确定 BusFactory 实现类名称:java.lang.ClassCastException : class org.apache.cxf.bus.spring.SpringBusFactory
它与 Eclipse 完美配合
import java.io.*;
import java.util.Iterator;
import javax.xml.soap.*;
import javax.xml.transform.*;
import javax.xml.transform.stream.StreamResult;
import javax.xml.xpath.*;
import org.xml.sax.InputSource;
public class metodos {
public metodos() {
super();
}
public String getInfo() {
String retorno = "";
System.out.println("methodGetInfo ");
try {
System.out.println("methodGetInfo newInstance");
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
System.out.println("methodGetInfo createConnection");
SOAPConnection soapConnection = soapConnectionFactory.createConnection();
System.out.println("methodGetInfo MessageFactory newInstance");
MessageFactory messageFactory = MessageFactory.newInstance();
System.out.println("methodGetInfo createMessage");
javax.xml.soap.SOAPMessage soapRequest = messageFactory.createMessage();
System.out.println("methodGetInfo getSOAPPart");
SOAPPart soapPart = soapRequest.getSOAPPart();
System.out.println("methodGetInfo getEnvelope");
SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
soapEnvelope.addNamespaceDeclaration("end", endPoint);
SOAPBody soapBody = soapEnvelope.getBody();
soapBody.addChildElement("getInfo", "end");
soapRequest.saveChanges();
System.out.println("methodGetInfo soapConnection call");
SOAPMessage soapResponse = soapConnection.call(soapRequest, url);
System.out.println("methodGetInfo transformerFactory");
TransformerFactory transformerFactory = TransformerFactory.newInstance();
System.out.println("methodGetInfo newTransformer");
Transformer transformer = transformerFactory.newTransformer();
System.out.println("methodGetInfo getSOAPPart");
Source sourceContent = soapResponse.getSOAPPart().getContent();
System.out.println("methodGetInfo StringWriter");
StringWriter writer = new StringWriter();
System.out.println("methodGetInfo StreamResult");
StreamResult result = new StreamResult(writer);
System.out.println("methodGetInfo transformer.transform");
transformer.transform(sourceContent, result);
当我使用 JBPM 时出现此错误:
错误是由这一行引起的:
SOAPMessage soapResponse = soapConnection.call(soapRequest, url);
我没有在 java 中使用任何外部库。
Java编译器级别:1.8
JBPM 版本:7.17.0 最终版

