0

I'm using log4j (1.2.17)

'infinispan-embedded' does work with my logs.

But when I change to work with: 'infinispan-core' I don't recive any logs from Infinispan.

  • I have Spring(4.1.4) & Hibernate(4.2.21)
  • Infinispan version - 8.2.6.Final

Any ideas?

Thanks.

my dependecy:tree is:

[INFO] ------------------------------------------------------------------------
[INFO] Building myapp War 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ myapp-war ---
[INFO] com.mycompany.myapp.myapp-app:myapp-war:war:1.0-SNAPSHOT
[INFO] +- com.mycompany.myapp.myapp-app:myapp-core:jar:1.0-SNAPSHOT:compile
[INFO] |  +- com.mycompany.myapp.common-framework:common-framework-core:jar:1.0-SNAPSHOT:compile
[INFO] |  |  +- com.mycompany.myapp.common-framework:common-framework-api:jar:1.0-SNAPSHOT:compile
[INFO] |  |  |  +- org.springframework:spring-context-support:jar:4.1.4.RELEASE:compile
[INFO] |  |  |  +- net.sf.jasperreports:jasperreports:jar:6.3.0:compile
[INFO] |  |  |  |  +- commons-digester:commons-digester:jar:2.1:compile
[INFO] |  |  |  |  +- com.lowagie:itext:jar:2.1.7.js5:compile
[INFO] |  |  |  |  +- org.jfree:jcommon:jar:1.0.23:compile
[INFO] |  |  |  |  +- org.eclipse.jdt.core.compiler:ecj:jar:4.3.1:compile
[INFO] |  |  |  |  \- org.codehaus.castor:castor-xml:jar:1.3.3:compile
[INFO] |  |  |  |     +- org.codehaus.castor:castor-core:jar:1.3.3:compile
[INFO] |  |  |  |     +- commons-lang:commons-lang:jar:2.6:compile
[INFO] |  |  |  |     +- stax:stax:jar:1.2.0:compile
[INFO] |  |  |  |     |  \- stax:stax-api:jar:1.0.1:compile
[INFO] |  |  |  |     \- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] |  |  |  +- org.apache.commons:commons-csv:jar:1.1:compile
[INFO] |  |  |  +- org.quartz-scheduler:quartz:jar:2.2.2:compile
[INFO] |  |  |  +- org.quartz-scheduler:quartz-jobs:jar:2.2.2:compile
[INFO] |  |  |  \- commons-net:commons-net:jar:3.3:compile
[INFO] |  |  +- org.apache.commons:commons-email:jar:1.4:compile
[INFO] |  |  |  \- com.sun.mail:javax.mail:jar:1.5.2:compile
[INFO] |  |  +- javax.activation:activation:jar:1.1.1:compile
[INFO] |  |  +- jasperreports-fonts:jasperreports-fonts:jar:1.1:compile
[INFO] |  |  +- net.sf.jasperreports:jasperreports-html-component:jar:6.1.0b:compile
[INFO] |  |  \- net.sourceforge.jexcelapi:jxl:jar:2.6.12:compile
[INFO] |  +- com.mycompany.myapp.myapp-app:myapp-api:jar:1.0-SNAPSHOT:compile
[INFO] |  |  +- com.mycompany.myapp.common-framework:common-framework-persistence:jar:1.0-SNAPSHOT:compile
[INFO] |  |  \- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[INFO] |  |     +- org.apache.httpcomponents:httpcore:jar:4.4.4:compile
[INFO] |  |     +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  |     \- commons-codec:commons-codec:jar:1.9:compile
[INFO] |  \- org.springframework:spring-tx:jar:4.1.4.RELEASE:compile
[INFO] +- com.mycompany.myapp.myapp-app:myapp-webapp:jar:1.0-SNAPSHOT:compile
[INFO] |  +- com.mycompany.myapp.common-framework:common-framework-webapp:jar:1.0-SNAPSHOT:compile
[INFO] |  |  +- org.apache.wicket:wicket-extensions:jar:6.21.0:compile
[INFO] |  |  +- org.apache.wicket:wicket-datetime:jar:6.21.0:compile
[INFO] |  |  +- org.apache.wicket:wicket-auth-roles:jar:6.21.0:compile
[INFO] |  |  +- org.odlabs.wiquery:wiquery-core:jar:6.13.0:compile
[INFO] |  |  +- org.odlabs.wiquery:wiquery-jquery-ui:jar:6.13.0:compile
[INFO] |  |  +- net.sourceforge.pjl-comp-filter:pjl-comp-filter:jar:1.8.1:compile
[INFO] |  |  +- com.octo.captcha:jcaptcha:jar:2.0-alpha-1:compile
[INFO] |  |  |  +- com.octo.captcha:jcaptcha-api:jar:2.0-alpha-1:compile
[INFO] |  |  |  \- com.jhlabs:filters:jar:2.0.235:compile
[INFO] |  |  \- net.redhogs.cronparser:cron-parser-core:jar:2.9:compile
[INFO] |  +- org.apache.wicket:wicket-core:jar:6.21.0:compile
[INFO] |  |  +- org.apache.wicket:wicket-util:jar:6.21.0:compile
[INFO] |  |  \- org.apache.wicket:wicket-request:jar:6.21.0:compile
[INFO] |  +- com.pingunaut:wicket-chartjs:jar:6.21.0:compile
[INFO] |  +- org.apache.wicket:wicket-spring:jar:6.21.0:compile
[INFO] |  |  \- org.apache.wicket:wicket-ioc:jar:6.21.0:compile
[INFO] |  |     +- cglib:cglib:jar:2.2.2:compile
[INFO] |  |     |  \- asm:asm:jar:3.3.1:compile
[INFO] |  |     \- javax.inject:javax.inject:jar:1:compile
[INFO] |  +- org.springframework:spring-context:jar:4.1.4.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-aop:jar:4.1.4.RELEASE:compile
[INFO] |  |     \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- org.springframework:spring-web:jar:4.1.4.RELEASE:compile
[INFO] |  \- org.wicketstuff:wicketstuff-restannotations-json:jar:6.21.0:compile
[INFO] |     +- org.wicketstuff:wicketstuff-restannotations:jar:6.21.0:compile
[INFO] |     \- org.apache.wicket:wicket:pom:6.21.0:compile
[INFO] +- com.mycompany.myapp.myapp-app:myapp-ws:jar:1.0-SNAPSHOT:compile
[INFO] +- org.eclipse.jetty.aggregate:jetty-all-server:jar:8.1.14.v20131031:provided
[INFO] |  +- org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:provided
[INFO] |  +- org.eclipse.jetty.orbit:javax.security.auth.message:jar:1.0.0.v201108011116:provided
[INFO] |  +- org.eclipse.jetty.orbit:javax.mail.glassfish:jar:1.4.1.v201005082020:provided
[INFO] |  +- org.eclipse.jetty.orbit:javax.activation:jar:1.1.0.v201105071233:provided
[INFO] |  \- org.eclipse.jetty.orbit:javax.annotation:jar:1.1.0.v201108011116:provided
[INFO] +- com.oracle:ojdbc6:jar:6.0:compile
[INFO] +- org.springframework.ws:spring-ws-core:jar:2.2.0.RELEASE:compile
[INFO] |  +- org.springframework.ws:spring-xml:jar:2.2.0.RELEASE:compile
[INFO] |  \- org.springframework:spring-core:jar:4.1.4.RELEASE:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.2.21.Final:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.1.Final:compile
[INFO] |  +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.2.Final:compile
[INFO] |  \- org.hibernate:hibernate-core:jar:4.2.21.Final:compile
[INFO] |     \- antlr:antlr:jar:2.7.7:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-ehcache:jar:4.2.21.Final:compile
[INFO] |  \- net.sf.ehcache:ehcache-core:jar:2.4.3:compile
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.7:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.7:compile
[INFO] +- org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:jar:1.16:compile
[INFO] +- org.lazyluke:log4jdbc-remix:jar:0.2.7:compile
[INFO] |  \- junit:junit:jar:4.11:test
[INFO] |     \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.infinispan:infinispan-core:jar:8.2.6.Final:compile
[INFO] |  +- org.infinispan:infinispan-commons:jar:8.2.6.Final:compile
[INFO] |  +- org.jgroups:jgroups:jar:3.6.7.Final:compile
[INFO] |  \- org.jboss.marshalling:jboss-marshalling-osgi:jar:2.0.0.Beta3:compile
[INFO] +- org.jboss.logging:jboss-logging:jar:3.2.0.Final:compile
[INFO] +- javax.cache:cache-api:jar:1.0.0:compile
[INFO] +- com.google.guava:guava:jar:19.0:compile
[INFO] +- com.google.code.gson:gson:jar:2.7:compile
[INFO] +- joda-time:joda-time:jar:2.7:compile
[INFO] +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
[INFO] |  \- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] +- org.apache.commons:commons-collections4:jar:4.0:compile
[INFO] +- commons-io:commons-io:jar:2.4:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.1.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-beans:jar:4.1.4.RELEASE:compile
[INFO] |  \- org.springframework:spring-expression:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-oxm:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:4.1.4.RELEASE:compile
[INFO] |  \- org.springframework:spring-jdbc:jar:4.1.4.RELEASE:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.4.3:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.3:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.3:compile
[INFO] +- org.reflections:reflections:jar:0.9.10:compile
[INFO] |  +- org.javassist:javassist:jar:3.19.0-GA:compile
[INFO] |  \- com.google.code.findbugs:annotations:jar:2.0.1:compile
[INFO] +- xml-apis:xml-apis:jar:1.0.b2:provided
[INFO] +- com.thoughtworks.xstream:xstream:jar:1.4.7:compile
[INFO] |  +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] |  \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] \- javax.servlet:javax.servlet-api:jar:3.1.0:compile
Isaace
  • 131
  • 6

2 Answers2

3

I've been through similar situations before. The problem here is most likely that there's a dependency missing when using infinispan-core.

The way to address such issues is by step-debugging through the code to understand why the logger is not being found. You can do that by putting a breakpoint at the start of org.jboss.logging.LoggerProviders.findProvider() method. That method detects which logger will be used, whether JDK, Log4j, Log4j2, Slf4j...etc.

So, put back the embedded dependency, put a breakpoint in that method, and verify that Log4j 1.x is added. Then, try running the same with infinispan-core in place and see what provider gets chosen (I guess it's not Log4j 1.x). Then see if adding Log4j 1.x as explicit dependency works...etc :)

Galder Zamarreño
  • 5,027
  • 2
  • 26
  • 34
  • Your hint led me to try the folloging: -Dorg.jboss.logging.provider=slf4j and now my logging works! – emanciperingsivraren Jul 26 '17 at 07:35
  • ...and after some investigation i found out that `infinispan-spring` pulls in log4j2 and that is why jboss.logging tries to use that. After removing log4j2 it works automatically. Jay – emanciperingsivraren Jul 26 '17 at 08:18
  • 1
    Another thing: please avoid infinispan-embedded as dependency for a Maven/Gradle project. These jars are what we call uber jars and they are designed for build systems that do not have dependency resolution capabilities. – Galder Zamarreño Aug 02 '17 at 15:51
1

Thanku Galder! - You walk me throught the solution.

I saw that there were a tiny bug on the jboss-logging in the version I used:
3.2.0.Final
and upgrading it to:
3.3.1.Final
fixed it.

The bug was only for log4j 1.x in the method:

LoggerProviders.tryLog4j
Isaace
  • 131
  • 6