I have upgraded from tools 1.1 to tools 1.2, and then to 1.3-rc1.  Since
moving off 1.1, Velocity View Servlet does not seem to be attempting to
load the toolbox at all.  My guess is that since I moved from tools 1.1
to tools 1.3, it's not finding the toolbox config XML file any more.

The reason I think it's not finding the toolbox xml config file any more
is because I can make up a totally bogus path to the toolbox, put it in
the web.xml file, and the behavior doesn't change from what I'm seeing
right now.  Symptoms include lots of lines in the velocity log like
this:

Mon Jan 29 16:15:34 PST 2007   [warn]
org.apache.velocity.runtime.exception.ReferenceException: reference :
template = /NPVRAdmin.vm [line 31,column 46] : $npvr.addSuccess is not a
valid reference.

And web pages with lots of velocity reference (like
'$callerid.getCallingNumber') visible.


My toolbox XML files are not in the default location, but this setup
seems to be legal based on the 1.3 VVS documentation, and the same
settings were working earlier today when I was on tools 1.1.

Here is the relevant section of my web.xml:

    <!--*******************************************************-->
    <!--************** Velocity with QAS Layout ****************-->
    <!--*******************************************************-->
    <servlet>
        <servlet-name>setup</servlet-name>
        <servlet-class>
            com.myrio.qa.qas.setup.SetupServlet
            <!-- extends the layout servlet -->
        </servlet-class>

        <init-param>
            <param-name>org.apache.velocity.toolbox</param-name>
            <param-value>/conf/QAStoolbox.xml</param-value>
        </init-param>

        <init-param>
            <param-name>org.apache.velocity.properties</param-name>
            <param-value>/conf/velocity.properties</param-value>
        </init-param>

        <load-on-startup>1</load-on-startup>
    </servlet>

    <welcome-file-list>
        <welcome-file>index.vm</welcome-file>
    </welcome-file-list>

    <!-- Map *.vm files to Velocity -->
    <servlet-mapping>
        <servlet-name>setup</servlet-name>
        <url-pattern>*.vm</url-pattern>
    </servlet-mapping>


    <!--*******************************************************-->
    <!--************ Generic Velocity, no layout  *************-->
    <!--*******************************************************-->
    <servlet>
        <servlet-name>velocity</servlet-name>
        <servlet-class>
            org.apache.velocity.tools.view.servlet.VelocityViewServlet
        </servlet-class>

        <init-param>
            <param-name>org.apache.velocity.toolbox</param-name>
            <param-value>/conf/genericToolbox.xml</param-value>
        </init-param>

        <init-param>
            <param-name>org.apache.velocity.properties</param-name>
            <param-value>/conf/velocity.properties</param-value>
        </init-param>

        <load-on-startup>11</load-on-startup>
    </servlet>




Here's the complete velocity log from startup through initialization.
As you can see it gives no indication that any toolbox was loaded:


Mon Jan 29 16:15:25 PST 2007  [debug] AvalonLogSystem initialized using
logfile 'velocity.log'
Mon Jan 29 16:15:25 PST 2007   [info] VelocityViewServlet: Using custom
properties at '/conf/velocity.properties'
Mon Jan 29 16:15:25 PST 2007   [info]
**************************************************************
Mon Jan 29 16:15:25 PST 2007   [info] Starting Jakarta Velocity v1.4
Mon Jan 29 16:15:25 PST 2007   [info] RuntimeInstance initializing.
Mon Jan 29 16:15:25 PST 2007   [info] Default Properties File:
org/apache/velocity/runtime/defaults/velocity.properties
Mon Jan 29 16:15:25 PST 2007   [info] Trying to use logger class
org.apache.velocity.runtime.log.AvalonLogSystem
Mon Jan 29 16:15:25 PST 2007   [info] Using logger class
org.apache.velocity.runtime.log.AvalonLogSystem
Mon Jan 29 16:15:25 PST 2007   [info] Default ResourceManager
initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
Mon Jan 29 16:15:25 PST 2007   [info] Resource Loader Instantiated:
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Mon Jan 29 16:15:25 PST 2007   [info] FileResourceLoader :
initialization starting.
Mon Jan 29 16:15:25 PST 2007   [info] FileResourceLoader : adding path
'/usr/local/tomcat/webapps/qas'
Mon Jan 29 16:15:25 PST 2007   [info] FileResourceLoader :
initialization complete.
Mon Jan 29 16:15:25 PST 2007   [info] ResourceCache : initialized.
(class org.apache.velocity.runtime.resource.ResourceCacheImpl)
Mon Jan 29 16:15:25 PST 2007   [info] Default ResourceManager
initialization complete.
Mon Jan 29 16:15:25 PST 2007   [info] Loaded System Directive:
org.apache.velocity.runtime.directive.Literal
Mon Jan 29 16:15:25 PST 2007   [info] Loaded System Directive:
org.apache.velocity.runtime.directive.Macro
Mon Jan 29 16:15:25 PST 2007   [info] Loaded System Directive:
org.apache.velocity.runtime.directive.Parse
Mon Jan 29 16:15:25 PST 2007   [info] Loaded System Directive:
org.apache.velocity.runtime.directive.Include
Mon Jan 29 16:15:25 PST 2007   [info] Loaded System Directive:
org.apache.velocity.runtime.directive.Foreach
Mon Jan 29 16:15:25 PST 2007   [info] Created: 20 parsers.
Mon Jan 29 16:15:25 PST 2007   [info] Velocimacro : initialization
starting.
Mon Jan 29 16:15:25 PST 2007   [info] Velocimacro : adding VMs from VM
library template : VM_global_library.vm
Mon Jan 29 16:15:25 PST 2007  [error] ResourceManager : unable to find
resource 'VM_global_library.vm' in any resource loader.
Mon Jan 29 16:15:25 PST 2007   [info] Velocimacro : error using  VM
library template VM_global_library.vm :
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'VM_global_library.vm'
Mon Jan 29 16:15:25 PST 2007   [info] Velocimacro :  VM library template
macro registration complete.
Mon Jan 29 16:15:25 PST 2007   [info] Velocimacro : allowInline = true :
VMs can be defined inline in templates
Mon Jan 29 16:15:25 PST 2007   [info] Velocimacro :
allowInlineToOverride = false : VMs defined inline may NOT replace
previous VM definitions
Mon Jan 29 16:15:25 PST 2007   [info] Velocimacro : allowInlineLocal =
false : VMs defined inline will be  global in scope if allowed.
Mon Jan 29 16:15:25 PST 2007   [info] Velocimacro : messages on  : VM
system will output logging messages
Mon Jan 29 16:15:25 PST 2007   [info] Velocimacro : autoload off  : VM
system will not automatically reload global library macros
Mon Jan 29 16:15:25 PST 2007   [info] Velocimacro : initialization
complete.
Mon Jan 29 16:15:25 PST 2007   [info] Velocity successfully started.
Mon Jan 29 16:15:25 PST 2007   [info] VelocityViewServlet: Default
content-type is: text/html

Thanks!


-Travis





On Mon, 2007-01-29 at 13:18 -0800, Nathan Bubna wrote:
> The release downloads have moved since 1.2, so the documentation with
> that release is out of date.  Downloads can now be found here:
> 
> http://velocity.apache.org/download.cgi
> 
> Please do upgrade first.  The toolbox manager was much improved
> between 1.1 and 1.2 and further so between 1.2 and the
> soon-to-be-released 1.3.
> 
> On 1/29/07, Travis Bear <[EMAIL PROTECTED]> wrote:
> > The Digester version I was using is unclear, but I'm sure it's a year or
> > two old.  It's from before the time the version number was in the name
> > of the jar file.  I updated Digester to the current version (1.8) and
> > tried again, with basically the same results:
> >
> > Mon Jan 29 12:50:50 PST 2007  [error] Problem loading toolbox
> > '/conf/QAStoolbox.xml' : java.lang.NullPointerException
> > Mon Jan 29 12:50:50 PST 2007  [error] java.lang.NullPointerException
> >         at
> > org.apache.commons.digester.Digester.createSAXException(Digester.java:3181)
> >         at
> > org.apache.commons.digester.Digester.createSAXException(Digester.java:3207)
> >         at
> > org.apache.commons.digester.Digester.endElement(Digester.java:1225)
> >         at
> > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
> >         at
> > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1241)
> >         at
> > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
> > $FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
> >         at
> > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
> >         at
> > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
> >         at
> > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
> >         at
> > com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
> >         at
> > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
> >         at
> > org.apache.commons.digester.Digester.parse(Digester.java:1765)
> >         at
> > org.apache.velocity.tools.view.XMLToolboxManager.load(XMLToolboxManager.java:148)
> >         at
> > org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance(ServletToolboxManager.java:172)
> >         at
> > org.apache.velocity.tools.view.servlet.VelocityViewServlet.initToolbox(VelocityViewServlet.java:231)
> >         at
> > org.apache.velocity.tools.view.servlet.VelocityViewServlet.init(VelocityViewServlet.java:174)
> >         at
> > org.apache.velocity.tools.view.servlet.VelocityLayoutServlet.init(VelocityLayoutServlet.java:147)
> >         at
> > com.myrio.qa.qas.setup.SetupServlet.init(SetupServlet.java:24)
> >         at
> > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
> >
> >
> > My Velocity tools is on 1.1.  I see there is a link to a released 1.2
> > version of velocity tools on the Velocity website:
> >
> > http://velocity.apache.org/tools/releases/velocity-tools-1.2/index.html
> >
> > I'm willing to upgrade, but the download link is currently broken.
> >
> >
> >
> > -Travis
> >
> >
> >
> >
> > On Mon, 2007-01-29 at 12:32 -0800, Nathan Bubna wrote:
> > > what versions of VelocityTools and Digester are you using?
> > >
> > > On 1/29/07, Travis Bear <[EMAIL PROTECTED]> wrote:
> > > > Hi All!
> > > >
> > > >
> > > > I'm having a problem with the Velocity Layout Servlet failing to load
> > > > the toolbox when a certain tool is configured in.  From the sound of it,
> > > > it would seem like this would be a simple problem to fix, but I have
> > > > been looking at this for a while without finding an obvious solution.
> > > >
> > > >
> > > > Here is the toolbox xml file (conf/QAStoolbox.xml), with the offending
> > > > tool commented out:
> > > >
> > > > <?xml version="1.0"?>
> > > > <!-- toolbox for the servlet that handles the 'QAS look-and-feel'
> > > > templates -->
> > > > <toolbox>
> > > >
> > > >     <tool>
> > > >         <key>setup</key>
> > > >         <scope>request</scope>
> > > >         <class>com.myrio.qa.qas.setup.SetupUI</class>
> > > >     </tool>
> > > > <!--
> > > >     <tool>
> > > >         <key>npvr</key>
> > > >         <scope>request</scope>
> > > >         <class>com.myrio.qa.qas.npvr.NPVRUI</class>
> > > >     </tool>
> > > > -->
> > > >     <tool>
> > > >         <key>callerid</key>
> > > >         <scope>request</scope>
> > > >         <class>com.myrio.qa.qas.callerID.CallerIDUI</class>
> > > >     </tool>
> > > >
> > > >     <tool>
> > > >         <key>conapi</key>
> > > >         <scope>session</scope>
> > > >         <class>com.myrio.qa.qas.conAPI.FeederUI</class>
> > > >     </tool>
> > > >
> > > >     <tool>
> > > >         <key>wallet</key>
> > > >         <scope>request</scope>
> > > >         <class>com.myrio.qa.qas.wallet.WalletUI</class>
> > > >     </tool>
> > > >
> > > >     <tool>
> > > >         <key>params</key>
> > > >         <scope>request</scope>
> > > >
> > > > <class>org.apache.velocity.tools.view.tools.ParameterParser</class>
> > > >     </tool>
> > > >
> > > >     <tool>
> > > >         <key>map</key>
> > > >         <scope>request</scope>
> > > >         <class>java.util.HashMap</class>
> > > >     </tool>
> > > >
> > > > </toolbox>
> > > >
> > > >
> > > > With the above config file, everything is is more or less fine.   Below
> > > > is the velocity log from using the above config:
> > > >
> > > > Mon Jan 29 11:18:03 PST 2007   [info] Velocimacro : initialization
> > > > complete.
> > > > Mon Jan 29 11:18:03 PST 2007   [info] Velocity successfully started.
> > > > Mon Jan 29 11:18:03 PST 2007   [info] ServletToolboxManager: Using
> > > > config file '/conf/QAStoolbox.xml'
> > > > Mon Jan 29 11:18:03 PST 2007  [debug] XMLToolboxManager: Loading
> > > > toolbox...
> > > > Mon Jan 29 11:18:03 PST 2007  [debug] XMLToolboxManager: Toolbox loaded.
> > > > Mon Jan 29 11:18:03 PST 2007   [info] ServletToolboxManager: Toolbox
> > > > setup complete.
> > > > Mon Jan 29 11:18:03 PST 2007   [info] VelocityViewServlet: Default
> > > > content-type is: text/html
> > > > Mon Jan 29 11:18:03 PST 2007   [info] VelocityLayoutServlet: Error
> > > > screen is 'Error.vm'
> > > > Mon Jan 29 11:18:03 PST 2007   [info] VelocityLayoutServlet: Layout
> > > > directory is './'        <scope>request</scope>
> > > > Mon Jan 29 11:18:03 PST 2007   [info] VelocityLayoutServlet: Default
> > > > layout template is 'LayoutMain.vm'
> > > > Mon Jan 29 11:18:03 PST 2007   [info] VelocityViewServlet: Custom
> > > > Properties File: /conf/velocity.properties
> > > > Mon Jan 29 11:18:03 PST 2007   [info] ServletToolboxManager: Using
> > > > config file '/conf/genericToolbox.xml'
> > > > Mon Jan 29 11:18:03 PST 2007  [debug] XMLToolboxManager: Loading
> > > > toolbox...
> > > > Mon Jan 29 11:18:03 PST 2007   [warn] ServletToolboxManager: Unknown
> > > > scope 'null' - wallet will be request scoped.
> > > > Mon Jan 29 11:18:03 PST 2007   [warn] ServletToolboxManager: Unknown
> > > > scope 'null' - map will be request scoped.
> > > > Mon Jan 29 11:18:03 PST 2007  [debug] XMLToolboxManager: Toolbox loaded.
> > > > Mon Jan 29 11:18:03 PST 2007   [info] ServletToolboxManager: Toolbox
> > > > setup complete.
> > > > Mon Jan 29 11:18:03 PST 2007   [info] VelocityViewServlet: Default
> > > > content-type is: text/html
> > > >
> > > >
> > > > When I uncomment the 'npvr' tool, the toolbox fails to load, which
> > > > breaks the web app.  It's hard for me to interpret the stack trace.  It
> > > > looks like an xml parsing error, but the XML in the config file seems
> > > > fine.  The com.myrio.qa.qas.npvr.NPVRUI class is verified to be present
> > > > along with the other classes in the WEB-INF directory.  Here's the
> > > > velocity log from when the toolbox fails to load:
> > > >
> > > > Mon Jan 29 11:28:02 PST 2007   [info] Velocimacro : initialization
> > > > complete.
> > > > Mon Jan 29 11:28:02 PST 2007   [info] Velocity successfully started.
> > > > Mon Jan 29 11:28:02 PST 2007   [info] ServletToolboxManager: Using
> > > > config file '/conf/QAStoolbox.xml'
> > > > Mon Jan 29 11:28:02 PST 2007  [debug] XMLToolboxManager: Loading
> > > > toolbox...
> > > > Mon Jan 29 11:28:02 PST 2007  [error] Problem loading toolbox
> > > > '/conf/QAStoolbox.xml' : java.lang.NullPointerException
> > > > Mon Jan 29 11:28:02 PST 2007  [error] java.lang.NullPointerException
> > > >         at
> > > > org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
> > > >         at
> > > > org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
> > > >         at
> > > > org.apache.commons.digester.Digester.endElement(Digester.java:1061)
> > > >         at
> > > > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
> > > >         at
> > > > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1241)
> > > >         at
> > > > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
> > > > $FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
> > > >         at
> > > > com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
> > > >         at
> > > > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
> > > >         at
> > > > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
> > > >         at
> > > > com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
> > > >         at
> > > > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
> > > >         at
> > > > org.apache.commons.digester.Digester.parse(Digester.java:1567)
> > > >         at
> > > > org.apache.velocity.tools.view.XMLToolboxManager.load(XMLToolboxManager.java:148)
> > > >         at
> > > > org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance(ServletToolboxManager.java:172)
> > > >         at
> > > > org.apache.velocity.tools.view.servlet.VelocityViewServlet.initToolbox(VelocityViewServlet.java:231)
> > > >         at
> > > > org.apache.velocity.tools.view.servlet.VelocityViewServlet.init(VelocityViewServlet.java:174)
> > > >         at
> > > > org.apache.velocity.tools.view.servlet.VelocityLayoutServlet.init(VelocityLayoutServlet.java:147)
> > > >         at
> > > > com.myrio.qa.qas.setup.SetupServlet.init(SetupServlet.java:24)
> > > >         at
> > > > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
> > > >         at
> > > > org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
> > > >         at
> > > > org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951)
> > > >         at
> > > > org.apache.catalina.core.StandardContext.start(StandardContext.java:4225)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
> > > >         at
> > > > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
> > > >         at
> > > > org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809)
> > > >         at
> > > > org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698)
> > > >         at
> > > > org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
> > > >         at
> > > > org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
> > > >         at
> > > > org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
> > > >         at
> > > > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
> > > >         at
> > > > org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
> > > >         at
> > > > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
> > > >         at
> > > > org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
> > > >         at
> > > > org.apache.catalina.core.StandardService.start(StandardService.java:450)
> > > >         at
> > > > org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
> > > >         at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
> > > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >         at
> > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > > >         at
> > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > > >         at java.lang.reflect.Method.invoke(Method.java:585)
> > > >         at
> > > > org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
> > > >         at
> > > > org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
> > > >
> > > >
> > > > Any suggestions appreciated.
> > > >
> > > >
> > > > Thanks!
> > > >
> > > >
> > > > -Travis
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > > _________________________________________________
> > > Scanned on 29 Jan 2007 20:34:53
> > > Scanned by Erado
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> _________________________________________________
> Scanned on 29 Jan 2007 21:20:24
> Scanned by Erado

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to