On 5/16/07, Claude Brisson <[EMAIL PROTECTED]> wrote:
Le mercredi 16 mai 2007 à 15:41 -0700, Nathan Bubna a écrit :
> i don't know if anyone else has taken the time to try out Tools 2.x or
> cares about it yet, but i thought i'd give an update anyway...

For now I just followed your updates. I'll try them soon (as soon as
I'll end up fighting with maven 2...). I am positively impressed by your
work, btw.

thanks :)

> [...]
> As this is a significant milestone, i thought i'd ask if anyone is
> interested in having an alpha release or milestone build.  I'd love to
> get some feedback on the progress so far, as well as the backwards
> compatibility of things.  Would that help lower the barrier for some
> of you to try it out?

I just tried a drop-in replacement, just to see what would happen. It
failed in my case due to the fact that the ViewTool interface
disappeared - after all the efforts you made to reach BC we should
probably put it back, as deprecated...

hmm.  it's already deprecated and useless as of the 1.3 release.  it
should be trivial to remove reference to it.  that's all you need to
do...

I'm too drunk tonight (an
official site release at work...) to commit anything but after having
added it back, I got :

[01:42:42.321]  Velocity  [debug] Loading configuration from: 
/WEB-INF/toolbox.xml
[01:42:42.364]  Velocity  [trace] Searching for configuration at: 
/WEB-INF/tools.xml
[01:42:42.366]  Velocity  [debug] Could not find file at: /WEB-INF/tools.xml

(shouldn't the library FIRST search for tools.xml THEN for toolbox.xml if 
tools.xml wasn't found?)

no.  newer should override older.  since a tools.xml should always be
the newest configuration file, it should have the opportunity to
override any tool/toolbox/data definitions configured in the old
toolbox.xml.

[01:42:42.498] java.lang.NoClassDefFoundError: 
org/apache/struts/action/ActionForm

(I don't use any struts, only jar.view... where does this reference to struts 
come from?)

ah, this is interesting.  i'm guessing you were actually using the
full velocity-tools jar, not just the velocity-tools-view jar.   if
you are sure you were using the velocity-tools-view jar, then i'll
have to try it myself.  this shouldn't have happened for that.

anyway, assuming my guess is correct, here's the explanation: since
VelocityView will now load all available tools by default, it is
trying to load the VelocityStruts tools.  during the load process, we
still create an instance to be sure (as early as possible) that we are
able to do so.  so, when it tries to create a struts tool instance,
the VM is trying to load all the classes that tool needs.  since you
don't have the struts dependencies on the classpath, that fails.

i'll have to think of a way to fail more gracefully (or perhaps just
log an error) when this happens.

in the meantime, you can add an init param to your VVS declaration in
your web.xml with the name:

org.apache.velocity.tools.suppressDefaults

and the value of:

true

that will let you get past this error and continue testing...

[01:42:42.498]  at java.lang.Class.getDeclaredMethods0(Native Method)
[01:42:42.498]  at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
[01:42:42.498]  at java.lang.Class.getMethod0(Class.java:2670)
[01:42:42.498]  at java.lang.Class.getMethod(Class.java:1603)
[01:42:42.498]  at 
org.apache.velocity.tools.config.ToolConfiguration.isOldTool(ToolConfiguration.java:134)
[01:42:42.498]  at 
org.apache.velocity.tools.config.ToolConfiguration.toString(ToolConfiguration.java:205)
[01:42:42.498]  at java.lang.String.valueOf(String.java:2827)
[01:42:42.498]  at java.lang.StringBuilder.append(StringBuilder.java:115)
[01:42:42.498]  at 
org.apache.velocity.tools.config.CompoundConfiguration.appendChildren(CompoundConfiguration.java:106)
[01:42:42.498]  at 
org.apache.velocity.tools.config.ToolboxConfiguration.toString(ToolboxConfiguration.java:154)
[01:42:42.498]  at java.lang.String.valueOf(String.java:2827)
[01:42:42.498]  at java.lang.StringBuilder.append(StringBuilder.java:115)
[01:42:42.498]  at 
org.apache.velocity.tools.config.CompoundConfiguration.appendChildren(CompoundConfiguration.java:106)
[01:42:42.498]  at 
org.apache.velocity.tools.config.FactoryConfiguration.toString(FactoryConfiguration.java:130)
[01:42:42.498]  at java.lang.String.valueOf(String.java:2827)
[01:42:42.498]  at java.lang.StringBuilder.append(StringBuilder.java:115)
[01:42:42.498]  at 
org.apache.velocity.tools.view.VelocityView.configure(VelocityView.java:496)
[01:42:42.498]  at 
org.apache.velocity.tools.view.VelocityView.init(VelocityView.java:356)
[01:42:42.498]  at 
org.apache.velocity.tools.view.VelocityView.init(VelocityView.java:291)
[01:42:42.498]  at 
org.apache.velocity.tools.view.VelocityView.<init>(VelocityView.java:189)
[01:42:42.498]  at 
org.apache.velocity.tools.view.VelocityView.<init>(VelocityView.java:181)
[01:42:42.498]  at 
org.apache.velocity.tools.view.ServletUtils.getVelocityView(ServletUtils.java:80)
[01:42:42.498]  at 
org.apache.velocity.tools.view.VelocityViewServlet.init(VelocityViewServlet.java:102)

If you need any custom debug log to investigate this, just ask!


  Claude



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



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

Reply via email to