0

I have a maven webapp project which generates a .war file. I deployed it in tomcat 6 and it displays: page not found for the ìndex.jsp and a white page for the login.jsp.

And did not get any problems in the tomcat history files and also in the file log.xml under my D:\

I tried in IE and Firefox.

Some suggestions will be the welcome.

EDIT

my web app structure :

enter image description here

my web.xml :

    <?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_ID">
<!--
  <web-app>
 -->
    <description>POSANet</description>
    <display-name>posanet2</display-name>

    <session-config>
        <session-timeout>10</session-timeout>
    </session-config>

    <!-- Context Parameters -->
    <context-param>
        <param-name>debug</param-name>
        <param-value>false</param-value>
    </context-param>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>

            classpath:applicationContext-acegi-security.xml
            classpath:applicationContext-ajax.xml
            classpath:applicationContext-service.xml
<!--            classpath:applicationContext-ws.xml-->
            classpath:applicationContext-common.xml
            classpath:applicationContext-datasSource.xml
            classpath:applicationContext-dao.xml
            classpath:applicationContext-notification.xml
            classpath:applicationContext-wsbscs.xml
<!--            classpath:applicationContext-jcaptcha.xml -->
<!--        classpath:applicationContext-mq.xml -->
        </param-value>
    </context-param>

    <!--            classpath:applicationContext-mq.xml
     -->


    <!-- log4j -->
    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>/WEB-INF/classes/log4j.xml</param-value>
    </context-param>

    <context-param>
        <param-name>log4jRefreshInterval</param-name>
        <param-value>120000</param-value>
    </context-param>

    <!-- Le lien vers site -->
    <context-param>
        <param-name>com.application.sitePrefix</param-name>
        <param-value>http://www.application.com</param-value>
    </context-param>

    <!-- Log4j intialisation -->
    <listener>
        <listener-class>
            org.springframework.web.util.Log4jConfigListener
        </listener-class>
    </listener>

    <!-- Spring intialisation -->
    <listener>
        <listener-class>
            org.springframework.web.context.ContextLoaderListener
        </listener-class>
    </listener>


    <listener>
        <listener-class>
            com.application.posanet.util.SessionListener
        </listener-class>
    </listener>


    <!-- Encoding Filter -->
    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>
            org.springframework.web.filter.CharacterEncodingFilter
        </filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>*.form</url-pattern>
    </filter-mapping>

    <!--  Expired Spring Web Flow Clean up Filter -->
    <filter>
        <filter-name>flowCleanup</filter-name>
        <filter-class>org.springframework.webflow.execution.servlet.ExpiredFlowCleanupFilter</filter-class>
        <init-param>
            <param-name>timeout</param-name>
            <param-value>20</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>flowCleanup</filter-name>
        <servlet-name>spring</servlet-name>
    </filter-mapping>

    <!-- Spring MVC Servlet -->
    <servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>*.form</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>*.jsp</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>*.excel</url-pattern>
    </servlet-mapping>

    <!-- DWR -->
    <servlet>
        <servlet-name>dwr-invoker</servlet-name>
        <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>true</param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>dwr-invoker</servlet-name>
        <url-pattern>/dwr/*</url-pattern>
    </servlet-mapping>

    <!-- Security -->
    <filter>
        <filter-name>Acegi Filter Chain Proxy</filter-name>
        <filter-class>
            net.sf.acegisecurity.util.FilterToBeanProxy
        </filter-class>
        <init-param>
            <param-name>targetClass</param-name>
            <param-value>
                net.sf.acegisecurity.util.FilterChainProxy
            </param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>Acegi Filter Chain Proxy</filter-name>
        <servlet-name>spring</servlet-name>
    </filter-mapping>

    <filter-mapping>
        <filter-name>Acegi Filter Chain Proxy</filter-name>
        <url-pattern>/j_acegi_security_check</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>Acegi Filter Chain Proxy</filter-name>
        <servlet-name>dwr-invoker</servlet-name>
    </filter-mapping>


    <listener>
        <listener-class>
            net.sf.acegisecurity.ui.session.HttpSessionEventPublisher
        </listener-class>
    </listener>

    <!-- Jsp config -->

    <jsp-config>
        <taglib>
            <taglib-uri>util-functions</taglib-uri>
            <taglib-location>/WEB-INF/classes/util-functions.tld</taglib-location>
        </taglib>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <page-encoding>UTF-8</page-encoding>
        </jsp-property-group>
    </jsp-config>

    <!-- Ressource -->

    <resource-ref>
        <description>Main Data Source</description>
        <res-ref-name>jdbc/posadb</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.htm</welcome-file>

        <welcome-file>default.jsp</welcome-file>
        <welcome-file>default.htm</welcome-file>

    </welcome-file-list>

    <!-- Error pages -->
    <error-page>
        <error-code>400</error-code>
        <location>/WEB-INF/pages/message/notFound.jsp</location>
    </error-page>

    <error-page>
        <error-code>404</error-code>
        <location>/WEB-INF/pages/message/notFound.jsp</location>
    </error-page>

    <error-page>
        <error-code>403</error-code>
        <location>/WEB-INF/pages/message/forbidden.jsp</location>
    </error-page>

    <error-page>
        <error-code>500</error-code>
        <location>/WEB-INF/pages/message/internalError.jsp</location>
    </error-page>

    <error-page>
        <error-code>408</error-code>
        <location>/WEB-INF/pages/message/timeExceeded.jsp</location>
    </error-page>

</web-app>

Structure target : enter image description here

Hohenheim
  • 1,545
  • 1
  • 12
  • 28
  • 1
    Show more Detail. web.xml and so on – Jens Jan 13 '16 at 10:04
  • 1
    post the webapp structure and url you are accessing it in browser – prem kumar Jan 13 '16 at 10:17
  • edited @prem kumar the url is : http://localhost:8080/posanet2/index.jsp or http://localhost:8080/posanet2/login.jsp – Hohenheim Jan 13 '16 at 10:33
  • what kind of request mappings you have defined in your spring mvc controller? Also can you see in tomcat/logs/catalina.out if any errors – prem kumar Jan 13 '16 at 10:48
  • didnt' find anything in `catalina`, i got a file `spring-servlet` and `tiles-definitions` for the layout , i post them ? – Hohenheim Jan 13 '16 at 11:07
  • Your project structure looks messed up. Have a look into target/posanet2.war, if the created structure looks good and if index.jsp (badly mapped to the DispatcherServlet) is in the root directory. – Stefan Jan 13 '16 at 12:31
  • why he's messed up ? i'll edit the poste with structure of `target\posanet` @Stefan – Hohenheim Jan 13 '16 at 13:15
  • Possible duplicate of [How to compile a servlet for Tomcat in command line? error: package javax.servlet does not exist](http://stackoverflow.com/questions/14104937/how-to-compile-a-servlet-for-tomcat-in-command-line-error-package-javax-servle) – Paul Sweatte Sep 29 '16 at 14:06

0 Answers0