glassfish
  1. glassfish
  2. GLASSFISH-21038

domain.xml application context race condition

    Details

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

      Windows 7 OS

      Description

      My team is experiencing an issue with deploying a war file containing web services. When the war is generated and then deployed, the following line is sometimes missing from the domain.xml file under domains/domain1/config:

      <engine sniffer="webservices"></engine>

      Other facts:
      -Attempting to access any web service then results in an error involving the javax.servlet.jar, for reasons unknown.
      -Nothing in our project ever modifies the domain.xml file
      -Using the /exact/ same war file, un-deploying and then re-deploying randomly results in the <engine sniffer="webservices"></engine> line being present or missing. The war file is not regenerated, we just have to undeploy and redeploy.
      -Adding the <engine sniffer="webservices"></engine> manually to the domain.xml file, stopping the server, and restarting the server fixes the issue, and the inverse is also true.
      -There are other <engine sniffer=".*"></engine> lines that are always present.

        Activity

        Hide
        Hong Zhang added a comment -

        Can you attach a reproducible test case for us to reproduce and look from our side?

        Assign to web services team for initial evaluation.

        Show
        Hong Zhang added a comment - Can you attach a reproducible test case for us to reproduce and look from our side? Assign to web services team for initial evaluation.
        Hide
        Jovok added a comment -

        I'm unable to produce a test case to submit, I can't pare down our code base enough to make it releasable. I'd be happy to take a look at it myself if I could get a copy of the glassfish4 source. If it helps, I'm almost certain its a threading issue, our code base is quite large, and it's seemingly random if a deploy will work or not.

        Show
        Jovok added a comment - I'm unable to produce a test case to submit, I can't pare down our code base enough to make it releasable. I'd be happy to take a look at it myself if I could get a copy of the glassfish4 source. If it helps, I'm almost certain its a threading issue, our code base is quite large, and it's seemingly random if a deploy will work or not.
        Hide
        sisirhc added a comment - - edited

        On our environment we experience the same behavior with Glassfish 3.1.2.2.

        The operating system doesn't seem to influence, the issue occurs on Windows as well on Ubuntu an CentOS. The JDK in use is JDK 7 update 45. But also with the JDK we experience the issue with different version.

        The deployment archive we are using is an EAR file using a number of sub projects which are web, ejb and webservices. One of the projects in a JAR package with beans annotated with "@java.jws.WebService". This package is not always correctly marked as web service package.

        Here is a logging snapshot

        [#|2014-06-24T17:15:10.449+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.annotation.impl.ModuleScanner;MethodName=calculateResults;|Adding my.company.AddMessagesWebServiceBean since my.company.AddMessagesWebServiceBean is annotated with javax.ejb.Stateless|#]
        [#|2014-06-24T17:15:10.457+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.annotation.impl.ModuleScanner;MethodName=calculateResults;|Adding my.company.AddMessagesWebServiceBean since messageConnector is annotated with javax.ejb.EJB|#]
        [#|2014-06-24T17:15:10.459+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.annotation.impl.ModuleScanner;MethodName=calculateResults;|Adding my.company.AddMessagesWebServiceBean since my.company.AddMessagesWebServiceBean is annotated with javax.jws.WebService|#]
        [#|2014-06-24T17:15:10.459+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.annotation.impl.ModuleScanner;MethodName=calculateResults;|Adding my.company.AddMessagesWebServiceBean since sc is annotated with javax.annotation.Resource|#]
        [#|2014-06-24T17:15:16.883+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|End of element  local name ejb-name and ejb-name value AddMessagesWebServiceBean|#]
        [#|2014-06-24T17:15:16.883+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|For element ejb-name And value AddMessagesWebServiceBean|#]
        [#|2014-06-24T17:15:16.884+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.DeploymentDescriptorNode;MethodName=setDescriptorInfo;|in class com.sun.enterprise.deployment.WebServiceEndpoint  method  setEndpointAddressUri with  /ht-tms-gmsg/GreenMessengerService/AddMessagesWebServiceBean|#]
        [#|2014-06-24T17:15:16.884+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|End of element  local name endpoint-address-uri and endpoint-address-uri value /ht-tms-gmsg/GreenMessengerService/AddMessagesWebServiceBean|#]
        [#|2014-06-24T17:15:16.884+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|End of element  local name port-component-name and port-component-name value AddMessagesWebServiceBean|#]
        [#|2014-06-24T17:15:16.884+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|For element endpoint-address-uri And value /ht-tms-gmsg/GreenMessengerService/AddMessagesWebServiceBean|#]
        [#|2014-06-24T17:15:16.884+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|For element port-component-name And value AddMessagesWebServiceBean|#]
        [#|2014-06-24T17:15:16.996+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.util.EjbBundleValidator;MethodName=accept;|Visiting RefLocal ejb-ref name=my.company.AddMessagesWebServiceBean/messageConnector,Local 3.x interface =my.company.connector.MessageConnectorLocal,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session|#]
        [#|2014-06-24T17:15:16.997+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.util.EjbBundleValidator;MethodName=accept;|Done Visiting AddMessagesWebServiceBean reference Local ejb-ref name=my.company.AddMessagesWebServiceBean/messageConnector,Local 3.x interface =my.company.connector.MessageConnectorLocal resolved to intra-app EJB MessageConnector in module ht-connector.jar,ejb-link=ht-connector.jar#MessageConnector,lookup=,mappedName=,jndi-name=,refType=Session|#]
        [#|2014-06-24T17:15:17.433+0200|FINEST|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.appserv.connectors.internal.api.AppSpecificConnectorClassLoaderUtil;MethodName=detectResourceInRA;|could not find resource by name : my.company.AddMessagesWebServiceBean/sc|#]
        [#|2014-06-24T17:15:18.205+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.Application;MethodName=setUniqueId;|Ejb  ht-tms-gmsg-2.7.0-SNAPSHOT.jar:AddMessagesWebServiceBean id = 91987831535894769|#]
        

        Comparing the above log file to a unsuccessful deployment the only line that seems to be missing is

        Adding my.company.AddMessagesWebServiceBean since my.company.AddMessagesWebServiceBean is annotated with javax.jws.WebService
        

        The occurrence seems to be random but always related to deployments and not to restarts. It's possible to have multiple deployment successes but also to have multiple failures.

        Adding the engine tag in the domain.xml seems to resolve the problem (until a new deploy is done).

        Show
        sisirhc added a comment - - edited On our environment we experience the same behavior with Glassfish 3.1.2.2. The operating system doesn't seem to influence, the issue occurs on Windows as well on Ubuntu an CentOS. The JDK in use is JDK 7 update 45. But also with the JDK we experience the issue with different version. The deployment archive we are using is an EAR file using a number of sub projects which are web, ejb and webservices. One of the projects in a JAR package with beans annotated with "@java.jws.WebService". This package is not always correctly marked as web service package. Here is a logging snapshot [#|2014-06-24T17:15:10.449+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.annotation.impl.ModuleScanner;MethodName=calculateResults;|Adding my.company.AddMessagesWebServiceBean since my.company.AddMessagesWebServiceBean is annotated with javax.ejb.Stateless|#] [#|2014-06-24T17:15:10.457+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.annotation.impl.ModuleScanner;MethodName=calculateResults;|Adding my.company.AddMessagesWebServiceBean since messageConnector is annotated with javax.ejb.EJB|#] [#|2014-06-24T17:15:10.459+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.annotation.impl.ModuleScanner;MethodName=calculateResults;|Adding my.company.AddMessagesWebServiceBean since my.company.AddMessagesWebServiceBean is annotated with javax.jws.WebService|#] [#|2014-06-24T17:15:10.459+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.annotation.impl.ModuleScanner;MethodName=calculateResults;|Adding my.company.AddMessagesWebServiceBean since sc is annotated with javax.annotation.Resource|#] [#|2014-06-24T17:15:16.883+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|End of element local name ejb-name and ejb-name value AddMessagesWebServiceBean|#] [#|2014-06-24T17:15:16.883+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|For element ejb-name And value AddMessagesWebServiceBean|#] [#|2014-06-24T17:15:16.884+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.DeploymentDescriptorNode;MethodName=setDescriptorInfo;|in class com.sun.enterprise.deployment.WebServiceEndpoint method setEndpointAddressUri with /ht-tms-gmsg/GreenMessengerService/AddMessagesWebServiceBean|#] [#|2014-06-24T17:15:16.884+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|End of element local name endpoint-address-uri and endpoint-address-uri value /ht-tms-gmsg/GreenMessengerService/AddMessagesWebServiceBean|#] [#|2014-06-24T17:15:16.884+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|End of element local name port-component-name and port-component-name value AddMessagesWebServiceBean|#] [#|2014-06-24T17:15:16.884+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|For element endpoint-address-uri And value /ht-tms-gmsg/GreenMessengerService/AddMessagesWebServiceBean|#] [#|2014-06-24T17:15:16.884+0200|FINER|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.node.SaxParserHandler;MethodName=endElement;|For element port-component-name And value AddMessagesWebServiceBean|#] [#|2014-06-24T17:15:16.996+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.util.EjbBundleValidator;MethodName=accept;|Visiting RefLocal ejb-ref name=my.company.AddMessagesWebServiceBean/messageConnector,Local 3.x interface =my.company.connector.MessageConnectorLocal,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session|#] [#|2014-06-24T17:15:16.997+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.util.EjbBundleValidator;MethodName=accept;|Done Visiting AddMessagesWebServiceBean reference Local ejb-ref name=my.company.AddMessagesWebServiceBean/messageConnector,Local 3.x interface =my.company.connector.MessageConnectorLocal resolved to intra-app EJB MessageConnector in module ht-connector.jar,ejb-link=ht-connector.jar#MessageConnector,lookup=,mappedName=,jndi-name=,refType=Session|#] [#|2014-06-24T17:15:17.433+0200|FINEST|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.appserv.connectors.internal.api.AppSpecificConnectorClassLoaderUtil;MethodName=detectResourceInRA;|could not find resource by name : my.company.AddMessagesWebServiceBean/sc|#] [#|2014-06-24T17:15:18.205+0200|FINE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.deployment.Application;MethodName=setUniqueId;|Ejb ht-tms-gmsg-2.7.0-SNAPSHOT.jar:AddMessagesWebServiceBean id = 91987831535894769|#] Comparing the above log file to a unsuccessful deployment the only line that seems to be missing is Adding my.company.AddMessagesWebServiceBean since my.company.AddMessagesWebServiceBean is annotated with javax.jws.WebService The occurrence seems to be random but always related to deployments and not to restarts. It's possible to have multiple deployment successes but also to have multiple failures. Adding the engine tag in the domain.xml seems to resolve the problem (until a new deploy is done).
        Hide
        mebemikeyc added a comment -

        I experienced the same issue with one of my applications while migrating to GlassFish 4.1.1. This seems to be caused by class annotation introspection failing to find the annotations defined in org.glassfish.webservices.connector.WebServicesSniffer.

        Looking into that file I discovered that, as a workaround, adding a WEB-INF/webservices.xml file will also trigger the engine to be added to the domain.xml.

        Show
        mebemikeyc added a comment - I experienced the same issue with one of my applications while migrating to GlassFish 4.1.1. This seems to be caused by class annotation introspection failing to find the annotations defined in org.glassfish.webservices.connector.WebServicesSniffer. Looking into that file I discovered that, as a workaround, adding a WEB-INF/webservices.xml file will also trigger the engine to be added to the domain.xml.

          People

          • Assignee:
            Martin Grebac
            Reporter:
            Jovok
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

              Estimated:
              Original Estimate - 1 week
              1w
              Remaining:
              Remaining Estimate - 1 week
              1w
              Logged:
              Time Spent - Not Specified
              Not Specified