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

JakartaEE Auto complete of @Named Managed Beans not working in Netbeans 14 #4338

Closed
bercolax opened this issue Jul 6, 2022 · 21 comments
Closed
Assignees
Labels
Java EE/Jakarta EE [ci] enable enterprise job kind:bug Bug report or fix

Comments

@bercolax
Copy link

bercolax commented Jul 6, 2022

Apache NetBeans version

Apache NetBeans 14

What happened

I have created a Maven built JakartaEE 9 web application in Netbeans 14. Other things are working fine. But in the JSF page, I am not able to see the EL auto complete displaying the list of @nAmed beans. As the packages have been renamed jakarta (replacing javax), may be the changes must be done in the related modules to list the @jakarta.inject.Named annotated Java classes in the EL autocomplete.
The navigation from the EL in the JSF page to the Java source code of the jakarta.inject.Named annotated Java classes is also not happening.

How to reproduce

  • Create a brand new JakartaEE 9 based Maven web app
  • Create a simple @jakarta.inject.Named annotated backing bean with @nAmed(value="demoBean") with just 1 function
  • In the JSF create EL #{ and then in the auto complete you dont see demoBean being listed.

Did this work correctly in an earlier version?

No

Operating System

Ubuntu 20+, Windows 11

JDK

JDK 11

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

Every time

Are you willing to submit a pull request?

No

Code of Conduct

Yes

@bercolax bercolax added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jul 6, 2022
@mbien mbien added the Java EE/Jakarta EE [ci] enable enterprise job label Jul 12, 2022
@grantleyT
Copy link

same problem. NB 13 and 14 if you hard code el link in it works fine, but will not display. Using Payara Community server, followed their Jakarta EE 9 tutorial where the same el worked perfectly on IntelliJ platform. If you just import Javax.inject.Name it displays correctly in NB.

@bercolax
Copy link
Author

bercolax commented Aug 11, 2022

I guess in the NB plugin must do a Search javax and replace with jakarta and publish this as an add on plugin for those who want to work with Jakarta EE 9 onwards.

@javierllorente
Copy link

I can still reproduce this issue with NetBeans 15 and 16-rc1.

@grantleyT
Copy link

grantleyT commented Oct 22, 2022 via email

@bercolax
Copy link
Author

bercolax commented Oct 22, 2022

Incase we can get involved and help, kindly let me know. Will be happy to get involved. We can have two jars for related plugin. Users working with the jakartaee packages can uninstall the javax.xxx plugin and install the jakartaee.xxx plugin.

  • If any user wishes to work on older versions they can have two versions of Netbeans like Netbeans 15 for jakartaee and Netbeans 14 for javax.xx based.
  • I guess the highlighted plugin is responsible for providing the autocomplete
    image

@juneau001 juneau001 removed the needs:triage Requires attention from one of the committers label Nov 2, 2022
@bercolax
Copy link
Author

Can any one please tell if this has been fixed in Netbeans 16? (released on Nov 30, 2022)

@menny68
Copy link

menny68 commented Dec 11, 2022

Cdi beans annotated with jakarta.inject.Named stil not detected in NetBeans 16

In a maven web application with jakartaee 9.1 and facelets when try auto complete in #{} expression are till proposed beans with javax namespace instead of jakarta namespace e.g. javax.servlet.http.httpsession

Screenshot from 2022-12-11 18-01-43

@juneau001
Copy link
Contributor

I had done some work on this issue earlier this year but the PR was not submitted in time for release. I need to perform a diff against the latest code and my working branch to try and determine what is still causing this issue. Will try to get this done soon. Sorry for the delay.

@grantleyT
Copy link

grantleyT commented Dec 12, 2022 via email

@bercolax
Copy link
Author

I had done some work on this issue earlier this year but the PR was not submitted in time for release. I need to perform a diff against the latest code and my working branch to try and determine what is still causing this issue. Will try to get this done soon. Sorry for the delay.

Thanks for the reply and the update.

@king-martinien
Copy link

hello, I have the same problem (cannot detect CDI beans in xhtml files ). i'm using Netbeans 14 and jakartaEE 10 with the compatible eclipse glassfish server.

@king-martinien
Copy link

hello, I have the same problem (cannot detect CDI beans in xhtml files ). i'm using Netbeans 14 and jakartaEE 10 with the compatible eclipse glassfish server.

Now i have downloaded Netbeans 17 and the problem is still there.

@juneau001 juneau001 self-assigned this Mar 2, 2023
@OnElectric
Copy link

Hi, the only way I have been able to use autocompletions in jsp is by adding the javax.servlet-api library with java 11.
Does anyone know another way? Since for everything to be correct when we compile jsp, we must remove that library so that it uses jakarta instead of javax.
Thank you

@AmilMammadli
Copy link

in netbeans 17 and jdk 20, autocomplete does not work between <%%> in jsp file, please help

@llufti
Copy link

llufti commented Apr 13, 2023

Unfortunately it was not possible to solve this problem I am using 17 without success the problem is that this is an essential tool for development making programming much easier did anyone succeed?

@juneau001
Copy link
Contributor

This is the same as issue #4035. I currently have a PR to repair that issue in progress.

@apapamarkou
Copy link

Still have this issue. MacOsx , Windows, Linux Netpeans 14, 16, 17.

@asbachb
Copy link
Collaborator

asbachb commented Jun 19, 2023

@bercolax @apapamarkou @grantleyT @menny68

Should be fixed in NetBeans 18. Would be nice if someone could double check so that we can close the issue.

@astain
Copy link

astain commented Jun 28, 2023

Issue is still present for me in 18, no named beans discovered, no EL auto-completion in projects that use JakartaEE.

asbachb added a commit to asbachb/netbeans that referenced this issue Jul 12, 2023
Previously NetBeans bundles the JSF reference implementation Mojarra in order to provide several functionality
(like namespaces) based on the parsed taglib xml files from that jar. This is somehow problematic as:
1) The dependency needs to be updated on every new JSF release
2) NetBeans needs to fulfil the expectations of Mojarra

This leads to the problem that we currently cannot update and bundle the latest Mojarra version as
Java 11 is required.

This change wants to get less dependant on that bundled JSF implementation by resolving the reference implementation
using maven. Instead of reading the taglib xml files from that bundled jar NetBeans now gets in from the local maven
repository or downloads it from maven central. If this is not possible we fallback to the bundled version.

This change also improves the situation when autosuggestion is invoked in the namespace part of JSF xhtml documents
by ordering the suggested namespace with the one on top which is most likely to be used.

This should fix apache#6069 apache#5470 apache#5470 apache#4338
asbachb added a commit to asbachb/netbeans that referenced this issue Jul 13, 2023
Previously NetBeans bundles the JSF reference implementation Mojarra in order to provide several functionality
(like namespaces) based on the parsed taglib xml files from that jar. This is somehow problematic as:
1) The dependency needs to be updated on every new JSF release
2) NetBeans needs to fulfil the expectations of Mojarra

This leads to the problem that we currently cannot update and bundle the latest Mojarra version as
Java 11 is required.

This change wants to get less dependant on that bundled JSF implementation by resolving the reference implementation
using maven. Instead of reading the taglib xml files from that bundled jar NetBeans now gets in from the local maven
repository or downloads it from maven central. If this is not possible we fallback to the bundled version.

This change also improves the situation when autosuggestion is invoked in the namespace part of JSF xhtml documents
by ordering the suggested namespace with the one on top which is most likely to be used.

This should fix apache#6069 apache#5470 apache#5470 apache#4338
asbachb added a commit to asbachb/netbeans that referenced this issue Jul 16, 2023
Previously NetBeans bundles the JSF reference implementation Mojarra in order to provide several functionality
(like namespaces) based on the parsed taglib xml files from that jar. This is somehow problematic as:
1) The dependency needs to be updated on every new JSF release
2) NetBeans needs to fulfil the expectations of Mojarra

This leads to the problem that we currently cannot update and bundle the latest Mojarra version as
Java 11 is required.

This change wants to get less dependant on that bundled JSF implementation by resolving the reference implementation
using maven. Instead of reading the taglib xml files from that bundled jar NetBeans now gets in from the local maven
repository or downloads it from maven central. If this is not possible we fallback to the bundled version.

This change also improves the situation when autosuggestion is invoked in the namespace part of JSF xhtml documents
by ordering the suggested namespace with the one on top which is most likely to be used.

This should fix apache#6069 apache#5470 apache#5470 apache#4338
@asbachb
Copy link
Collaborator

asbachb commented Jul 17, 2023

Fixed with #6160

@asbachb asbachb closed this as completed Jul 17, 2023
@bercolax
Copy link
Author

Installed Netbeans 19 and verified that the issue has been fixed. Thanks a lot.

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

No branches or pull requests