netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

CDI bean as "@Named" is not listed in the xhtml for selection (Jakarta EE version 9.1.0)

Open howardfun opened this issue 3 years ago • 3 comments

Apache NetBeans version

Apache NetBeans 13

What happened

CDI bean is supposed to be found in the xhtml file after typing the "#{}" keyword. Also, when ctrl + click on class/ method name of CDI statement in xhtml, the "go to declaration" function is not working in the Netbeans IDE.

*Found that the bug can be fixed when turning it back to Jakarta EE 8.0.0 version instead of 9.1.0. Second, change the "jakarta.xxxx" back to "javax.xxxx" for a temporary fixing.

How to reproduce

Please use the example here to reproduce https://github.com/juneau001/jakarta_cdi_reservations

Open the part 2 project, open the "reservations.xhtml" file in Apache Netbean 13 (in fact, it is also happen in version 12).

<p:inputText id="firstName" value="#{reservationController.currentReservation.firstName}"/>

When you ctrl + click on the "currentReservation" or "firstName", Netbeans not able to "go to declaration".

Besides, when type the "#{}" the CDI bean is not even found in the list as captured below:

image

I believe a similar error is like the following: https://bz.apache.org/netbeans/show_bug.cgi?id=178687

Lastly, the workaround is to change the Jakarta EE version from 9.1.0 back to 8.0.0 and change the "jakarta.xxxx" to "javax.xxxx" for all java files. This works but defeats the purpose, please take note.

I hope this bug can be solved very soon as this already spent me a long time to try and error. Thank you in advance!

Did this work correctly in an earlier version?

No

Operating System

Windows 10 home edition

JDK

OpenJDK 11

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

howardfun avatar Apr 26 '22 05:04 howardfun

Hey ! May be its related with #4033, in my case am using Spring @Component not CDI in a Joinfaces project (JSF + Spring Boot).

mtbadi39 avatar Apr 27 '22 20:04 mtbadi39

Hey ! May be its related with #4033, in my case am using Spring @component not CDI in a Joinfaces project (JSF + Spring Boot).

Thanks for the comment, but this is a different issue as I checked.

howardfun avatar May 02 '22 13:05 howardfun

Apache NetBeans version

Apache NetBeans 13

What happened

CDI bean is supposed to be found in the xhtml file after typing the "#{}" keyword. Also, when ctrl + click on class/ method name of CDI statement in xhtml, the "go to declaration" function is not working in the Netbeans IDE.

*Found that the bug can be fixed when turning it back to Jakarta EE 8.0.0 version instead of 9.1.0. Second, change the "jakarta.xxxx" back to "javax.xxxx" for a temporary fixing.

How to reproduce

Please use the example here to reproduce https://github.com/juneau001/jakarta_cdi_reservations

Open the part 2 project, open the "reservations.xhtml" file in Apache Netbean 13 (in fact, it is also happen in version 12).

<p:inputText id="firstName" value="#{reservationController.currentReservation.firstName}"/>

When you ctrl + click on the "currentReservation" or "firstName", Netbeans not able to "go to declaration".

Besides, when type the "#{}" the CDI bean is not even found in the list as captured below:

image

I believe a similar error is like the following: https://bz.apache.org/netbeans/show_bug.cgi?id=178687

Lastly, the workaround is to change the Jakarta EE version from 9.1.0 back to 8.0.0 and change the "jakarta.xxxx" to "javax.xxxx" for all java files. This works but defeats the purpose, please take note.

I hope this bug can be solved very soon as this already spent me a long time to try and error. Thank you in advance!

Did this work correctly in an earlier version?

No

Operating System

Windows 10 home edition

JDK

OpenJDK 11

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

I'm having the same issue when using Jakarta naming instead of javax

fakhrkh avatar Jul 20 '22 08:07 fakhrkh

I have the same issue with Netbeans 15 with OpenJDK 11 on MacOS 12.6

hichamglia avatar Sep 17 '22 22:09 hichamglia

I have the same issue with Netbeans 17 with OpenJDK 17 on Pop OS

king-martinien avatar Mar 02 '23 05:03 king-martinien

I have the same issue with (Netbeans 17 + Jakarta EE 10 projects).

saladmaker avatar Apr 12 '23 21:04 saladmaker

I believe that I have a fix for this issue on the way.  Thanks for the reports.  Josh JuneauOn Apr 12, 2023, at 4:55 PM, saladmaker @.***> wrote: I have the same issue with (Netbeans 17 + Jakarta EE 10 projects).

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were assigned.Message ID: @.***>

juneau001 avatar Apr 12 '23 22:04 juneau001

There is a strange behavior with Facelet pages autocompletion some times it gives you angular properties suggestions I believe. It would be great if the angular support could be disabled all together because as of now it's part html5 support I think.

saladmaker avatar Apr 12 '23 22:04 saladmaker

I am placing a PR that should repair this issue. The PR contains a new module jakarta.web.beans so that the Jakarta EE namespace is supported for CDI injection.

juneau001 avatar Apr 20 '23 15:04 juneau001

Netbeans 17 doesn't support the Jakarta Faces new namaspace like jakarta.faces.html and others, but it supports old ones.

saladmaker avatar Apr 21 '23 06:04 saladmaker

Netbeans 17 doesn't support the Jakarta Faces new namaspace like jakarta.faces.html and others, but it supports old ones.

see https://github.com/apache/netbeans/pull/6096

asbachb avatar Jun 19 '23 14:06 asbachb

I have the same issue with Netbeans 18

hichamglia avatar Aug 11 '23 19:08 hichamglia

@hichamglia It should be fixed in upcoming release NB19. There's a currently a release candidate feel free to verify.

asbachb avatar Aug 11 '23 20:08 asbachb

it is working perfectly with Netbeans 19. Thanks a lot

hichamglia avatar Sep 16 '23 22:09 hichamglia