Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
howardfun opened this issue Apr 26, 2022 · 14 comments
Assignees
Labels
enterprise [ci] enable enterprise job Java EE/Jakarta EE [ci] enable enterprise job kind:bug Bug report or fix

Comments

@howardfun
Copy link

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 howardfun added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Apr 26, 2022
@mbien mbien added enterprise [ci] enable enterprise job and removed needs:triage Requires attention from one of the committers labels Apr 26, 2022
@mtbadi39
Copy link

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

@howardfun
Copy link
Author

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.

@juneau001 juneau001 self-assigned this Jul 7, 2022
@mbien mbien added the Java EE/Jakarta EE [ci] enable enterprise job label Jul 12, 2022
@fakhrkh
Copy link

fakhrkh commented Jul 20, 2022

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

@hichamglia
Copy link

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

@king-martinien
Copy link

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

@saladmaker
Copy link

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

@juneau001
Copy link
Contributor

juneau001 commented Apr 12, 2023 via email

@saladmaker
Copy link

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.

@juneau001
Copy link
Contributor

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.

@saladmaker
Copy link

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

@asbachb
Copy link
Collaborator

asbachb commented Jun 19, 2023

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

see #6096

@hichamglia
Copy link

I have the same issue with Netbeans 18

@asbachb
Copy link
Collaborator

asbachb commented Aug 11, 2023

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

@hichamglia
Copy link

it is working perfectly with Netbeans 19. Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enterprise [ci] enable enterprise job Java EE/Jakarta EE [ci] enable enterprise job kind:bug Bug report or fix
Projects
Development

No branches or pull requests

9 participants