glassfish
  1. glassfish
  2. GLASSFISH-20960

Batch job won't start when glassfish application versioning is used.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0
    • Fix Version/s: 4.1.1
    • Component/s: concurrency
    • Labels:
      None
    • Environment:

      Ubuntu 12.04, Mac OS X 10.9, Windows 7

      Description

      To reproduce the issue take the webserverlog batch application sample from the java ee 7 tutorial, add the glassfish-web.xml file and make sure it contains the version-identifier element with the value, say, 1.0. Build and deploy the applicaiton, go to http://localhost:8080/webserverlog/ (assuming your instance listens on 8080) and start the batch job. The status of the job will change to STARTING, but the job itself won't start executing.

      I can upload the source code of the modified version of the webserverlog sample application, but I don't know how to add the attachments.

        Activity

        Hide
        jiggster added a comment -

        Is there any chance that this issue will be evaluated any time soon?

        Regards,
        Jigg

        Show
        jiggster added a comment - Is there any chance that this issue will be evaluated any time soon? Regards, Jigg
        Hide
        Mahesh Kannan added a comment -

        Mark for 4.0.1

        Show
        Mahesh Kannan added a comment - Mark for 4.0.1
        Hide
        Mahesh Kannan added a comment -

        Assigning to Anthony

        Show
        Mahesh Kannan added a comment - Assigning to Anthony
        Hide
        Mahesh Kannan added a comment -

        The root cause is that setupContext in ManagedFuture (incorrectly) finds that the application is NOT enabled. The issue is
        in ContextSetupProviderImpl.isApplicationEnabled(). This method probably needs to look into the application version field
        before deciding if the app is disabled or not.

        For example, after deploying an app with a different version, as you could see from the below output,
        only app1:v3 is enabled. So, maybe ContextSetupProviderImpl.isApplicationEnabled() (or some
        other utility method) should look into the versioning field of the app to decide correctly, if it is
        enabled or not.

        asadmin list-applications --long
        NAME TYPE STATUS
        app1 <ejb, web> disabled
        app1:v1 <ejb, web> disabled
        app1:v2 <ejb, web> disabled
        app1v3 <ejb, web> enabled
        Command list-applications executed successfully.

        Here is the call stack when a batch job is submitted from a versioned app.

        ManagedFutureTask::setupContext
        ContextSetupProviderImpl::setup(ContextHandle contextHandleForSetup)
        appName = handle.getInvocation().getAppName();
        isApplicationEnabled(appName)

        Unfortunately, isapplicationEnabled(appName) returns false thus causing
        contextSetupException to IllegalStateException.

        This causes ManagedfutureTask.run() method to be aborted. Hence the Batch job
        is never executed.

        Show
        Mahesh Kannan added a comment - The root cause is that setupContext in ManagedFuture (incorrectly) finds that the application is NOT enabled. The issue is in ContextSetupProviderImpl.isApplicationEnabled(). This method probably needs to look into the application version field before deciding if the app is disabled or not. For example, after deploying an app with a different version, as you could see from the below output, only app1:v3 is enabled. So, maybe ContextSetupProviderImpl.isApplicationEnabled() (or some other utility method) should look into the versioning field of the app to decide correctly, if it is enabled or not. asadmin list-applications --long NAME TYPE STATUS app1 <ejb, web> disabled app1:v1 <ejb, web> disabled app1:v2 <ejb, web> disabled app1v3 <ejb, web> enabled Command list-applications executed successfully. Here is the call stack when a batch job is submitted from a versioned app. ManagedFutureTask::setupContext ContextSetupProviderImpl::setup(ContextHandle contextHandleForSetup) appName = handle.getInvocation().getAppName(); isApplicationEnabled(appName) Unfortunately, isapplicationEnabled(appName) returns false thus causing contextSetupException to IllegalStateException. This causes ManagedfutureTask.run() method to be aborted. Hence the Batch job is never executed.

          People

          • Assignee:
            anthony.lai
            Reporter:
            jiggster
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: