velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Austin" <reaus...@ucsd.edu>
Subject Re: DataSourceResourceLoader
Date Thu, 26 Dec 2002 19:17:23 GMT
Does this Stacktrace help anyone understand the problem I am having?

Thanks,
Ryan

----- Original Message -----
From: Ryan Austin <reaustin@ucsd.edu>
To: Velocity Users List <velocity-user@jakarta.apache.org>
Sent: Friday, December 20, 2002 2:40 PM
Subject: Re: DataSourceResourceLoader


> Ok, I modified DataSourceResourceLoader.java to print a full stacktrace.
>
> Here is the stacktrace:
>
> Fri Dec 20 14:34:11 PST 2002  [error] DataSourceResourceLoader Error:
> database problem trying to load resource layouts/Index.vm:
> java.lang.ClassCastException
>         at
> javax.naming.spi.NamingManager.getURLObject(NamingManager.java:580)
>         at
> javax.naming.spi.NamingManager.getURLContext(NamingManager.java:538)
>         at
>
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:282)
>         at javax.naming.InitialContext.lookup(InitialContext.java:354)
>         at
>
org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader.openDbC
> onnection(DataSourceResourceLoader.java:319)
>         at
>
org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader.getReso
> urceStream(DataSourceResourceLoader.java:201)
>         at
>
org.apache.velocity.runtime.resource.ResourceManager.getLoaderNameForResourc
> e(ResourceManager.java)
>         at
> org.apache.velocity.runtime.Runtime.getLoaderNameForResource(Runtime.java)
>         at org.apache.velocity.app.Velocity.templateExists(Velocity.java)
>         at
>
org.apache.turbine.services.velocity.TurbineVelocityService.templateExists(T
> urbineVelocityService.java:484)
>         at
>
org.apache.turbine.services.template.TurbineTemplateService.getParsedLayoutT
> emplateName(TurbineTemplateService.java:786)
>         at
>
org.apache.turbine.services.template.TurbineTemplateService.getCachedName(Tu
> rbineTemplateService.java:576)
>         at
>
org.apache.turbine.services.template.TurbineTemplateService.getLayoutTemplat
> eName(TurbineTemplateService.java:426)
>         at
>
org.apache.turbine.services.template.TurbineTemplate.getLayoutTemplateName(T
> urbineTemplate.java:105)
>         at
>
org.apache.turbine.modules.pages.TemplatePage.doBuildAfterAction(TemplatePag
> e.java:143)
>         at
> org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:152)
>         at org.apache.turbine.modules.Page.build(Page.java:90)
>         at org.apache.turbine.modules.PageLoader.exec(PageLoader.java:123)
>         at org.apache.turbine.Turbine.doGet(Turbine.java:447)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
>         at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
>         at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:255)
>         at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
>         at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:225)
>         at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
>         at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
>         at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> )
>         at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
>         at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
>         at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 64)
>         at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :163)
>         at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
>         at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>         at
>
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
> 875)
>         at
>
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
>         at java.lang.Thread.run(Thread.java:536)
>
> Ryan
>
>
> ----- Original Message -----
> From: Geir Magnusson Jr. <geirm@adeptra.com>
> To: Velocity Users List <velocity-user@jakarta.apache.org>
> Sent: Thursday, December 19, 2002 7:34 PM
> Subject: Re: DataSourceResourceLoader
>
>
> > Is there a more complete stacktrace?
> >
> > On Thursday, December 19, 2002, at 10:29 PM, Ryan Austin wrote:
> >
> > > Anyone with knowledge of this problem?
> > >
> > > Ryan
> > >
> > > ----- Original Message -----
> > > From: Ryan Austin <reaustin@popmail.ucsd.edu>
> > > To: <velocity-user@jakarta.apache.org>
> > > Sent: Wednesday, December 18, 2002 6:55 PM
> > > Subject: DataSourceResourceLoader
> > >
> > >
> > >> I am trying to have Velocity load templates from a database without
> > >> any
> > >> success.
> > >>
> > >> I get this error:
> > >>
> > >> Wed Dec 18 18:41:40 PST 2002  [error] DataSourceResourceLoader Error:
> > >> database problem trying to load resource layouts/Test.vm:
> > >> java.lang.ClassCastException
> > >>
> > >> My properties file has this:
> > >>
> > >> resource.loader = ds
> > >> ds.resource.loader.public.name = DataSource
> > >> ds.resource.loader.description = Velocity DataSource Resource Loader
> > >> ds.resource.loader.class =
> > >> org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader
> > >> ds.resource.loader.resource.datasource = java:comp/env/jdbc/newapp
> > >> ds.resource.loader.resource.table = TEMPLATE
> > >> ds.resource.loader.resource.keycolumn = TEMPLATE_ID
> > >> ds.resource.loader.resource.templatecolumn = TEMPLATE_DEFINITION
> > >> ds.resource.loader.resource.timestampcolumn = TEMPLATE_TIMESTAMP
> > >> ds.resource.loader.cache = false
> > >> ds.resource.loader.modificationCheckInterval = 60
> > >>
> > >> My web.xml has this:
> > >>
> > >> <resource-ref>
> > >>         <description>Turbine template DataSource</description>
> > >>         <res-ref-name>jdbc/newapp</res-ref-name>
> > >>         <res-type>javax.sql.DataSource</res-type>
> > >>         <res-auth>Container</res-auth>
> > >>     </resource-ref>
> > >>
> > >> My server.xml has this:
> > >>
> > >> <Context path="/newapp" docBase="newapp" reloadable="true" debug="0">
> > >>          <ResourceParams name="jdbc/newapp">
> > >>            <parameter>
> > >>              <name>driverClassName</name>
> > >>              <value>org.gjt.mm.mysql.Driver</value>
> > >>            </parameter>
> > >>            <parameter>
> > >>              <name>driverName</name>
> > >>              <value>jdbc:mysql:database</value>
> > >>            </parameter>
> > >>            <parameter>
> > >>              <name>user</name>
> > >>              <value>cgi</value>
> > >>            </parameter>
> > >>            <parameter>
> > >>              <name>password</name>
> > >>              <value>cgi</value>
> > >>            </parameter>
> > >>          </ResourceParams>
> > >>        </Context>
> > >>
> > >> I have a Table called TEMPLATE with the corresponding fields.
> > >>
> > >> The log file shows that it loads DataSourceResourceLoader fine:
> > >>
> > >> Wed Dec 18 17:09:23 PST 2002 AvalonLogSystem initialized using
logfile
> > >> /usr/local/tdk/bin/./../webapps/newapp/logs/velocity.log
> > >> Wed Dec 18 17:09:23 PST 2002   [info]   [info] Default Properties
> > >> File:
> > >> org/apache/velocity/runtime/defaults/velocity.properties
> > >> Wed Dec 18 17:09:23 PST 2002   [info] Resource Loader Instantiated:
> > >> org.apache.velocity.runtime.resource.loader.FileResourceLoader
> > >> Wed Dec 18 17:09:23 PST 2002   [info] FileResourceLoader :
> > >> initialization
> > >> starting.
> > >> Wed Dec 18 17:09:23 PST 2002   [info] FileResourceLoader : adding
path
> > >> '/usr/local/tdk/bin/./../webapps/newapp/templates/app'
> > >> Wed Dec 18 17:09:23 PST 2002   [info] FileResourceLoader : adding
path
> > >> '/usr/local/tdk/bin/./../webapps/newapp/templates/flux'
> > >> Wed Dec 18 17:09:23 PST 2002   [info] FileResourceLoader :
> > >> initialization
> > >> complete.
> > >> Wed Dec 18 17:09:23 PST 2002   [info] Resource Loader Instantiated:
> > >> org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader
> > >> Wed Dec 18 17:09:23 PST 2002   [info] Resources Loaded From:
> > >> java:comp/env/jdbc/newapp/TEMPLATE
> > >> Wed Dec 18 17:09:23 PST 2002   [info] Resource Loader using columns:
> > >> TEMPLATE_ID, TEMPLATE_DEFINITION and TEMPLATE_TIMESTAMP
> > >> Wed Dec 18 17:09:23 PST 2002   [info] Resource Loader Initalized.
> > >> Wed Dec 18 17:09:23 PST 2002   [info] Resource Loader Instantiated:
> > >> org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
> > >> Wed Dec 18 17:09:23 PST 2002   [info] ClasspathResourceLoader :
> > >> initialization starting.
> > >> Wed Dec 18 17:09:23 PST 2002   [info] ClasspathResourceLoader :
> > >> initialization complete.
> > >>
> > >> Any ideas??
> > >>
> > >> Thanks,
> > >> Ryan
> > >>
> > >>
> > >> --
> > >> To unsubscribe, e-mail:
> > > <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> > >> For additional commands, e-mail:
> > > <mailto:velocity-user-help@jakarta.apache.org>
> > >>
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <mailto:velocity-user-help@jakarta.apache.org>
> > >
> > >
> > --
> > Geir Magnusson Jr                                   203-355-2219(w)
> > Adeptra, Inc.                                       203-247-1713(m)
> > geirm@adeptra.com
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:velocity-user-help@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:velocity-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message