2017-03-03 472 views
7

我在WEB-INF/classes目錄中創建applicationContext.xml。 並添加在XML中,卻得到了一個錯誤:URI未在applicationContext.xml中註冊(設置|語言和框架|模式和DTD)

URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)

你可以看到下面的快照:

enter image description here

的XML如下:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> // -> there comes the issue 
<beans xmlns="http://www.springframework.org/schema/beans" 
     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.xsd"> 

</beans> 

回答

12

你可以輕鬆解決它:獲取外部資源。

單擊光(你是紅色) - >獲取外部資源。

2

我假設這是在IntelliJ IDEA或其他JetBrains工具。如果將光標放在URL上(或選擇它),則應在窗口左邊看到一個紅色燈泡。單擊紅色燈泡時,會給你一些選項來糾正任何錯誤。其中一個選項應該是下載DTD(獲取外部資源)。這樣做和錯誤應該消失。

1

對我來說建設>清潔工程工作。