为什么这个URL不在我的servlet中?

时间:2014-11-26 08:32:09

标签: java servlets intellij-idea

我在 servlet 应用程序中遇到以下问题。今天上午工作正常,现在出现了问题。

这是 web.xml 配置文件:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">    
<web-app>

    <display-name>Enel EDI-MON</display-name>

    <listener>
        <listener-class>it.sistinf.ediweb.quartz.QuartzListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>edimon</servlet-name>    
        <servlet-class>it.sistinf.ediweb.monitor.servlets.Monitoraggio</servlet-class>   
        <load-on-startup>0</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>edimon</servlet-name>
        <url-pattern>/edimon.do/*</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>salwf</servlet-name>
        <servlet-class>it.sistinf.ediweb.monitor.servlets.Salwf</servlet-class>
        <load-on-startup>0</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>salwf</servlet-name>
        <url-pattern>/salwf.do</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>/logon.jsp</welcome-file>
    </welcome-file-list>

    <taglib>
        <taglib-uri>displaytag</taglib-uri>
        <taglib-location>/WEB-INF/displaytag-11.tld</taglib-location>
    </taglib>

</web-app>

如您所见,我有2个 servlet

第二个servlet 应该像这样映射路径:

http://localhost:7001/salwf.do

虽然有效但现在如果我尝试打开此链接,我会收到以下错误消息:

Error 404--Not Found
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.5 404 Not Found

The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.

If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.

这是我的 Salwf 类的代码,用于实现 HttpServlet 接口:

public class Salwf extends HttpServlet {

    private String msg = StringUtils.EMPTY;

    public void init(ServletConfig config) throws ServletException {
        super.init(config);

        StandardConfigurationFactory standardConfigurationFactory = new StandardConfigurationFactory();

        try {
            standardConfigurationFactory.init();
        } catch (ConfigurationException e) {
            throw new ServletException(e);
        }

        ConfigurationFactory.setInstance(standardConfigurationFactory);
    }

    public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        LoggerMDC.setup(req, res);
        Logger logger = (Logger) Logger.getStdLogger(Monitoraggio.class); // do not declare 'logger' as static field in order to work with MDC

        String service = req.getParameter("serv");

        char serviceId = Utility.getServizio(req.getParameter("serv"));

        // The collection that have to be shown in a table inside the JSP view:
        SalDettaglio[] salDettaglio = this.getSalDettaglioList();

        gotoPage(ConfigurationFactory.getPropertiesPages().getProperty("pagina_salwf"), req, res);

        //String paginaDaLanciare = lanciaServizio(serviceId, req, res);
    }

    /*
    private String lanciaServizio(char num_servizio, HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        Logger logger = (Logger) Logger.getStdLogger(Monitoraggio.class); // do not declare 'logger' as static field in order to work with MDC

        HttpSession session;

    }
    */

    private void gotoPage(String address, HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        Logger logger = (Logger) Logger.getStdLogger(Monitoraggio.class); // do not declare 'logger' as static field in order to work with MDC
        logger.debug("gotoPage() | address: " + address);

        ServletContext ctx = getServletConfig().getServletContext();
        RequestDispatcher dispatcher = ctx.getRequestDispatcher(address);
        dispatcher.forward(req, res);
    }

    private SalDettaglio[] getSalDettaglioList(){

        SalDettaglio[] salDettaglioArrayResult;

        List<SalDettaglio> salDettaglioList = new ArrayList<SalDettaglio>();

        List<RM> rmList = new ArrayList<RM>();

        RM rm1 = new RM("codiceRM1", "Andrea", "01/01/1014", "acqRiserva1", "consegnaFinale1", "descrizioneRM1", BigDecimal.valueOf(1000));
        RM rm2 = new RM("codiceRM2", "Andrea", "01/01/1014", "acqRiserva2", "consegnaFinale2", "descrizioneRM2", BigDecimal.valueOf(1000));

        rmList.add(rm1);
        rmList.add(rm2);

        RM[] rmArray =  (RM[]) rmList.toArray();

        SalDettaglio salDettaglio1 = new SalDettaglio("codice1", "stato1", "01/01/2014", "01/06/2014", "Andrea",
                "Andrea", "Andrea", BigDecimal.valueOf(1000), "fornitore1",
                "rmConRiserva1", "errore1", null, rmArray);

        SalDettaglio salDettaglio2 = new SalDettaglio("codice2", "stato2", "01/01/2014", "01/06/2014", "Andrea",
                "Andrea", "Andrea", BigDecimal.valueOf(1000), "fornitore2",
                "rmConRiserva2", "errore2", null, rmArray);

        salDettaglioList.add(salDettaglio1);
        salDettaglioList.add(salDettaglio2);

        salDettaglioArrayResult = (SalDettaglio[]) salDettaglioList.toArray();

        return salDettaglioArrayResult;

    }

}

我还尝试在我的servlet的 service()方法的开头加上一个括号,但似乎无法进入它。这似乎是一个servlet路由问题。

在我看来很奇怪。可能是什么问题呢?我该如何尝试解决这个问题?

作为IDE我使用Intellij IDEA,我看到一些奇怪的东西:进入服务器框(我看到我的部署项目)我看到带有(!)图标的项目,如果我把鼠标放入在项目名称上,我可以阅读以下消息:工件部署期间出错。有关详细信息,请参阅服务器日志

enter image description here

这是服务器堆栈跟踪:

log4j:WARN No appenders could be found for logger (it.sistinf.ediweb.quartz.QuartzListener).
log4j:WARN Please initialize the log4j system properly.
StandardConfigurationFactory | init(): base config dir   : C:\EDI-MON\src\config
StandardConfigurationFactory | init(): log4j config file : C:\EDI-MON\src\config\log4j.properties
log4j: Parsing for [root] with value=[TRACE,EDIMON-APP].
log4j: Level token is [TRACE].
log4j: Category root set to TRACE
log4j: Parsing appender named "EDIMON-APP".
log4j: Parsing layout options for "EDIMON-APP".
log4j: Setting property [conversionPattern] to [%d{ISO8601} | %X{MDC_CONNECTION_ID} | %X{MDC_REMOTE_SESSION_ID} | %X{MDC_REMOTE_ADDRESS} | USERID=%X{MDC_USER_ID} | PIVA=%X{MDC_USER_PIVA} | %-5p | %c | %t | %m%n].
log4j: End of parsing for "EDIMON-APP".
log4j: Setting property [maxFileSize] to [2000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-APP" options.
log4j: Setting category factory to [it.sistinf.ediweb.logging.LoggerFactory].
log4j: Parsing for [org.displaytag] with value=[ERROR,EDIMON-APP].
log4j: Level token is [ERROR].
log4j: Category org.displaytag set to ERROR
log4j: Parsing appender named "EDIMON-APP".
log4j: Appender "EDIMON-APP" was already parsed.
log4j: Handling log4j.additivity.org.displaytag=[false]
log4j: Setting additivity for "org.displaytag" to false
log4j: Parsing for [soa.it.sistinf.ediweb] with value=[SOA#it.sistinf.ediweb.logging.LoggerLevel,EDIMON-SOA].
log4j: Level token is [SOA#it.sistinf.ediweb.logging.LoggerLevel].
log4j: toLevel:class=[it.sistinf.ediweb.logging.LoggerLevel]:pri=[SOA]
log4j: Category soa.it.sistinf.ediweb set to SOA
log4j: Parsing appender named "EDIMON-SOA".
log4j: Parsing layout options for "EDIMON-SOA".
log4j: Setting property [conversionPattern] to [%d{ISO8601} [USERID=%X{MDC_USER_ID}] [PIVA=%X{MDC_USER_PIVA}] %m%n].
log4j: End of parsing for "EDIMON-SOA".
log4j: Setting property [maxFileSize] to [1000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon-soa.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon-soa.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-SOA" options.
log4j: Handling log4j.additivity.soa.it.sistinf.ediweb=[true]
log4j: Setting additivity for "soa.it.sistinf.ediweb" to true
log4j: Finished configuring.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
StandardConfigurationFactory | init(): base config dir   : C:\EDI-MON\src\config
StandardConfigurationFactory | init(): log4j config file : C:\EDI-MON\src\config\log4j.properties
log4j: Parsing for [root] with value=[TRACE,EDIMON-APP].
log4j: Level token is [TRACE].
log4j: Category root set to TRACE
log4j: Parsing appender named "EDIMON-APP".
log4j: Parsing layout options for "EDIMON-APP".
log4j: Setting property [conversionPattern] to [%d{ISO8601} | %X{MDC_CONNECTION_ID} | %X{MDC_REMOTE_SESSION_ID} | %X{MDC_REMOTE_ADDRESS} | USERID=%X{MDC_USER_ID} | PIVA=%X{MDC_USER_PIVA} | %-5p | %c | %t | %m%n].
log4j: End of parsing for "EDIMON-APP".
log4j: Setting property [maxFileSize] to [2000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-APP" options.
log4j: Setting category factory to [it.sistinf.ediweb.logging.LoggerFactory].
log4j: Parsing for [org.displaytag] with value=[ERROR,EDIMON-APP].
log4j: Level token is [ERROR].
log4j: Category org.displaytag set to ERROR
log4j: Parsing appender named "EDIMON-APP".
log4j: Appender "EDIMON-APP" was already parsed.
log4j: Handling log4j.additivity.org.displaytag=[false]
log4j: Setting additivity for "org.displaytag" to false
log4j: Parsing for [soa.it.sistinf.ediweb] with value=[SOA#it.sistinf.ediweb.logging.LoggerLevel,EDIMON-SOA].
log4j: Level token is [SOA#it.sistinf.ediweb.logging.LoggerLevel].
log4j: toLevel:class=[it.sistinf.ediweb.logging.LoggerLevel]:pri=[SOA]
log4j: Category soa.it.sistinf.ediweb set to SOA
log4j: Parsing appender named "EDIMON-SOA".
log4j: Parsing layout options for "EDIMON-SOA".
log4j: Setting property [conversionPattern] to [%d{ISO8601} [USERID=%X{MDC_USER_ID}] [PIVA=%X{MDC_USER_PIVA}] %m%n].
log4j: End of parsing for "EDIMON-SOA".
log4j: Setting property [maxFileSize] to [1000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon-soa.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon-soa.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-SOA" options.
log4j: Handling log4j.additivity.soa.it.sistinf.ediweb=[true]
log4j: Setting additivity for "soa.it.sistinf.ediweb" to true
log4j: Finished configuring.
StandardConfigurationFactory | init(): base config dir   : C:\EDI-MON\src\config
StandardConfigurationFactory | init(): log4j config file : C:\EDI-MON\src\config\log4j.properties
log4j: Parsing for [root] with value=[TRACE,EDIMON-APP].
log4j: Level token is [TRACE].
log4j: Category root set to TRACE
log4j: Parsing appender named "EDIMON-APP".
log4j: Parsing layout options for "EDIMON-APP".
log4j: Setting property [conversionPattern] to [%d{ISO8601} | %X{MDC_CONNECTION_ID} | %X{MDC_REMOTE_SESSION_ID} | %X{MDC_REMOTE_ADDRESS} | USERID=%X{MDC_USER_ID} | PIVA=%X{MDC_USER_PIVA} | %-5p | %c | %t | %m%n].
log4j: End of parsing for "EDIMON-APP".
log4j: Setting property [maxFileSize] to [2000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-APP" options.
log4j: Setting category factory to [it.sistinf.ediweb.logging.LoggerFactory].
log4j: Parsing for [org.displaytag] with value=[ERROR,EDIMON-APP].
log4j: Level token is [ERROR].
log4j: Category org.displaytag set to ERROR
log4j: Parsing appender named "EDIMON-APP".
log4j: Appender "EDIMON-APP" was already parsed.
log4j: Handling log4j.additivity.org.displaytag=[false]
log4j: Setting additivity for "org.displaytag" to false
log4j: Parsing for [soa.it.sistinf.ediweb] with value=[SOA#it.sistinf.ediweb.logging.LoggerLevel,EDIMON-SOA].
log4j: Level token is [SOA#it.sistinf.ediweb.logging.LoggerLevel].
log4j: toLevel:class=[it.sistinf.ediweb.logging.LoggerLevel]:pri=[SOA]
log4j: Category soa.it.sistinf.ediweb set to SOA
log4j: Parsing appender named "EDIMON-SOA".
log4j: Parsing layout options for "EDIMON-SOA".
log4j: Setting property [conversionPattern] to [%d{ISO8601} [USERID=%X{MDC_USER_ID}] [PIVA=%X{MDC_USER_PIVA}] %m%n].
log4j: End of parsing for "EDIMON-SOA".
log4j: Setting property [maxFileSize] to [1000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon-soa.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon-soa.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-SOA" options.
log4j: Handling log4j.additivity.soa.it.sistinf.ediweb=[true]
log4j: Setting additivity for "soa.it.sistinf.ediweb" to true
log4j: Finished configuring.
<25-nov-2014 17.33.04 CET> <Notice> <LoggingService> <BEA-320400> <The log file C:\Oracle\Middleware\user_projects\domains\edimon_domain\servers\AdminServer\logs\edimon_domain.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.> 
<25-nov-2014 17.33.04 CET> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to C:\Oracle\Middleware\user_projects\domains\edimon_domain\servers\AdminServer\logs\edimon_domain.log00034. Log messages will continue to be logged in C:\Oracle\Middleware\user_projects\domains\edimon_domain\servers\AdminServer\logs\edimon_domain.log.> 
<25-nov-2014 17.33.04 CET> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.> 
<25-nov-2014 17.33.04 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN> 
<25-nov-2014 17.33.04 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[5]" is now listening on fe80:0:0:0:8412:ac00:b07a:ed71:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on fe80:0:0:0:9092:bf:900d:11b2:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[7]" is now listening on fe80:0:0:0:dba:3e6e:937b:247f:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 172.16.27.64:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[9]" is now listening on fe80:0:0:0:0:5efe:c0a8:b01:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[11]" is now listening on fe80:0:0:0:95e9:b3de:1431:7f1b:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[10]" is now listening on fe80:0:0:0:0:5efe:c0a8:2301:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[13]" is now listening on fe80:0:0:0:4506:22d2:e7de:5a0c:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[14]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.11.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 192.168.35.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[6]" is now listening on fe80:0:0:0:88c4:cada:9151:3919:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[4]" is now listening on fe80:0:0:0:0:5efe:ac10:1b40:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[12]" is now listening on fe80:0:0:0:89ff:6d12:49cf:4354:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[15]" is now listening on 0:0:0:0:0:0:0:1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <Server> <BEA-002613> <Channel "Default[8]" is now listening on fe80:0:0:0:cd21:3fe9:54bd:a17b:7001 for protocols iiop, t3, ldap, snmp, http.> 
<25-nov-2014 17.33.04 CET> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "AdminServer" for domain "edimon_domain" running in Development Mode> 
<25-nov-2014 17.33.04 CET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING> 
<25-nov-2014 17.33.04 CET> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode> 
<25-nov-2014 17.33.05 CET> <Warning> <Server> <BEA-002611> <Hostname "AndreaNobili", maps to multiple IP addresses: 192.168.11.1, 192.168.35.1, 172.16.27.64, fe80:0:0:0:88c4:cada:9151:3919%14, fe80:0:0:0:dba:3e6e:937b:247f%13, fe80:0:0:0:4506:22d2:e7de:5a0c%3> 
Connected to server
log4j:WARN No appenders could be found for logger (it.sistinf.ediweb.quartz.QuartzListener).
StandardConfigurationFactory | init(): base config dir   : C:\EDI-MON\src\config
log4j:WARN Please initialize the log4j system properly.
StandardConfigurationFactory | init(): log4j config file : C:\EDI-MON\src\config\log4j.properties
log4j: Parsing for [root] with value=[TRACE,EDIMON-APP].
log4j: Level token is [TRACE].
log4j: Category root set to TRACE
log4j: Parsing appender named "EDIMON-APP".
log4j: Parsing layout options for "EDIMON-APP".
log4j: Setting property [conversionPattern] to [%d{ISO8601} | %X{MDC_CONNECTION_ID} | %X{MDC_REMOTE_SESSION_ID} | %X{MDC_REMOTE_ADDRESS} | USERID=%X{MDC_USER_ID} | PIVA=%X{MDC_USER_PIVA} | %-5p | %c | %t | %m%n].
log4j: End of parsing for "EDIMON-APP".
log4j: Setting property [maxFileSize] to [2000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-APP" options.
log4j: Setting category factory to [it.sistinf.ediweb.logging.LoggerFactory].
log4j: Parsing for [org.displaytag] with value=[ERROR,EDIMON-APP].
log4j: Level token is [ERROR].
log4j: Category org.displaytag set to ERROR
log4j: Parsing appender named "EDIMON-APP".
log4j: Appender "EDIMON-APP" was already parsed.
log4j: Handling log4j.additivity.org.displaytag=[false]
log4j: Setting additivity for "org.displaytag" to false
log4j: Parsing for [soa.it.sistinf.ediweb] with value=[SOA#it.sistinf.ediweb.logging.LoggerLevel,EDIMON-SOA].
log4j: Level token is [SOA#it.sistinf.ediweb.logging.LoggerLevel].
log4j: toLevel:class=[it.sistinf.ediweb.logging.LoggerLevel]:pri=[SOA]
log4j: Category soa.it.sistinf.ediweb set to SOA
log4j: Parsing appender named "EDIMON-SOA".
log4j: Parsing layout options for "EDIMON-SOA".
log4j: Setting property [conversionPattern] to [%d{ISO8601} [USERID=%X{MDC_USER_ID}] [PIVA=%X{MDC_USER_PIVA}] %m%n].
log4j: End of parsing for "EDIMON-SOA".
log4j: Setting property [maxFileSize] to [1000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon-soa.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon-soa.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-SOA" options.
log4j: Handling log4j.additivity.soa.it.sistinf.ediweb=[true]
log4j: Setting additivity for "soa.it.sistinf.ediweb" to true
log4j: Finished configuring.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
StandardConfigurationFactory | init(): base config dir   : C:\EDI-MON\src\config
StandardConfigurationFactory | init(): log4j config file : C:\EDI-MON\src\config\log4j.properties
log4j: Parsing for [root] with value=[TRACE,EDIMON-APP].
log4j: Level token is [TRACE].
log4j: Category root set to TRACE
log4j: Parsing appender named "EDIMON-APP".
log4j: Parsing layout options for "EDIMON-APP".
log4j: Setting property [conversionPattern] to [%d{ISO8601} | %X{MDC_CONNECTION_ID} | %X{MDC_REMOTE_SESSION_ID} | %X{MDC_REMOTE_ADDRESS} | USERID=%X{MDC_USER_ID} | PIVA=%X{MDC_USER_PIVA} | %-5p | %c | %t | %m%n].
log4j: End of parsing for "EDIMON-APP".
log4j: Setting property [maxFileSize] to [2000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-APP" options.
log4j: Setting category factory to [it.sistinf.ediweb.logging.LoggerFactory].
log4j: Parsing for [org.displaytag] with value=[ERROR,EDIMON-APP].
log4j: Level token is [ERROR].
log4j: Category org.displaytag set to ERROR
log4j: Parsing appender named "EDIMON-APP".
log4j: Appender "EDIMON-APP" was already parsed.
log4j: Handling log4j.additivity.org.displaytag=[false]
log4j: Setting additivity for "org.displaytag" to false
log4j: Parsing for [soa.it.sistinf.ediweb] with value=[SOA#it.sistinf.ediweb.logging.LoggerLevel,EDIMON-SOA].
log4j: Level token is [SOA#it.sistinf.ediweb.logging.LoggerLevel].
log4j: toLevel:class=[it.sistinf.ediweb.logging.LoggerLevel]:pri=[SOA]
log4j: Category soa.it.sistinf.ediweb set to SOA
log4j: Parsing appender named "EDIMON-SOA".
log4j: Parsing layout options for "EDIMON-SOA".
log4j: Setting property [conversionPattern] to [%d{ISO8601} [USERID=%X{MDC_USER_ID}] [PIVA=%X{MDC_USER_PIVA}] %m%n].
log4j: End of parsing for "EDIMON-SOA".
log4j: Setting property [maxFileSize] to [1000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon-soa.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon-soa.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-SOA" options.
log4j: Handling log4j.additivity.soa.it.sistinf.ediweb=[true]
log4j: Setting additivity for "soa.it.sistinf.ediweb" to true
log4j: Finished configuring.
StandardConfigurationFactory | init(): base config dir   : C:\EDI-MON\src\config
StandardConfigurationFactory | init(): log4j config file : C:\EDI-MON\src\config\log4j.properties
log4j: Parsing for [root] with value=[TRACE,EDIMON-APP].
log4j: Level token is [TRACE].
log4j: Category root set to TRACE
log4j: Parsing appender named "EDIMON-APP".
log4j: Parsing layout options for "EDIMON-APP".
log4j: Setting property [conversionPattern] to [%d{ISO8601} | %X{MDC_CONNECTION_ID} | %X{MDC_REMOTE_SESSION_ID} | %X{MDC_REMOTE_ADDRESS} | USERID=%X{MDC_USER_ID} | PIVA=%X{MDC_USER_PIVA} | %-5p | %c | %t | %m%n].
log4j: End of parsing for "EDIMON-APP".
log4j: Setting property [maxFileSize] to [2000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-APP" options.
log4j: Setting category factory to [it.sistinf.ediweb.logging.LoggerFactory].
log4j: Parsing for [org.displaytag] with value=[ERROR,EDIMON-APP].
log4j: Level token is [ERROR].
log4j: Category org.displaytag set to ERROR
log4j: Parsing appender named "EDIMON-APP".
log4j: Appender "EDIMON-APP" was already parsed.
log4j: Handling log4j.additivity.org.displaytag=[false]
log4j: Setting additivity for "org.displaytag" to false
log4j: Parsing for [soa.it.sistinf.ediweb] with value=[SOA#it.sistinf.ediweb.logging.LoggerLevel,EDIMON-SOA].
log4j: Level token is [SOA#it.sistinf.ediweb.logging.LoggerLevel].
log4j: toLevel:class=[it.sistinf.ediweb.logging.LoggerLevel]:pri=[SOA]
log4j: Category soa.it.sistinf.ediweb set to SOA
log4j: Parsing appender named "EDIMON-SOA".
log4j: Parsing layout options for "EDIMON-SOA".
log4j: Setting property [conversionPattern] to [%d{ISO8601} [USERID=%X{MDC_USER_ID}] [PIVA=%X{MDC_USER_PIVA}] %m%n].
log4j: End of parsing for "EDIMON-SOA".
log4j: Setting property [maxFileSize] to [1000KB].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [file] to [C:\EDI-MON\log\edi-web-mon-soa.log].
log4j: setFile called: C:\EDI-MON\log\edi-web-mon-soa.log, true
log4j: setFile ended
log4j: Parsed "EDIMON-SOA" options.
log4j: Handling log4j.additivity.soa.it.sistinf.ediweb=[true]
log4j: Setting additivity for "soa.it.sistinf.ediweb" to true
log4j: Finished configuring.
:::::::::::::

2 个答案:

答案 0 :(得分:1)

您的web.xml不正确

<servlet>
    <servlet-name>edimon</servlet-name>    
    <servlet-class>it.sistinf.ediweb.monitor.servlets.Monitoraggio</servlet-class>   
    <load-on-startup>0</load-on-startup>
</servlet>

<servlet>
    <servlet-name>salwf</servlet-name>
    <servlet-class>it.sistinf.ediweb.monitor.servlets.Salwf</servlet-class>
    <load-on-startup>0</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>edimon</servlet-name>
    <url-pattern>/edimon*</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>salwf</servlet-name>
    <url-pattern>/salwf.do</url-pattern>
</servlet-mapping>

编写XML文件时,必须遵循DTD。 DTD定义了标签的名称,属性和标签序列,标签应该出现的顺序。

根据DTD <servlet-mapping>无法在</servlet>之前出现。您可以从这里下载和参考 Web.xml DTD

<servlet-mapping>总是在<servlet>之后。它应该在所有servlet-nameservlet-class映射后开始。

正确的撰写方式/edimon.do/*/edimon.do/edimon*。 此处*它会匹配edimon之后的任何文字,例如: - /edimonXYZ/edimon.com

答案 1 :(得分:0)

自己解决:

错误是非常愚蠢的,这是因为如果我想进入secondo servlet,则URL必须是:

http://localhost:7001/edi-mon/salwf.do