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

The Archive Base Latest Questions

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

I have a stateless EJB-3.1 session bean containing an asynchronous method that does some

  • 0

I have a stateless EJB-3.1 session bean containing an asynchronous method that does some expensive processing and returns a future to the client, thereby allowing it to display the processing result once it’s ready:

@Asynchronous
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public Future<String> importModules() {
   String result = doSomeHeavyStuff();
   return new AsyncResult<String>(result);
}

This bean is running on a JBoss 6 instance and invoked remotely from a Swing client:

final Future<String> termination =
            Proxy.getProxy().getMenfpImportService().importModules();

SwingWorker<String, Object> worker = new SwingWorker<String, Object>() {

    @Override
    protected String doInBackground() {
        /* ... */
        if (termination.isDone()) {
             return termination.get();
        }
        /* ... */
    }

    /* ... */
}

While the processing usually finishes successfully, some computations take longer than 300 seconds to finish.

For these computations, a JBoss socket timeout causes the client to receive an ExecutionException instead of the computation result when calling termination.get():

10:26:16,301     INFO Application:1150 - Execution exception during modules import: 
java.util.concurrent.ExecutionException: org.jboss.remoting.InvocationFailureException: Socket timed out.  Waited 300000 milliseconds for response while calling on InvokerLocator [socket://degotte:3873/?timeout=300000]; nested exception is: 
java.net.SocketTimeoutException: Read timed out
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.jboss.ejb3.async.spi.AsynchronousClientFuture.get(AsynchronousClientFuture.java:113)
at org.jboss.ejb3.async.impl.util.concurrent.LocalJvmSerializableFutureWrapper.get(LocalJvmSerializableFutureWrapper.java:161)
at lu.lippmann.forminitiale.client.gui.Application$2.doInBackground(Application.java:1137)
at lu.lippmann.forminitiale.client.gui.Application$2.doInBackground(Application.java:1)
at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at javax.swing.SwingWorker.run(SwingWorker.java:316)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

Unfortunately, the @Asynchronous annotation doesn’t provide any configuration options.

My question is how I can increase the client server communication socket timeout, and if in any way possible only for the connection established during the invocation of the asynchronous method.

Thanks,
Thomas

  • 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-27T23:39:14+00:00Added an answer on May 27, 2026 at 11:39 pm

    The link posted by Nayan Wadekar pointed to the right direction. The component responsible for managing the sockets on a JBoss AS is JBoss remoting which provides so-called Connectors to call the suitable invocation handlers for the connecting transports.

    In the case of an EJB method invocation the responsible connector seems to be the DefaultEjb3Connector whose parameters can be configured in the file ejb3-connectors-jboss-beans.xml in the deploy folder, e.g. in

    $JBOSS_HOME/server/default/deploy/ejb3-connectors-jboss-beans.xml
    

    if using the default profile.

    Raising the timeout parameter after the socket URL proved to be effective.

    <bean name="org.jboss.ejb3.RemotingConnector"
    class="org.jboss.remoting.transport.Connector">
    
    <property name="invokerLocator">
    
      <value-factory bean="ServiceBindingManager"
        method="getStringBinding">
        <parameter>
          jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3
        </parameter>
        <parameter>
          <null />
        </parameter>
        <!-- <parameter>socket://${hostforurl}:${port}?timeout=300000</parameter> -->
        <parameter>socket://${hostforurl}:${port}?timeout=1200000</parameter>
        <parameter>
          <null />
        </parameter>
        <parameter>3873</parameter>
      </value-factory>
    
    </property>
    <property name="serverConfiguration">
      <inject bean="ServerConfiguration" />
    </property>
    

    However, this raises the timeout for all EJB method invocations. Given what I have read about the concepts of JBoss remoting, I am not sure whether adding an adapted connector for certain session beans only is actually possible.

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

Sidebar

Related Questions

We have some JavaEE5 stateless EJB bean that passes the injected EntityManager to its
I have an EJB3 stateless session bean that uses some other ejbs to do
What would a stateless session bean provide over just a regular class that has
We have a project with a pretty considerable number of EJB 2 stateless session
I have a Stateless Session Bean (java ee 6, cdi) which throw events @Stateless
I have a web app using JSF2 with JPA Entities, Stateless ejb session beans
I have Stateless Session Bean with Container-Managed Transactions. I want to return unmanaged entity
I have a servlet code which calls a ejb stateful session bean code as
How to ensure that the exception thrown by @Asynchronous method from EJB 3.1 methods
Scenario: I have @Singleton UserFactory ( @Stateless could be) , its method createSession() generating

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.