Results 1 to 7 of 7

Thread: 404 error on Spring+Weblogic

Hybrid View

  1. #1
    Join Date
    Dec 2011
    Posts
    4

    Default 404 error on Spring+Weblogic

    Hi, All
    I'm using spring+hibernate in a web project on weblogic. There is a servlet mapping(InternalResourceViewResolver): from *.jsp => .htm,
    when I open a url http://localhost:7001/app/index.htm (it should be responsed by a spring controller), but Weblogic throw 404 page not found.

    How can I abandon Weblogic finding *.htm request-url as a file?

    thanks for any responses!

  2. #2
    Join Date
    Jan 2006
    Location
    Seattle, Washington
    Posts
    467

    Default

    You'd have to provide much more information. Show your context, particularly your view resolver configuration.

  3. #3
    Join Date
    Dec 2011
    Posts
    4

    Default

    DispatcherServlet define contextConfigLocation:
    <bean id="viewReslover" class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
    <property name="viewClass">
    <value>org.springframework.web.servlet.view.JstlVi ew</value>
    </property>
    <property name="prefix">
    <value>/WEB-INF/jsp/</value>
    </property>
    <property name="suffix">
    <value>.jsp</value>
    </property>
    </bean>

    and this is controller mapping:
    <bean id="SimpleUrlMap_framework_query" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
    <property name="mappings">
    <props>
    <prop key="/main.htm">mainController</prop
    </props>
    </property>
    </bean>

    why weblogic12c can't redirect url to my controller?Thranks

  4. #4
    Join Date
    Jan 2006
    Location
    Seattle, Washington
    Posts
    467

    Default

    The missing link is likely your web.xml, then. Show us that.

  5. #5
    Join Date
    Dec 2011
    Posts
    4

    Default web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <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">
    <display-name>sys</display-name>
    <description>JSP application</description>
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    classpath:spring/framework-data.xml,
    classpath:spring/framework-common.xml,
    classpath:spring/framework-query.xml,
    /WEB-INF/spring/sys-portal.xml,
    /WEB-INF/spring/sys-bbs.xml
    </param-value>
    <!--framework-sms.xml-->
    </context-param>
    <!--encoding-->
    <filter>
    <filter-name>sessionFilter</filter-name>
    <filter-class>com.wri.hy.framework.application.framework.s ecurity.controller.SessionFilter</filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>utf-8</param-value>
    </init-param>
    <init-param>
    <param-name>isCheck</param-name>
    <param-value>true</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>sessionFilter</filter-name>
    <url-pattern>*.htm</url-pattern>
    </filter-mapping>
    <listener>
    <listener-class>com.wri.hy.framework.application.framework.s ecurity.controller.SessionListener</listener-class>
    </listener>

    <!--spring-->
    <servlet>
    <servlet-name>framework</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:spring/framework-servlet.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>context</servlet-name>
    <servlet-class>org.springframework.web.context.ContextLoade rServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>framework</servlet-name>
    <url-pattern>*.htm</url-pattern>
    </servlet-mapping>

    <!--Axis Web Services-->
    <servlet>
    <servlet-name>AxisServlet</servlet-name>
    <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/servlet/AxisServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>*.jws</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
    </servlet-mapping>

    <session-config>
    <session-timeout>240</session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <error-page>
    <error-code>404</error-code>
    <location>/fileNotFound.html</location>
    </error-page>

    </web-app>

  6. #6
    Join Date
    Dec 2008
    Location
    India
    Posts
    295

    Default

    Which url you firing? and try to change loading order as two servlet at same order(suggestion not solution yet)
    Enjoy
    Rohan Chauhan
    ------------------------------------------------------------------------------
    SpringSource Certified Spring 3.0 Professional


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •