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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:03:41+00:00 2026-05-26T16:03:41+00:00

I’m struggling to figure out why an @Asynchronous method in my EJB isn’t actually

  • 0

I’m struggling to figure out why an @Asynchronous method in my EJB isn’t actually being invoked asynchronously. I’m running on JBoss AS 7 using CDI (with beans.xml) in a JSF2 project with simple .war packaging produced by Maven.

The EJB is packaged in a .war along with the JSF2 managed beans that interact with it. It’s a simple @Stateless EJB. It’s used by injecting it (via @Inject) into a JSF2 managed bean that invokes its @Asynchronous method.

Instead of the @Asynchronous method invocation returning a Future immediately, it executes synchronously as if it were an ordinary unproxied direct call. This is true whether I use a local no-interface view or a local business interface to invoke the EJB.

Is @Asynchronous only supported for @Remote beans? If so, can it work within .war packaging or do I have to package an EJB jar in an EAR just to get this one feature?

Simplified code for example’s sake, with each class in the same package in a .war:

public interface SomeEJB {
  public Future<Void> doSomething();
}

@Stateless
@Local(SomeEJB.class)
public class SomeEJBImpl implements SomeEJB {

  @Asynchronous
  @Override
  public Future<Void> doSomething() {
    // Spend a while doing work
    // then:
    return new AsyncResult<Void>(null);
  }

}

@Named
@RequestScoped
public class JSFBean {

  @Inject private transient SomeEJB someEJB;
  private Future<Void> progress;

  // Called from JSF2, starts work and re-displays page
  public String startWorkAction() {
    // This call SHOULD return a Future immediately. Instead it blocks
    // until doWork() completes.
    progress = someEJB.doWork();
  }

  public Boolean isDone() {
    return progress != null && progress.isDone();
  }

}
  • 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-26T16:03:41+00:00Added an answer on May 26, 2026 at 4:03 pm

    JBoss AS 7.0.2 doesn’t support @Asynchronous by default. You have to turn it on. If it’s not turned on there’s no warning or error message, asynchronous methods are just executed synchronously.

    Yep, that’s user friendly.

    To enable these features in this supposedly finished and released* product, you must run JBoss AS 7.0.2 with the “standalone-preview.xml”, eg:

    bin/standalone.sh --server-config=standalone-preview.xml
    

    or in AS 7.1 (beta) or later:

    bin/standalone.sh --server-config=standalone-full.xml
    

    … which gets the asynchronous methods to be invoked … asynchronously.

    • (Admittedly AS 7 doesn’t claim Java EE 6 Full Profile compliance, but a warning would be nice! Or some documentation on the known issues/holes! Anything but silent undocumented failure…)

    Update: As noted by garcia-jj, removing lite=true from standalone.xml will also get async EJBs working.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.