Uploaded image for project: 'Velocity Tools'
  1. Velocity Tools
  2. VELTOOLS-107

ValueParser - UnsupportedOperationException with commons-beanutils 1.8

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.0
    • GenericTools
    • None
    • commons-beanutils 1.8

    Description

      As defined in [1], VelocityTools requires commons-beanutils 1.7 as a dependency.

      But because I'm running velocity in an OSGi environment and common-beanutils is delivered as an ready-to-use OSGi bundle as of version 1.8, I've tried to run Velocity-Tools 2.0-beta2 with common-beanutils 1.8 and I'm getting the following Exception:


      java.lang.RuntimeException: java.lang.UnsupportedOperationException: ValueParser is read-only
      at org.apache.velocity.tools.ToolInfo.setProperty(ToolInfo.java:356)
      at org.apache.velocity.tools.ToolInfo.configure(ToolInfo.java:251)
      at org.apache.velocity.tools.ToolInfo.create(ToolInfo.java:232)
      at org.apache.velocity.tools.Toolbox.getFromInfo(Toolbox.java:147)
      at org.apache.velocity.tools.Toolbox.get(Toolbox.java:107)
      at org.apache.velocity.tools.ToolContext.findTool(ToolContext.java:181)
      at org.apache.velocity.tools.view.ViewToolContext.get(ViewToolContext.java:158)
      at org.apache.velocity.context.InternalContextAdapterImpl.get(InternalContextAdapterImpl.java:219)
      at org.apache.velocity.runtime.parser.node.ASTReference.getVariableValue(ASTReference.java:740)
      at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
      at org.apache.velocity.runtime.parser.node.ASTReference.evaluate(ASTReference.java:396)
      at org.apache.velocity.runtime.parser.node.ASTExpression.evaluate(ASTExpression.java:64)
      at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:86)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
      at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:88)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      at org.apache.velocity.Template.merge(Template.java:254)
      at org.apache.velocity.tools.view.VelocityLayoutServlet.mergeTemplate(VelocityLayoutServlet.java:192)
      at org.apache.velocity.tools.view.VelocityViewServlet.doRequest(VelocityViewServlet.java:228)
      at org.paxle.gui.impl.servlets.StatusView.doRequest(StatusView.java:54)
      at org.apache.velocity.tools.view.VelocityViewServlet.doGet(VelocityViewServlet.java:191)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
      at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
      at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:59)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:255)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
      at org.mortbay.jetty.Server.handle(Server.java:324)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
      Caused by: java.lang.UnsupportedOperationException: ValueParser is read-only
      at org.apache.velocity.tools.generic.ValueParser.put(ValueParser.java:537)
      at org.apache.velocity.tools.generic.ValueParser.put(ValueParser.java:45)
      at org.apache.commons.beanutils.PropertyUtilsBean.setPropertyOfMapBean(PropertyUtilsBean.java:2026)
      at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1942)
      at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:2054)
      at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:858)
      at org.apache.velocity.tools.ToolInfo.setProperty(ToolInfo.java:350) ... 40 more


      It would be fine if Velocity would work with Common Beanutils 1.8.0

      Regards,
      Martin

      [1] http://velocity.apache.org/tools/devel/dependencies.html

      Attachments

        Activity

          People

            Unassigned Unassigned
            theli Martin Thelian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: