Perhaps it would be better to release individual logger implementations
as plugins, which would allow us to package the necessary libraries in
the plugin, sandboxing them from the rest of apiman.
-Eric
On 6/24/2016 8:24 AM, Marc Savy wrote:
I wonder what the nicest strategy for this kind of stuff is, where
we
have support for multiple loggers but don't want to ship the jars by
default. Maybe we need to have a lib folder or something that we deploy
automatically? Or just instructions as to where to put those jar(s) so
they're on the class-path.
On 24 June 2016 at 12:37, Eric Wittmann <eric.wittmann(a)redhat.com
<mailto:eric.wittmann@redhat.com>> wrote:
Here are two new jira issues for tracking purposes:
https://issues.jboss.org/browse/APIMAN-1199
https://issues.jboss.org/browse/APIMAN-1200
-Eric
On 6/24/2016 7:35 AM, Eric Wittmann wrote:
He's using 1.2.6.Final, though - so that dependency change
wouldn't be
affecting him.
I'll write up some jiras for these issues (documentation +
classnotfound).
-Eric
On 6/24/2016 5:10 AM, Marc Savy wrote:
You will need log4j2 onto your classpath.
It was recently removed as an explicit dependency, I believe.
On 23 June 2016 at 23:41, ejlp ejlp <ejlp12(a)gmail.com
<mailto:ejlp12@gmail.com>
<mailto:ejlp12@gmail.com <mailto:ejlp12@gmail.com>>> wrote:
Hi Eric,
Thanks for the answer. The package/class name was copied
from
http://www.apiman.io/latest/developer-guide.html section
4.2.2.2
I have changed it and now I got following response:
{"responseCode":500,"message":"org/apache/logging/log4j/LogManager","trace":"java.lang.NoClassDefFoundError:
org/apache/logging/log4j/LogManager\n\tat
io.apiman.common.logging.slf4j.Log4j2LoggerFactory.createLogger(Log4j2LoggerFactory.java:35)\n\tat
io.apiman.gateway.engine.policy.PolicyContextImpl.getLogger(PolicyContextImpl.java:115)\n\tat
io.apiman.plugins.log_policy.LogHeadersPolicy.doApply(LogHeadersPolicy.java:75)\n\tat
io.apiman.plugins.log_policy.LogHeadersPolicy.doApply(LogHeadersPolicy.java:36)\n\tat
io.apiman.gateway.engine.policies.AbstractMappedPolicy.apply(AbstractMappedPolicy.java:70)\n\tat
io.apiman.gateway.engine.policy.RequestChain.applyPolicy(RequestChain.java:68)\n\tat
io.apiman.gateway.engine.policy.Chain.doApply(Chain.java:148)\n\tat
io.apiman.gateway.engine.policies.RateLimitingPolicy$1.handle(RateLimitingPolicy.java:104)\n\tat
io.apiman.gateway.engine.policies.RateLimitingPolicy$1.handle(RateLimitingPolicy.java:91)\n\tat
io.apiman.gateway.engine.es
<
http://io.apiman.gateway.engine.es>.ESRateLimiterComponent.updateBucke...
io.apiman.gateway.engine.es
<
http://io.apiman.gateway.engine.es>.ESRateLimiterComponent.accept(ESRa...
io.apiman.gateway.engine.policies.RateLimitingPolicy.doApply(RateLimitingPolicy.java:91)\n\tat
io.apiman.gateway.engine.policies.RateLimitingPolicy.doApply(RateLimitingPolicy.java:45)\n\tat
io.apiman.gateway.engine.policies.AbstractMappedPolicy.apply(AbstractMappedPolicy.java:70)\n\tat
io.apiman.gateway.engine.policy.RequestChain.applyPolicy(RequestChain.java:68)\n\tat
io.apiman.gateway.engine.policy.Chain.doApply(Chain.java:148)\n\tat
io.apiman.gateway.engine.policies.BasicAuthenticationPolicy.doApply(BasicAuthenticationPolicy.java:80)\n\tat
io.apiman.gateway.engine.policies.BasicAuthenticationPolicy.doApply(BasicAuthenticationPolicy.java:45)\n\tat
io.apiman.gateway.engine.policies.AbstractMappedPolicy.apply(AbstractMappedPolicy.java:70)\n\tat
io.apiman.gateway.engine.policy.RequestChain.applyPolicy(RequestChain.java:68)\n\tat
io.apiman.gateway.engine.policy.Chain.doApply(Chain.java:148)\n\tat
io.apiman.gateway.engine.impl.ApiRequestExecutorImpl.lambda$execute$4(ApiRequestExecutorImpl.java:271)\n\tat
io.apiman.gateway.engine.impl.ApiRequestExecutorImpl$$Lambda$110/1594790599.handle(Unknown
Source)\n\tat
io.apiman.gateway.engine.impl.ApiRequestExecutorImpl.lambda$loadPolicies$7(ApiRequestExecutorImpl.java:631)\n\tat
io.apiman.gateway.engine.impl.ApiRequestExecutorImpl$$Lambda$112/863872294.handle(Unknown
Source)\n\tat
io.apiman.gateway.engine.policy.PolicyFactoryImpl$1.handle(PolicyFactoryImpl.java:192)\n\tat
io.apiman.gateway.engine.policy.PolicyFactoryImpl$1.handle(PolicyFactoryImpl.java:170)\n\tat
io.apiman.gateway.engine.impl.DefaultPluginRegistry.lambda$loadPlugin$18(DefaultPluginRegistry.java:185)\n\tat
io.apiman.gateway.engine.impl.DefaultPluginRegistry$$Lambda$113/366500518.handle(Unknown
Source)\n\tat
io.apiman.gateway.engine.impl.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:234)\n\tat
io.apiman.gateway.engine.policy.PolicyFactoryImpl.doLoadFromPlugin(PolicyFactoryImpl.java:170)\n\tat
io.apiman.gateway.engine.policy.PolicyFactoryImpl.loadPolicy(PolicyFactoryImpl.java:109)\n\tat
io.apiman.gateway.engine.impl.ApiRequestExecutorImpl.loadPolicies(ApiRequestExecutorImpl.java:603)\n\tat
io.apiman.gateway.engine.impl.ApiRequestExecutorImpl.lambda$execute$6(ApiRequestExecutorImpl.java:391)\n\tat
io.apiman.gateway.engine.impl.ApiRequestExecutorImpl$$Lambda$111/1559374006.handle(Unknown
Source)\n\tat
io.apiman.gateway.engine.impl.SecureRegistryWrapper$3.handle(SecureRegistryWrapper.java:172)\n\tat
io.apiman.gateway.engine.impl.SecureRegistryWrapper$3.handle(SecureRegistryWrapper.java:154)\n\tat
io.apiman.gateway.engine.es
<
http://io.apiman.gateway.engine.es>.CachingESRegistry.getContract(Cach...
io.apiman.gateway.engine.impl.SecureRegistryWrapper.getContract(SecureRegistryWrapper.java:154)\n\tat
io.apiman.gateway.engine.impl.ApiRequestExecutorImpl.execute(ApiRequestExecutorImpl.java:357)\n\tat
io.apiman.gateway.platforms.servlet.GatewayServlet.doAction(GatewayServlet.java:179)\n\tat
io.apiman.gateway.platforms.servlet.GatewayServlet.service(GatewayServlet.java:79)\n\tat
javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat
io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)\n\tat
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)\n\tat
io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)\n\tat
org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)\n\tat
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat
io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)\n\tat
io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)\n\tat
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat
io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)\n\tat
io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)\n\tat
io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)\n\tat
io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)\n\tat
io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)\n\tat
io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)\n\tat
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat
org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)\n\tat
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)\n\tat
io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:285)\n\tat
io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264)\n\tat
io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)\n\tat
io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175)\n\tat
io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)\n\tat
io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:792)\n\tat
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat
java.lang.Thread.run(Thread.java:745)\nCaused by:
java.lang.ClassNotFoundException:
org.apache.logging.log4j.LogManager
from [Module \"deployment.apiman-gateway.war:main\" from
Service
Module Loader]\n\tat
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)\n\tat
org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)\n\tat
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)\n\tat
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)\n\t...
70 more\n"}
On Thu, Jun 23, 2016 at 7:26 PM, Eric Wittmann
<eric.wittmann(a)redhat.com
<mailto:eric.wittmann@redhat.com>
<mailto:eric.wittmann@redhat.com
<mailto:eric.wittmann@redhat.com>>> wrote:
> You are just *slightly* off in your apiman.properties
configuration! And
> it's understandable, as you'll see shortly. :)
>
> You have modified "apiman-gateway.logger-factory" to
have the
following
> value:
>
> io.apiman.common.logging.log4j2.Log4j2LoggerFactory
>
> But instead it should be this:
>
> io.apiman.common.logging.slf4j.Log4j2LoggerFactory
>
> -Eric
>
>
> On 6/22/2016 7:40 PM, ejlp ejlp wrote:
>>
>> Hi,
>>
>> I was trying to use Log Header policy but no logging
message shown in
>> Gatway's console or server.log.
>> I am using JBoss EAP 7.0 and Apiman 1.2.6.Final
>>
>> This is what I've done in Gateway node:
>>
>> * Use extracted war of apiman-gateway-api.war and
apiman-gateway.war
>> * Put apiman-common-logging-log4j2-1.2.6.Final.jar into
>>
<JBOSS_HOME>/standalone/deployment/apiman-gateway-api.war/WEB-INF/lib/
>> and
<JBOSS_HOME>/standalone/deployment/apiman-gateway.war/WEB-INF/lib/
>> * Remove following line from apiman.properties
>>
>>
>>
apiman-gateway.logger-factory=io.apiman.common.logging.impl.NoOpLoggerFactory
>>
>> and put this line:
>>
>>
>>
apiman-gateway.logger-factory=io.apiman.common.logging.log4j2.Log4j2LoggerFactory
>>
>> * Restart JBoss EAP
>>
>> I got following stacktrace when EAP started:
>>
>> 05:58:00,693 ERROR [org.jboss.msc.service.fail]
(ServerService Thread
>> Pool -- 64) MSC000001: Failed to start service
>>
jboss.undertow.deployment.default-server.default-host./apiman-gateway-api:
>> org.jboss.msc.service.StartException in service
>>
jboss.undertow.deployment.default-server.default-host./apiman-gateway-api:
>> java.lang.RuntimeException: java.lang.RuntimeException:
>> java.lang.NullPointerException
>> at
>>
org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
>> at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>> at
java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> at
>>
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>> at
>>
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>> at java.lang.Thread.run(Thread.java:745)
>> at
org.jboss.threads.JBossThread.run(JBossThread.java:320)
>> Caused by: java.lang.RuntimeException:
java.lang.RuntimeException:
>> java.lang.NullPointerException
>> at
>>
io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:231)
>> at
>>
org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
>> at
>>
org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
>> ... 6 more
>> Caused by: java.lang.RuntimeException:
java.lang.NullPointerException
>> at
>>
io.apiman.gateway.engine.impl.ConfigDrivenEngineFactory.instantiate(ConfigDrivenEngineFactory.java:179)
>> at
>>
io.apiman.gateway.engine.impl.ConfigDrivenEngineFactory.create(ConfigDrivenEngineFactory.java:163)
>> at
>>
io.apiman.gateway.engine.impl.ConfigDrivenEngineFactory.createLoggerFactory(ConfigDrivenEngineFactory.java:152)
>> at
>>
io.apiman.gateway.engine.impl.AbstractEngineFactory.createEngine(AbstractEngineFactory.java:60)
>> at
io.apiman.gateway.platforms.war.WarGateway.init(WarGateway.java:55)
>> at
>>
io.apiman.gateway.platforms.war.listeners.WarGatewayBootstrapper.contextInitialized(WarGatewayBootstrapper.java:42)
>> at
>>
io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
>> at
>>
io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:198)
>> ... 8 more
>> Caused by: java.lang.NullPointerException
>> at
>>
io.apiman.gateway.engine.impl.ConfigDrivenEngineFactory.instantiate(ConfigDrivenEngineFactory.java:175)
>> ... 15 more
>>
>> 05:58:00,695 ERROR
[org.jboss.as.controller.management-operation]
>> (DeploymentScanner-threads - 1) WFLYCTL0013:
Operation ("deploy")
>> failed - address: ([("deployment" =>
"apiman-gateway-api.war")]) -
>> failure description: {"WFLYCTL0080: Failed services"
=>
>>
>>
{"jboss.undertow.deployment.default-server.default-host./apiman-gateway-api"
>> => "org.jboss.msc.service.StartException in service
>>
jboss.undertow.deployment.default-server.default-host./apiman-gateway-api:
>> java.lang.RuntimeException: java.lang.RuntimeException:
>> java.lang.NullPointerException
>> Caused by: java.lang.RuntimeException:
java.lang.RuntimeException:
>> java.lang.NullPointerException
>> Caused by: java.lang.RuntimeException:
java.lang.NullPointerException
>> Caused by: java.lang.NullPointerException"}}
>> _______________________________________________
>> Apiman-user mailing list
>> Apiman-user(a)lists.jboss.org
<mailto:Apiman-user@lists.jboss.org>
<mailto:Apiman-user@lists.jboss.org
<mailto:Apiman-user@lists.jboss.org>>
>>
https://lists.jboss.org/mailman/listinfo/apiman-user
>>
>
_______________________________________________
Apiman-user mailing list
Apiman-user(a)lists.jboss.org
<mailto:Apiman-user@lists.jboss.org>
<mailto:Apiman-user@lists.jboss.org
<mailto:Apiman-user@lists.jboss.org>>
https://lists.jboss.org/mailman/listinfo/apiman-user
_______________________________________________
Apiman-user mailing list
Apiman-user(a)lists.jboss.org <mailto:Apiman-user@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/apiman-user