apache / apache/netbeans

Cannot create REST service based on Entity Beans

Open
#6,468 0 comments 0 reactions 0 assignees View on GitHub
Java EE/Jakarta EE kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 19

### What happened

To create a REST webservice based on Entity classes it is necessary to have entity classes first.
However, despite having created an entity Netbeans does not allow to generate the REST service.

### How to reproduce

To get clarity on the feature, I used Netbeans 19 on OpenJDK 17 and created a new _Java with Maven_/_Web Application_. In there I created one entity class, named WorkItem. Apart from the fields that the WorkItem got per default I added one more status field including getter and setter.

After building the project I can see the war file in the target folder, and it contains a persistence.xml file that lists my entity class. So far so good, I think it was created/generated correctly.

Now I want to add Restful Web Services for this entity class (Create, Read, Update, Delete) and choose the "Restful Web Services from Entity class". To my surprise the wizard does not show any entity. Why so?

(I cannot upload an image here - in case it is needed check https://stackoverflow.com/questions/77128695/how-to-correctly-use-netbeans-19-restful-web-services-from-entity-classes)

### Did this work correctly in an earlier version?

Apache NetBeans 13 or earlier

### Operating System

Windows 10

### JDK

openjdk version "17.0.5" 2022-10-18 LTS

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

This should be pretty much repeatable - for me it happens every time.
Somehow I suspect the wizard for generating stuff based on entities has not been upgraded for newer versions of JEE.

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in NetBeans 19 with a Java with Maven Web Application, an entity named WorkItem, and the "Restful Web Services from Entity class" wizard. Start by tracing how that wizard discovers entities from persistence.xml; done means the existing WorkItem entity appears and can be used to generate CRUD REST services.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.