Spring MVC - Environment setup on Intellij

| Mar 27, 2022 min read

Preface

This is notes base on Udemy Q&A - Liberty’s comment and Spring MVC Setup on IntelliJ.

My source code

Error - Context initialization failed

if you are seeing this error that means you might miss some config in your xml

// Errr log
org.springframework.web.context.ContextLoader.initWebApplicationContext Context initialization failed
...
The matching wildcard is strict, but no declaration can be found for element 'context:component-scan'

You have to declare xmlns:context namespace and setup schema inxsi:schemaLocation, so put below into your xsi:schemaLocation and restart tomcat server.

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd

Others

Change log message language on intellij

If you found that log message is not fully in English. You can config it in Tomcat

  • Run/Debug configuration
  • add -Duser.language=en into VM options

Reference

Hot to change error messages to English (Intellij)?

spring中注解注入 context:component-scan 的使用说明