[jboss-jira] [JBoss JIRA] (WFLY-11999) Wildfly creates to many instances of all web service classes

Stefan Frings (Jira) issues at jboss.org
Wed Apr 17 10:33:00 EDT 2019


    [ https://issues.jboss.org/browse/WFLY-11999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13723783#comment-13723783 ] 

Stefan Frings commented on WFLY-11999:
--------------------------------------

Interesting info: Apache Tomcat starts only 1 instance of the class with @ApplicationScoped:
{code}
Using CATALINA_BASE:   /home/sfrings/workspace_Congstar/apache-tomcat-8.5.40
Using CATALINA_HOME:   /home/sfrings/workspace_Congstar/apache-tomcat-8.5.40
Using CATALINA_TMPDIR: /home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/temp
Using JRE_HOME:        /usr/lib/jvm/java-8-openjdk-amd64
Using CLASSPATH:       /home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/bin/bootstrap.jar:/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/bin/tomcat-juli.jar
Listening for transport dt_socket at address: 11550
17-Apr-2019 16:27:14.075 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.40
17-Apr-2019 16:27:14.077 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Apr 10 2019 14:31:19 UTC
17-Apr-2019 16:27:14.078 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.40.0
17-Apr-2019 16:27:14.078 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
17-Apr-2019 16:27:14.078 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.18.0-17-generic
17-Apr-2019 16:27:14.078 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
17-Apr-2019 16:27:14.078 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-8-openjdk-amd64/jre
17-Apr-2019 16:27:14.078 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_191-8u191-b12-2ubuntu0.18.10.1-b12
17-Apr-2019 16:27:14.078 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
17-Apr-2019 16:27:14.079 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /home/sfrings/workspace_Congstar/apache-tomcat-8.5.40
17-Apr-2019 16:27:14.079 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /home/sfrings/workspace_Congstar/apache-tomcat-8.5.40
17-Apr-2019 16:27:14.079 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/conf/logging.properties
17-Apr-2019 16:27:14.079 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
17-Apr-2019 16:27:14.079 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttp.nonProxyHosts=localhost|127.0.0.1|stefanpc
17-Apr-2019 16:27:14.080 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
17-Apr-2019 16:27:14.080 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
17-Apr-2019 16:27:14.080 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
17-Apr-2019 16:27:14.080 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=11550,server=y,suspend=n
17-Apr-2019 16:27:14.080 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
17-Apr-2019 16:27:14.080 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40
17-Apr-2019 16:27:14.081 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40
17-Apr-2019 16:27:14.081 INFORMATION [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/temp
17-Apr-2019 16:27:14.081 INFORMATION [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
17-Apr-2019 16:27:14.245 INFORMATION [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
17-Apr-2019 16:27:14.260 INFORMATION [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
17-Apr-2019 16:27:14.299 INFORMATION [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
17-Apr-2019 16:27:14.305 INFORMATION [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
17-Apr-2019 16:27:14.308 INFORMATION [main] org.apache.catalina.startup.Catalina.load Initialization processed in 868 ms
17-Apr-2019 16:27:14.384 INFORMATION [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
17-Apr-2019 16:27:14.387 INFORMATION [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.40
17-Apr-2019 16:27:14.421 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/conf/Catalina/localhost/Test-1.0-SNAPSHOT.xml]
17-Apr-2019 16:27:15.702 INFORMATION [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
17-Apr-2019 16:27:15.865 FEIN [localhost-startStop-1] com.mvneco.test.SoapService.<init> Init SoapService 1
17-Apr-2019 16:27:18.690 INFORMATION [localhost-startStop-1] com.sun.xml.ws.server.MonitorBase.createRoot Metro monitoring rootname successfully set to: com.sun.metro:pp=/,type=WSEndpoint,name=/Test-1.0-SNAPSHOT-SoapServiceService-SoapServicePort
17-Apr-2019 16:27:18.870 INFORMATION [localhost-startStop-1] com.sun.xml.ws.transport.http.servlet.WSServletDelegate.<init> WSSERVLET14: Initialisierung von JAX-WS-Servlet
17-Apr-2019 16:27:18.872 INFORMATION [localhost-startStop-1] com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized WSSERVLET12: Initialisierung von JAX-WS-Kontext-Listener
17-Apr-2019 16:27:18.872 INFORMATION [localhost-startStop-1] com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized WSSERVLET12: Initialisierung von JAX-WS-Kontext-Listener
17-Apr-2019 16:27:18.905 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/conf/Catalina/localhost/Test-1.0-SNAPSHOT.xml] has finished in [4,484] ms
17-Apr-2019 16:27:18.907 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/webapps/docs]
17-Apr-2019 16:27:19.728 INFORMATION [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
17-Apr-2019 16:27:19.730 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/webapps/docs] has finished in [823] ms
17-Apr-2019 16:27:19.731 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/webapps/host-manager]
17-Apr-2019 16:27:20.473 INFORMATION [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
17-Apr-2019 16:27:20.479 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/webapps/host-manager] has finished in [749] ms
17-Apr-2019 16:27:20.479 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/webapps/examples]
17-Apr-2019 16:27:21.633 INFORMATION [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
17-Apr-2019 16:27:21.700 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/webapps/examples] has finished in [1,221] ms
17-Apr-2019 16:27:21.700 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/webapps/manager]
17-Apr-2019 16:27:23.001 INFORMATION [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
17-Apr-2019 16:27:23.088 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/webapps/manager] has finished in [1,388] ms
17-Apr-2019 16:27:23.088 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/webapps/ROOT]
17-Apr-2019 16:27:23.757 INFORMATION [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
17-Apr-2019 16:27:23.759 INFORMATION [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/sfrings/workspace_Congstar/apache-tomcat-8.5.40/webapps/ROOT] has finished in [671] ms
17-Apr-2019 16:27:23.765 INFORMATION [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
17-Apr-2019 16:27:23.944 INFORMATION [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
17-Apr-2019 16:27:23.951 INFORMATION [main] org.apache.catalina.startup.Catalina.start Server startup in 9641 ms
17-Apr-2019 16:27:35.074 FEIN [http-nio-8080-exec-1] com.mvneco.test.SoapService.test Start test(). payload=?
{code}

> Wildfly creates to many instances of all web service classes
> ------------------------------------------------------------
>
>                 Key: WFLY-11999
>                 URL: https://issues.jboss.org/browse/WFLY-11999
>             Project: WildFly
>          Issue Type: Bug
>          Components: EE
>    Affects Versions: 8.0.0.Final, 16.0.0.Final
>         Environment: Ubuntu 18.10 64bit, Open JDK 8 or Open JDK 11
>            Reporter: Stefan Frings
>            Assignee: Brian Stansberry
>            Priority: Minor
>         Attachments: Test.zip
>
>
> 1) My @Webservice classes are all constructed multiple times (3x - 4x) but I expected only one instance.
> 2) Only the second instance receives a call to the observer method for initialization. I expect that this method is called in each instance.
> The issue can be reproduced with the attached minimum project on Wildfly 8 with JDK 8 as well as Wildfly 16 with JDK 11.
> Complete source code of the whole application:
> {code}
> package com.mvneco.test;
> import javax.enterprise.context.ApplicationScoped;
> import javax.enterprise.context.Initialized;
> import javax.enterprise.event.Observes;
> import javax.jws.WebMethod;
> import javax.jws.WebService;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> @ApplicationScoped
> @WebService
> public class SoapService
> {
>     private Log log = LogFactory.getLog(SoapService.class);
>     public SoapService() 
>     {
>         log.debug("Init SoapService 1");
>     }
>     @WebMethod(exclude = true)
>     public void init(@Observes @Initialized(ApplicationScoped.class) Object init)
>     {
>         log.debug("Init SoapService 2");
>     }
>     @WebMethod
>     public String test(String payload)
>     {
>         log.debug("Start test(). payload="+payload);
>         return "OK";
>     }
> }
> {code}
> Extract from Log messages that show the issue (the complete log is in the attached ZIP):
> {code}
> 2019-04-17 13:12:21,399 DEBUG [com.mvneco.test.SoapService] (MSC service thread 1-2) Init SoapService 1
> 2019-04-17 13:12:23,068 DEBUG [com.mvneco.test.SoapService] (ServerService Thread Pool -- 74) Init SoapService 1
> 2019-04-17 13:12:23,070 DEBUG [com.mvneco.test.SoapService] (ServerService Thread Pool -- 74) Init SoapService 2
> 2019-04-17 13:12:23,475 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 16.0.0.Final (WildFly Core 8.0.0.Final) started in 10514ms - Started 510 of 699 services (337 services are lazy, passive or on-demand)
> 2019-04-17 13:12:28,920 INFO  [org.apache.cxf.services.SoapService.REQ_IN] (default task-1) REQ_IN
>     Address: http://localhost:8080/Test-1.0-SNAPSHOT/SoapService
>     ...
> 2019-04-17 13:12:28,932 DEBUG [com.mvneco.test.SoapService] (default task-1) Init SoapService 1
> 2019-04-17 13:12:28,937 DEBUG [com.mvneco.test.SoapService] (default task-1) Init SoapService 1
> 2019-04-17 13:12:28,937 DEBUG [com.mvneco.test.SoapService] (default task-1) Start test(). payload=?
> 2019-04-17 13:12:28,969 INFO  [org.apache.cxf.services.SoapService.RESP_OUT] (default task-1) RESP_OUT
>     Content-Type: text/xml
>     ...
> {code}



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list