Problems with Jakarta Schemas
See original GitHub issueApache NetBeans version
Apache NetBeans 13
What happened
I have several full Jakarta EE 9 projects that use Servlet 5.0 and Persistence 3.0. The IDE does not recognises the web.xml or persistence.xml files as valid as they use Jakarta namespaces on their schemas instead of Javax. Considers them as having a wrong version and ask to upgrade them to a lower version than they have.
Reviewing the embedded DTD/XSD of the IDE (Tools->DTDs and XML Schemas) you can see that the latest versions of those schemas are not in their catalog:
The error warnings are incorrect but just annoying. But there some functionalities associated with those files, specially with the persistence one, that do not work correctly and probably are related to this:
- Cannot edit the persistence file in Design mode.
- The “Entity Classes from Database” wizard does not recognise the entity classes already created and included in the persistence file.
- The RESTful Web Services folder with the list of web services of these project is missing.
Those are the ones that I have found for now, cannot say if there is more.
How to reproduce
1 - Create a web project (maven in my case)
2 - Assign Jakarta EE 9.1 on the Project Properties Configuration (Build, Run section).
3 - Add a web.xml and/or a persistence.xml files.
4 - Set they XML definition using the JakartaEE Schemas.
Example of the persistence one:
<persistence version="3.0" xmlns="https://jakarta.ee/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd">
5 - From that moment, the design tab disappears from the persistence file:
6 - Any Refactoring (like a simple name change of a file) will show the error message about the XML files being wrong.
Did this work correctly in an earlier version?
No
Operating System
Ubuntu 20.04 - Windows 10 64bits
JDK
java 11 openjdk amd64
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
I am not sure if the packaging I have chosen is the correct one, just in case, I have installed the latest version of Netbeans by Ubuntu Sofware Manager (snap).
This issue was already reported as part of anther on Jira: https://issues.apache.org/jira/browse/NETBEANS-6030
I have separated it in two now that I understand better the problem. The other one is now in :https://github.com/apache/netbeans/issues/3756#issue-1165558156
Are you willing to submit a pull request?
No
Code of Conduct
Yes
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
I started to work on that issue. I’m going to keep that branch in sync (force push). But I’m unsure if I’m capable of fixing that issue as many modules needs to be touched.
https://github.com/asbachb/incubator-netbeans/tree/jakartaee-fixup
Also, the web.xml is now OK, but the Persistence is still out of commission and not being accepted as valid. (Sorry for the multiple messages).