You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Shammat <sh...@gmx.net> on 2019/07/12 13:48:17 UTC

NetBeans fails to validate web.xml - bug or missing feature?

NetBeans 11.1-vc1 fails to alidate a valid web.xml

When I open my web.xml from my project and click on the "Validate XML" button (the two down arrows), it shows the following error message:

XML validation started.
Checking file:/C:/**********/src/main/webapp/WEB-INF/web.xml...
schema_reference.4: Failed to read schema document 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. [2]
cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [2]

However, the file "web-app_2_4.xsd" is contained in several jar files.

It is contained in "org-netbeans-modules-j2ee-dd.jar", but inside that jar file it's in the package/directory:

   org/netbeans/modules/j2ee/dd/impl/resources

rather than "org/netbeans/modules/j2ee/ddloaders/catalog/resources" where the editor seems to expect it.

And it's also part of servlet3.1-jsp2.3-api.jar, but there it's in the package/directory "resources/schemas"

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans fails to validate web.xml - bug or missing feature?

Posted by Pete Whelpton <pe...@gmail.com>.
Ok - having a quick look at github, it looks like my change to
EnterpriseCatalog.java might have been regresessed  by 3e7e6fe6,
specifically:

private static final String RESOURCE_PATH =
"nbres:/org/netbeans/modules/j2ee/dd/impl/resources/"; //NO18N

Changed back to:

private static final String RESOURCE_PATH =
"nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/"; //NO18N

When those xsd files no longer exist. I suspect they were removed as part
of the donation due to licencing.

It seemed sensible to me to reference the xsd already in a dependent
module, rather than keep two copies - but happy to defer to NB gurus.


P


On Tue, 16 Jul 2019, 09:40 Thomas Kellerer, <sh...@gmx.net> wrote:

> Pete,
>
> thanks for the suggestion.
>
> The project was indeed "migrated" from NetBeans 8.2 - but it's a Maven
> project.
> So the only (project) configuration file there is, is the pom.xml
>
> There is nbactions.xml but that does not seem to contain any entries
> relevant for that.
>
> nb-configuration.xml contains the following
>
>     <?xml version="1.0" encoding="UTF-8"?>
>     <project-shared-configuration>
>         <!--
>     This file contains additional configuration written by modules in the
> NetBeans IDE.
>     The configuration is intended to be shared among all the users of
> project and
>     therefore it is assumed to be part of version control checkout.
>     Without this configuration present, some functionality in the IDE may
> be limited or fail altogether.
>     -->
>         <properties xmlns="
> http://www.netbeans.org/ns/maven-properties-data/1">
>             <!--
>     Properties that influence various parts of the IDE, especially code
> formatting and the like.
>     You can copy and paste the single properties, into the pom.xml file
> and the IDE will pick them up.
>     That way multiple projects can share the same settings (useful for
> formatting rules for example).
>     Any value defined here will override the pom.xml file value but is
> only applicable to the current project.
>     -->
>
> <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>Tomcat</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
>             <netbeans.hint.jdkPlatform>JDK_1.8</netbeans.hint.jdkPlatform>
>         </properties>
>     </project-shared-configuration>
>
>
> Not sure if that influences the resolution of the XSD files.
>
> Thomas
>
>
> Pete Whelpton schrieb am 16.07.2019 um 10:10:
> > Hi Thomas,
> >
> > I was banned from bringing a laptop on holiday, so this is from memory -
> > please excuse any mistakes.
> >
> > I submitted https://github.com/apache/netbeans/pull/1266 to update the
> > enterprise catalog to look for JavaEE XSDs in
> org/netbeans/modules/j2ee/dd/
> > impl/resources
> >
> > I'm curious why NB is trying to find the XSDs in the old location in your
> > case. Does your project date from <= NB8.2?
> >
> > If you root around inside the nbproject folder of your project, you may
> > find an XML configuration file (sorry, can't remember exact name/location
> > offhand) listing the XSDs used by the project and directory structures
> > containing any XSDs NB downloaded as it couldn't find them in the
> > Enterprise Catalog.
> >
> > Could be that config file still points to an old location?
> >
> > If so, close your project, make a copy of your project, and in that copy
> > remove said config file along with the directories containing any
> > downloaded XSDs. NB will then try and re-resolve them when you open that
> > copy.
> >
> > Obviously make sure you have plenty of backups etc etc
> >
> >
> > P
> >
> >
> >
> > On Tue, 16 Jul 2019, 06:54 Thomas Kellerer, <sh...@gmx.net> wrote:
> >
> >> Hi Josh,
> >>
> >> same with a clean userdir. This is the (somewhat obfuscated) web.xml:
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
> >>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> >> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> >>     <display-name>Registration Servlet</display-name>
> >>     <description>Registration Servlet</description>
> >>     <resource-ref>
> >>         <res-ref-name>jdbc/events</res-ref-name>
> >>         <res-type>javax.sql.DataSource</res-type>
> >>         <res-auth>Container</res-auth>
> >>         <res-sharing-scope>Shareable</res-sharing-scope>
> >>     </resource-ref>
> >>     <servlet>
> >>         <servlet-name>RegistrationServlet</servlet-name>
> >>
>  <servlet-class>com.somepackage.RegistrationServlet</servlet-class>
> >>         <init-param>
> >>             <param-name>event-id</param-name>
> >>             <param-value>${event.id}<param-value>
> >>         </init-param>
> >>     </servlet>
> >>     <servlet-mapping>
> >>         <servlet-name>RegistrationServlet</servlet-name>
> >>         <url-pattern>/register</url-pattern>
> >>     </servlet-mapping>
> >> </web-app>
> >>
> >>
> >> It's a Maven project using OpenJDK 1.8 - maybe that makes a difference?
> >>
> >> The actual value of ${event.id} will be replaced by Maven during build.
> >> I tried with a hardcoded value as well, and that doesn't make a
> difference.
> >>
> >> The error it shows is still:
> >>
> >> XML validation started.
> >> Checking file:/C:/*******/web.xml...
> >> schema_reference.4: Failed to read schema document
> >>
> 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd',
> >> because 1) could not find the document; 2) the document could not be
> read;
> >> 3) the root element of the document is not <xsd:schema>. [4]
> >> cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [4]
> >> .....
> >> .....
> >>
> >> Regards
> >> Thomas
> >>
> >>
> >> P.S.: totally unrelated, but: your link to apress.com results in a
> blank
> >> page in Firefox and an "Sorry, I can't display this page" in Microsoft
> Edge
> >>
> >> Josh Juneau schrieb am 15.07.2019 um 17:41:
> >>> Hi Thomas,
> >>>
> >>> I cannot reproduce with 11.1 beta 4.  The web.xml does not show a red
> >> X.  Have you tried with a clean userdir?   Thanks!
> >>>
> >>>
> >>> Josh Juneau
> >>> http://jj-blogger.blogspot.com
> >>> https://www.apress.com/index.php/author/author/view/id/1866
> >>>
> >>>
> >>>> On Jul 15, 2019, at 1:40 AM, Thomas Kellerer <sh...@gmx.net> wrote:
> >>>>
> >>>> Josh,
> >>>>
> >>>> it's not a big thing, because everything works even editing the
> web.xml
> >> with the "wizard".
> >>>>
> >>>> Only the Projects window shows a little red cross next to the file.
> >>>>
> >>>> It's a (very old) Maven project and it's using JavaEE 7
> >>>>
> >>>>    <dependency>
> >>>>      <groupId>javax</groupId>
> >>>>      <artifactId>javaee-web-api</artifactId>
> >>>>      <version>7.0</version>
> >>>>      <scope>provided</scope>
> >>>>    </dependency>
> >>>>
> >>>> Regards
> >>>> Thomas
> >>>>
> >>>>
> >>>> Josh Juneau schrieb am 12.07.2019 um 16:10:
> >>>>> Hi Thomas,
> >>>>>
> >>>>> There is a PR that has been submitted which may repair these issues.
> >> There
> >>>>> is a similar issue that is repaired in the PR which addresses
> >> validation of
> >>>>> the web-app_4_0.xsd.
> >>>>>
> >>>>> Is your project running a very old (pre-Java EE 5) version of Java
> EE?
> >>>>> Even J2EE perhaps?
> >>>>>
> >>>>> Thanks
> >>>>>
> >>>>>> On Fri, Jul 12, 2019 at 8:48 AM Shammat <sh...@gmx.net> wrote:
> >>>>>>
> >>>>>> NetBeans 11.1-vc1 fails to alidate a valid web.xml
> >>>>>>
> >>>>>> When I open my web.xml from my project and click on the "Validate
> XML"
> >>>>>> button (the two down arrows), it shows the following error message:
> >>>>>>
> >>>>>> XML validation started.
> >>>>>> Checking file:/C:/**********/src/main/webapp/WEB-INF/web.xml...
> >>>>>> schema_reference.4: Failed to read schema document
> >>>>>>
> >>
> 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd',
> >>>>>> because 1) could not find the document; 2) the document could not be
> >> read;
> >>>>>> 3) the root element of the document is not <xsd:schema>. [2]
> >>>>>> cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [2]
> >>>>>>
> >>>>>> However, the file "web-app_2_4.xsd" is contained in several jar
> files.
> >>>>>>
> >>>>>> It is contained in "org-netbeans-modules-j2ee-dd.jar", but inside
> >> that jar
> >>>>>> file it's in the package/directory:
> >>>>>>
> >>>>>>   org/netbeans/modules/j2ee/dd/impl/resources
> >>>>>>
> >>>>>> rather than "org/netbeans/modules/j2ee/ddloaders/catalog/resources"
> >> where
> >>>>>> the editor seems to expect it.
> >>>>>>
> >>>>>> And it's also part of servlet3.1-jsp2.3-api.jar, but there it's in
> the
> >>>>>> package/directory "resources/schemas"
> >>>>>>
> >>>>>> Thomas
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> >> For additional commands, e-mail: dev-help@netbeans.apache.org
> >>
> >> For further information about the NetBeans mailing lists, visit:
> >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >>
> >>
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: NetBeans fails to validate web.xml - bug or missing feature?

Posted by Thomas Kellerer <sh...@gmx.net>.
Pete,

thanks for the suggestion.

The project was indeed "migrated" from NetBeans 8.2 - but it's a Maven project.
So the only (project) configuration file there is, is the pom.xml

There is nbactions.xml but that does not seem to contain any entries relevant for that.

nb-configuration.xml contains the following

    <?xml version="1.0" encoding="UTF-8"?>
    <project-shared-configuration>
        <!--
    This file contains additional configuration written by modules in the NetBeans IDE.
    The configuration is intended to be shared among all the users of project and
    therefore it is assumed to be part of version control checkout.
    Without this configuration present, some functionality in the IDE may be limited or fail altogether.
    -->
        <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
            <!--
    Properties that influence various parts of the IDE, especially code formatting and the like.
    You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
    That way multiple projects can share the same settings (useful for formatting rules for example).
    Any value defined here will override the pom.xml file value but is only applicable to the current project.
    -->
            <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>Tomcat</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
            <netbeans.hint.jdkPlatform>JDK_1.8</netbeans.hint.jdkPlatform>
        </properties>
    </project-shared-configuration>


Not sure if that influences the resolution of the XSD files.

Thomas


Pete Whelpton schrieb am 16.07.2019 um 10:10:
> Hi Thomas,
>
> I was banned from bringing a laptop on holiday, so this is from memory -
> please excuse any mistakes.
>
> I submitted https://github.com/apache/netbeans/pull/1266 to update the
> enterprise catalog to look for JavaEE XSDs in org/netbeans/modules/j2ee/dd/
> impl/resources
>
> I'm curious why NB is trying to find the XSDs in the old location in your
> case. Does your project date from <= NB8.2?
>
> If you root around inside the nbproject folder of your project, you may
> find an XML configuration file (sorry, can't remember exact name/location
> offhand) listing the XSDs used by the project and directory structures
> containing any XSDs NB downloaded as it couldn't find them in the
> Enterprise Catalog.
>
> Could be that config file still points to an old location?
>
> If so, close your project, make a copy of your project, and in that copy
> remove said config file along with the directories containing any
> downloaded XSDs. NB will then try and re-resolve them when you open that
> copy.
>
> Obviously make sure you have plenty of backups etc etc
>
>
> P
>
>
>
> On Tue, 16 Jul 2019, 06:54 Thomas Kellerer, <sh...@gmx.net> wrote:
>
>> Hi Josh,
>>
>> same with a clean userdir. This is the (somewhat obfuscated) web.xml:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
>>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>>     <display-name>Registration Servlet</display-name>
>>     <description>Registration Servlet</description>
>>     <resource-ref>
>>         <res-ref-name>jdbc/events</res-ref-name>
>>         <res-type>javax.sql.DataSource</res-type>
>>         <res-auth>Container</res-auth>
>>         <res-sharing-scope>Shareable</res-sharing-scope>
>>     </resource-ref>
>>     <servlet>
>>         <servlet-name>RegistrationServlet</servlet-name>
>>         <servlet-class>com.somepackage.RegistrationServlet</servlet-class>
>>         <init-param>
>>             <param-name>event-id</param-name>
>>             <param-value>${event.id}<param-value>
>>         </init-param>
>>     </servlet>
>>     <servlet-mapping>
>>         <servlet-name>RegistrationServlet</servlet-name>
>>         <url-pattern>/register</url-pattern>
>>     </servlet-mapping>
>> </web-app>
>>
>>
>> It's a Maven project using OpenJDK 1.8 - maybe that makes a difference?
>>
>> The actual value of ${event.id} will be replaced by Maven during build.
>> I tried with a hardcoded value as well, and that doesn't make a difference.
>>
>> The error it shows is still:
>>
>> XML validation started.
>> Checking file:/C:/*******/web.xml...
>> schema_reference.4: Failed to read schema document
>> 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd',
>> because 1) could not find the document; 2) the document could not be read;
>> 3) the root element of the document is not <xsd:schema>. [4]
>> cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [4]
>> .....
>> .....
>>
>> Regards
>> Thomas
>>
>>
>> P.S.: totally unrelated, but: your link to apress.com results in a blank
>> page in Firefox and an "Sorry, I can't display this page" in Microsoft Edge
>>
>> Josh Juneau schrieb am 15.07.2019 um 17:41:
>>> Hi Thomas,
>>>
>>> I cannot reproduce with 11.1 beta 4.  The web.xml does not show a red
>> X.  Have you tried with a clean userdir?   Thanks!
>>>
>>>
>>> Josh Juneau
>>> http://jj-blogger.blogspot.com
>>> https://www.apress.com/index.php/author/author/view/id/1866
>>>
>>>
>>>> On Jul 15, 2019, at 1:40 AM, Thomas Kellerer <sh...@gmx.net> wrote:
>>>>
>>>> Josh,
>>>>
>>>> it's not a big thing, because everything works even editing the web.xml
>> with the "wizard".
>>>>
>>>> Only the Projects window shows a little red cross next to the file.
>>>>
>>>> It's a (very old) Maven project and it's using JavaEE 7
>>>>
>>>>    <dependency>
>>>>      <groupId>javax</groupId>
>>>>      <artifactId>javaee-web-api</artifactId>
>>>>      <version>7.0</version>
>>>>      <scope>provided</scope>
>>>>    </dependency>
>>>>
>>>> Regards
>>>> Thomas
>>>>
>>>>
>>>> Josh Juneau schrieb am 12.07.2019 um 16:10:
>>>>> Hi Thomas,
>>>>>
>>>>> There is a PR that has been submitted which may repair these issues.
>> There
>>>>> is a similar issue that is repaired in the PR which addresses
>> validation of
>>>>> the web-app_4_0.xsd.
>>>>>
>>>>> Is your project running a very old (pre-Java EE 5) version of Java EE?
>>>>> Even J2EE perhaps?
>>>>>
>>>>> Thanks
>>>>>
>>>>>> On Fri, Jul 12, 2019 at 8:48 AM Shammat <sh...@gmx.net> wrote:
>>>>>>
>>>>>> NetBeans 11.1-vc1 fails to alidate a valid web.xml
>>>>>>
>>>>>> When I open my web.xml from my project and click on the "Validate XML"
>>>>>> button (the two down arrows), it shows the following error message:
>>>>>>
>>>>>> XML validation started.
>>>>>> Checking file:/C:/**********/src/main/webapp/WEB-INF/web.xml...
>>>>>> schema_reference.4: Failed to read schema document
>>>>>>
>> 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd',
>>>>>> because 1) could not find the document; 2) the document could not be
>> read;
>>>>>> 3) the root element of the document is not <xsd:schema>. [2]
>>>>>> cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [2]
>>>>>>
>>>>>> However, the file "web-app_2_4.xsd" is contained in several jar files.
>>>>>>
>>>>>> It is contained in "org-netbeans-modules-j2ee-dd.jar", but inside
>> that jar
>>>>>> file it's in the package/directory:
>>>>>>
>>>>>>   org/netbeans/modules/j2ee/dd/impl/resources
>>>>>>
>>>>>> rather than "org/netbeans/modules/j2ee/ddloaders/catalog/resources"
>> where
>>>>>> the editor seems to expect it.
>>>>>>
>>>>>> And it's also part of servlet3.1-jsp2.3-api.jar, but there it's in the
>>>>>> package/directory "resources/schemas"
>>>>>>
>>>>>> Thomas
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans fails to validate web.xml - bug or missing feature?

Posted by Pete Whelpton <pe...@gmail.com>.
Hi Thomas,

I was banned from bringing a laptop on holiday, so this is from memory -
please excuse any mistakes.

I submitted https://github.com/apache/netbeans/pull/1266 to update the
enterprise catalog to look for JavaEE XSDs in org/netbeans/modules/j2ee/dd/
impl/resources

I'm curious why NB is trying to find the XSDs in the old location in your
case. Does your project date from <= NB8.2?

If you root around inside the nbproject folder of your project, you may
find an XML configuration file (sorry, can't remember exact name/location
offhand) listing the XSDs used by the project and directory structures
containing any XSDs NB downloaded as it couldn't find them in the
Enterprise Catalog.

Could be that config file still points to an old location?

If so, close your project, make a copy of your project, and in that copy
remove said config file along with the directories containing any
downloaded XSDs. NB will then try and re-resolve them when you open that
copy.

Obviously make sure you have plenty of backups etc etc


P



On Tue, 16 Jul 2019, 06:54 Thomas Kellerer, <sh...@gmx.net> wrote:

> Hi Josh,
>
> same with a clean userdir. This is the (somewhat obfuscated) web.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>     <display-name>Registration Servlet</display-name>
>     <description>Registration Servlet</description>
>     <resource-ref>
>         <res-ref-name>jdbc/events</res-ref-name>
>         <res-type>javax.sql.DataSource</res-type>
>         <res-auth>Container</res-auth>
>         <res-sharing-scope>Shareable</res-sharing-scope>
>     </resource-ref>
>     <servlet>
>         <servlet-name>RegistrationServlet</servlet-name>
>         <servlet-class>com.somepackage.RegistrationServlet</servlet-class>
>         <init-param>
>             <param-name>event-id</param-name>
>             <param-value>${event.id}<param-value>
>         </init-param>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>RegistrationServlet</servlet-name>
>         <url-pattern>/register</url-pattern>
>     </servlet-mapping>
> </web-app>
>
>
> It's a Maven project using OpenJDK 1.8 - maybe that makes a difference?
>
> The actual value of ${event.id} will be replaced by Maven during build.
> I tried with a hardcoded value as well, and that doesn't make a difference.
>
> The error it shows is still:
>
> XML validation started.
> Checking file:/C:/*******/web.xml...
> schema_reference.4: Failed to read schema document
> 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd',
> because 1) could not find the document; 2) the document could not be read;
> 3) the root element of the document is not <xsd:schema>. [4]
> cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [4]
> .....
> .....
>
> Regards
> Thomas
>
>
> P.S.: totally unrelated, but: your link to apress.com results in a blank
> page in Firefox and an "Sorry, I can't display this page" in Microsoft Edge
>
> Josh Juneau schrieb am 15.07.2019 um 17:41:
> > Hi Thomas,
> >
> > I cannot reproduce with 11.1 beta 4.  The web.xml does not show a red
> X.  Have you tried with a clean userdir?   Thanks!
> >
> >
> > Josh Juneau
> > http://jj-blogger.blogspot.com
> > https://www.apress.com/index.php/author/author/view/id/1866
> >
> >
> >> On Jul 15, 2019, at 1:40 AM, Thomas Kellerer <sh...@gmx.net> wrote:
> >>
> >> Josh,
> >>
> >> it's not a big thing, because everything works even editing the web.xml
> with the "wizard".
> >>
> >> Only the Projects window shows a little red cross next to the file.
> >>
> >> It's a (very old) Maven project and it's using JavaEE 7
> >>
> >>    <dependency>
> >>      <groupId>javax</groupId>
> >>      <artifactId>javaee-web-api</artifactId>
> >>      <version>7.0</version>
> >>      <scope>provided</scope>
> >>    </dependency>
> >>
> >> Regards
> >> Thomas
> >>
> >>
> >> Josh Juneau schrieb am 12.07.2019 um 16:10:
> >>> Hi Thomas,
> >>>
> >>> There is a PR that has been submitted which may repair these issues.
> There
> >>> is a similar issue that is repaired in the PR which addresses
> validation of
> >>> the web-app_4_0.xsd.
> >>>
> >>> Is your project running a very old (pre-Java EE 5) version of Java EE?
> >>> Even J2EE perhaps?
> >>>
> >>> Thanks
> >>>
> >>>> On Fri, Jul 12, 2019 at 8:48 AM Shammat <sh...@gmx.net> wrote:
> >>>>
> >>>> NetBeans 11.1-vc1 fails to alidate a valid web.xml
> >>>>
> >>>> When I open my web.xml from my project and click on the "Validate XML"
> >>>> button (the two down arrows), it shows the following error message:
> >>>>
> >>>> XML validation started.
> >>>> Checking file:/C:/**********/src/main/webapp/WEB-INF/web.xml...
> >>>> schema_reference.4: Failed to read schema document
> >>>>
> 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd',
> >>>> because 1) could not find the document; 2) the document could not be
> read;
> >>>> 3) the root element of the document is not <xsd:schema>. [2]
> >>>> cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [2]
> >>>>
> >>>> However, the file "web-app_2_4.xsd" is contained in several jar files.
> >>>>
> >>>> It is contained in "org-netbeans-modules-j2ee-dd.jar", but inside
> that jar
> >>>> file it's in the package/directory:
> >>>>
> >>>>   org/netbeans/modules/j2ee/dd/impl/resources
> >>>>
> >>>> rather than "org/netbeans/modules/j2ee/ddloaders/catalog/resources"
> where
> >>>> the editor seems to expect it.
> >>>>
> >>>> And it's also part of servlet3.1-jsp2.3-api.jar, but there it's in the
> >>>> package/directory "resources/schemas"
> >>>>
> >>>> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: NetBeans fails to validate web.xml - bug or missing feature?

Posted by Thomas Kellerer <sh...@gmx.net>.
Hi Josh,

same with a clean userdir. This is the (somewhat obfuscated) web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>Registration Servlet</display-name>
    <description>Registration Servlet</description>
    <resource-ref>
        <res-ref-name>jdbc/events</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    <servlet>
        <servlet-name>RegistrationServlet</servlet-name>
        <servlet-class>com.somepackage.RegistrationServlet</servlet-class>
        <init-param>
            <param-name>event-id</param-name>
            <param-value>${event.id}<param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>RegistrationServlet</servlet-name>
        <url-pattern>/register</url-pattern>
    </servlet-mapping>
</web-app>


It's a Maven project using OpenJDK 1.8 - maybe that makes a difference?

The actual value of ${event.id} will be replaced by Maven during build.
I tried with a hardcoded value as well, and that doesn't make a difference.

The error it shows is still:

XML validation started.
Checking file:/C:/*******/web.xml...
schema_reference.4: Failed to read schema document 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. [4]
cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [4]
.....
.....

Regards
Thomas


P.S.: totally unrelated, but: your link to apress.com results in a blank page in Firefox and an "Sorry, I can't display this page" in Microsoft Edge

Josh Juneau schrieb am 15.07.2019 um 17:41:
> Hi Thomas,
>
> I cannot reproduce with 11.1 beta 4.  The web.xml does not show a red X.  Have you tried with a clean userdir?   Thanks!
>
>
> Josh Juneau
> http://jj-blogger.blogspot.com
> https://www.apress.com/index.php/author/author/view/id/1866
>
>
>> On Jul 15, 2019, at 1:40 AM, Thomas Kellerer <sh...@gmx.net> wrote:
>>
>> Josh,
>>
>> it's not a big thing, because everything works even editing the web.xml with the "wizard".
>>
>> Only the Projects window shows a little red cross next to the file.
>>
>> It's a (very old) Maven project and it's using JavaEE 7
>>
>>    <dependency>
>>      <groupId>javax</groupId>
>>      <artifactId>javaee-web-api</artifactId>
>>      <version>7.0</version>
>>      <scope>provided</scope>
>>    </dependency>
>>
>> Regards
>> Thomas
>>
>>
>> Josh Juneau schrieb am 12.07.2019 um 16:10:
>>> Hi Thomas,
>>>
>>> There is a PR that has been submitted which may repair these issues.  There
>>> is a similar issue that is repaired in the PR which addresses validation of
>>> the web-app_4_0.xsd.
>>>
>>> Is your project running a very old (pre-Java EE 5) version of Java EE?
>>> Even J2EE perhaps?
>>>
>>> Thanks
>>>
>>>> On Fri, Jul 12, 2019 at 8:48 AM Shammat <sh...@gmx.net> wrote:
>>>>
>>>> NetBeans 11.1-vc1 fails to alidate a valid web.xml
>>>>
>>>> When I open my web.xml from my project and click on the "Validate XML"
>>>> button (the two down arrows), it shows the following error message:
>>>>
>>>> XML validation started.
>>>> Checking file:/C:/**********/src/main/webapp/WEB-INF/web.xml...
>>>> schema_reference.4: Failed to read schema document
>>>> 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd',
>>>> because 1) could not find the document; 2) the document could not be read;
>>>> 3) the root element of the document is not <xsd:schema>. [2]
>>>> cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [2]
>>>>
>>>> However, the file "web-app_2_4.xsd" is contained in several jar files.
>>>>
>>>> It is contained in "org-netbeans-modules-j2ee-dd.jar", but inside that jar
>>>> file it's in the package/directory:
>>>>
>>>>   org/netbeans/modules/j2ee/dd/impl/resources
>>>>
>>>> rather than "org/netbeans/modules/j2ee/ddloaders/catalog/resources" where
>>>> the editor seems to expect it.
>>>>
>>>> And it's also part of servlet3.1-jsp2.3-api.jar, but there it's in the
>>>> package/directory "resources/schemas"
>>>>
>>>> Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans fails to validate web.xml - bug or missing feature?

Posted by Josh Juneau <ju...@gmail.com>.
Hi Thomas,

I cannot reproduce with 11.1 beta 4.  The web.xml does not show a red X.  Have you tried with a clean userdir?   Thanks!


Josh Juneau
http://jj-blogger.blogspot.com
https://www.apress.com/index.php/author/author/view/id/1866


> On Jul 15, 2019, at 1:40 AM, Thomas Kellerer <sh...@gmx.net> wrote:
> 
> Josh,
> 
> it's not a big thing, because everything works even editing the web.xml with the "wizard".
> 
> Only the Projects window shows a little red cross next to the file.
> 
> It's a (very old) Maven project and it's using JavaEE 7
> 
>    <dependency>
>      <groupId>javax</groupId>
>      <artifactId>javaee-web-api</artifactId>
>      <version>7.0</version>
>      <scope>provided</scope>
>    </dependency>
> 
> Regards
> Thomas
> 
> 
> Josh Juneau schrieb am 12.07.2019 um 16:10:
>> Hi Thomas,
>> 
>> There is a PR that has been submitted which may repair these issues.  There
>> is a similar issue that is repaired in the PR which addresses validation of
>> the web-app_4_0.xsd.
>> 
>> Is your project running a very old (pre-Java EE 5) version of Java EE?
>> Even J2EE perhaps?
>> 
>> Thanks
>> 
>>> On Fri, Jul 12, 2019 at 8:48 AM Shammat <sh...@gmx.net> wrote:
>>> 
>>> NetBeans 11.1-vc1 fails to alidate a valid web.xml
>>> 
>>> When I open my web.xml from my project and click on the "Validate XML"
>>> button (the two down arrows), it shows the following error message:
>>> 
>>> XML validation started.
>>> Checking file:/C:/**********/src/main/webapp/WEB-INF/web.xml...
>>> schema_reference.4: Failed to read schema document
>>> 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd',
>>> because 1) could not find the document; 2) the document could not be read;
>>> 3) the root element of the document is not <xsd:schema>. [2]
>>> cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [2]
>>> 
>>> However, the file "web-app_2_4.xsd" is contained in several jar files.
>>> 
>>> It is contained in "org-netbeans-modules-j2ee-dd.jar", but inside that jar
>>> file it's in the package/directory:
>>> 
>>>   org/netbeans/modules/j2ee/dd/impl/resources
>>> 
>>> rather than "org/netbeans/modules/j2ee/ddloaders/catalog/resources" where
>>> the editor seems to expect it.
>>> 
>>> And it's also part of servlet3.1-jsp2.3-api.jar, but there it's in the
>>> package/directory "resources/schemas"
>>> 
>>> Thomas
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>> 
>>> For further information about the NetBeans mailing lists, visit:
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>> 
>>> 
>>> 
>>> --
>> Josh Juneau
>> juneau001@gmail.com
>> http://jj-blogger.blogspot.com
>> https://www.apress.com/us/search?query=Juneau
>> <https://www.apress.com/index.php/author/author/view/id/1866>
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 

Re: NetBeans fails to validate web.xml - bug or missing feature?

Posted by Thomas Kellerer <sh...@gmx.net>.
Josh,

it's not a big thing, because everything works even editing the web.xml with the "wizard".

Only the Projects window shows a little red cross next to the file.

It's a (very old) Maven project and it's using JavaEE 7

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

Regards
Thomas


Josh Juneau schrieb am 12.07.2019 um 16:10:
> Hi Thomas,
>
> There is a PR that has been submitted which may repair these issues.  There
> is a similar issue that is repaired in the PR which addresses validation of
> the web-app_4_0.xsd.
>
> Is your project running a very old (pre-Java EE 5) version of Java EE?
> Even J2EE perhaps?
>
> Thanks
>
> On Fri, Jul 12, 2019 at 8:48 AM Shammat <sh...@gmx.net> wrote:
>
>> NetBeans 11.1-vc1 fails to alidate a valid web.xml
>>
>> When I open my web.xml from my project and click on the "Validate XML"
>> button (the two down arrows), it shows the following error message:
>>
>> XML validation started.
>> Checking file:/C:/**********/src/main/webapp/WEB-INF/web.xml...
>> schema_reference.4: Failed to read schema document
>> 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd',
>> because 1) could not find the document; 2) the document could not be read;
>> 3) the root element of the document is not <xsd:schema>. [2]
>> cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [2]
>>
>> However, the file "web-app_2_4.xsd" is contained in several jar files.
>>
>> It is contained in "org-netbeans-modules-j2ee-dd.jar", but inside that jar
>> file it's in the package/directory:
>>
>>    org/netbeans/modules/j2ee/dd/impl/resources
>>
>> rather than "org/netbeans/modules/j2ee/ddloaders/catalog/resources" where
>> the editor seems to expect it.
>>
>> And it's also part of servlet3.1-jsp2.3-api.jar, but there it's in the
>> package/directory "resources/schemas"
>>
>> Thomas
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>
>>
>> --
> Josh Juneau
> juneau001@gmail.com
> http://jj-blogger.blogspot.com
> https://www.apress.com/us/search?query=Juneau
> <https://www.apress.com/index.php/author/author/view/id/1866>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans fails to validate web.xml - bug or missing feature?

Posted by Josh Juneau <ju...@gmail.com>.
Hi Thomas,

There is a PR that has been submitted which may repair these issues.  There
is a similar issue that is repaired in the PR which addresses validation of
the web-app_4_0.xsd.

Is your project running a very old (pre-Java EE 5) version of Java EE?
Even J2EE perhaps?

Thanks

On Fri, Jul 12, 2019 at 8:48 AM Shammat <sh...@gmx.net> wrote:

> NetBeans 11.1-vc1 fails to alidate a valid web.xml
>
> When I open my web.xml from my project and click on the "Validate XML"
> button (the two down arrows), it shows the following error message:
>
> XML validation started.
> Checking file:/C:/**********/src/main/webapp/WEB-INF/web.xml...
> schema_reference.4: Failed to read schema document
> 'nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/web-app_2_4.xsd',
> because 1) could not find the document; 2) the document could not be read;
> 3) the root element of the document is not <xsd:schema>. [2]
> cvc-elt.1.a: Cannot find the declaration of element 'web-app'. [2]
>
> However, the file "web-app_2_4.xsd" is contained in several jar files.
>
> It is contained in "org-netbeans-modules-j2ee-dd.jar", but inside that jar
> file it's in the package/directory:
>
>    org/netbeans/modules/j2ee/dd/impl/resources
>
> rather than "org/netbeans/modules/j2ee/ddloaders/catalog/resources" where
> the editor seems to expect it.
>
> And it's also part of servlet3.1-jsp2.3-api.jar, but there it's in the
> package/directory "resources/schemas"
>
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
> --
Josh Juneau
juneau001@gmail.com
http://jj-blogger.blogspot.com
https://www.apress.com/us/search?query=Juneau
<https://www.apress.com/index.php/author/author/view/id/1866>