Announcement Announcement Module
Collapse
No announcement yet.
ServletContextResource bug? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ServletContextResource bug?

    hi all; i am using 2.0M1
    i am trying to use ServletContextResource to load quartz.properties file from under WEB-INF directory.
    my configuration in as follows:
    <bean id="schedulerFactory" class="org.springframework.scheduling.quartz.Sched ulerFactoryBean">
    <property name="schedulerName" value="service-layer-sched"/>
    <property name="configLocation" value="servletcontext:/WEB-INF/quartz.properties"/>
    <property name="triggers">
    ...
    note that to make sure i the resource could be loaded i explicitly use the servlet API as follows:
    servletContext.getResourceAsStream("/WEB-INF/quartz.properties")
    and got this output (the file was found):
    java.io.ByteArrayInputStream@6d0040
    also, i have no problem putting the properties file in the classpath and loading it via the classpath resource.
    any help would be great.
    P.S: i dont know if this is related but my application is the root application in tomcat meaning that to access my app i use the URL http://localhost (not http://localhost/someApp)
    thanks

    here is the stack trace of the exception:
    java.io.FileNotFoundException: Could not open ServletContext resource [/servletcontext:/WEB-INF/quartz.properties]
    at org.springframework.web.context.support.ServletCon textResource.getInputStream(ServletContextResource .java:99)
    at org.springframework.core.io.support.PropertiesLoad erUtils.fillProperties(PropertiesLoaderUtils.java: 61)
    at org.springframework.scheduling.quartz.SchedulerFac toryBean.initSchedulerFactory(SchedulerFactoryBean .java:607)
    at org.springframework.scheduling.quartz.SchedulerFac toryBean.afterPropertiesSet(SchedulerFactoryBean.j ava:532)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:810)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:779)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:360)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:256)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:331)
    at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:150)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:240)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:178)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 49)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3669)
    Last edited by gkatz; Jan 8th, 2006, 03:05 PM.
Working...
X