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 8447035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:05:08+00:00 2026-06-10T10:05:08+00:00

Is there a fix to the below error. When i click the command button

  • 0

Is there a fix to the below error. When i click the command button it calls the java script to set the values for topic_body,topic_url and submit the values to a method in server by the commandbutton. I am not sure what was need to be corrected to stop the error.

XHTML

<h:form prependId="false" id="testForm">
        <h:inputHidden value="#{topicBean.topicVO.body}" id="topic_body">
        </h:inputHidden>
        <h:inputHidden value="#{topicBean.topicVO.videoAudioUrl}" id="topic_vaurl" >
        </h:inputHidden>
        <h:inputHidden value="#{topicBean.topic_guid}" id="topic_guid">
        </h:inputHidden>
                <p:commandButton id="shareeButton" action="#{topicController.createTopic}" onclick="javascript:renderElement();">
                Share
                <f:ajax execute="@form" render="@form"></f:ajax>
                </p:commandButton>
            </h:form>

Javascript

function  renderElement(){
           var textarea_content = $('textarea#wall').val();
           $('#topic_body').val(textarea_content);
           if (textarea_content != '') {
               var sitetitle = $('label.title').html();
               if (sitetitle == null) {
                   sitetitle = ' ';
               }
.......
......
..

}

JSF Bean

@ManagedBean(name = "topicBean")
@SessionScoped
public class TopicBean extends BaseMB implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private final static Logger logger = Logger.getLogger(CircleBean.class.toString());
    private TopicVO topicVO = new TopicVO();
    private long topic_guid =0;
    public TopicBean(){
        logger.info("****************************Start TopicBean Constructor****************************************");
        logger.info("****************************End TopicBean Constructor****************************************");

    }

JSF Method

@ManagedBean(name = "topicController")
@RequestScoped
public class TopicController  extends BaseMB implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private final static Logger logger = Logger
            .getLogger(CircleController.class.toString());
    TopicBean topicBean;


    public void createTopic(){
        logger.info("*******************Inside creatTopic********************");
        topicBean = (TopicBean) FacesUtils.getManagedBean("topicBean");
        ITopicService topicService = (ITopicService) ServiceLocator
                .getService("TOPICSERVICE");
         topicBean.setTopic_guid(topicService.createTopic(topicBean.getTopicVO(), userSession));

        logger.info("*******************Inside creatTopic********************");
    }

ERROR

14:44:20,335 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/emyed-web].[Faces Servlet]] (http--127.0.0.1-8080-3) Servlet.service() for servlet Faces Servlet threw exception: java.lang.NullPointerException
    at com.sun.faces.mgbean.BeanManager$ScopeManager$SessionScopeHandler.handle(BeanManager.java:575) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.mgbean.BeanManager$ScopeManager.pushToScope(BeanManager.java:458) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:410) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.zreflect.emyed.filter.EmyEdAccessFilter.hasLoggedIn(EmyEdAccessFilter.java:113) [emyed-ui-1.0.jar:]
    at com.zreflect.emyed.filter.EmyEdAccessFilter.doFilter(EmyEdAccessFilter.java:84) [emyed-ui-1.0.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626) [jbossweb-7.0.13.Final.jar:]
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2039) [jbossweb-7.0.13.Final.jar:]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]



enter code here
  • 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-10T10:05:10+00:00Added an answer on June 10, 2026 at 10:05 am

    According to the stacktrace,

    java.lang.NullPointerException
        at com.sun.faces.mgbean.BeanManager$ScopeManager$SessionScopeHandler.handle(BeanManager.java:575) [jsf-impl-2.1.7-jbossorg-2.jar:]
        at com.sun.faces.mgbean.BeanManager$ScopeManager.pushToScope(BeanManager.java:458) [jsf-impl-2.1.7-jbossorg-2.jar:]
        at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:410) [jsf-impl-2.1.7-jbossorg-2.jar:]
        at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269) [jsf-impl-2.1.7-jbossorg-2.jar:]
        at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244) [jsf-impl-2.1.7-jbossorg-2.jar:]
        at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116) [jsf-impl-2.1.7-jbossorg-2.jar:]
        at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) [jsf-impl-2.1.7-jbossorg-2.jar:]
        at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) [jsf-impl-2.1.7-jbossorg-2.jar:]
        at com.zreflect.emyed.filter.EmyEdAccessFilter.hasLoggedIn(EmyEdAccessFilter.java:113) [emyed-ui-1.0.jar:]
        at com.zreflect.emyed.filter.EmyEdAccessFilter.doFilter(EmyEdAccessFilter.java:84) [emyed-ui-1.0.jar:]
    

    you’ve a Filter class EmyEdAccessFilter which is trying to resolve a JSF-specific EL expression using ValueExpression, most likely with the sole purpose to find a session scoped JSF managed bean or its property which should represent the logged-in user. But this EL resolving failed because there’s no means of a FacesContext inside a servlet filter. The FacesContext is supposed to be created by the FacesServlet, but at the moment the filter runs, the FacesServlet hasn’t run at all and thus the FacesContext.getCurrentInstance() returns null and thus your code breaks.

    All with all, this is not the right way to check a session scoped JSF managed bean in a filter.

    Under JSF’s covers, session scoped managed beans are stored as attributes of the HttpSession with the managed bean name as session attribute name. You can just access them "the usual way" as session attributes in a servlet filter. E.g.

    @Override
    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) res;
        HttpSession session = request.getSession(false);
        UserManager userManager = (session != null) ? (UserManager) session.getAttribute("userManager") : null;
    
        if (userManager == null || !userManager.isLoggedIn()) {
            response.sendRedirect(request.getContextPath() + "/login.xhtml"); // No logged-in user found, so redirect to login page.
        } else {
            chain.doFilter(req, res); // Logged-in user found, so just continue request.
        }
    }
    

    Where UserManager represents your session scoped JSF managed bean.

    See also:

    • Get JSF managed bean by name in any Servlet related class
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can you help me understandand/fix the error below. I don't understand as CustomCellView is
Is there a tool to help fix Html errors and warnings? I just checked
I know there should be a simple fix for this, but im braindead at
Is there a way to get the accuracy of the fix from MyLocationOverlay? It
I want to know if there is any way to fix all the PEP-8
I am trying to create a generic container (e.g. java code below), which has
i want to backup firebird database. Below is command that i use to execute
Post updated to reflect partial fix suggested by @Kate. Original post below new post:
Below you can see my .xaml.cs code. The app opens fine. There are 4
I have a php script below known as cancelimage.php where it will display 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.