Сервер Jboss 7.0.1, Spring MVC, 404 Не найдена проблема - PullRequest
1 голос
/ 13 декабря 2011

Мой web.xml выглядит так,

<web-app version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

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

    <listener>
        <listener-class>com.myapp.mg.listener.TokenListener</listener-class>
    </listener>


    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            classpath:applicationContext.xml,
            classpath:applicationContext-DataSource.xml,
            classpath:wurfl-default-ctx.xml,
            classpath:applicationContext-security.xml
        </param-value>
    </context-param>

    <servlet>
        <servlet-name>springwebapp</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:applicationContext-Web.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
</web-app>

Мой файл applicationContext-Web.xml выглядит следующим образом,

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:device="http://www.springframework.org/schema/mobile/device"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/mvc
                                            http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
                                            http://www.springframework.org/schema/beans
                                            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
                                            http://www.springframework.org/schema/context 
                                            http://www.springframework.org/schema/context/spring-context-3.0.xsd
                                            http://www.springframework.org/schema/mobile/device
                                            http://www.springframework.org/schema/mobile/device/spring-mobile-device-1.0.xsd">

    <!-- FOR MVC RESOURCE MAPPING DEFINITIONS -->

    <mvc:annotation-driven>
        <mvc:argument-resolvers>
            <bean class="org.springframework.mobile.device.DeviceWebArgumentResolver"/>
        </mvc:argument-resolvers>
    </mvc:annotation-driven>
    <context:annotation-config/>

    <mvc:interceptors>
        <bean class="org.springframework.mobile.device.DeviceResolverHandlerInterceptor">
            <constructor-arg>
                <!-- Inject a WurflDeviceResolver that populates its device repository from the specified file locations -->
                <device:wurfl-device-resolver root-location="classpath:wurfl/wurfl-latest.xml"
                                              patch-locations="classpath:/wurfl/web_browsers_patch.xml"/>
            </constructor-arg>
        </bean>
    </mvc:interceptors>

    <context:component-scan base-package="com.myweb.mg.web"/>



    <bean class="com.myweb.mg.resolver.ExternalResourceViewResolver">
        <property name="viewClass" value="com.myweb.mg.resolver.ExternalResourceView"/>
        <property name="prefix" value="${mg.appHostingFolder}"/>
        <property name="order" value="0"/>
    </bean>

    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
        <property name="prefix" value="/WEB-INF/jsp/"/>
        <property name="suffix" value=".jsp"/>
        <property name="order" value="1"/>
    </bean>

    <bean name="themeResolver" class="org.springframework.web.servlet.theme.FixedThemeResolver">
        <property name="defaultThemeName" value="theme"/>
    </bean>


</beans>

Теперь, когда я запускаю свое приложение на сервере, оно показывает ошибку 404, то есть

type Status report

message /myweb/

description The requested resource (/myweb/) is not available.

Может ли кто-нибудь дать мне несколько советов здесь, что я здесь делаю неправильно?

...