zoukankan      html  css  js  c++  java
  • Caused by: java.lang.IllegalArgumentException: addChild: Child name 'localhost' is not unique

    1、错误描述

    严重: End event threw exception
    java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:852)
    	at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201)
    	at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1060)
    	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1555)
    	at org.apache.catalina.startup.Catalina.load(Catalina.java:615)
    	at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
    Caused by: java.lang.IllegalArgumentException: addChild:  Child name 'localhost' is not unique
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:887)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    	at org.apache.catalina.core.StandardEngine.addChild(StandardEngine.java:244)
    	... 26 more

    2、错误原因

         由于在Tomcat中的server.xml中加了一个:

    <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true"></Host>
        而自身本来自带一个:

    <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true"></Host>

         有两个Host导致重复


    3、解决办法

        去掉添加的一个Host

    <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true"></Host>

  • 相关阅读:
    利用Java脚本实现弹出窗口后,按确定实现跳转
    客服利用QQ实现即时聊天
    获取页面可见区域,屏幕区域的尺寸
    圆角模板百度知道
    利用javascript实现web页面刷新的方法
    论:命名空间,程序集和类
    我从少年时候就非常喜欢的诗歌:雨巷
    魔兽世界 圣骑士唯一的远程武器任务
    又想起我年少时候熟记的抒情诗致海伦
    System.Text.Encoding.UTF8 字符串和字节数组的互相转换
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13314413.html
Copyright © 2011-2022 走看看