[JBoss JIRA] (WFWIP-312) [EAP7-1386] servletContext and servletConfig in config provider names are always null
by Petr Kremensky (Jira)
[ https://issues.redhat.com/browse/WFWIP-312?page=com.atlassian.jira.plugin... ]
Petr Kremensky updated WFWIP-312:
---------------------------------
Description:
I've noticed that names of additional config sources provided by EAP7-1386 are always:
{noformat}
null:null:ServletConfigSource
null:null:FilterConfigSource
null:ServletContextConfigSource
{noformat}
I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
Servlet additions:
{code:java}
System.out.println("-------------------------------------");
System.out.println("Servlet context name: " + getServletContext().getServletContextName());
System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
System.out.println("Servlet name: " + getServletName());
System.out.println("Servlet info: " + getServletInfo());
ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
System.out.println("=================================");
System.out.println(configSource.getName());
System.out.println(configSource.getOrdinal());
System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
});
System.out.println("-------------------------------------");
{code}
web.xml addition
{code:xml}
<web-app>
+ <display-name>test</display-name>
...
{code}
server output:
{noformat}
-------------------------------------
Servlet context name: test
Servlet virtual server name: default-host
Servlet name from servlet config: recruiter
Servlet name: recruiter
Servlet info:
=================================
SysPropConfigSource
400
Property names: [Standalone], awt.toolkit, java.specification.version ...
=================================
EnvConfigSource
300
Property names: PATH, ...
=================================
null:null:ServletConfigSource
60
Property names:
=================================
null:null:FilterConfigSource
50
Property names:
=================================
null:ServletContextConfigSource
40
Property names:
-------------------------------------
{noformat}
Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
{code:java}
@Override
public String getName() {
if (name == null) {
synchronized(this) {
if (name == null) {
ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
StringBuilder sb = new StringBuilder();
name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
.append(servletConfig != null ? servletConfig.getServletName() : null)
.append(":ServletConfigSource").toString();
}
}
}
return name;
}
{code}
My simple-minded expectation would be that the config sources name will use the fields provided in web.xml.
*Reproduce:*
* start standalone server
* deploy [^source-names.war]
* curl http://localhost:8080/source-names/servlet1
* see server logs
See [^source-names.zip] for sources.
was:
I've noticed that names of additional config sources provided by EAP7-1386 are always:
{noformat}
null:null:ServletConfigSource
null:null:FilterConfigSource
null:ServletContextConfigSource
{noformat}
I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
Servlet additions:
{code:java}
System.out.println("-------------------------------------");
System.out.println("Servlet context name: " + getServletContext().getServletContextName());
System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
System.out.println("Servlet name: " + getServletName());
System.out.println("Servlet info: " + getServletInfo());
ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
System.out.println("=================================");
System.out.println(configSource.getName());
System.out.println(configSource.getOrdinal());
System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
});
System.out.println("-------------------------------------");
{code}
web.xml addition
{code:xml}
<web-app>
+ <display-name>test</display-name>
...
{code}
server output:
{noformat}
-------------------------------------
Servlet context name: test
Servlet virtual server name: default-host
Servlet name from servlet config: recruiter
Servlet name: recruiter
Servlet info:
=================================
SysPropConfigSource
400
Property names: [Standalone], awt.toolkit, java.specification.version ...
=================================
EnvConfigSource
300
Property names: PATH, ...
=================================
null:null:ServletConfigSource
60
Property names:
=================================
null:null:FilterConfigSource
50
Property names:
=================================
null:ServletContextConfigSource
40
Property names:
-------------------------------------
{noformat}
Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
{code:java}
@Override
public String getName() {
if (name == null) {
synchronized(this) {
if (name == null) {
ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
StringBuilder sb = new StringBuilder();
name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
.append(servletConfig != null ? servletConfig.getServletName() : null)
.append(":ServletConfigSource").toString();
}
}
}
return name;
}
{code}
My simple-minded expectation would be that the config sources will use the fields provided in the name.
*Reproduce:*
* start standalone server
* deploy [^source-names.war]
* curl http://localhost:8080/source-names/servlet1
* see server logs
See [^source-names.zip] for sources.
> [EAP7-1386] servletContext and servletConfig in config provider names are always null
> -------------------------------------------------------------------------------------
>
> Key: WFWIP-312
> URL: https://issues.redhat.com/browse/WFWIP-312
> Project: WildFly WIP
> Issue Type: Quality Risk
> Reporter: Petr Kremensky
> Assignee: Ronald Sigal
> Priority: Major
> Attachments: source-names.war, source-names.zip
>
>
> I've noticed that names of additional config sources provided by EAP7-1386 are always:
> {noformat}
> null:null:ServletConfigSource
> null:null:FilterConfigSource
> null:ServletContextConfigSource
> {noformat}
> I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
> Servlet additions:
> {code:java}
> System.out.println("-------------------------------------");
> System.out.println("Servlet context name: " + getServletContext().getServletContextName());
> System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
> System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
> System.out.println("Servlet name: " + getServletName());
> System.out.println("Servlet info: " + getServletInfo());
> ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
> System.out.println("=================================");
> System.out.println(configSource.getName());
> System.out.println(configSource.getOrdinal());
> System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
> });
> System.out.println("-------------------------------------");
> {code}
> web.xml addition
> {code:xml}
> <web-app>
> + <display-name>test</display-name>
> ...
> {code}
> server output:
> {noformat}
> -------------------------------------
> Servlet context name: test
> Servlet virtual server name: default-host
> Servlet name from servlet config: recruiter
> Servlet name: recruiter
> Servlet info:
> =================================
> SysPropConfigSource
> 400
> Property names: [Standalone], awt.toolkit, java.specification.version ...
> =================================
> EnvConfigSource
> 300
> Property names: PATH, ...
> =================================
> null:null:ServletConfigSource
> 60
> Property names:
> =================================
> null:null:FilterConfigSource
> 50
> Property names:
> =================================
> null:ServletContextConfigSource
> 40
> Property names:
> -------------------------------------
> {noformat}
> Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
> {code:java}
> @Override
> public String getName() {
> if (name == null) {
> synchronized(this) {
> if (name == null) {
> ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
> ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
> StringBuilder sb = new StringBuilder();
> name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
> .append(servletConfig != null ? servletConfig.getServletName() : null)
> .append(":ServletConfigSource").toString();
> }
> }
> }
> return name;
> }
> {code}
> My simple-minded expectation would be that the config sources name will use the fields provided in web.xml.
> *Reproduce:*
> * start standalone server
> * deploy [^source-names.war]
> * curl http://localhost:8080/source-names/servlet1
> * see server logs
> See [^source-names.zip] for sources.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (WFWIP-313) [EAP7-1386] Cannot deploy simple jax-rs application to server without microprofile extenstions
by Petr Kremensky (Jira)
Petr Kremensky created WFWIP-313:
------------------------------------
Summary: [EAP7-1386] Cannot deploy simple jax-rs application to server without microprofile extenstions
Key: WFWIP-313
URL: https://issues.redhat.com/browse/WFWIP-313
Project: WildFly WIP
Issue Type: Quality Risk
Reporter: Petr Kremensky
Assignee: Ronald Sigal
This one is probably caused by a fact that https://github.com/resteasy/Resteasy/pull/2250 was submitted a long time before the "MicroProfile Config will be available to EAP only when installing the MicroProfile expansion pack" was introduces. I just want to be sure that we're on a same page here and my understanding that this is a valid use case for EAP7-1386 is correct. If so, we might include similar use case into test plan to cover this.
*Reproduce*
Update the standalone.xml configuration file inside the WildFly server - remove all microprofile extensions/subsystems from it, and deploy a simple Jax-rs application - e.g. https://github.com/wildfly/quickstart/tree/master/helloworld-rs
* WildFly 19.0.0.Final with default RESTEasy (3.11.0.Final)
No issues with deployment.
* WildFly 19.0.0.Final with RESTEasy 3.10.0-SNAPSHOT from https://github.com/resteasy/Resteasy/pull/2250 (7f10848)
{noformat}
07:55:08,542 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 68) MSC000001: Failed to start service jboss.deployment.unit."helloworld-rs.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."helloworld-rs.war".undertow-deployment: java.lang.IllegalStateException: No ConfigProviderResolver implementation found!
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: java.lang.IllegalStateException: No ConfigProviderResolver implementation found!
at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:125)
at org.eclipse.microprofile.config.spi.ConfigProviderResolver.instance(ConfigProviderResolver.java:110)
at org.eclipse.microprofile.config.ConfigProvider.getConfig(ConfigProvider.java:105)
at org.jboss.resteasy.microprofile.config.ResteasyConfigProvider.getConfig(ResteasyConfigProvider.java:11)
at org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap.getParameter(ConfigurationBootstrap.java:353)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:136)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:42)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:305)
at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:145)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:585)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:556)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1541)
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:598)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:97)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
... 8 more
07:55:08,546 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "helloworld-rs.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"helloworld-rs.war\".undertow-deployment" => "java.lang.IllegalStateException: No ConfigProviderResolver implementation found!
Caused by: java.lang.IllegalStateException: No ConfigProviderResolver implementation found!"}}
07:55:08,547 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "helloworld-rs.war" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"helloworld-rs.war\".undertow-deployment" => "java.lang.IllegalStateException: No ConfigProviderResolver implementation found!
Caused by: java.lang.IllegalStateException: No ConfigProviderResolver implementation found!"}}
{noformat}
Please let me know in case that my expectations about this use case are wrong.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (LOGMGR-271) NoSuchAlgorithmException in SocketHandlerTests on IBM JDK
by Daniel Cihak (Jira)
[ https://issues.redhat.com/browse/LOGMGR-271?page=com.atlassian.jira.plugi... ]
Daniel Cihak closed LOGMGR-271.
-------------------------------
Resolution: Duplicate Issue
> NoSuchAlgorithmException in SocketHandlerTests on IBM JDK
> ---------------------------------------------------------
>
> Key: LOGMGR-271
> URL: https://issues.redhat.com/browse/LOGMGR-271
> Project: JBoss Log Manager
> Issue Type: Bug
> Affects Versions: 2.1.5.Final
> Reporter: Daniel Cihak
> Assignee: Daniel Cihak
> Priority: Major
> Fix For: 2.2.0.Final
>
>
> Following tests fail on IBM JDK:
> {code}
> org.jboss.logmanager.handlers.SocketHandlerTests#testProtocolChange
> org.jboss.logmanager.handlers.SocketHandlerTests#testTlsConnection
> org.jboss.logmanager.handlers.SocketHandlerTests#testTlsConfig
> {code}
> Error:
> {code}
> java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: IBMJSSE2, class: com.ibm.jsse2.aj)
> {code}
> Stack Trace:
> {code}
> Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: IBMJSSE2, class: com.ibm.jsse2.aj)
> at java.security.Provider$Service.newInstance(Provider.java:1628)
> at sun.security.jca.GetInstance.getInstance(GetInstance.java:248)
> at sun.security.jca.GetInstance.getInstance(GetInstance.java:176)
> at javax.net.ssl.SSLContext.getInstance(SSLContext.java:6)
> at javax.net.ssl.SSLContext.getDefault(SSLContext.java:8)
> at javax.net.ssl.SSLServerSocketFactory.getDefault(SSLServerSocketFactory.java:32)
> ... 29 more
> Caused by: java.security.KeyStoreException: IBMKeyManager: Problem accessing key store java.io.IOException: Invalid keystore format
> at com.ibm.jsse2.ah.a(ah.java:72)
> at com.ibm.jsse2.aj.g(aj.java:5)
> at com.ibm.jsse2.aj.<init>(aj.java:13)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:83)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
> at java.security.Provider$Service.newInstance(Provider.java:1606)
> ... 34 more
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (LOGMGR-271) NoSuchAlgorithmException in SocketHandlerTests on IBM JDK
by Daniel Cihak (Jira)
[ https://issues.redhat.com/browse/LOGMGR-271?page=com.atlassian.jira.plugi... ]
Daniel Cihak reassigned LOGMGR-271:
-----------------------------------
Assignee: Daniel Cihak (was: James Perkins)
> NoSuchAlgorithmException in SocketHandlerTests on IBM JDK
> ---------------------------------------------------------
>
> Key: LOGMGR-271
> URL: https://issues.redhat.com/browse/LOGMGR-271
> Project: JBoss Log Manager
> Issue Type: Bug
> Affects Versions: 2.1.5.Final
> Reporter: Daniel Cihak
> Assignee: Daniel Cihak
> Priority: Major
> Fix For: 2.2.0.Final
>
>
> Following tests fail on IBM JDK:
> {code}
> org.jboss.logmanager.handlers.SocketHandlerTests#testProtocolChange
> org.jboss.logmanager.handlers.SocketHandlerTests#testTlsConnection
> org.jboss.logmanager.handlers.SocketHandlerTests#testTlsConfig
> {code}
> Error:
> {code}
> java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: IBMJSSE2, class: com.ibm.jsse2.aj)
> {code}
> Stack Trace:
> {code}
> Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: IBMJSSE2, class: com.ibm.jsse2.aj)
> at java.security.Provider$Service.newInstance(Provider.java:1628)
> at sun.security.jca.GetInstance.getInstance(GetInstance.java:248)
> at sun.security.jca.GetInstance.getInstance(GetInstance.java:176)
> at javax.net.ssl.SSLContext.getInstance(SSLContext.java:6)
> at javax.net.ssl.SSLContext.getDefault(SSLContext.java:8)
> at javax.net.ssl.SSLServerSocketFactory.getDefault(SSLServerSocketFactory.java:32)
> ... 29 more
> Caused by: java.security.KeyStoreException: IBMKeyManager: Problem accessing key store java.io.IOException: Invalid keystore format
> at com.ibm.jsse2.ah.a(ah.java:72)
> at com.ibm.jsse2.aj.g(aj.java:5)
> at com.ibm.jsse2.aj.<init>(aj.java:13)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:83)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
> at java.security.Provider$Service.newInstance(Provider.java:1606)
> ... 34 more
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (LOGMGR-271) NoSuchAlgorithmException in SocketHandlerTests on IBM JDK
by Daniel Cihak (Jira)
Daniel Cihak created LOGMGR-271:
-----------------------------------
Summary: NoSuchAlgorithmException in SocketHandlerTests on IBM JDK
Key: LOGMGR-271
URL: https://issues.redhat.com/browse/LOGMGR-271
Project: JBoss Log Manager
Issue Type: Bug
Affects Versions: 2.1.5.Final
Reporter: Daniel Cihak
Assignee: James Perkins
Fix For: 2.2.0.Final
Following tests fail on IBM JDK:
{code}
org.jboss.logmanager.handlers.SocketHandlerTests#testProtocolChange
org.jboss.logmanager.handlers.SocketHandlerTests#testTlsConnection
org.jboss.logmanager.handlers.SocketHandlerTests#testTlsConfig
{code}
Error:
{code}
java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: IBMJSSE2, class: com.ibm.jsse2.aj)
{code}
Stack Trace:
{code}
Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: IBMJSSE2, class: com.ibm.jsse2.aj)
at java.security.Provider$Service.newInstance(Provider.java:1628)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:248)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:176)
at javax.net.ssl.SSLContext.getInstance(SSLContext.java:6)
at javax.net.ssl.SSLContext.getDefault(SSLContext.java:8)
at javax.net.ssl.SSLServerSocketFactory.getDefault(SSLServerSocketFactory.java:32)
... 29 more
Caused by: java.security.KeyStoreException: IBMKeyManager: Problem accessing key store java.io.IOException: Invalid keystore format
at com.ibm.jsse2.ah.a(ah.java:72)
at com.ibm.jsse2.aj.g(aj.java:5)
at com.ibm.jsse2.aj.<init>(aj.java:13)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:83)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
at java.security.Provider$Service.newInstance(Provider.java:1606)
... 34 more
{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (WFWIP-312) [EAP7-1386] servletContext and servletConfig in config provider names are always null
by Petr Kremensky (Jira)
[ https://issues.redhat.com/browse/WFWIP-312?page=com.atlassian.jira.plugin... ]
Petr Kremensky updated WFWIP-312:
---------------------------------
Description:
I've noticed that names of additional config sources provided by EAP7-1386 are always:
{noformat}
null:null:ServletConfigSource
null:null:FilterConfigSource
null:ServletContextConfigSource
{noformat}
I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
Servlet additions:
{code:java}
System.out.println("-------------------------------------");
System.out.println("Servlet context name: " + getServletContext().getServletContextName());
System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
System.out.println("Servlet name: " + getServletName());
System.out.println("Servlet info: " + getServletInfo());
ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
System.out.println("=================================");
System.out.println(configSource.getName());
System.out.println(configSource.getOrdinal());
System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
});
System.out.println("-------------------------------------");
{code}
web.xml addition
{code:xml}
<web-app>
+ <display-name>test</display-name>
...
{code}
server output:
{noformat}
-------------------------------------
Servlet context name: test
Servlet virtual server name: default-host
Servlet name from servlet config: recruiter
Servlet name: recruiter
Servlet info:
=================================
SysPropConfigSource
400
Property names: [Standalone], awt.toolkit, java.specification.version ...
=================================
EnvConfigSource
300
Property names: PATH, ...
=================================
null:null:ServletConfigSource
60
Property names:
=================================
null:null:FilterConfigSource
50
Property names:
=================================
null:ServletContextConfigSource
40
Property names:
-------------------------------------
{noformat}
Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
{code:java}
@Override
public String getName() {
if (name == null) {
synchronized(this) {
if (name == null) {
ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
StringBuilder sb = new StringBuilder();
name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
.append(servletConfig != null ? servletConfig.getServletName() : null)
.append(":ServletConfigSource").toString();
}
}
}
return name;
}
{code}
My simple-minded expectation would be that the config sources will use the fields provided in the name.
*Reproduce:*
* start standalone server
* deploy [^source-names.war]
* curl http://localhost:8080/source-names/servlet1
* see server logs
See [^source-names.zip] for sources.
was:
I've noticed that names of additional config sources provided by EAP7-1386 are always:
{noformat}
null:null:ServletConfigSource
null:null:FilterConfigSource
null:ServletContextConfigSource
{noformat}
I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
Servlet additions:
{code:java}
System.out.println("-------------------------------------");
System.out.println("Servlet context name: " + getServletContext().getServletContextName());
System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
System.out.println("Servlet name: " + getServletName());
System.out.println("Servlet info: " + getServletInfo());
ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
System.out.println("=================================");
System.out.println(configSource.getName());
System.out.println(configSource.getOrdinal());
System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
});
System.out.println("-------------------------------------");
{code}
web.xml addition
{code:xml}
<web-app>
+ <display-name>test</display-name>
...
{code}
server output:
{noformat}
-------------------------------------
Servlet context name: test
Servlet virtual server name: default-host
Servlet name from servlet config: recruiter
Servlet name: recruiter
Servlet info:
=================================
SysPropConfigSource
400
Property names: [Standalone], awt.toolkit, java.specification.version ...
=================================
EnvConfigSource
300
Property names: PATH, ...
=================================
null:null:ServletConfigSource
60
Property names:
=================================
null:null:FilterConfigSource
50
Property names:
=================================
null:ServletContextConfigSource
40
Property names:
-------------------------------------
{noformat}
Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
{code:java}
@Override
public String getName() {
if (name == null) {
synchronized(this) {
if (name == null) {
ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
StringBuilder sb = new StringBuilder();
name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
.append(servletConfig != null ? servletConfig.getServletName() : null)
.append(":ServletConfigSource").toString();
}
}
}
return name;
}
{code}
My simple-minded expectation would be that the config sources will use the fields provided in the name.
*Reproduce:*
* start standalone server
* deploy {{source-names.war}}
* curl http://localhost:8080/source-names/servlet1
* see server logs
> [EAP7-1386] servletContext and servletConfig in config provider names are always null
> -------------------------------------------------------------------------------------
>
> Key: WFWIP-312
> URL: https://issues.redhat.com/browse/WFWIP-312
> Project: WildFly WIP
> Issue Type: Quality Risk
> Reporter: Petr Kremensky
> Assignee: Ronald Sigal
> Priority: Major
> Attachments: source-names.war, source-names.zip
>
>
> I've noticed that names of additional config sources provided by EAP7-1386 are always:
> {noformat}
> null:null:ServletConfigSource
> null:null:FilterConfigSource
> null:ServletContextConfigSource
> {noformat}
> I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
> Servlet additions:
> {code:java}
> System.out.println("-------------------------------------");
> System.out.println("Servlet context name: " + getServletContext().getServletContextName());
> System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
> System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
> System.out.println("Servlet name: " + getServletName());
> System.out.println("Servlet info: " + getServletInfo());
> ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
> System.out.println("=================================");
> System.out.println(configSource.getName());
> System.out.println(configSource.getOrdinal());
> System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
> });
> System.out.println("-------------------------------------");
> {code}
> web.xml addition
> {code:xml}
> <web-app>
> + <display-name>test</display-name>
> ...
> {code}
> server output:
> {noformat}
> -------------------------------------
> Servlet context name: test
> Servlet virtual server name: default-host
> Servlet name from servlet config: recruiter
> Servlet name: recruiter
> Servlet info:
> =================================
> SysPropConfigSource
> 400
> Property names: [Standalone], awt.toolkit, java.specification.version ...
> =================================
> EnvConfigSource
> 300
> Property names: PATH, ...
> =================================
> null:null:ServletConfigSource
> 60
> Property names:
> =================================
> null:null:FilterConfigSource
> 50
> Property names:
> =================================
> null:ServletContextConfigSource
> 40
> Property names:
> -------------------------------------
> {noformat}
> Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
> {code:java}
> @Override
> public String getName() {
> if (name == null) {
> synchronized(this) {
> if (name == null) {
> ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
> ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
> StringBuilder sb = new StringBuilder();
> name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
> .append(servletConfig != null ? servletConfig.getServletName() : null)
> .append(":ServletConfigSource").toString();
> }
> }
> }
> return name;
> }
> {code}
> My simple-minded expectation would be that the config sources will use the fields provided in the name.
> *Reproduce:*
> * start standalone server
> * deploy [^source-names.war]
> * curl http://localhost:8080/source-names/servlet1
> * see server logs
> See [^source-names.zip] for sources.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (WFWIP-312) [EAP7-1386] servletContext and servletConfig in config provider names are always null
by Petr Kremensky (Jira)
[ https://issues.redhat.com/browse/WFWIP-312?page=com.atlassian.jira.plugin... ]
Petr Kremensky updated WFWIP-312:
---------------------------------
Attachment: source-names.zip
> [EAP7-1386] servletContext and servletConfig in config provider names are always null
> -------------------------------------------------------------------------------------
>
> Key: WFWIP-312
> URL: https://issues.redhat.com/browse/WFWIP-312
> Project: WildFly WIP
> Issue Type: Quality Risk
> Reporter: Petr Kremensky
> Assignee: Ronald Sigal
> Priority: Major
> Attachments: source-names.war, source-names.zip
>
>
> I've noticed that names of additional config sources provided by EAP7-1386 are always:
> {noformat}
> null:null:ServletConfigSource
> null:null:FilterConfigSource
> null:ServletContextConfigSource
> {noformat}
> I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
> Servlet additions:
> {code:java}
> System.out.println("-------------------------------------");
> System.out.println("Servlet context name: " + getServletContext().getServletContextName());
> System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
> System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
> System.out.println("Servlet name: " + getServletName());
> System.out.println("Servlet info: " + getServletInfo());
> ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
> System.out.println("=================================");
> System.out.println(configSource.getName());
> System.out.println(configSource.getOrdinal());
> System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
> });
> System.out.println("-------------------------------------");
> {code}
> web.xml addition
> {code:xml}
> <web-app>
> + <display-name>test</display-name>
> ...
> {code}
> server output:
> {noformat}
> -------------------------------------
> Servlet context name: test
> Servlet virtual server name: default-host
> Servlet name from servlet config: recruiter
> Servlet name: recruiter
> Servlet info:
> =================================
> SysPropConfigSource
> 400
> Property names: [Standalone], awt.toolkit, java.specification.version ...
> =================================
> EnvConfigSource
> 300
> Property names: PATH, ...
> =================================
> null:null:ServletConfigSource
> 60
> Property names:
> =================================
> null:null:FilterConfigSource
> 50
> Property names:
> =================================
> null:ServletContextConfigSource
> 40
> Property names:
> -------------------------------------
> {noformat}
> Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
> {code:java}
> @Override
> public String getName() {
> if (name == null) {
> synchronized(this) {
> if (name == null) {
> ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
> ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
> StringBuilder sb = new StringBuilder();
> name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
> .append(servletConfig != null ? servletConfig.getServletName() : null)
> .append(":ServletConfigSource").toString();
> }
> }
> }
> return name;
> }
> {code}
> My simple-minded expectation would be that the config sources will use the fields provided in the name.
> *Reproduce:*
> * start standalone server
> * deploy {{source-names.war}}
> * curl http://localhost:8080/source-names/servlet1
> * see server logs
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (WFWIP-312) [EAP7-1386] servletContext and servletConfig in config provider names are always null
by Petr Kremensky (Jira)
[ https://issues.redhat.com/browse/WFWIP-312?page=com.atlassian.jira.plugin... ]
Petr Kremensky updated WFWIP-312:
---------------------------------
Attachment: (was: source-names.war)
> [EAP7-1386] servletContext and servletConfig in config provider names are always null
> -------------------------------------------------------------------------------------
>
> Key: WFWIP-312
> URL: https://issues.redhat.com/browse/WFWIP-312
> Project: WildFly WIP
> Issue Type: Quality Risk
> Reporter: Petr Kremensky
> Assignee: Ronald Sigal
> Priority: Major
> Attachments: source-names.war
>
>
> I've noticed that names of additional config sources provided by EAP7-1386 are always:
> {noformat}
> null:null:ServletConfigSource
> null:null:FilterConfigSource
> null:ServletContextConfigSource
> {noformat}
> I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
> Servlet additions:
> {code:java}
> System.out.println("-------------------------------------");
> System.out.println("Servlet context name: " + getServletContext().getServletContextName());
> System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
> System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
> System.out.println("Servlet name: " + getServletName());
> System.out.println("Servlet info: " + getServletInfo());
> ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
> System.out.println("=================================");
> System.out.println(configSource.getName());
> System.out.println(configSource.getOrdinal());
> System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
> });
> System.out.println("-------------------------------------");
> {code}
> web.xml addition
> {code:xml}
> <web-app>
> + <display-name>test</display-name>
> ...
> {code}
> server output:
> {noformat}
> -------------------------------------
> Servlet context name: test
> Servlet virtual server name: default-host
> Servlet name from servlet config: recruiter
> Servlet name: recruiter
> Servlet info:
> =================================
> SysPropConfigSource
> 400
> Property names: [Standalone], awt.toolkit, java.specification.version ...
> =================================
> EnvConfigSource
> 300
> Property names: PATH, ...
> =================================
> null:null:ServletConfigSource
> 60
> Property names:
> =================================
> null:null:FilterConfigSource
> 50
> Property names:
> =================================
> null:ServletContextConfigSource
> 40
> Property names:
> -------------------------------------
> {noformat}
> Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
> {code:java}
> @Override
> public String getName() {
> if (name == null) {
> synchronized(this) {
> if (name == null) {
> ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
> ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
> StringBuilder sb = new StringBuilder();
> name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
> .append(servletConfig != null ? servletConfig.getServletName() : null)
> .append(":ServletConfigSource").toString();
> }
> }
> }
> return name;
> }
> {code}
> My simple-minded expectation would be that the config sources will use the fields provided in the name.
> *Reproduce:*
> * start standalone server
> * deploy {{source-names.war}}
> * curl http://localhost:8080/source-names/servlet1
> * see server logs
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (WFWIP-312) [EAP7-1386] servletContext and servletConfig in config provider names are always null
by Petr Kremensky (Jira)
[ https://issues.redhat.com/browse/WFWIP-312?page=com.atlassian.jira.plugin... ]
Petr Kremensky updated WFWIP-312:
---------------------------------
Attachment: source-names.war
> [EAP7-1386] servletContext and servletConfig in config provider names are always null
> -------------------------------------------------------------------------------------
>
> Key: WFWIP-312
> URL: https://issues.redhat.com/browse/WFWIP-312
> Project: WildFly WIP
> Issue Type: Quality Risk
> Reporter: Petr Kremensky
> Assignee: Ronald Sigal
> Priority: Major
> Attachments: source-names.war
>
>
> I've noticed that names of additional config sources provided by EAP7-1386 are always:
> {noformat}
> null:null:ServletConfigSource
> null:null:FilterConfigSource
> null:ServletContextConfigSource
> {noformat}
> I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
> Servlet additions:
> {code:java}
> System.out.println("-------------------------------------");
> System.out.println("Servlet context name: " + getServletContext().getServletContextName());
> System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
> System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
> System.out.println("Servlet name: " + getServletName());
> System.out.println("Servlet info: " + getServletInfo());
> ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
> System.out.println("=================================");
> System.out.println(configSource.getName());
> System.out.println(configSource.getOrdinal());
> System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
> });
> System.out.println("-------------------------------------");
> {code}
> web.xml addition
> {code:xml}
> <web-app>
> + <display-name>test</display-name>
> ...
> {code}
> server output:
> {noformat}
> -------------------------------------
> Servlet context name: test
> Servlet virtual server name: default-host
> Servlet name from servlet config: recruiter
> Servlet name: recruiter
> Servlet info:
> =================================
> SysPropConfigSource
> 400
> Property names: [Standalone], awt.toolkit, java.specification.version ...
> =================================
> EnvConfigSource
> 300
> Property names: PATH, ...
> =================================
> null:null:ServletConfigSource
> 60
> Property names:
> =================================
> null:null:FilterConfigSource
> 50
> Property names:
> =================================
> null:ServletContextConfigSource
> 40
> Property names:
> -------------------------------------
> {noformat}
> Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
> {code:java}
> @Override
> public String getName() {
> if (name == null) {
> synchronized(this) {
> if (name == null) {
> ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
> ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
> StringBuilder sb = new StringBuilder();
> name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
> .append(servletConfig != null ? servletConfig.getServletName() : null)
> .append(":ServletConfigSource").toString();
> }
> }
> }
> return name;
> }
> {code}
> My simple-minded expectation would be that the config sources will use the fields provided in the name.
> *Reproduce:*
> * start standalone server
> * deploy {{source-names.war}}
> * curl http://localhost:8080/source-names/servlet1
> * see server logs
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months
[JBoss JIRA] (WFWIP-312) [EAP7-1386] servletContext and servletConfig in config provider names are always null
by Petr Kremensky (Jira)
[ https://issues.redhat.com/browse/WFWIP-312?page=com.atlassian.jira.plugin... ]
Petr Kremensky updated WFWIP-312:
---------------------------------
Description:
I've noticed that names of additional config sources provided by EAP7-1386 are always:
{noformat}
null:null:ServletConfigSource
null:null:FilterConfigSource
null:ServletContextConfigSource
{noformat}
I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
Servlet additions:
{code:java}
System.out.println("-------------------------------------");
System.out.println("Servlet context name: " + getServletContext().getServletContextName());
System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
System.out.println("Servlet name: " + getServletName());
System.out.println("Servlet info: " + getServletInfo());
ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
System.out.println("=================================");
System.out.println(configSource.getName());
System.out.println(configSource.getOrdinal());
System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
});
System.out.println("-------------------------------------");
{code}
web.xml addition
{code:xml}
<web-app>
+ <display-name>test</display-name>
...
{code}
server output:
{noformat}
-------------------------------------
Servlet context name: test
Servlet virtual server name: default-host
Servlet name from servlet config: recruiter
Servlet name: recruiter
Servlet info:
=================================
SysPropConfigSource
400
Property names: [Standalone], awt.toolkit, java.specification.version ...
=================================
EnvConfigSource
300
Property names: PATH, ...
=================================
null:null:ServletConfigSource
60
Property names:
=================================
null:null:FilterConfigSource
50
Property names:
=================================
null:ServletContextConfigSource
40
Property names:
-------------------------------------
{noformat}
Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
{code:java}
@Override
public String getName() {
if (name == null) {
synchronized(this) {
if (name == null) {
ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
StringBuilder sb = new StringBuilder();
name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
.append(servletConfig != null ? servletConfig.getServletName() : null)
.append(":ServletConfigSource").toString();
}
}
}
return name;
}
{code}
My simple-minded expectation would be that the config sources will use the fields provided in the name.
*Reproduce:*
* start standalone server
* deploy {{source-names.war}}
* curl http://localhost:8080/source-names/servlet1
* see server logs
was:
I've noticed that names of additional config sources provided by EAP7-1386 are always:
{noformat}
null:null:ServletConfigSource
null:null:FilterConfigSource
null:ServletContextConfigSource
{noformat}
I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
Servlet additions:
{code:java}
System.out.println("-------------------------------------");
System.out.println("Servlet context name: " + getServletContext().getServletContextName());
System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
System.out.println("Servlet name: " + getServletName());
System.out.println("Servlet info: " + getServletInfo());
ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
System.out.println("=================================");
System.out.println(configSource.getName());
System.out.println(configSource.getOrdinal());
System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
});
System.out.println("-------------------------------------");
{code}
web.xml addition
{code:xml}
<web-app>
+ <display-name>test</display-name>
...
{code}
server output:
{noformat}
-------------------------------------
Servlet context name: test
Servlet virtual server name: default-host
Servlet name from servlet config: recruiter
Servlet name: recruiter
Servlet info:
=================================
SysPropConfigSource
400
Property names: [Standalone], awt.toolkit, java.specification.version ...
=================================
EnvConfigSource
300
Property names: PATH, ...
=================================
null:null:ServletConfigSource
60
Property names:
=================================
null:null:FilterConfigSource
50
Property names:
=================================
null:ServletContextConfigSource
40
Property names:
-------------------------------------
{noformat}
Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
{code:java}
@Override
public String getName() {
if (name == null) {
synchronized(this) {
if (name == null) {
ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
StringBuilder sb = new StringBuilder();
name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
.append(servletConfig != null ? servletConfig.getServletName() : null)
.append(":ServletConfigSource").toString();
}
}
}
return name;
}
{code}
My simple-minded expectation would be that the config sources will use the fields provided in the name.
I'll add sources in a minute...
> [EAP7-1386] servletContext and servletConfig in config provider names are always null
> -------------------------------------------------------------------------------------
>
> Key: WFWIP-312
> URL: https://issues.redhat.com/browse/WFWIP-312
> Project: WildFly WIP
> Issue Type: Quality Risk
> Reporter: Petr Kremensky
> Assignee: Ronald Sigal
> Priority: Major
> Attachments: source-names.war
>
>
> I've noticed that names of additional config sources provided by EAP7-1386 are always:
> {noformat}
> null:null:ServletConfigSource
> null:null:FilterConfigSource
> null:ServletContextConfigSource
> {noformat}
> I've tried to enhance the https://www.geeksforgeeks.org/difference-between-servletconfig-and-servle... example with MP config, to get the different names
> Servlet additions:
> {code:java}
> System.out.println("-------------------------------------");
> System.out.println("Servlet context name: " + getServletContext().getServletContextName());
> System.out.println("Servlet virtual server name: " + getServletContext().getVirtualServerName());
> System.out.println("Servlet name from servlet config: " + getServletConfig().getServletName());
> System.out.println("Servlet name: " + getServletName());
> System.out.println("Servlet info: " + getServletInfo());
> ConfigProvider.getConfig().getConfigSources().forEach(configSource -> {
> System.out.println("=================================");
> System.out.println(configSource.getName());
> System.out.println(configSource.getOrdinal());
> System.out.println("Property names: " + configSource.getPropertyNames().stream().collect(Collectors.joining(", ")));
> });
> System.out.println("-------------------------------------");
> {code}
> web.xml addition
> {code:xml}
> <web-app>
> + <display-name>test</display-name>
> ...
> {code}
> server output:
> {noformat}
> -------------------------------------
> Servlet context name: test
> Servlet virtual server name: default-host
> Servlet name from servlet config: recruiter
> Servlet name: recruiter
> Servlet info:
> =================================
> SysPropConfigSource
> 400
> Property names: [Standalone], awt.toolkit, java.specification.version ...
> =================================
> EnvConfigSource
> 300
> Property names: PATH, ...
> =================================
> null:null:ServletConfigSource
> 60
> Property names:
> =================================
> null:null:FilterConfigSource
> 50
> Property names:
> =================================
> null:ServletContextConfigSource
> 40
> Property names:
> -------------------------------------
> {noformat}
> Looking into sources https://github.com/resteasy/Resteasy/pull/2250/files#diff-c4301c90ec39134...
> {code:java}
> @Override
> public String getName() {
> if (name == null) {
> synchronized(this) {
> if (name == null) {
> ServletContext servletContext = ResteasyProviderFactory.getContextData(ServletContext.class);
> ServletConfig servletConfig = ResteasyProviderFactory.getContextData(ServletConfig.class);
> StringBuilder sb = new StringBuilder();
> name = sb.append(servletContext != null ? servletContext.getServletContextName() : null).append(":")
> .append(servletConfig != null ? servletConfig.getServletName() : null)
> .append(":ServletConfigSource").toString();
> }
> }
> }
> return name;
> }
> {code}
> My simple-minded expectation would be that the config sources will use the fields provided in the name.
> *Reproduce:*
> * start standalone server
> * deploy {{source-names.war}}
> * curl http://localhost:8080/source-names/servlet1
> * see server logs
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 2 months