Frage

Im trying to deploy my ear file once I install the application and try to start the server it doesnt start and I get the following error: Error:

SimpleUrlHand I org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
registerHandler Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'

Web.xml:

   <?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" 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>excs</display-name>
<listener>
    <listener-class>
        org.springframework.web.context.ContextLoaderListener
    </listener-class>
</listener>

<servlet>
    <servlet-name>springmvc</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
      <servlet-name>springmvc</servlet-name>
      <url-pattern>/</url-pattern>
</servlet-mapping>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/spring-security.xml
        /WEB-INF/springmvc-servlet.xml 
    </param-value>
</context-param>

  <!-- Spring Security -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>   <!-- all actions will intercepted -->
</filter-mapping>


<welcome-file-list>
    <welcome-file>/WEB-INF/index.jsp</welcome-file>
</welcome-file-list>
    </web-app>

Springmvc-servlet.xml:

 <?xml version="1.0" encoding="UTF-8"?>
 <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:jee="http://www.springframework.org/schema/jee"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:tx="http://www.springframework.org/schema/tx"
   xsi:schemaLocation=
     "http://www.springframework.org/schema/mvc
      http://www.springframework.org/schema/mvc/spring-mvc-3.0.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/tx
      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

<!-- all static thing should be listed under the resources folder. for example, 
 img, css, ... -->
<mvc:resources mapping="/resources/**" location="/resources/" />   <!-- sets up a 
  handler for serving static content -->

<!-- Configures the annotation-driven Spring MVC Controller programming model.
     Note that, with Spring 3.0, this tag works in Servlet MVC only!  -->
<mvc:annotation-driven/> <!-- turn on all of the annotation-driven features you’ll 
  need from Spring MVC -->

<!-- Activates various annotations to be detected in bean classes -->
<!-- tells Spring that you intend to use annotation-based wiring in Spring.    
                              Spring 3 supports a few different annotations for 
  autowiring:
                              Spring’s own @Autowired 
 annotation
                              @Inject annotation from 
 JSR-330
                              @Resource annotation from 
 JSR-250
                               -->
<context:annotation-config /> 


<!-- Scans the classpath for annotated components that will be auto-registered as 
 Spring beans.
 For example @Component,@Controller, @Repository, and @Service. Make sure to set the 
 correct base-package-->
<context:component-scan base-package="psup.excs" />    


<!-- To use Tiles views in Spring MVC, add the following two -->
<!-- TilesConfigurer loads one or more Tiles definition files and make them available    
 for
     TilesViewResolver to resolve views from. -->    
<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver" 
id="tilesViewResolver">
    <property name="order" value="1"/>
    <property name="viewClass" 
  value="org.springframework.web.servlet.view.tiles2.TilesView"/>
</bean>
<bean class="org.springframework.web.servlet.view.tiles2.TilesConfigurer" 
  id="tilesConfigurer">
    <property name="definitions">
        <list>
            <value>/WEB-INF/tiles-config.xml</value>
        </list>
    </property>
</bean>

<!-- if not using tiles, uncomment out the folowing and comment out the above 
    tilesViewResolver and tileConfiguerer,
     then controlller will forward to jsp instead of tiles. 
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/views/"></property>
    <property name="suffix" value=".jsp" />
</bean>
!-->  


<!-- MyBatis Configuration -->   

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="jdbc/excs" />     
    <property name="resourceRef" value="false" />
</bean>

<tx:annotation-driven transaction-manager="txManager" /> 
<bean id="txManager"  

  class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource" /> 
</bean>

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean" 
scope="singleton">
    <property name="dataSource" ref="dataSource"/>
    <property name="typeAliasesPackage" value="excs.data.bean" />
</bean>

<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <property name="basePackage" value="excs.data.mapper" /> 
</bean>


    </beans>
War es hilfreich?

Lösung

I Solved it! Basically our WAS tech team installed Hibernate on application server and this application uses myBatis so conflict was there. Once we uninstalled Hibernate it worked fine and server did start.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top