JSP IllegalArgumentException:com.sun.xml.messaging.saaj.soap.LocalString!= com.sun.xml.internal.messaging.saaj.soap.LocalStrings problem

时间:2011-05-08 14:32:43

标签: java eclipse jsp tomcat struts

我正在创建一个与Web服务通信的程序,该服务是用JSP和Struts编写的。但是当我想创建webservice的新实例时,我收到以下错误:

SEVERE: Servlet.service() for servlet [FrontController] in context with path [/P3_GUI] threw exception [Servlet execution threw an exception] with root cause
java.lang.IllegalArgumentException: com.sun.xml.messaging.saaj.soap.LocalStrings != com.sun.xml.internal.messaging.saaj.soap.LocalStrings

在我的ActionClass的以下代码中出现

 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;

  import org.apache.struts.action.Action;
  import org.apache.struts.action.ActionForm;
  import org.apache.struts.action.ActionForward;
  import org.apache.struts.action.ActionMapping;

  import vakws.Vak;
  import vakws.VakService;

  public class AddAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,     HttpServletRequest request, HttpServletResponse response) {
    AddForm myForm = (AddForm)form;

    VakService service = new VakService();
    Vak vakProxy = service.getVakPort();

    boolean result = vakProxy.addVak(myForm.getVakName(), Double.parseDouble(myForm.getVakMark()));

    if(!result){
        return mapping.findForward("show_addError");    
    }       
    return mapping.findForward("show_addResults");      
  }
}

使用wsdl文档自动生成VakService和VakProxy。

我正在Eclipse中开发并在Tomcat服务器上部署该程序。 Web服务器使用JAX-WS 2.2.3

运行

有人知道这个问题的解决方案吗?

提前致谢!

1 个答案:

答案 0 :(得分:3)

您的webapp的运行时类路径中有多个不同版本的SAAJ库。 SAAJ已与JDK捆绑在一起。可能您的webapp saaj-*.jar中有一些/WEB-INF/lib文件与JDK捆绑的SAAJ库存在冲突。清理它。