Bug 804140 - Wrong path to jdbc.properties in applicationContextHibernate.xml in Petclinic
Wrong path to jdbc.properties in applicationContextHibernate.xml in Petclinic
Status: CLOSED NEXTRELEASE
Product: JBoss Enterprise WFK Platform 2
Classification: JBoss
Component: Spring, Examples (Show other bugs)
2.0.0.ER3
Unspecified Unspecified
medium Severity medium
: ---
: 2.0.0.ER7
Assigned To: Marius Bogoevici
Tomas Repel
petclinic
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-16 11:48 EDT by Tomas Repel
Modified: 2013-03-03 20:00 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-22 07:10:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomas Repel 2012-03-16 11:48:51 EDT
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 00:05:30 EDT
Would prefer to fix this together with 804143, as Hibernate deployment would still be an issue.
Comment 2 Marek Novotny 2012-04-27 07:55:31 EDT
is it fixed? I saw the 804143 introduced profiles.
Comment 4 Tomas Repel 2012-06-06 09:00:34 EDT
Already fixed in WFK2 ER7. Verified.
Comment 5 Karel Piwko 2012-06-22 07:10:54 EDT
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.