Thymeleaf template/ view not found - Spring 4 - java

I'm setting up a new SPring4 app using Thymeleaf and keep encountering the same issue when it comes to returning the view. I've searched don here and followed some online tutorials but the same error so I'm thinking it may be due to configuration, any help is appreciated, thanks.
The error : org.thymeleaf.exceptions.TemplateInputException: Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers
And then my config is:
Web.xml:
<web-app 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_3_0.xsd"
version="3.0">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<!-- Use the simplified configuration by default. -->
<context-param>
<param-name>spring.profiles.default</param-name>
<param-value>simple</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>Test</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value></param-value>
</init-param>
<init-param>
<param-name>spring.profiles.default</param-name>
<param-value>simple</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<display-name>Test Web Application</display-name>
mcv.xml:
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<mvc:annotation-driven/>
<!--Allows for static content to easily be served up without needing a controller etc-->
<mvc:resources mapping="/images/**" location="/assets/img/"/>
<mvc:resources mapping="/css/" location="/assets/css/"/>
<mvc:resources mapping="/assets/**" location="/assets/"/>
<!--taken from the thymeleaf site-->
<bean id="templateResolver"
class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".html" />
<property name="templateMode" value="HTML5" />
<property name="cacheable" value="false" />
</bean>
<bean id="templateEngine"
class="org.thymeleaf.spring4.SpringTemplateEngine">
<property name="templateResolver" ref="templateResolver" />
</bean>
<bean class="org.thymeleaf.spring4.view.ThymeleafViewResolver">
<property name="templateEngine" ref="templateEngine" />
</bean>
</beans>
rootcontext.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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<import resource="mvc.xml" />
<!--double asterisk allows for recursive search - load all under the pacakge-->
<context:component-scan
base-package="
com.example.*"/>
<context:property-placeholder location="classpath:application.properties"/>
</beans>
Edit:
Controller:
#Controller //restcontroller is not meant to be for returning view, but instead the data http://stackoverflow.com/questions/33062509/returning-view-from-spring-mvc-restcontroller
#EnableAutoConfiguration
public class EmrController {
#Autowired EmrService emr;
#ModelAttribute("emrClusterList")
private List<EmrCluster>getAllClusters(){ return emr.getRunningClusters(); }
#RequestMapping(value = "/EmrClusters", method = RequestMethod.GET)
public String displayEmrList(Model model){
model.addAttribute("emrClusterList", emr.getRunningClusters());
return "index";
}

Related

getting null value when using #Value injection in class annotated by #Service but able to get values in class annotated by #Controller

I am getting null value when trying to inject it using #Value injection in clas annotated by #Service Class but i am able to get values for same properties in class annotated by #Service
I am using Spring 4.2 vesion
web.xml is as follow:::
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
<display-name></display-name>
<servlet>
<servlet-name>CaptchaServlet</servlet-name>
<servlet-class>com.cdac.sikkimSprings.servlets.CaptchaServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CaptchaServlet</servlet-name>
<url-pattern>/captcha.jpg</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>SpringController</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>SpringController</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/beans.xml
/WEB-INF/spring-security.xml
</param-value>
</context-param>
<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>
</filter-mapping>
</web-app>
springMVC.xml is as follow
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/context/spring-context-4.0.xsd">
<context:component-scan base-package="com.basePackage" />
<mvc:annotation-driven />
<mvc:resources mapping="/resources/**" location="/resources/" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
<context:property-placeholder location="classpath:properties/development.properties" order="1"/>
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
</beans>
i also have beans.xml for bean definitions which is as follow
<?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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd">
<!-- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property
name="url" value="jdbc:mysql://localhost:3306/test" /> <property name="username"
value="root" /> <property name="password" value="password" /> </bean> -->
//Bean definition mentioned below is the same class where i need the property values to be injected
which is annotated by #Service annotation
<bean id="userManagement"
class="com.basepackage.userManagement">
</bean>
</beans>
Below is actual java class where values are needed to be injected
#Service("userManagementService")
#Transactional
public class userManagement implements RetrieveUserListService{
//This value is not getting injected
#Value("${registrationstatus_registered}")
String statusRegistered;
#Value("${registrationstatus_pending}")
String statusPending;
#Override
public List<ShowUserListPOJO> RetrieveUserList(HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
//here the required value is null
System.out.println(statusRegistered);
return null;
}
//Code bellow is skipped...
Same values i am injecting in class below here they are injected properly
#Controller
public class UserManagement {
#Value( "${registrationstatus_registered}" )
String registrationstatus;
#RequestMapping(value="/userManagement", method = RequestMethod.GET)
public void userManagement(HttpServletRequest request,HttpServletResponse response) {
//here value is prnted properly
System.out.println(registrationstatus);
//......Code below skipped
}
development.properties is as follow
registrationstatus_registered = registered
registrationstatus_pending = pending
In your application you have two spring contexts: root application context (ContextLoaderListener) and web application context(DispatcherServlet). You need to understand the difference between them. Read here .
If you move your property resource definition to beans.xml(which is used for root context), your property value will be injected correctly throughout the application.
move this bean difinition to beans.xml
<context:property-placeholder location="classpath:properties/development.properties" order="1"/>.

Atmosphere Framework Integration with spring MVC mapping not found in controller

web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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_3_0.xsd"
version="3.0">
<servlet>
<servlet-name>chatbook</servlet-name>
<servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class>
<init-param>
<param-name>org.atmosphere.servlet</param-name>
<param-value>org.springframework.web.servlet.DispatcherServlet</param-value>
</init-param>
<init-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/chatbook-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>chatbook</servlet-name>
<url-pattern>/chatbook/*</url-pattern>
</servlet-mapping>
my chatbook-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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache-4.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.2.xsd">
<context:component-scan
base-package="com.chatbook.web.controllers">
</context:component-scan>
<mvc:annotation-driven>
</mvc:annotation-driven>
<bean id="jspResolveToViews"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jspfiles/">
</property>
<property name="suffix" value=".jsp"></property>
</bean>
<mvc:resources location="/staticresources/" mapping="/static/**" ></mvc:resources>
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename"
value="com.chatbook.web.localizeMessages.messages">
</property>
</bean>
my controller:
#Controller
public class ChatController{
#RequestMapping("/")
public String showSignUp(){
return "signup";
}
}
I m trying to integrate Atmosphere with spring MVC but its not take me to right requestmapping and get this warning:
org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/chatbook/] in DispatcherServlet with name 'chatbook'
I am using tomcat 7 server and set connector tag in server.xml with
protocol="org.apache.coyote.http11.Http11NioProtocol"
Please help me anyone tell me correct onfiguration of atmoshphere framework(runtime 2.4.7) with spring mvc..thanks

spring render welcome file like a text

I am new in spring, my issue is that index.jsp show me like text.
this is my web.xml
I use netbeans, spring 4, glassfish and maven
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<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>*.jsp</url-pattern>
</servlet-mapping>
</web-app>
spring-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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
">
<mvc:default-servlet-handler/>
<context:annotation-config />
<mvc:annotation-driven />
<mvc:resources mapping="/images/**" location="/images/" />
<mvc:resources mapping="/css/**" location="/css/" />
<mvc:resources mapping="/bootstrap/**" location="/resources/" />
<mvc:resources mapping="/js/**" location="/js/" />
<context:component-scan base-package="mx.com.shopping.cart.spring.controller" />
<bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property>
<property name="prefix" value="/WEB-INF/jsp/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
</beans>
my tree directory
but show
browser
Let your spring dispatcher map your urls. So in your web.xml change your welcome-file to:
<welcome-file>/</welcome-file>
then in your controller add a mapping for index.
#RequestMapping(value = "/", method = RequestMethod.GET)
public String viewIndex() {
return "index";
}
And put your index.jsp inside your WEB-INF/jsp folder

MIME type text/html

Hi I'm working on a project and try to add css to a page but its not loading and when i check srourcecode at the browser I get a :
Resource interpreted as Stylesheet but transferred with MIME type text/html:
I tried to load css in every way, with
- " rel="stylesheet">
-
- even with #import file ( not a best practice but i tried...)
and its not working.
Files:
Project:
-WebContent
-resources
- css
-main.css
-WEB-INF-
-MTEA-INF
Web.xml:
<?xml version="1.0" encoding="UTF-8"?>
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<!-- The front controller of this Spring Web application, responsible for
handling all application requests -->
<servlet>
<servlet-name>springapp</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/springapp-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map all requests to the DispatcherServlet for handling -->
<servlet-mapping>
<servlet-name>springapp</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
dispatcher-servlet.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" 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/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:component-scan base-package="com.drs.controller" />
<mvc:annotation-driven />
<mvc:resources mapping="/resources/**" location="resources/" />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView"></property>
<property name="prefix" value="/WEB-INF/jsp/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
Anyone have an ideea?How to solve this?

Spring #Autowired Field - NoSuchBeanDefinitionException

I realize this question has been asked many times, but those answers don't seem to get me working.
The class which has the #Autowired field:
#Component
public class SpecialClaimsCaseManager {
#Autowired
private SpecialClaimsCaseRepositoryService<SpecialClaimsCaseDto> service;
public SpecialClaimsCaseManager() {
}
public Collection<SpecialClaimsCase> findAll() {
return convertToSpecialClaimsCase(service.findAll());
}
The interface SpecialClaimsCaseRepositoryService
public interface SpecialClaimsCaseRepositoryService<C extends SpecialClaimsCaseDto> {
//Some method signatures, not relevant
The implementation class (what should be injected)
#Service("specialClaimsCaseRepositoryService")
public class SpecialClaimsCaseRepositoryServiceImpl implements SpecialClaimsCaseRepositoryService<SpecialClaimsCaseDto> {
//Some method implementations, not relevant
mvcDispatcher.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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
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">
<context:component-scan base-package="com.redacted.sch"/>
<mvc:resources mapping="/resources/**" location="/resources/" />
<mvc:annotation-driven />
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
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">
<display-name>SpecialClaimsHandling</display-name>
<!-- Spring Configuration Files -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/application-security.xml
classpath*:sch_model_spring.xml
</param-value>
</context-param>
<!-- Spring Security Filters -->
<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>
</filter-mapping>
<!-- Spring Listeners -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- MVC Filter -->
<servlet>
<servlet-name>mvcDispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>mvcDispatcher</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<!-- Session Configuration -->
<session-config>
<session-timeout>5</session-timeout>
</session-config>
</web-app>
sch_model_spring.xml (in another project)
<?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:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:component-scan base-package="com.redacted.sch.model"/>
<tx:annotation-driven />
<tx:jta-transaction-manager />
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.ibm.db2.jcc.DB2Driver" />
<property name="url" value="redacted" />
<property name="username" value="redacted" />
<property name="password" value="redacted" />
</bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="schManager" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
</beans>
Full stack trace (fpasted because it's pretty long) http://fpaste.org/116696/14049194/
So, as we can see, mvc:annotation-driven is enabled, and autowiring is enabled. If I understand this correctly (I might not, pretty new to Spring), this should be all I need. SpecialClaimsCaseRepositoryService is an interface, if that matters, though I don't think it should as this same #Autowiring worked fine in another class annotated with #Controller.
Thanks for any help!
You'll notice from your stack trace that the exception occurs in the process of initializing the root application context loaded by the ContextLoaderListener. That's taken from
<!-- Spring Configuration Files -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/application-security.xml
classpath*:sch_model_spring.xml
</param-value>
</context-param>
In those two, you are scanning
<context:component-scan base-package="com.redacted.sch.model"/>
but not the com.redacted.sch.service... package that is required by one of the beans.
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.redacted.sch.service.SpecialClaimsCaseRepositoryService com.redacted.sch.model.SpecialClaimsCaseManager.specialClaimsCaseRepositoryService;
In this case, xyz.model.SpecialClaimsCaseManager has an #Autowired field of type xyz.service.SpecialClaimsCaseRepositoryService, but no such bean exists.
Don't mix component-scanned folders between application contexts, those loaded by ContextLoaderListener vs DispatcherServlet. Refactor so that application beans are loaded by the ContextLoaderListener and controller-related beans are loaded by the DispatcherServlet.
Reading:
Difference between applicationContext.xml and spring-servlet.xml in Spring Framework
What is the difference between ApplicationContext and WebApplicationContext in Spring MVC?

Categories

Resources