[Apiman-user] Logger exception

Balu S sbalu27 at gmail.com
Tue Feb 7 04:50:22 EST 2017


Great, I will check that.

On Mon, Feb 6, 2017 at 4:33 PM, Marc Savy <marc.savy at redhat.com> wrote:

> The default logger seems to work fine for me, e.g.
>
> apiman-gateway.logger-factory=io.apiman.common.logging.Defau
> ltDelegateFactory
>
> Double check you didn't accidentally null the entry out by overwriting it
> later in your config.
>
> For SLF4J, the WAR implementation doesn't have the logger on the classpath
> by default. You can do it manually, but it's a bit of a hassle and is only
> a small addition, so I've added it and it will be in the next release:
>
> https://github.com/apiman/apiman/pull/532
>
> On 3 February 2017 at 10:27, Balu S <sbalu27 at gmail.com> wrote:
>
>> Hi,
>>
>> I have managed to build these 2 projects (apiman-common-logging-core and
>> /apiman-common-logging-slf4j) and add it as global jboss module to make
>> Apiman to use Slf4jLoggerFactory logger.
>>
>> Does it not work out of box with just specifying Slf4jLoggerFactory in
>> apiman.properties?
>>
>> On Tue, Jan 31, 2017 at 3:14 PM, Marc Savy <marc.savy at redhat.com> wrote:
>>
>>> I'll try to look into it shortly and post back onto the ML.
>>>
>>> On 30 January 2017 at 16:16, Balu S <sbalu27 at gmail.com> wrote:
>>>
>>>> Hi Marc,
>>>> thanks for your quick response. Unfortunately it doesn't work.
>>>>
>>>> Although, what I am trying to achieve is to use "Slf4jLoggerFactory"
>>>> and it fails with same null pointer.
>>>>
>>>> 2017-01-30 17:12:59,911 ERROR [org.jboss.msc.service.fail]
>>>> (ServerService Thread Pool -- 64) MSC000001: Failed to start service
>>>> jboss.undertow.deployment.default-server.default-host./apiman-gateway:
>>>> org.jboss.msc.service.StartException in service
>>>> jboss.undertow.deployment.default-server.default-host./apiman-gateway:
>>>> java.lang.RuntimeException: java.lang.RuntimeException:
>>>> java.lang.NullPointerException
>>>> at org.wildfly.extension.undertow.deployment.UndertowDeployment
>>>> Service$1.run(UndertowDeploymentService.java:85)
>>>> at java.util.concurrent.Executors$RunnableAdapter.call(Executor
>>>> s.java:511)
>>>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>>>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool
>>>> Executor.java:1142)
>>>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
>>>> lExecutor.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(Deploy
>>>> mentManagerImpl.java:236)
>>>> at org.wildfly.extension.undertow.deployment.UndertowDeployment
>>>> Service.startContext(UndertowDeploymentService.java:100)
>>>> at org.wildfly.extension.undertow.deployment.UndertowDeployment
>>>> Service$1.run(UndertowDeploymentService.java:82)
>>>> ... 6 more
>>>> Caused by: java.lang.RuntimeException: java.lang.NullPointerException
>>>> at io.apiman.gateway.engine.impl.ConfigDrivenEngineFactory.inst
>>>> antiate(ConfigDrivenEngineFactory.java:179)
>>>> at io.apiman.gateway.engine.impl.ConfigDrivenEngineFactory.crea
>>>> te(ConfigDrivenEngineFactory.java:163)
>>>> at io.apiman.gateway.engine.impl.ConfigDrivenEngineFactory.crea
>>>> teLoggerFactory(ConfigDrivenEngineFactory.java:152)
>>>> at io.apiman.gateway.engine.impl.AbstractEngineFactory.createEn
>>>> gine(AbstractEngineFactory.java:60)
>>>> at io.apiman.gateway.platforms.war.WarGateway.init(WarGateway.java:55)
>>>> at io.apiman.gateway.platforms.war.listeners.WarGatewayBootstra
>>>> pper.contextInitialized(WarGatewayBootstrapper.java:
>>>>
>>>> On Mon, Jan 30, 2017 at 5:07 PM, Marc Savy <marc.savy at redhat.com>
>>>> wrote:
>>>>
>>>>> I think you want
>>>>> io.apiman.common.logging.DefaultDelegateFactory in that field rather
>>>>> than SystemOutLogger directly.
>>>>>
>>>>> Does that work?
>>>>>
>>>>> The name is probably confusing - it *was* the default one at some
>>>>> point.
>>>>>
>>>>>
>>>>>
>>>>> On 30 January 2017 at 15:57, Balu S <sbalu27 at gmail.com> wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I'm trying to simply replace the NoOpLoggerFactory to SystemOutLogger
>>>>>> in apiman.properties and get below exception. It is quite strange as
>>>>>> SystemOutLogger  is infact implements IDelegateFactory.
>>>>>>
>>>>>> #apiman-gateway.logger-factory=io.apiman.common.logging.impl
>>>>>> .NoOpLoggerFactory
>>>>>> apiman-gateway.logger-factory=io.apiman.common.logging.impl.
>>>>>> SystemOutLogger
>>>>>>
>>>>>> Also, If I try to change to Slf4jLoggerFactory, then even
>>>>>> the Slf4jLoggerFactory.class is not found.
>>>>>>
>>>>>> Could you please advise if there is any reference to be added and
>>>>>> causes below error. Thanks
>>>>>>
>>>>>> .  Falling back to the Default. [No IDataEncrypter class configured.]
>>>>>> 16:50:52,028 ERROR [org.jboss.msc.service.fail] (ServerService Thread
>>>>>> Pool -- 69) MSC000001: Failed
>>>>>> to start service jboss.undertow.deployment.defa
>>>>>> ult-server.default-host./apiman-gateway-api: org.jbos
>>>>>> s.msc.service.StartException in service jboss.undertow.deployment.defa
>>>>>> ult-server.default-host./apima
>>>>>> n-gateway-api: java.lang.RuntimeException:
>>>>>> java.lang.ClassCastException: io.apiman.common.logging.impl.SystemOutLogger
>>>>>> cannot be cast to io.apiman.common.logging.IDelegateFactory
>>>>>>         at org.wildfly.extension.undertow
>>>>>> .deployment.UndertowDeploymentService$1.run(UndertowDeploym
>>>>>> entService.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.ThreadPoo
>>>>>> lExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>>>>>         at java.util.concurrent.ThreadPoo
>>>>>> lExecutor$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.ClassCastException:
>>>>>> io.apiman.common.logging.impl.SystemOutLogger cannot be cast to
>>>>>> io.apiman.common.logging.IDelegateFactory
>>>>>>         at io.undertow.servlet.core.Deplo
>>>>>> ymentManagerImpl.deploy(DeploymentManagerImpl.java:236)
>>>>>>         at org.wildfly.extension.undertow
>>>>>> .deployment.UndertowDeploymentService.startContext(Undertow
>>>>>> DeploymentService.java:100)
>>>>>>         at org.wildfly.extension.undertow
>>>>>> .deployment.UndertowDeploymentService$1.run(UndertowDeploym
>>>>>>
>>>>>>
>>>>>> regards
>>>>>> Balu
>>>>>>
>>>>>> _______________________________________________
>>>>>> Apiman-user mailing list
>>>>>> Apiman-user at lists.jboss.org
>>>>>> https://lists.jboss.org/mailman/listinfo/apiman-user
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/apiman-user/attachments/20170207/9b0efc1f/attachment.html 


More information about the Apiman-user mailing list