question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems with Jakarta Schemas

See original GitHub issue

Apache 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.

image

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: image

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: image

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
asbachbcommented, Mar 14, 2022

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

0reactions
cpramirezcommented, Nov 17, 2022

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jakarta EE 9 projects should use new XML Schema definiotions
Jakarta EE 9 will use new locations for Schema Definitions. At the moment they are marked as Drafts, despite that it is still...
Read more >
XML Namespace under Jakarta · Issue #592 - GitHub
I've been bitten a few times in the past where misconfigured tools or libraries would try and download a schema from the given...
Read more >
Jakarta at 30 million: my city is choking and sinking
But the issue for Jakarta isn't its 9.6 million residents – it is the 3.5 million commuters. Governing this city is no longer...
Read more >
Indonesia's giant capital city is sinking. Can the government's ...
For hundreds of years, flooding has been one of Jakarta's biggest problems. The city, a major port, sits on a delta: Thirteen rivers...
Read more >
Problem with schema/postgres - CodeRanch
I am having a problem when the application runs, it creates the table in the right schema, but, the sequence in the public...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found