-
1. Re: [InputStreamZippedJarVisitor] Unable to find file (ignored): jndi:/localhost/tls-toolkit-webapp/
jaikiran Jun 21, 2010 7:10 AM (in response to tim.taylor)Looks like it's picking up a persistence.xml from within the application. Do you have a persistence.xml in any of the jar/war? What does it look like?
-
2. Re: [InputStreamZippedJarVisitor] Unable to find file (ignored): jndi:/localhost/tls-toolkit-webapp/
tim.taylor Jun 21, 2010 9:54 AM (in response to jaikiran)Hi,
Yes, I have a persistence.xml file in [ear file]-->[war-file]-->META-INF-->persistence.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"><persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider><properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="false"/>
<property name="org.hibernate.type" value="false"/>
</properties>
</persistence-unit>
</persistence>Im finding my jars which contain my entities by adding my own entityScanner to the persistence context via spring with org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean --> persistenceUnitPostProcessors property as I was having difficulty finding my jars when specifying them in persistence.xml (only fall file path would find them - no good for production).
However, theres no mention of my entity scanner in the trace - only PersistenceAnnotationBeanPostProcessor which is a different thing I think. and anyway my scanner gets invoked and works as intended because all the entities are mapped and can be used ok. The WARN above comes before by entity scanner is invoked during startup.
*** ok, forgive me but this is looking like a Spring issue insomuch that my EntityScanner recieves an instance of MutablePersistenceUnitInfo which is a spring class. This is what the jar resources (injected via Spring) urls are added. However, after your comment and while debugging I notived that MutablePersistenceUnitInfo has a property called persistentUnitRootURL which is set to would you beleive it "jndi:/localhost/tls-toolkit-webapp", the url displayed in the warning.
Im tempted to set this URL to null and see what happens, but I dont know where its configured from. I guess (unless you know) thats a download the spring src job, or post onto springsource forum.
-
3. Re: [InputStreamZippedJarVisitor] Unable to find file (ignored): jndi:/localhost/tls-toolkit-webapp/
tim.taylor Jun 21, 2010 10:10 AM (in response to tim.taylor)ok, looks like setting persistenceUnitRootUrl to null removes the warning. I can see the entity resolver is using the list of jar file resources and this URL to resolve all the entities, but since the persistenceUnitRootUrl is set to jndi:/webapp-name it cannot load this.
Im not sure where/how/who sets this to that URL though, or why.
Apploologies that this turned out to be a Spring issue/Hibernate integration issue and not a Jboss configuration issue.
-
4. Re: [InputStreamZippedJarVisitor] Unable to find file (ignored): jndi:/localhost/tls-toolkit-webapp/
nullspace Jun 19, 2012 9:20 AM (in response to tim.taylor)This problem confused me for a long time too. I don't know how to set persistenceUnitRootUrl to null. But this warning was not reported any more after I moved the persistence.xml to src/META-INF and remove persistenceXmlLocation from applicationContext.xml.
-
5. Re: [InputStreamZippedJarVisitor] Unable to find file (ignored): jndi:/localhost/tls-toolkit-webapp/
serval54 Dec 6, 2012 9:00 AM (in response to nullspace)Hello all
I 'had met this issue for several months
As it was just a warning that didn't cause any trouble, i had kept it in my basket hoping to fix it later
I've just succeded to fix it
In my Spring configuration, i use a separated file to declare the JPA configurations
In that file i have defined the Entity Manager Factory as follow
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceProviderClass">
<value>org.hibernate.ejb.HibernatePersistence</value>
</property>
<property name="persistenceXmlLocation" value="classpath*:META-INF/persistence-MyApp.xml"/>I have fix the issue by modifying the value of the "persistenceXmlLocation" property by adding the keyword "classpath*:"
before the relative path of persistence XML configuration file :
<property name="persistenceXmlLocation" value="classpath*:META-INF/persistence-MyApp.xml"/>
Hope it will help you ...
Regards
-
6. Re: [InputStreamZippedJarVisitor] Unable to find file (ignored): jndi:/localhost/tls-toolkit-webapp/
simlu Dec 9, 2012 11:48 PM (in response to serval54)Hi,Pascal
this warning still exists,
ENV.(Hibernate4.1.6&Spring3.1.2&JBoss7.1.1)
classpath:applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd"><!-- 定义组件扫描,配置需要扫描的包-->
<context:component-scan base-package="com.deloitte.demo" /><!-- 定义实体管理器工厂 -->
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"><property name="persistenceProviderClass" value ="org.hibernate.ejb.HibernatePersistence">
<property name="persistenceXmlLocation" value="classpath*:META-INF/persistence.xml"/>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
p:entityManagerFactory-ref="entityManagerFactory" /><!-- 启用 annotation事务-->
<tx:annotation-driven transaction-manager="transactionManager" /><bean id="personService" class="com.deloitte.demo.service.PersonServiceImpl" />
<bean id="personAction" scope="prototype"
class="com.deloitte.demo.action.PersonAction">
<constructor-arg ref="personService" />
</bean>
</beans>classpath:META-INF/persistence.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<!-- this persistence unit is for the web application -->
<persistence-unit name="mysqlJPA" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<!-- <jta-data-source>java:jboss/datasources/MySqlDS</jta-data-source> -->
<!--<class>com.deloitte.demo.model.Person</class>-->
<properties>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/test" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="root"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.use_sql_comments" value="true" />
</properties>
</persistence-unit>
</persistence>