cancel
Showing results for 
Search instead for 
Did you mean: 

Migrating to SAP Web AS - Hibernate/EHCache problem (ehcache.xml not found)

Former Member
0 Kudos

Hi SAP Gurus!

We are migrating one of our web applications to SAP Netweaver CE SR5 and we are stuck in one apparent simple problem but yet we canu00B4t figure the solution out.

Our web application uses Spring 2.5.2 as IoC container, Hibernate 3.2.5 as ORM mechanism, EHCache as the Hibernate second level cache and it runs fine (as a WAR file) in the Tomcat 5.5 or higher.

The problem is that ehcache.xml file whitch is bundled in the root dir of a JAR file named foundation.jar is never found in SAP Web AS and we get a FileNotFoundException (the important part of the exception stack can be found below).

Itu00B4s important to register that the ehcache.xml file can be found in the foundation.jar mentioned in the exception stack below.

It seems like the server is correctly searchig for the ehcache.xml file inside the foundation.jar but strangely canu00B4t find it.

I also tried to put the ehcache.xml file in the root of the EAR file but the same exception was thrown.

Our applicationu00B4s structure is as follows:

cpl350.ear

Cockpit_oracle9_3_5_0.war (inside cpl350.ear)

foundation.jar (inside Cockpit_oracle9_3_5_0.war in the WEB-INF/lib directory)

Does anybody know what this could be?

Is there any SAP Web AS class loading issue we are not aware of?

Thanks in advance and best regards.

Carlos Ballock.

ps.: reward points

##########################################################################################

Caused by: net.sf.ehcache.CacheException: Error configuring from jar:file:/C:/usr/sap/CE1/J00/j2ee/cluster/apps/JavaEE/CPL%203.5.0/servlet_jsp/cpl350/root/WEB-INF/lib/foundation.jar!/ehcache.xml. Initial cause was JAR entry ehcache.xml not found in C:\usr\sap\CE1\J00\j2ee\cluster\apps\JavaEE\CPL 3.5.0\servlet_jsp\cpl350\root\WEB-INF\lib\foundation.jar

at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:95)

at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:131)

at net.sf.ehcache.CacheManager.parseConfiguration(CacheManager.java:271)

at net.sf.ehcache.CacheManager.init(CacheManager.java:219)

at net.sf.ehcache.CacheManager.<init>(CacheManager.java:212)

at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:124)

at org.springframework.orm.hibernate3.LocalCacheProviderProxy.start(LocalCacheProviderProxy.java:59)

at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:183)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)

at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:816)

at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:734)

at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1333)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1299)

... 159 more

Caused by: java.io.FileNotFoundException: JAR entry ehcache.xml not found in C:\usr\sap\CE1\J00\j2ee\cluster\apps\JavaEE\CPL 3.5.0\servlet_jsp\cpl350\root\WEB-INF\lib\foundation.jar

at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:114)

at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)

at java.net.URL.openStream(URL.java:1007)

at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:92)

... 172 more

Edited by: Ballock on Aug 19, 2008 11:47 PM

Edited by: Ballock on Aug 19, 2008 11:48 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi all!

The problem apparently was caused by a blank space in my application name.

It seems to be a bug in the EHCache config file loading mechanism:

http://sourceforge.net/tracker/index.php?func=detail&aid=1237017&group_id=93232&atid=603559

The previous name was "CPL 3.5.0" (with a blank space between the CPL and 3.5.0).

Now I´ve renamed it to "CPL350" (without the blank space and the dots to avoid further surprises) and the problem is not happening anymore.

Regards.

Ballock.