Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6874245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:10:13+00:00 2026-05-27T04:10:13+00:00

I just started using the Netbeans 7.1 beta and it is calling out errors

  • 0

I just started using the Netbeans 7.1 beta and it is calling out errors of a type which I have never seen before. Specifically:

A managed bean with a public field should not declare any scope other than @Dependent.

The fields it is complaining about are public static final. I can understand the restriction on non-static fields, but I can’t think of a good reason this would not be allowed for a static field. Unfortunately I use a lot of them since I don’t like having constants in my code.

I note that even though I get the red dot in the margin in the editor, the maven-driven build still works and GlassFish still runs my application the way I would expect.

So what is my denoument on this issue? Am I going to have to move my static fields elsewhere or is there another way of handling this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:10:14+00:00Added an answer on May 27, 2026 at 4:10 am

    Quoting the javax.enterprise.inject package javadocs:

    If a managed bean has a public field, it must have scope @Dependent.

    But I do agree wih @BalusC that if this compiles, Netbeans should report it as Warning (does it?).

    Anyway, are those constants really part of the API? I mean, do you access they anywhere else but within their own classes? If not, reduce visibility to private. (If you just need to access the constants from the view you can also create accessors for the private constant). If yes, I would suggest you to move them somewhere else anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have just started with Gui Programming in netbeans (Using the template Java Desktop
I have just recently started using NetBeans IDE (6.9.1) and have used it to
I just started using Netbeans to debug PHP apps, but when I inspect any
Have just started using Google Chrome , and noticed in parts of our site,
I just started using SVN, and I have a cache directory that I don't
I just started using the new project type SQL Server 2008 Database. I can
Please bear with me as I've just started using NetBeans for the first time!
Just started using carrierwave with Rails and things have been going smoothly with one
Just started using fadein/fadeout - it's functioning but with problems. I have a set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.