IDEA Cannot resolve library

IDEA v.12.1.3.
I’ve got a maven dependency with some Faces tag library descriptor.
It contains something like:
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib version="2.0" 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-facelettaglibrary_2_0.xsd">
      <namespace>http://abc.com/core</namespace>
      <composite-library-name>abc/core</composite-library-name>
</facelet-taglib>

When the corresponding namespace (http://abc.com/core) is defined in my faces xhtml file, IDEA says: URI is not registered.
<html

      xmlns:abc="http://abc.com/core"
      xmlns:abcb=”http://abc.com/b”

But it doesn’t complain about http://abc.com/b namespace which is defined in the same library in another descriptor file.

The only difference between these 2 descriptor files is <composite-library-name>, which is not in the second one.

When I open this "problem" descriptor file in my project, IDEA colors "abc/core" in red and says: Cannot resolve library. But if I create such project with these tag library descriptor files in IDEA, everything can be resolved and even I can navigate to this abc/core directory.

The question is, why this namespace which contains <composite-library-name> tag is considered to be not registered URI?

2 comments

That simply means IDEA does not yet know about the schema or DTD and is unable to automatically resolve its location. It's an easy fix. With your cursor on the error, open the quick fix popup (ALT+Enter). Select "Fetch External Resource". IDEA will attempt to download the needed schema or DTD. If is is successful, the red highlighting will go away and you will have syntax checking and code completion for the namespace. If IDEA is not able to fetch it, you will need to manually configure it. Open the quick fix popup again and select "Manually Setup External Resource". If the schema is in a project dependency, just select it on the "schemas " tab. If not, select the "Explorer" tab, then locate and select the schema from the file system.

You can also manual configure schemes in the settings: File > Settings > [Project Settings] schemas and DTDs

0

Thanks, but unfortunately it doesn't help. I can't find this library in "Schemas" tab, probably because IDEA considers this descriptor file not to be valid.

0

Please sign in to leave a comment.