我有一个应用JPA,Hibernate,Spring和Wicket的Web应用程序。当我运行Tomcat时,它已启动,但有一个异常:
WARN org.hibernate.ejb.packaging.InputStreamZippedJarVisitor - Unable to find file (ignored): jndi:/localhost/tracking/
java.io.FileNotFoundException
at org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:298)
at java.net.URL.openStream(URL.java:1007)
at org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:38)
at org.hibernate.ejb.packaging.AbstractJarVisitor.getMatchingEntries(AbstractJarVisitor.java:139)
at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:287)
at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:614)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:360)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:221)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:383)
at java.security.AccessController.doPrivileged(Native Method)...
这是我的persistence.xml:
<!-- language: xml -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="1.0">
<persistence-unit name="tracking" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.eds.eai.tracking.web.model.Archive</class>
<class>com.eds.eai.tracking.web.model.Audit</class>
<class>com.eds.eai.tracking.web.model.Message</class>
<class>com.eds.eai.tracking.web.model.Partner</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.DerbyDialect" />
<property name="hibernate.hbm2ddl.auto"
value="update" />
</properties>
</persistence-unit>
</persistence>
这是applicationContext.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<bean id="wicketApplication"
class="com.eds.eai.tracking.web.Application">
</bean>
<!-- Using a username of logging creates the tables in a schema of the same name -->
<!-- Note the embedded driver defaults the schema to app unless a username is given -->
<bean id="db2DataSourceDev"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName"
value="com.ibm.db2.jcc.DB2Driver" />
<property name="url"
value="jdbc:db2://gotx72.got.skf.se:50000/GOT20" />
<property name="username" value="capsusr1" />
<property name="password" value="welcome3" />
<property name="poolPreparedStatements" value="true" />
<property name="maxActive" value="10" />
<property name="maxIdle" value="10" />
</bean>
<bean id="db2DataSourceStaging"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName"
value="com.ibm.db2.jcc.DB2Driver" />
<property name="url"
value="jdbc:db2://gotx75.got.skf.se:50000/GOT20" />
<property name="username" value="capsusr1" />
<property name="password" value="welcome3" />
<property name="poolPreparedStatements" value="true" />
<property name="maxActive" value="10" />
<property name="maxIdle" value="10" />
</bean>
<bean id="db2DataSourceMof"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName"
value="com.ibm.db2.jcc.DB2Driver" />
<property name="url"
value="jdbc:db2://ruex12.rue.skf.net:60000/RUE11" />
<property name="username" value="eai12" />
<property name="password" value="welcome3" />
<property name="poolPreparedStatements" value="true" />
<property name="maxActive" value="10" />
<property name="maxIdle" value="10" />
</bean>
<bean id="db2DataSourceStagingLinux" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.ibm.db2.jcc.DB2Driver" />
<property name="url" value="jdbc:db2://x0015.rue.skf.net:50001/RUE22" />
<property name="username" value="capsusr1" />
<property name="password" value="Finogaratu93" />
<property name="poolPreparedStatements" value="true" />
<property name="maxActive" value="10" />
<property name="maxIdle" value="10" />
</bean>
<bean id="entityManagerFactory1"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="db2DataSourceDev" />
<property name="persistenceXmlLocation"
value="META-INF/persistence.xml" />
<property name="loadTimeWeaver">
<bean
class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver" />
</property>
</bean>
<bean id="entityManagerFactory2"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="db2DataSourceStaging" />
<property name="persistenceXmlLocation"
value="META-INF/persistence.xml" />
<property name="loadTimeWeaver">
<bean
class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver" />
</property>
</bean>
<bean id="entityManagerFactory3"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="db2DataSourceMof" />
<property name="persistenceXmlLocation"
value="META-INF/persistence.xml" />
<property name="loadTimeWeaver">
<bean
class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver" />
</property>
</bean>
<bean id="entityManagerFactory4"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="db2DataSourceStagingLinux" />
<property name="persistenceXmlLocation"
value="META-INF/persistence.xml" />
<property name="loadTimeWeaver">
<bean
class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver" />
</property>
</bean>
<bean name="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory"
ref="entityManagerFactory1" />
</bean>
<!-- bean post-processor for JPA annotations -->
<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<tx:annotation-driven />
<bean id="auditDAO"
class="com.eds.eai.tracking.web.dao.impl.AuditDAOImpl" />
<bean id="configurationDAO"
class="com.eds.eai.tracking.web.dao.impl.ConfigurationDAOImpl">
<property name="filename" value="WEB-INF/config.xml" />
</bean>
</beans>
这是如何引起的?如何解决?