Tomcat on the release of WebServices's War project, Access exception 404

Source: Internet
Author: User
Tags wsdl

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

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.