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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:56:38+00:00 2026-06-02T09:56:38+00:00

I tried to deactivate passivation of a stateful session bean using @CacheConfig(maxSize = 0,

  • 0

I tried to deactivate passivation of a stateful session bean using

@CacheConfig(maxSize = 0, idleTimeoutSeconds = 0)

http://docs.jboss.org/ejb3/docs/reference/1.0.7/html/SessionBean_and_MDB_configuration.html

I added a couple print statements to my stateful session bean and the managed bean that it’s injected into to better understand what’s happening. It appears that the stateful bean is indeed injected into the managed bean (as it’s not null), but calling it’s methods has no effect (if you look at the loadData() method of the managed bean below, it calls the test() routine of the stateful session bean, but the output “test” never appears).

15:06:07,861 INFO [STDOUT] loadData programSlug = some-program-name

15:06:07,876 INFO [STDOUT] programServiceBean = No-Interface view for endpoint [ jboss.j2ee:jar=TEI.war,name=ProgramServiceBean,service=EJB3 ] and session 43h1h2v-j35uon-h18czgvf-1-h18d0nzj-df

15:06:07,908 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/TEI].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalStateException:
Unable to locate member [com.ray.TEI.model.Program#urlSlug]
at org.hibernate.ejb.metamodel.AbstractAttribute.readObject(AbstractAttribute.java:122) [:3.6.6.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_30]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_30]

Here is my stateful session bean…

package com.ray.TEI.ejb;

import com.ray.TEI.model.Program;

import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType;

import org.jboss.ejb3.annotation.CacheConfig;

@Stateful
@CacheConfig(maxSize = 0, idleTimeoutSeconds = 0)
public class ProgramServiceBean {
  @PersistenceContext(unitName="TEI", type=PersistenceContextType.EXTENDED)
  protected EntityManager em;

  public void test() {
    System.out.println("test");
  }

  public Program findBySlug(String urlSlug) {
    System.out.println("findBySlug " + urlSlug);
    return em.createNamedQuery("Program.findBySlug", Program.class)
        .setParameter("urlSlug", urlSlug)
        .getSingleResult();
  }
}

And here is the managed bean…

package com.ray.TEI.controller;

import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;

import com.ocpsoft.pretty.faces.annotation.URLAction;
import com.ocpsoft.pretty.faces.annotation.URLMapping;
import com.ocpsoft.pretty.faces.annotation.URLQueryParameter;
import com.ray.TEI.ejb.ProgramServiceBean;
import com.ray.TEI.model.Program;

@Named
@RequestScoped
@URLMapping(
  id="uuts",
  pattern="/#{programSlug:uutsController.programSlug}/uuts",
  viewId="/uuts.xhtml"
)
public class UutsController {
  @Inject private ProgramServiceBean programServiceBean;
  private String programSlug;
  private Program program;

  @URLQueryParameter("new")
  private Boolean displayAddForm = false;

  @URLAction
  public String loadData() {
    System.out.println("loadData programSlug = " + programSlug);
    if (programSlug != null) {
      System.out.println("programServiceBean = " + programServiceBean);
      programServiceBean.test();
      program = programServiceBean.findBySlug(programSlug);
      System.out.println("loadData program = " + program.getName());
    }
    if (program == null) {
      return "pretty:error";
    }
    return null;
  }

  public String getProgramSlug() {
    return programSlug;
  }
  public void setProgramSlug(String programSlug) {
    this.programSlug = programSlug;
  }

  //other getters/setters
}

Any idea of what the problem is?

Thanks,
Jason

(By the way, I’m using JBoss 6.1 Final)

  • 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-02T09:56:39+00:00Added an answer on June 2, 2026 at 9:56 am

    Fixed my problem by setting the bean removal timeout to be less than the idle timeout as described here https://community.jboss.org/wiki/Ejb3DisableSfsbPassivation (Option 2, method 2)

    import org.jboss.ejb3.annotation.CacheConfig;
    
    @Stateful
    @CacheConfig (maxSize=100000, idleTimeoutSeconds=600, removalTimeoutSeconds=300)
    public class ProgramServiceBean {
      //...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
I tried using PHPDoc for the first time today and quickly ran into a
Ruby keeps segfaulting when using the Koala gem to talk over HTTP: /Users/pawel/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG]
I am using the Aria C++ programming libs for mobile robots (http://robots.mobilerobots.com/wiki/ARIA). I am
Is there a way to truncate tables with constraints ? I tried to DEACTIvATE
I just got done walking through the install instructions on this page: http://grails.org/plugin/spring-security-facebook I
tried using solutions posted here How to fast get Hardware-ID in C#? and here
Tried following the instructions here: How to use Google app engine with my own
Tried a bunch of things but I can't get it to work consistently amid
tried to find the answer by googling and in MSDN but with no luck.

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.