I have a GWT/Spring application, building with Maven and the gwt-maven-plugin.
When I run
mvn gwt:run
the gwt-maven-plugin runs the application and everything starts up and runs fine. What’s bothering me is that the log messages claim [ERROR] on every line even though there are no apparent errors, and no message ever says what the error might be.
My guess is that [ERROR] on every log line is from the gwt-maven-plugin, since what comes after seems to be Spring’s log message like so… [ERROR] INFO:
and when I run the app with mvn jetty:run, I see only the INFO: part of the messages.
Attached is most of the log to standard out. Has anybody seen log output like this, or have any ideas about what could cause a plugin to log info messages as error messages?
[INFO] ------------------------------------------------------------------------
[INFO] Building GWT Maven Archetype 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> gwt-maven-plugin:2.4.0:run (default-cli) @ gwt >>>
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ gwt ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ gwt ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-war-plugin:2.1.1:exploded (default) @ gwt ---
[INFO] Exploding webapp
[INFO] Assembling webapp [gwt] in [/home/jay/workspace/buildtimer/target/gwt-1.0- SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/jay/workspace/buildtimer/src/main/webapp]
[INFO] Webapp assembled in [169 msecs]
[INFO]
[INFO] <<< gwt-maven-plugin:2.4.0:run (default-cli) @ gwt <<<
[INFO]
[INFO] --- gwt-maven-plugin:2.4.0:run (default-cli) @ gwt ---
[INFO] create exploded Jetty webapp in /home/jay/workspace/buildtimer/target/gwt-1.0- SNAPSHOT
[INFO] auto discovered modules [com.buildtimer.Main]
[ERROR] Nov 14, 2011 7:38:44 PM org.springframework.web.context.ContextLoader initWebApplicationContext
[ERROR] INFO: Root WebApplicationContext: initialization started
[ERROR] Nov 14, 2011 7:38:44 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
[ERROR] INFO: Refreshing Root WebApplicationContext: startup date [Mon Nov 14 19:38:44 EST 2011]; root of context hierarchy
[ERROR] Nov 14, 2011 7:38:44 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
[ERROR] INFO: Loading XML bean definitions from class path resource [META- INF/applicationContext.xml]
[ERROR] Nov 14, 2011 7:38:44 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
[ERROR] INFO: Loading XML bean definitions from class path resource [META- INF/applicationContext-persistence.xml]
[ERROR] Nov 14, 2011 7:38:44 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
[ERROR] INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1e42c6e: defining beans [org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.ann otation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.T ransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,tr ansactionManager,buildDao,dataSource,sessionFactory]; root of factory hierarchy
[ERROR] Nov 14, 2011 7:38:45 PM org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
[ERROR] INFO: Loaded JDBC driver: com.mysql.jdbc.Driver
[ERROR] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[ERROR] SLF4J: Defaulting to no-operation (NOP) logger implementation
[ERROR] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[ERROR] Nov 14, 2011 7:38:46 PM org.springframework.orm.hibernate3.LocalSessionFactoryBean buildSessionFactory
[ERROR] INFO: Building new Hibernate SessionFactory
[ERROR] Nov 14, 2011 7:38:48 PM org.springframework.orm.hibernate3.LocalSessionFactoryBean updateDatabaseSchema
[ERROR] INFO: Updating database schema for Hibernate SessionFactory
[ERROR] Nov 14, 2011 7:38:48 PM org.springframework.orm.hibernate3.HibernateTransactionManager afterPropertiesSet
[ERROR] INFO: Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource@1b0e438] of Hibernate SessionFactory for HibernateTransactionManager
My web.xml logging configuration is
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
...
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
...
</web-app>
my log4j.properties.xml file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="rootAppender" class="org.apache.log4j.FileAppender" >
<param name="file" value="app.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %c - %m%n"/>
</layout>
</appender>
<root>
<priority value ="warn" />
<appender-ref ref="rootAppender" />
</root>
</log4j:configuration>
Not sure how much it is related, but your log indicates that the SLF4J logging framework is not properly initilaized
Make sure that you have all three dependencies in your pom (SLF4J, The log4j binding and log4j itself)