Tomcat on the release of WebServices's War project, Access exception 404
Tomcat deployment is normal, the war export project is normal, Tomcat comes with the project can be normal access;
Problem:
WebServices Engineering Access Exception 404
Solution:
Because the port of the WebServices WSDL access setting conflicts with the Tomcat port;
PackageNc.xyzq.listener;Importjava.net.InetAddress;Importjava.net.UnknownHostException;Importjavax.servlet.ServletContextEvent;ImportJavax.servlet.ServletContextListener;ImportJavax.servlet.annotation.WebListener;ImportJavax.xml.ws.Endpoint;ImportNc.xyzq.uuib.service.impl.FrServiceImpl;/** * @authorGaCl * Listener for publishing WebService*/ //use the servlet. The @weblistener annotations provided will implement the Webservicepublishlistener class labeled Servletcontextlistener interface as a listener@WebListener Public classWebservicepublishlistenerImplementsServletcontextlistener {@Override Public voidcontextdestroyed (Servletcontextevent sce) {System.GC (); } @Override Public voidcontextinitialized (Servletcontextevent sce) {//WebService address of the publicationString IP = ""; Try{IP=inetaddress.getlocalhost (). gethostaddress (); } Catch(unknownhostexception e) {//TODO auto-generated Catch blockE.printstacktrace (); } System.out.println ("Native IP =" +IP); String Address= "http://" +ip+ "8080/webservices/webservice"; //Publishing the Webservice,webserviceimpl class is the specific implementation class of the Webservie interfaceEndpoint.publish (Address,NewFrserviceimpl ()); System.out.println ("Use Webservicepublishlistener to publish WebService success!"); } }
Port 8080 conflicts with Tomcat port; Change the port of the WSDL address to 8060;
Tomcat on the release of WebServices's War project, Access exception 404