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

  • Home
  • SEARCH
  • 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 7812879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:39:22+00:00 2026-06-02T04:39:22+00:00

I have this Managed bean: import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import

  • 0

I have this Managed bean:

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.sql.DataSource;
import javax.annotation.Resource;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
// or import javax.faces.bean.ManagedBean;   

import org.glassfish.osgicdi.OSGiService;

@Named("ApplicationController")
@SessionScoped

public class Tab1Page implements Serializable {
    public String actionString;

    public Tab1Page() {
    }
    public static final long serialVersionUID = 254415216070877770L;
// Constants
    public final static String hashKey = "tab1PageTab";
    public String actApplicationControllerionString = "";

    @PostConstruct
    public void post() {
        Format formatter;
        Date date = new Date();

        // Time formate 01:12:53 AM
        formatter = new SimpleDateFormat("hh:mm:ss a");
        tabName = formatter.format(date);
        System.out.println("Tab1Page\t" + tabName + "\t@PostConstruct...");
    }

    @PreDestroy
    public void destroy() {
        Format formatter;
        Date date = new Date();

        // Time formate 01:12:53 AM
        formatter = new SimpleDateFormat("hh:mm:ss a");
        tabName = formatter.format(date);
        System.out.println("Tab1Page\t" + tabName + "\t@PreDestroy...");
    }
    String tabName;

    public String getTabName() {
        return this.getClass().getName().substring(this.getClass().getName().lastIndexOf(".")) + "\t" + tabName;
    }

    public void setTabName(String tabName) {
        this.tabName = tabName;
    }

    public String getActionString() {
        String actionString = null;
        return actionString;
    }

    public void setActionString(String actionString) {
        this.actionString = actionString;
    }
}

When I try to deploy it on Glassfish I get this error:

[#|2012-04-16T21:42:51.689+0300|INFO|glassfish3.1.2|org.glassfish.osgiweb|_ThreadID=63;_ThreadName=Thread-2;|Removed bundle 416 against context path /HM_57-1.0-SNAPSHOT |#]

[#|2012-04-16T21:42:51.690+0300|WARNING|glassfish3.1.2|org.glassfish.osgijavaeebase|_ThreadID=63;_ThreadName=Thread-2;|Failed to deploy bundle com.DX_57.History-Module-57 [416]
org.glassfish.osgijavaeebase.DeploymentException: Deployment of com.DX_57.History-Module-57 [416] failed because of following reason: Failed while deploying bundle com.DX_57.History-Module-57 [416] : java.lang.RuntimeException: Failed to deploy bundle [ com.DX_57.History-Module-57 [416] ], root cause: Exception while loading the app
    at org.glassfish.osgijavaeebase.AbstractOSGiDeployer.deploy(AbstractOSGiDeployer.java:125)
    at org.glassfish.osgijavaeebase.OSGiContainer.deploy(OSGiContainer.java:154)
    at org.glassfish.osgijavaeebase.JavaEEExtender.deploy(JavaEEExtender.java:107)
    at org.glassfish.osgijavaeebase.JavaEEExtender.access$200(JavaEEExtender.java:61)
    at org.glassfish.osgijavaeebase.JavaEEExtender$HybridBundleTrackerCustomizer$1.call(JavaEEExtender.java:151)
    at org.glassfish.osgijavaeebase.JavaEEExtender$HybridBundleTrackerCustomizer$1.call(JavaEEExtender.java:148)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException: Failed to deploy bundle [ com.DX_57.History-Module-57 [416] ], root cause: Exception while loading the app
    at org.glassfish.osgijavaeebase.OSGiDeploymentRequest.deploy(OSGiDeploymentRequest.java:196)
    at org.glassfish.osgijavaeebase.OSGiDeploymentRequest.execute(OSGiDeploymentRequest.java:118)
    at org.glassfish.osgijavaeebase.AbstractOSGiDeployer.deploy(AbstractOSGiDeployer.java:121)
    ... 10 more
Caused by: org.glassfish.deployment.common.DeploymentException: WELD-000075 Normal scoped managed bean implementation class has a public field:  public@Named @SessionScoped class com.DX_57.HM_57.Tab1Page
    at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:181)
    at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
    at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:277)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    at org.glassfish.osgijavaeebase.OSGiDeploymentRequest.deploy(OSGiDeploymentRequest.java:183)
    ... 12 more
Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-000075 Normal scoped managed bean implementation class has a public field:  public@Named @SessionScoped class com.DX_57.HM_57.Tab1Page
    at org.jboss.weld.bean.ManagedBean.checkBeanImplementation(ManagedBean.java:438)
    at org.jboss.weld.bean.AbstractClassBean.initialize(AbstractClassBean.java:191)
    at org.jboss.weld.bean.ManagedBean.initialize(ManagedBean.java:322)
    at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:115)
    at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:204)
    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:344)
    at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:179)
    ... 17 more
|#]

I don’t understand what this error means. I modified all methods to be public but still I get this error. How I can correct the code?

Best wishes

  • 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-06-02T04:39:24+00:00Added an answer on June 2, 2026 at 4:39 am

    The problem is the field (public String actionString;) not the methods.

    From docs:

    If a managed bean has a public field, it must have scope @Dependent.
    If a managed bean with a public field declares any scope other than
    @Dependent, the container automatically detects the problem and treats
    it as a definition error.

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

Sidebar

Related Questions

I have this managed bean based on this tutorial . import java.io.Serializable; import javax.enterprise.context.SessionScoped;
I have this managed bean which takes two values from database's table import java.io.Serializable;
I have this java code which is a part of a managed bean which
i have an managed bean(session scope) like this: class Home {// as homeBean public
I have this managed bean: package com.DX_57.SR_57; /** include default packages for Beans */
I have a property in my JSF managed bean: private List<Long> selectedDataSets; I initialize
I have this managed bean which makes SQL queries to Oracle database and returns
Let's say I have this action in a JSF Managed Bean: public String doSomething()
Well I have this code in my Managed C++/Cli in Visual Studio 2008, I
I have managed to put this condition and rule below together to redirect a

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.