Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs) in applicationContext.xml

I created an application Context.xml at the WEB-INF/classes directory. and I have added the <!DOCTYPE> in the xml. I am getting the below error:

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

You can see the snapshot below:

enter image description here

The xml is below:

<?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>
like image 982
qg_java_17137 Avatar asked Mar 03 '17 02:03

qg_java_17137


People also ask

How do I fetch an external resource in IntelliJ?

Place the caret at the referenced URL and press Alt+Enter . From the list of suggested options, select one of the following: Fetch external resource. IntelliJ IDEA downloads the referenced file and associates it with the URL (or the namespace URI).


4 Answers

You can easy solve it by: Fetch external resource.

Click the light(your is red) -> Fetch external resource.

like image 67
aircraft Avatar answered Oct 16 '22 13:10

aircraft


This did the work:

Alt+Enter -> Fetch external resource

like image 39
Grandtour Avatar answered Oct 16 '22 14:10

Grandtour


I'm assuming this is in IntelliJ IDEA or some other JetBrains tool. If you place the cursor over the URL (or select it), you should see a red bulb on the left border of the window. That red bulb, when clicked, will give you some options to correct any errors. One of the options should be to download the DTD (Fetch external resource). Do that and the error should go away.

like image 13
BamaPookie Avatar answered Oct 16 '22 14:10

BamaPookie


If you select and hit ALT+ENTER i.e. More Actions... then following options would be displayed:

1. Add xsi schema location for external resource
2. Fetch external resource <- my preferred way
3. Ignore external resource
4. Manually setup external resource

Most of the time you would either select option no. 2 or 3 to get rid of this error.

like image 11
Saikat Avatar answered Oct 16 '22 15:10

Saikat