5

Having updated to IntelliJ 14.0.3 Community Edition I am working on a new web project, but suddenly IntelliJ does not find the most basic schema definitions anymore. Here are examples: https://i.stack.imgur.com/FVYld.png and https://i.stack.imgur.com/SboLZ.png.

I have tried to 'Fetch External Resource', but with no success.

Using this approach "JSF xmlns URI not registered in IntelliJ IDEA" I imported web-facelettaglibrary_2_2.xsd, but the auto competition had errors and was useless.

I try to get this to work for weeks now and get 'URI is not registered' and 'Cannot resolve symbol' errors all over the place. How IntelliJ can be unaware of these URIs is completely beyond me.

Can someone please help me get my beloved auto competition up and running again?

Update:

I finally got the web-app schema working by adding web-app_3_1.xsd and every file it references and their references as well, namely:

  • javaee_7.xsd
  • javaee_web_services_client_1_4.xsd
  • jsp_2_3.xsd
  • web-app_3_1.xsd
  • web-common_3_1.xsd.

All from here: hxxp://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html

Community
  • 1
  • 1
Johannes
  • 828
  • 12
  • 29
  • I am using the Ultimate edition of IDEA for a few years now and never had these issues again, but maybe this works now with the Community edition, too. – Johannes Sep 12 '20 at 12:01

1 Answers1

4

I have tried the same (with the firewall blocking all IntelliJ's external connections) and this worked for me:

web.xml

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"></web-app>

pom.xml

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>7.0</version>
    </dependency>

From Java EE Schemas download the definition web-app_3_1.xsd. In IntelliJ manually add an external resource and select the file you just downloaded. You can also see it under Settings > Languages & Frameworks > Schemas and DTDs in the list of external schemas.

kol
  • 76
  • 4
  • Adding that dependency did not work for me, IntelliJ still could not recognize the namespaces. I checked my firewall settings and IntelliJ is not blocked, I was actually hoping for a quick fix for the fetching mechanism here. IntelliJ tries to get the file and shows a little message about that at the bottom, but it obviously fails to get it. I can open the XSD file in my browser using the exact same link and I explicitly ran IntelliJ with administrator privileges, restarting it most of the time after a change. – Johannes Feb 22 '15 at 17:57
  • When I set it up manually it is working for most namespaces, but for some I can not get it to work. For example, I could get it to work for persistence_2_1.xsd and urn:jboss:deployment-structure:1.2 and finally even managed to get it to work for web.xml, but I still do not know what files to add for the JSF tags (see first screenshot in my question). – Johannes Feb 22 '15 at 17:59
  • Are you using the community edition? Of not, try these steps: https://www.jetbrains.com/idea/help/preparing-for-jsf-application-development.html – kol Feb 23 '15 at 07:45
  • No, I am using the Community Edition.. it should still be able to use schema information from additional XSD resources, if only I knew which ones to add for JSF. – Johannes Feb 27 '15 at 14:22