我打电话时收到以下错误
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>
`
将 log4j 版本更改为 1.2.15 会产生此异常。
在我将以下内容添加到 spring.xml 后问题已解决
<prop key="javax.persistence.validation.mode">none</prop>