You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by mm...@enherent.com on 2002/04/08 22:04:43 UTC

Interesting stacktrace, please help. [sample app]


In my attempts to get a grip on Turbine, I became a recipient of the
"Horrible" exception.

This is from the sample app "Turbine Data Manager"

Horrible Exception: java.lang.Exception: Screen template '/Login.vm' not
found
        at
org.apache.turbine.services.template.TurbineTemplateService.getParsedScreen
TemplateName(TurbineTemplateService.java:726)
        at
org.apache.turbine.services.template.TurbineTemplateService.getCachedName(T
urbineTemplateService.java:572)
        at
org.apache.turbine.services.template.TurbineTemplateService.getScreenTempla
teName(TurbineTemplateService.java:412)
        at
org.apache.turbine.services.template.TurbineTemplate.getScreenTemplateName(
TurbineTemplate.java:92)
        at
org.apache.turbine.modules.screens.VelocityScreen.buildTemplate(VelocityScr
een.java:129)
        at
org.apache.turbine.modules.screens.TemplateScreen.doBuild(TemplateScreen.ja
va: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(VelocityECSLay
out.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)

Looking at this after having read the specifications document, makes a lot
of sense about modules.

Turbine -> layouts -> screens -> services...

However, when I installed the sample app on my web host (a shared Tomcat
4.0.1) I got the above Exception. Would anyone know how I could print out
the actual path in which Velocity is looking for Login.vm. Following is my
attempt at doing the same.

I tried searching mail-archive with little success. Next I debugged the
application, downloaded turbine2.1 source. Put in debug code in
TurbineTemplateService.java and found that the
TemplateEngineService.templateExists("screens/Login.vm") call was returning
negative and hence this Exception being thrown.

Getting deeper, I realized that the TemplateEngineService calls
TurbineVelocityService, which in turn calls Velocity.templateExists()...
which meant I needed the Velocity source to find which path and file the
application is looking for. So I downloaded the Velocity1.2 source. Removed
velocity-1.2-dev.jar from the lib directory, compiled the source and put it
in. It wouldn't work. I get the following trace..

java.lang.NoClassDefFoundError: org/apache/log/format/Formatter
     at java.lang.Class.forName1(Native Method)
     at java.lang.Class.forName(Class.java:134)
     at
org.apache.velocity.runtime.log.LogManager.createLogSystem(LogManager.java:
104)
     at
org.apache.velocity.runtime.RuntimeInstance.initializeLogger(RuntimeInstanc
e.java:468)
     at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:259)
     at
org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:169
)
     at org.apache.velocity.app.Velocity.init(Velocity.java:123)
     at
org.apache.turbine.services.velocity.TurbineVelocityService.initVelocity(Tu
rbineVelocityService.java:460)
     at
org.apache.turbine.services.velocity.TurbineVelocityService.init(TurbineVel
ocityService.java:138)
     at
org.apache.turbine.services.TurbineBaseService.init(TurbineBaseService.java
:108)
     at
org.apache.turbine.services.BaseInitableBroker.initClass(BaseInitableBroker
.java:150)
     at
org.apache.turbine.services.BaseServiceBroker.doInitService(BaseServiceBrok
er.java:232)
     at
org.apache.turbine.services.BaseServiceBroker.initServices(BaseServiceBroke
r.java:197)
     at org.apache.turbine.Turbine.init(Turbine.java:185)


Thats when I realized that I have the wrong source for Velocity. And
decided to write and ask for help. Can someone point to the source of
velocity-1.2-dev.jar

Thanks
-Manu



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Interesting stacktrace, please help. [sample app]

Posted by "Dan K." <da...@YorkU.CA>.
Hi Manu,

In turbine, velocity looks for the templates specified in the
TurbineResources.properties file of your web app.  In turbine2.1, the
setting is like:

services.VelocityService.file.resource.loader.path = /templates

If there are more directories that contain your templates then you can
include additional ones with a comma, like:

services.VelocityService.file.resource.loader.path =
/templates,/moretemplates,/evenmoretemplates

The template paths specified by this setting is relative to the webapp
root (e.g. <tomcat_root>/webapps/my_webapp).

Hope this helps,
Dan

On Mon, 8 Apr 2002 mmanickalal@enherent.com wrote:

>
>
> In my attempts to get a grip on Turbine, I became a recipient of the
> "Horrible" exception.
>
> This is from the sample app "Turbine Data Manager"
>
> Horrible Exception: java.lang.Exception: Screen template '/Login.vm' not
> found
>         at
> org.apache.turbine.services.template.TurbineTemplateService.getParsedScreen
> TemplateName(TurbineTemplateService.java:726)
>         at
> org.apache.turbine.services.template.TurbineTemplateService.getCachedName(T
> urbineTemplateService.java:572)
>         at
> org.apache.turbine.services.template.TurbineTemplateService.getScreenTempla
> teName(TurbineTemplateService.java:412)
>         at
> org.apache.turbine.services.template.TurbineTemplate.getScreenTemplateName(
> TurbineTemplate.java:92)
>         at
> org.apache.turbine.modules.screens.VelocityScreen.buildTemplate(VelocityScr
> een.java:129)
>         at
> org.apache.turbine.modules.screens.TemplateScreen.doBuild(TemplateScreen.ja
> va: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(VelocityECSLay
> out.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)
>
> Looking at this after having read the specifications document, makes a lot
> of sense about modules.
>
> Turbine -> layouts -> screens -> services...
>
> However, when I installed the sample app on my web host (a shared Tomcat
> 4.0.1) I got the above Exception. Would anyone know how I could print out
> the actual path in which Velocity is looking for Login.vm. Following is my
> attempt at doing the same.
>
> I tried searching mail-archive with little success. Next I debugged the
> application, downloaded turbine2.1 source. Put in debug code in
> TurbineTemplateService.java and found that the
> TemplateEngineService.templateExists("screens/Login.vm") call was returning
> negative and hence this Exception being thrown.
>
> Getting deeper, I realized that the TemplateEngineService calls
> TurbineVelocityService, which in turn calls Velocity.templateExists()...
> which meant I needed the Velocity source to find which path and file the
> application is looking for. So I downloaded the Velocity1.2 source. Removed
> velocity-1.2-dev.jar from the lib directory, compiled the source and put it
> in. It wouldn't work. I get the following trace..
>
> java.lang.NoClassDefFoundError: org/apache/log/format/Formatter
>      at java.lang.Class.forName1(Native Method)
>      at java.lang.Class.forName(Class.java:134)
>      at
> org.apache.velocity.runtime.log.LogManager.createLogSystem(LogManager.java:
> 104)
>      at
> org.apache.velocity.runtime.RuntimeInstance.initializeLogger(RuntimeInstanc
> e.java:468)
>      at
> org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:259)
>      at
> org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:169
> )
>      at org.apache.velocity.app.Velocity.init(Velocity.java:123)
>      at
> org.apache.turbine.services.velocity.TurbineVelocityService.initVelocity(Tu
> rbineVelocityService.java:460)
>      at
> org.apache.turbine.services.velocity.TurbineVelocityService.init(TurbineVel
> ocityService.java:138)
>      at
> org.apache.turbine.services.TurbineBaseService.init(TurbineBaseService.java
> :108)
>      at
> org.apache.turbine.services.BaseInitableBroker.initClass(BaseInitableBroker
> .java:150)
>      at
> org.apache.turbine.services.BaseServiceBroker.doInitService(BaseServiceBrok
> er.java:232)
>      at
> org.apache.turbine.services.BaseServiceBroker.initServices(BaseServiceBroke
> r.java:197)
>      at org.apache.turbine.Turbine.init(Turbine.java:185)
>
>
> Thats when I realized that I have the wrong source for Velocity. And
> decided to write and ask for help. Can someone point to the source of
> velocity-1.2-dev.jar
>
> Thanks
> -Manu
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>