Bug 804140 - Wrong path to jdbc.properties in applicationContextHibernate.xml in Petclinic
Summary: Wrong path to jdbc.properties in applicationContextHibernate.xml in Petclinic
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: JBoss Enterprise WFK Platform 2
Classification: Retired
Component: Spring, Examples
Version: 2.0.0.ER3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 2.0.0.ER7
Assignee: Marius Bogoevici
QA Contact: Tomas Repel
URL:
Whiteboard: petclinic
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-16 15:48 UTC by Tomas Repel
Modified: 2013-03-04 01:00 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-22 11:10:54 UTC
Type: ---


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 804143 0 medium CLOSED Hibernate 2nd level cache is not configured properly in Petclinic example 2021-02-22 00:41:40 UTC

Internal Links: 804143

Description Tomas Repel 2012-03-16 15:48:51 UTC
Description of problem:

The location attribute of context:property-placeholder element in applicationContextHibernate.xml has wrong value 'classpath/jdbc.properties'. The correct value should be 'classpath:jdbc.properties'.

Version-Release number of selected component (if applicable):

WFK2 Beta1 Petclinic example
EAP6 Beta

How reproducible:

Always.

Steps to Reproduce:
1. modify web.xml so that the applicationContextHibernate.xml is used as a value for 'contextConfigLocator' parameter
2. build and deploy petclinic.war
  
Actual results:

10:50:10,583 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-7) Context initialization failed: org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/classpath/jdbc.properties]
	at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:78) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:663) [spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:638) [spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407) [spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282) [spring-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204) [spring-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) [spring-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.10.Final-redhat-1.jar:]
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.10.Final-redhat-1.jar:]
	at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.6.0_22]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.6.0_22]
	at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_22]
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/classpath/jdbc.properties]
	at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:118) [spring-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:181) [spring-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:161) [spring-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:69) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]
	... 14 more


Expected results:

It deploys.

Comment 1 Marius Bogoevici 2012-04-13 04:05:30 UTC
Would prefer to fix this together with 804143, as Hibernate deployment would still be an issue.

Comment 2 Marek Novotny 2012-04-27 11:55:31 UTC
is it fixed? I saw the 804143 introduced profiles.

Comment 4 Tomas Repel 2012-06-06 13:00:34 UTC
Already fixed in WFK2 ER7. Verified.

Comment 5 Karel Piwko 2012-06-22 11:10:54 UTC
These example related issues are fixed in WFK 2.0.0. Documenting them as fixed issues is not required.


Note You need to log in before you can comment on or make changes to this bug.