2

I'm working on a new JEE8 project using Netbeans 12 as IDE and every thing work but I have a strange tip that goes like this:

the element is not managed bean it has qualifiers but implements javax.enterprise.inject.spi.Extension

on classes marked as:

@javax.inject.Named
@javax.faces.view.ViewScoped
public class ProjectsView implements Serializable {
    public static final long serialVersionUID = -1L;
    @Inject
    private ProjectService service;
      ...

My code works fine on server, the application works as intended but I want to understand what this tip mean?

here is a picture: enter image description here

EDIT ADDITIONAL INFO:

this only appears if you set source to 14 in POM.xml maven compiler plugin

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>14</source>
                    <target>14</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
alibttb
  • 526
  • 4
  • 19
  • 1
    I think netbeans is just wrong here. OffTopic: if this is a managed bean to be used in JSF, please read https://stackoverflow.com/questions/30639785/jsf-controller-service-and-dao Entitimanagers should be used in services, not 'controllers' – Kukeltje Aug 06 '20 at 06:53
  • I think they’re wrong but I want to know understand if there is something about this that I don’t know, I couldn’t find this tip in the tip manager or any where else. thank you for the tip on em. – alibttb Aug 06 '20 at 06:58
  • I've tried the exact same code using NB12 (updated to this date), and no such tip showed up. Can you check if your installation and code is fully updated and report? Also off-topic: you should also move the @Transactional annotation to services classes, as any transaction related exception probably cannot be treated properly if thrown while commiting. – Paulo Araújo Aug 10 '20 at 14:09
  • I just check for updates, I'm using NB12, still having the same hint, I moved the @Transactional to service layer as advised, I'll edit the question to reflect all. – alibttb Aug 10 '20 at 18:16
  • Your edits (good in a 'architectural' sense) just not change anything about your code and nb just being wrong. And the 'hints' you get when using alt-enter, what does it show? – Kukeltje Aug 10 '20 at 18:48
  • @Kukeltje alt-enter shows the usual `Create Test Class` and `Create Subclass ..` shortcuts, I noticed it doesn't show with java 8 source code, I edited the question. – alibttb Aug 11 '20 at 03:39
  • Can you post ProjectService class? – Bogus Mar 18 '21 at 21:19

0 Answers0