I am getting the following error when I call
ApplicationContext ctx = new ClassPathXmlApplicationContext(“spring.xml”)
`
<bean id="derbyDataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="url" value="jdbc:derby:db/analyticsDB;create=true" />
<property name="username" value="username" />
<property name="password" value="password" />
<property name="initialSize" value="5" />
<property name="maxActive" value="50" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="derbyDataSource" />
<property name="packagesToScan" value="com.example.analytics.model" />
<property name="hibernateProperties">
<props>
<prop key="dialect">org.hibernate.dialect.DerbyDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
</props>
</property>
</bean>
`
Changing log4j version to 1.2.15 produces this exception.
The issue been resolved after I added the following to spring.xml
<prop key="javax.persistence.validation.mode">none</prop>
The important part here is
java.lang.NoSuchFieldError: TRACE.It seems to be an error with the version of log4j / slf4j you are using.
You should only use version 1.2.12 or higher of log4j, and make sure there is only one version of log4j jar in your classpath.
You should also make sure to not use an slf4j version lower than 1.5.1.