3 Replies Latest reply on Jan 30, 2009 5:53 AM by ptr deko

    [Jboss 5.0.0.GA] problem with JNDI name persistent unit

    ptr deko Newbie

      I have an application that works in Jboss 4.2.3.GA, but doesn't work in Jboss5GA.

      This is the stacktrace (cleaned for readability:


      WARN [EhCacheProvider] Could not find configuration [persistence.unit:unitName=foo.ear/bar-ejb.jar#foo-PU.be.foo.bar.domain.user]; using defaults.
      ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=foo.ear/bar-ejb.jar#foo-PU state=Create
      java.lang.IllegalArgumentException: Cache name cannot contain '/' characters.
      at net.sf.ehcache.config.CacheConfiguration.setName(CacheConfiguration.java:163)
      at net.sf.ehcache.Cache.setName(Cache.java:1721)
      at net.sf.ehcache.CacheManager.addCache(CacheManager.java:632)
      at org.hibernate.cache.EhCacheProvider.buildCache(EhCacheProvider.java:94)


      I think this is caused by the not working of the jboss.entity.manager.factory.jndi.name

      this is the 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="foo-PU" transaction-type="JTA">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>java:fooDS</jta-data-source>
       <properties>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:foo-PU" />
       <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
       <property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider" />
       <property name="hibernate.cache.use_query_cache" value="true" />
       <property name="hibernate.cache.use_second_level_cache" value="true" />
       <property name="hibernate.generate_statistics" value="false" />
       <property name="hibernate.cache.provider_configuration_file_resource_path" value="ehcache.xml"/>
       </properties>
       </persistence-unit>
      </persistence>


      I'm using Spring 2.5.6 in the applicationContext I simply use:
       <jee:jndi-lookup id="emf" jndi-name="java:foo-PU"/>