You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Achim Weßling <ac...@gt-net.de> on 2007/01/29 18:16:15 UTC
encoding problems with velocity 1.4
Hallo,
I've some encoding problems using velocity 1.4. I coded the following:
context.put("test", "Wildhünherstraße 5");
As you can see I use some german-specific-characters.
I use this in the template as follows:
<!-- $test -->
<!-- Wildhühnerstraße 6 -->
The output of the html page looks like this:
<!-- Wildh�nherstra�e 5 -->
<!-- Wildhühnerstraße 6 -->
The html page has the encoding UTF-8. I use the following initialization:
Properties props = loadConfiguration(config);
// define Logging
Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
"org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
Velocity.setProperty("runtime.log.logsystem.log4j.category", logger.getName());
Velocity.setProperty("input.encoding", "UTF-8");
Velocity.setProperty("output.encoding", "UTF-8");
Velocity.setProperty("response.encoding", "UTF-8");
Velocity.init(props);
logger.info("Velocity initialized!");
Is somebody out there, how can help me? ;-)
Achim
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
migration issues (Re: NPE loading Velocity View Servlet Toolbox.)
Posted by Travis Bear <tb...@myrio.com>.
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 <tb...@myrio.com> 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 <tb...@myrio.com> 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: user-unsubscribe@velocity.apache.org
> > > > For additional commands, e-mail: user-help@velocity.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > > For additional commands, e-mail: user-help@velocity.apache.org
> > >
> > >
> > >
> > > _________________________________________________
> > > Scanned on 29 Jan 2007 20:34:53
> > > Scanned by Erado
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: user-help@velocity.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
>
> _________________________________________________
> Scanned on 29 Jan 2007 21:20:24
> Scanned by Erado
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: NPE loading Velocity View Servlet Toolbox.
Posted by Nathan Bubna <nb...@gmail.com>.
On 1/31/07, Travis Bear <tb...@myrio.com> wrote:
> I upgraded my version of velocity-tools. The the problem behavior I was
> seeing was similar with the new version. There was no NPE this time,
> but the toolbox still failed to load when that one tool was configured
> in.
>
> I traced the problem back to the fact that that one offending tool was
> throwing an unhandled IllegalStateException in its constructor. When I
> fixed this, the problem went away.
fixes are good.
> Which leads me to this question: Is this correct behavior by the
> toolbox loader? If I configure several tools into my toolbox, and one
> of them fails to load, shouldn't the toolbox soldier on, log an error,
> and go ahead and load the other components anyway?
It's debatable, to be sure. We do validate that the tool info is
present, but we don't catch any exceptions thrown by tool init. So,
if a tool blows up while we're loading the toolbox, then the toolbox
doesn't load.
I'll think about this. I'm not sure i like the idea of just logging
and moving on when there's a startup error, but i'll think about it.
There may be some way to easily offer a choice of behaviors there. If
you were to make any patches to change this, i'd definitely consider
them.
>
> 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 <tb...@myrio.com> 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 <tb...@myrio.com> 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: user-unsubscribe@velocity.apache.org
> > > > > For additional commands, e-mail: user-help@velocity.apache.org
> > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > > > For additional commands, e-mail: user-help@velocity.apache.org
> > > >
> > > >
> > > >
> > > > _________________________________________________
> > > > Scanned on 29 Jan 2007 20:34:53
> > > > Scanned by Erado
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > > For additional commands, e-mail: user-help@velocity.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: user-help@velocity.apache.org
> >
> >
> >
> > _________________________________________________
> > Scanned on 29 Jan 2007 21:20:24
> > Scanned by Erado
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: NPE loading Velocity View Servlet Toolbox.
Posted by Travis Bear <tb...@myrio.com>.
I upgraded my version of velocity-tools. The the problem behavior I was
seeing was similar with the new version. There was no NPE this time,
but the toolbox still failed to load when that one tool was configured
in.
I traced the problem back to the fact that that one offending tool was
throwing an unhandled IllegalStateException in its constructor. When I
fixed this, the problem went away.
Which leads me to this question: Is this correct behavior by the
toolbox loader? If I configure several tools into my toolbox, and one
of them fails to load, shouldn't the toolbox soldier on, log an error,
and go ahead and load the other components anyway?
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 <tb...@myrio.com> 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 <tb...@myrio.com> 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: user-unsubscribe@velocity.apache.org
> > > > For additional commands, e-mail: user-help@velocity.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > > For additional commands, e-mail: user-help@velocity.apache.org
> > >
> > >
> > >
> > > _________________________________________________
> > > Scanned on 29 Jan 2007 20:34:53
> > > Scanned by Erado
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: user-help@velocity.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
>
> _________________________________________________
> Scanned on 29 Jan 2007 21:20:24
> Scanned by Erado
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: NPE loading Velocity View Servlet Toolbox.
Posted by Nathan Bubna <nb...@gmail.com>.
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 <tb...@myrio.com> 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 <tb...@myrio.com> 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: user-unsubscribe@velocity.apache.org
> > > For additional commands, e-mail: user-help@velocity.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: user-help@velocity.apache.org
> >
> >
> >
> > _________________________________________________
> > Scanned on 29 Jan 2007 20:34:53
> > Scanned by Erado
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: NPE loading Velocity View Servlet Toolbox.
Posted by Claude Brisson <cl...@renegat.net>.
Did you check that you hadn't any other old digester.jar somewhere, for
instance in the shared libraries directory of your servlet container ? A
good test is to try to launch the webapp without any digester
in /WEB-INF/lib/ .
Claude
Le lundi 29 janvier 2007 à 12:54 -0800, Travis Bear a écrit :
> 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 <tb...@myrio.com> 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: user-unsubscribe@velocity.apache.org
> > > For additional commands, e-mail: user-help@velocity.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: user-help@velocity.apache.org
> >
> >
> >
> > _________________________________________________
> > Scanned on 29 Jan 2007 20:34:53
> > Scanned by Erado
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: NPE loading Velocity View Servlet Toolbox.
Posted by Travis Bear <tb...@myrio.com>.
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 <tb...@myrio.com> 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: user-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: user-help@velocity.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
>
> _________________________________________________
> Scanned on 29 Jan 2007 20:34:53
> Scanned by Erado
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: NPE loading Velocity View Servlet Toolbox.
Posted by Nathan Bubna <nb...@gmail.com>.
what versions of VelocityTools and Digester are you using?
On 1/29/07, Travis Bear <tb...@myrio.com> 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: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
NPE loading Velocity View Servlet Toolbox.
Posted by Travis Bear <tb...@myrio.com>.
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: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
AW: encoding problems with velocity 1.4
Posted by Konstantin Breu <Ko...@gmx.net>.
You could try
context.put("test", "Wildh\u00FCnherstra\u00DFe 5");
(to make sure that it's not caused by a wrong interpretaion of the international chars in the java sources)
I use Velocity in an UTF-8 based web application without any problems...
-----Ursprüngliche Nachricht-----
Von: Achim Weßling [mailto:achim.wessling@gt-net.de]
Gesendet: Montag, 29. Januar 2007 18:16
An: user@velocity.apache.org
Betreff: encoding problems with velocity 1.4
Hallo,
I've some encoding problems using velocity 1.4. I coded the following:
context.put("test", "Wildhünherstraße 5");
As you can see I use some german-specific-characters.
I use this in the template as follows:
<!-- $test -->
<!-- Wildhühnerstraße 6 -->
The output of the html page looks like this:
<!-- Wildh�nherstra�e 5 -->
<!-- Wildhühnerstraße 6 -->
The html page has the encoding UTF-8. I use the following initialization:
Properties props = loadConfiguration(config);
// define Logging
Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
"org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
Velocity.setProperty("runtime.log.logsystem.log4j.category", logger.getName());
Velocity.setProperty("input.encoding", "UTF-8");
Velocity.setProperty("output.encoding", "UTF-8");
Velocity.setProperty("response.encoding", "UTF-8");
Velocity.init(props);
logger.info("Velocity initialized!");
Is somebody out there, how can help me? ;-)
Achim
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: encoding problems with velocity 1.4
Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Achim =?ISO-8859-1?Q?We=DFling?= <ac...@gt-net.de> writes:
>Hallo,
>I've some encoding problems using velocity 1.4. I coded the following:
>context.put("test", "Wildhünherstraße 5");
You probably have a source encoding problem. That is not really a
Velocity but a Java problem.
If you are using Java 1.4 or later, add
-encoding UTF-8 to your javac command line or 'encoding="UTF-8"' to
your <javac> task in ant.
Also make sure that your source code *is* UTF-8 encoded. If you are
using ISO encoding, you can substitute UTF-8 with ISO-8859-1 (though
that is not recommended).
Or you can (as suggested) use the \uxxxx escaping for your umlauts.
Best regards
Henning
--
Henning P. Schmiedehausen -- hps@intermeta.de | J2EE, Linux,
91054 Buckenhof, Germany -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy
"Save the cheerleader. Save the world."
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org