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:
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>
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).
You can easy solve it by: Fetch external resource.
Click the light(your is red) -> Fetch external resource.
This did the work:
Alt+Enter -> Fetch external resource
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With