You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by ro...@yahoo.com on 2002/05/16 13:46:38 UTC

velocimacro.context.localscope crashes

hi,

am trying to set "local" vars in velocity
but when doing so by setting the properties
of the context-object. velocity crashes.
any ideas.

heres the resulting trace
>>>
java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:375)
        at
org.apache.commons.collections.ExtendedProperties.addPropertyDirect(Extended
Properties.java:683)
        at
org.apache.commons.collections.ExtendedProperties.addProperty(ExtendedProper
ties.java:657)
        at
org.apache.commons.collections.ExtendedProperties.setProperty(ExtendedProper
ties.java:746)
        at
org.apache.commons.collections.ExtendedProperties.convertProperties(Extended
Properties.java:1872)
        at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:440)
        at
org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:260)
        at org.apache.velocity.app.Velocity.init(Velocity.java:149)
>>>

and thats the java-soruce:
>>>
    private Properties getProperties()
    {
        Properties props = new Properties();
        props.put("file.resource.loader.path",
"c:/data/develop/typelib/jemitter");
        props.put("velocimacro.library", getMacros());
        props.put("velocimacro.context.localscope", Boolean.TRUE);
        //LOGGER.log(Level.INFO, getMacros());
        return props;
    }

...
      Properties props = getProperties();
      Velocity.init(props);
...
>>>

ciao robertj

------------------------------------------------------------
Robert Kuzelj
Gaissacherstrasse 7           email: robert_kuzelj@yahoo.com
81371 Muenchen                tel:   0177/5302230

the trinity of desirables of (software) architecture:
Firmitas, Utilitas, Venustas (marcus vitruvius 20 BC)
strength, utility, beauty



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


[reprise] velocimacro.context.localscope crashes

Posted by ro...@yahoo.com.
hi geir,

did you find anything about this velocimacro-crash?

here once again the possibly shortest jython script
that creates this error

>>> from java.util import Properties
>>> from java.lang import Boolean
>>> from org.apache.velocity.app import Velocity
>>>
>>> props = Properties()
>>> props.put("velocimacro.context.localscope", Boolean.TRUE)
>>>
>>> Velocity.init(props)
Traceback (innermost last):
  File "<console>", line 1, in ?
java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:375)
        at
org.apache.commons.collections.ExtendedProperties.addPropertyDirect(Extended
Properties.java:683)
        at
org.apache.commons.collections.ExtendedProperties.addProperty(ExtendedProper
ties.java:657)
        at
org.apache.commons.collections.ExtendedProperties.setProperty(ExtendedProper
ties.java:746)
        at
org.apache.commons.collections.ExtendedProperties.convertProperties(Extended
Properties.java:1872)
        at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:440)
        at
org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:260)
        at org.apache.velocity.app.Velocity.init(Velocity.java:149)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
        at
org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
        at org.python.core.PyObject.__call__(PyObject.java)
        at org.python.core.PyObject.invoke(PyObject.java)
        at org.python.pycode._pyx8.f$0(<console>:1)
        at org.python.pycode._pyx8.call_function(<console>)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyCode.call(PyCode.java)
        at org.python.core.Py.runCode(Py.java)
        at org.python.core.Py.exec(Py.java)
        at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
        at
org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java)
        at
org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java
)
        at
org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java
)
        at org.python.util.InteractiveConsole.push(InteractiveConsole.java)
        at
org.python.util.InteractiveConsole.interact(InteractiveConsole.java)
        at org.python.util.jython.main(jython.java)

java.lang.NullPointerException: java.lang.NullPointerException
>>>

any ideas?

tia

ciao robertj
------------------------------------------------------------
Robert Kuzelj
Gaissacherstrasse 7           email: robert_kuzelj@yahoo.com
81371 Muenchen                tel:   0177/5302230

the trinity of desirables of (software) architecture:
Firmitas, Utilitas, Venustas (marcus vitruvius 20 BC)
strength, utility, beauty

----- Original Message -----
From: <ro...@yahoo.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Thursday, May 16, 2002 2:28 PM
Subject: Re: velocimacro.context.localscope crashes


> hi,
>
> > This is interesting.  It's crashing in java.util.Hashtable??  What does
> > 'getMacros()' return?
> a string containing a list of macro-files to be included.
> but this is not the reason of this error. only excluding the line
>
>    props.put("velocimacro.context.localscope", Boolean.TRUE);
>
> helps.
>
> ciao robertj
>
>
>
> ------------------------------------------------------------
> Robert Kuzelj
> Gaissacherstrasse 7           email: robert_kuzelj@yahoo.com
> 81371 Muenchen                tel:   0177/5302230
>
> the trinity of desirables of (software) architecture:
> Firmitas, Utilitas, Venustas (marcus vitruvius 20 BC)
> strength, utility, beauty
>
> ----- Original Message -----
> From: "Geir Magnusson Jr." <ge...@optonline.net>
> To: <ve...@jakarta.apache.org>
> Sent: Thursday, May 16, 2002 1:56 PM
> Subject: Re: velocimacro.context.localscope crashes
>
>
> > On 5/16/02 7:46 AM, "robert_kuzelj@yahoo.com" <ro...@yahoo.com>
> > wrote:
> >
> > > hi,
> > >
> > > am trying to set "local" vars in velocity
> > > but when doing so by setting the properties
> > > of the context-object. velocity crashes.
> > > any ideas.
> > >
> > > heres the resulting trace
> > >>>>
> > > java.lang.NullPointerException
> > >       at java.util.Hashtable.put(Hashtable.java:375)
> > >       at
> > >
>
org.apache.commons.collections.ExtendedProperties.addPropertyDirect(Extended
> > > Properties.java:683)
> > >       at
> > >
>
org.apache.commons.collections.ExtendedProperties.addProperty(ExtendedProper
> > > ties.java:657)
> > >       at
> > >
>
org.apache.commons.collections.ExtendedProperties.setProperty(ExtendedProper
> > > ties.java:746)
> > >       at
> > >
>
org.apache.commons.collections.ExtendedProperties.convertProperties(Extended
> > > Properties.java:1872)
> >
> > This is interesting.  It's crashing in java.util.Hashtable??  What does
> > 'getMacros()' return?
> >
> > --
> > Geir Magnusson Jr.
> > Research & Development, Adeptra Inc.
> > geirm@adeptra.com
> > +1-203-247-1713
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: velocimacro.context.localscope crashes

Posted by ro...@yahoo.com.
hi,

> This is interesting.  It's crashing in java.util.Hashtable??  What does
> 'getMacros()' return?
a string containing a list of macro-files to be included.
but this is not the reason of this error. only excluding the line

   props.put("velocimacro.context.localscope", Boolean.TRUE);

helps.

ciao robertj



------------------------------------------------------------
Robert Kuzelj
Gaissacherstrasse 7           email: robert_kuzelj@yahoo.com
81371 Muenchen                tel:   0177/5302230

the trinity of desirables of (software) architecture:
Firmitas, Utilitas, Venustas (marcus vitruvius 20 BC)
strength, utility, beauty

----- Original Message -----
From: "Geir Magnusson Jr." <ge...@optonline.net>
To: <ve...@jakarta.apache.org>
Sent: Thursday, May 16, 2002 1:56 PM
Subject: Re: velocimacro.context.localscope crashes


> On 5/16/02 7:46 AM, "robert_kuzelj@yahoo.com" <ro...@yahoo.com>
> wrote:
>
> > hi,
> >
> > am trying to set "local" vars in velocity
> > but when doing so by setting the properties
> > of the context-object. velocity crashes.
> > any ideas.
> >
> > heres the resulting trace
> >>>>
> > java.lang.NullPointerException
> >       at java.util.Hashtable.put(Hashtable.java:375)
> >       at
> >
org.apache.commons.collections.ExtendedProperties.addPropertyDirect(Extended
> > Properties.java:683)
> >       at
> >
org.apache.commons.collections.ExtendedProperties.addProperty(ExtendedProper
> > ties.java:657)
> >       at
> >
org.apache.commons.collections.ExtendedProperties.setProperty(ExtendedProper
> > ties.java:746)
> >       at
> >
org.apache.commons.collections.ExtendedProperties.convertProperties(Extended
> > Properties.java:1872)
>
> This is interesting.  It's crashing in java.util.Hashtable??  What does
> 'getMacros()' return?
>
> --
> Geir Magnusson Jr.
> Research & Development, Adeptra Inc.
> geirm@adeptra.com
> +1-203-247-1713
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: velocimacro.context.localscope crashes

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 5/16/02 7:46 AM, "robert_kuzelj@yahoo.com" <ro...@yahoo.com>
wrote:

> hi,
> 
> am trying to set "local" vars in velocity
> but when doing so by setting the properties
> of the context-object. velocity crashes.
> any ideas.
> 
> heres the resulting trace
>>>> 
> java.lang.NullPointerException
>       at java.util.Hashtable.put(Hashtable.java:375)
>       at
> org.apache.commons.collections.ExtendedProperties.addPropertyDirect(Extended
> Properties.java:683)
>       at
> org.apache.commons.collections.ExtendedProperties.addProperty(ExtendedProper
> ties.java:657)
>       at
> org.apache.commons.collections.ExtendedProperties.setProperty(ExtendedProper
> ties.java:746)
>       at
> org.apache.commons.collections.ExtendedProperties.convertProperties(Extended
> Properties.java:1872)

This is interesting.  It's crashing in java.util.Hashtable??  What does
'getMacros()' return?

-- 
Geir Magnusson Jr.
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>