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 Fri, 20 Dec 2002 03:54:44 GMT
I am using velocity thru turbine.
All I get from velocity.log is:

Wed Dec 18 18:41:40 PST 2002  [error] DataSourceResourceLoader Error:
database problem trying to load resource layouts/Test.vm:
java.lang.ClassCastException
Wed Dec 18 18:41:40 PST 2002  [error] DataSourceResourceLoader Error:
database problem trying to load resource screens/Test.vm:
java.lang.ClassCastException
Wed Dec 18 18:41:40 PST 2002  [error] DataSourceResourceLoader Error:
database problem trying to load resource layouts/Error.vm:
java.lang.ClassCastException
Wed Dec 18 18:41:40 PST 2002  [error] DataSourceResourceLoader Error:
database problem trying to load resource layouts/Error.vm:
java.lang.ClassCastException
Wed Dec 18 18:41:40 PST 2002  [error] DataSourceResourceLoader Error:
database problem trying to load resource layouts/Error.vm:
java.lang.ClassCastException

I don't know if you have any knowledge of turbine, but this is from the
turbine.log

[Wed Dec 18 18:41:40 PST 2002] -- ERROR -- Turbine.handleException: Screen
template 'Test.vm' not found
[Wed Dec 18 18:41:40 PST 2002] -- ERROR --
        Exception:  java.lang.Exception: Screen template 'Test.vm' not found
        Stack Trace follows:
        java.lang.Exception: Screen template 'Test.vm' not found
        at
org.apache.turbine.services.template.TurbineTemplateService.getParsedScreenT
emplateName(TurbineTemplateService.java:726)
        at
org.apache.turbine.services.template.TurbineTemplateService.getCachedName(Tu
rbineTemplateService.java:572)
        at
org.apache.turbine.services.template.TurbineTemplateService.getScreenTemplat
eName(TurbineTemplateService.java:412)
        at
org.apache.turbine.services.template.TurbineTemplate.getScreenTemplateName(T
urbineTemplate.java:92)
        at
org.apache.turbine.modules.screens.VelocityScreen.buildTemplate(VelocityScre
en.java:129)
        at
org.apache.turbine.modules.screens.TemplateScreen.doBuild(TemplateScreen.jav
a:130)
        at org.apache.turbine.modules.Screen.build(Screen.java:99)
        at
org.apache.turbine.modules.ScreenLoader.eval(ScreenLoader.java:129)
        at
org.apache.turbine.modules.layouts.VelocityECSLayout.doBuild(VelocityECSLayo
ut.java:100)
        at org.apache.turbine.modules.Layout.build(Layout.java:91)
        at
org.apache.turbine.modules.LayoutLoader.exec(LayoutLoader.java:123)
        at
org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:166)
        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.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)

If you think this is a Turbine problem, then I will try there mailing list.

Thanks,
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>


Mime
View raw message