velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cort Schaefer" <c...@xmission.com>
Subject RE: Velocity ClassCastException 'velocimacro.permissions.allow.inline '
Date Mon, 05 Jan 2004 21:37:29 GMT
As a guess, I would assume that the properties are being loaded twice
somehow and the value of the property 'velocimacro.permissions.allow.inline'
ends up being a vector of Boolean.  Just a guess....

Cort



-----Original Message-----
From: Nortje, Andrew [mailto:Andrew.Nortje@nscorp.com] 
Sent: Monday, January 05, 2004 1:37 PM
To: velocity-user@jakarta.apache.org
Subject: Velocity ClassCastException 'velocimacro.permissions.allow.inline '

I am using Velocity with WebWork deployed under WebLogic running under
Windows and UNIX.



The application works fine under Windows but fails on UNIX.



To tell Velocity where to find the template files I have a
velocity.properties file in WEB-INF/classes which looks like this



runtime.log = /opt/home/blah/blah

resource.loader = class

class.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader



web.xml looks like this



     ...

    <servlet>

        <servlet-name>velocity</servlet-name>


<servlet-class>com.nscorp.cdb.view.CodeDatabaseServlet</servlet-class>

        <init-param>

            <param-name>properties</param-name>

            <param-value>/WEB-INF/classes/velocity.properties</param-value>

        </init-param>

    </servlet>

    ...



I then followed the "Velocity WebLogic Cook Book" on the Velocity website to
get Velocity to use resource.loader=class by over riding the WebWork servlet
and implementing  the loadConfiguration() method. All works fine on Windows,
I have a bunch of println() statements which show me what's going on. On
UNIX it fails with the message below before even executing the
loadConfiguration() method.



Any ideas?



TIA



Andrew





####<Jan 5, 2004 3:19:35 PM EST> <Info> <HTTP> <pastry> <DashBoard>
<ExecuteThread: '11' for queue: 'default'> <kernel identity> <> <101047>
<[ServletContext(id=7588838,name=CodeTable.war,context-path=/CodeTable)]
velocity: init>

####<Jan 5, 2004 3:19:35 PM EST> <Error> <HTTP> <pastry> <DashBoard>
<ExecuteThread: '11' for queue: 'default'> <kernel identity> <> <101018>
<[ServletContext(id=7588838,name=CodeTable.war,context-path=/CodeTable)]
Servlet failed with ServletException>

javax.servlet.ServletException: Error initializing Velocity:
java.lang.ClassCastException: 'velocimacro.permissions.allow.inline' doesn't
map to a Boolean object

        at
org.apache.velocity.servlet.VelocityServlet.initVelocity(VelocityServlet.jav
a:236)

        at
org.apache.velocity.servlet.VelocityServlet.init(VelocityServlet.java:198)

        at
weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubI
mpl.java:1075)

        at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:780)

        at
weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java
:899)

        at
weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.ja
va:833)

        at
weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
a:773)

        at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:51
7)

        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:351)

        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:306)

        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:5445)

        at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:780)

        at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3105)

        at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2588)

        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)

        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)







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


Mime
View raw message