Bug 804140

Summary: Wrong path to jdbc.properties in applicationContextHibernate.xml in Petclinic
Product: [Retired] JBoss Enterprise WFK Platform 2 Reporter: Tomas Repel <trepel>
Component: Spring, ExamplesAssignee: Marius Bogoevici <mariusb>
Status: CLOSED NEXTRELEASE QA Contact: Tomas Repel <trepel>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.0.0.ER3CC: kpiwko, mnovotny, rruss
Target Milestone: ---   
Target Release: 2.0.0.ER7   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: petclinic
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-22 11:10:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.