Uploaded image for project: 'Commons Jelly'
  1. Commons Jelly
  2. JELLY-189

null pointer exception when executing a script that exist only in memory

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.0
    • Component/s: core / taglib.core
    • Labels:
      None
    • Environment:

      ibm websphere

      Description

      When executing a script that exist only in memory, Jelly throws a NullPointerException at org.apache.commons.jelly.JellyContext.getJellyContextURL(JellyContext.java:947)

      This code will fail even if the StringBuffer passed in is a valid jelly script.

      public void exectute(StringBuffer message) {
      OutputStream output = new ByteArrayOutputStream();
      try

      { XMLOutput xmlOutput =XMLOutput.createXMLOutput(output); InputSource script = new InputSource( new StringReader(message.toString()) ); JellyContext context = new JellyContext(); context.runScript( script, xmlOutput); xmlOutput.flush(); }

      catch (Exception e)

      { e.printStackTrace(); }

      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jeffg Jeff Gregory
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: