Description of the problem: The access interface address can see the detailed information ( xml information ) of the generated interface, but an error will be reported when the interface is called. This kind of error mainly occurs in weblogic, and is accessed normally in tomcat.
Step 1: Add the following configuration to web.xml:
<!-- for weblogic --> <listener> <listener-class>org.weichai.iws.service.demo.listener.CxfWeblogicListener</listener-class> </listener>
Step 2: Create a listener directory under the directory org.weichai.iws.service.demo, and create a CxfWeblogicListener class under it. The code is as follows:
package org.weichai.iws.service.demo.listener; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; /** * Created by Admin on 2017/5/5. */ public class CxfWeblogicListener implements ServletContextListener { public CxfWeblogicListener(){ System.setProperty("org.apache.cxf.stax.allowInsecureParser","1"); } @Override public void contextDestroyed(ServletContextEvent arg0) { // TODO Auto-generated method stub } @Override public void contextInitialized(ServletContextEvent arg0) { // TODO Auto-generated method stub } }