You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Matthew Van Horn <ma...@ashleyassociates.co.jp> on 2004/02/09 10:12:35 UTC

Tools Problem

I am a total newbie to velocity, so I posted this on the Jboss list
first. 
Anyway, I am trying to get the TilesTool to work, so I can migrate my
project from jsp to Velocity. I keep seeing the following error in the
logs, and there seems to be no tools capability, even though velocity is
working somewhat.

I hope someone can point me towards the reason for this, so I can fix
the problem.

Here's the relevant part of the stack trace as far as I can tell...

2004-02-09 17:47:04,945 INFO  [org.jboss.web.localhost.Engine]  Velocity
[info] ServletToolboxManager: Using config file '/WEB-INF/toolbox.xml'
2004-02-09 17:47:04,945 INFO  [org.jboss.web.localhost.Engine]  Velocity
[debug] XMLToolboxManager: Loading toolbox... 2004-02-09 17:47:04,976
ERROR [org.apache.commons.digester.Digester] Begin event threw exception
java.lang.ClassNotFoundException: No ClassLoaders found for:
org.apache.velocity.tools.view.servlet.ServletToolInfo
	at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:161)
	at
org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.j
ava:175)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
	at
org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java
:252)
	at org.apache.commons.digester.Rule.begin(Rule.java:200)
	at
org.apache.commons.digester.Digester.startElement(Digester.java:1268)
	at
org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXPars
er.java:434)
	at
org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinde
r.java:571)
	at
org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.
java:796)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(X
MLDocumentFragmentScannerImpl.java:752)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1454)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo
cumentFragmentScannerImpl.java:333)
	at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPars
erConfiguration.java:529)
	at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPars
erConfiguration.java:585)
	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
	at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java
:1148)
	at
org.apache.commons.digester.Digester.parse(Digester.java:1562)
	at
org.apache.velocity.tools.view.XMLToolboxManager.load(XMLToolboxManager.
java:185)
	at
org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance
(ServletToolboxManager.java:210)
	at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.initToolbox(V
elocityViewServlet.java:269)
	at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.init(Velocity
ViewServlet.java:212)
	at
org.apache.velocity.tools.view.servlet.VelocityLayoutServlet.init(Veloci
tyLayoutServlet.java:185)
	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
a:935)
	at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
	at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
ava:3420)
	<snippage>
	at
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run
(AbstractDeploymentScanner.java:190)
2004-02-09 17:47:04,976 INFO  [org.jboss.web.localhost.Engine]  Velocity
[error] Problem loading toolbox '/WEB-INF/toolbox.xml' :
java.lang.ClassNotFoundException: No ClassLoaders found for:
org.apache.velocity.tools.view.servlet.ServletToolInfo
2004-02-09 17:47:04,976 INFO  [org.jboss.web.localhost.Engine]  Velocity
[error] java.lang.ClassNotFoundException: No ClassLoaders found for:
org.apache.velocity.tools.view.servlet.ServletToolInfo
	at
org.apache.commons.digester.Digester.createSAXException(Digester.java:23
83)
	at
org.apache.commons.digester.Digester.createSAXException(Digester.java:24
09)
	at
org.apache.commons.digester.Digester.startElement(Digester.java:1271)
	at
org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXPars
er.java:434)
	at
org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinde
r.java:571)
	at
org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.
java:796)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(X
MLDocumentFragmentScannerImpl.java:752)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1454)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo
cumentFragmentScannerImpl.java:333)
	at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPars
erConfiguration.java:529)
	at
org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPars
erConfiguration.java:585)
	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
	at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java
:1148)
	at
org.apache.commons.digester.Digester.parse(Digester.java:1562)
	at
org.apache.velocity.tools.view.XMLToolboxManager.load(XMLToolboxManager.
java:185)
	at
org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance
(ServletToolboxManager.java:210)
	at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.initToolbox(V
elocityViewServlet.java:269)
	at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.init(Velocity
ViewServlet.java:212)
	at
org.apache.velocity.tools.view.servlet.VelocityLayoutServlet.init(Veloci
tyLayoutServlet.java:185)
	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
a:935)
	at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
	<snippage>
	at
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run
(AbstractDeploymentScanner.java:190)


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Tools Problem

Posted by Matthew Van Horn <ma...@ashleyassociates.co.jp>.
OK - Here are the version numbers for anyone who might know what is
going on.
JDK: j2sdk1.4.2_01
JBoss:jboss-3.2.1 with integrated Tomcat-4.1.24
Velocity Tools: 1.1 beta 1
Servlet 2.3
Digester - not sure, using the jar that came w/ Struts 1.1

Below is a more detailed log from just before the error

I am wondering if the digester jar in JBoss's Tomcat service could be
causing problems. I don't know enough about JBoss classloading (yet) to
figure this out.

2004-02-10 16:08:47,513 INFO  [org.jboss.web.localhost.Engine] 
Velocity   [info] Velocity successfully started.
2004-02-10 16:08:47,518 DEBUG [org.jboss.mx.loading.UnifiedClassLoader]
New jmx UCL with url null
2004-02-10 16:08:47,526 DEBUG [org.jboss.mx.loading.UnifiedClassLoader]
New jmx UCL with url null
2004-02-10 16:08:47,539 DEBUG [org.jboss.mx.loading.UnifiedClassLoader]
New jmx UCL with url null
2004-02-10 16:08:47,546 DEBUG [org.jboss.mx.loading.UnifiedClassLoader]
New jmx UCL with url null
2004-02-10 16:08:47,553 DEBUG [org.jboss.mx.loading.UnifiedClassLoader]
New jmx UCL with url null
2004-02-10 16:08:47,562 DEBUG [org.jboss.mx.loading.UnifiedClassLoader]
New jmx UCL with url null
2004-02-10 16:08:47,569 DEBUG [org.jboss.mx.loading.UnifiedClassLoader]
New jmx UCL with url null
2004-02-10 16:08:47,574 INFO  [org.jboss.web.localhost.Engine] 
Velocity   [info] ServletToolboxManager: Using config file
'/WEB-INF/toolbox.xml'
2004-02-10 16:08:47,574 INFO  [org.jboss.web.localhost.Engine] 
Velocity  [debug] XMLToolboxManager: Loading toolbox...
2004-02-10 16:08:47,574 DEBUG [org.apache.commons.digester.Digester]
addRuleSet() with no namespace URI
2004-02-10 16:08:47,577 DEBUG [org.jboss.mx.loading.UnifiedClassLoader]
New jmx UCL with url null
2004-02-10 16:08:47,583 DEBUG [org.jboss.mx.loading.UnifiedClassLoader]
New jmx UCL with url null
2004-02-10 16:08:47,593 DEBUG [org.jboss.mx.loading.UnifiedClassLoader]
New jmx UCL with url null
2004-02-10 16:08:47,624 DEBUG [org.jboss.mx.loading.UnifiedClassLoader]
New jmx UCL with url null
2004-02-10 16:08:47,649 DEBUG [org.apache.commons.digester.Digester.sax]
setDocumentLocator(org.apache.xerces.
parsers.AbstractSAXParser$LocatorProxy@10277cd)
2004-02-10 16:08:47,649 DEBUG [org.apache.commons.digester.Digester.sax]
startDocument()
2004-02-10 16:08:47,649 DEBUG [org.apache.commons.digester.Digester.sax]
startElement(,,toolbox)
2004-02-10 16:08:47,650 DEBUG [org.apache.commons.digester.Digester]  
Pushing body text ''
2004-02-10 16:08:47,650 DEBUG [org.apache.commons.digester.Digester]  
New match='toolbox'
2004-02-10 16:08:47,650 DEBUG [org.apache.commons.digester.Digester]  
No rules found matching 'toolbox'.
2004-02-10 16:08:47,650 DEBUG [org.apache.commons.digester.Digester.sax]
characters(         )
2004-02-10 16:08:47,650 DEBUG [org.apache.commons.digester.Digester.sax]
startElement(,,tool)
2004-02-10 16:08:47,650 DEBUG [org.apache.commons.digester.Digester]  
Pushing body text '         '
2004-02-10 16:08:47,650 DEBUG [org.apache.commons.digester.Digester]  
New match='toolbox/tool'
2004-02-10 16:08:47,650 DEBUG [org.apache.commons.digester.Digester]  
Fire begin() for ObjectCreateRule[class
Name=org.apache.velocity.tools.view.servlet.ServletToolInfo,
attributeName=null]
2004-02-10 16:08:47,650 DEBUG [org.apache.commons.digester.Digester]
[ObjectCreateRule]{toolbox/tool}New org.a
pache.velocity.tools.view.servlet.ServletToolInfo
2004-02-10 16:08:47,653 ERROR [org.apache.commons.digester.Digester]
Begin event threw exception
java.lang.ClassNotFoundException: No ClassLoaders found for:
org.apache.velocity.tools.view.servlet.ServletToo
lInfo
        at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:161)
        at
org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:175)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at
org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252)
        at org.apache.commons.digester.Rule.begin(Rule.java:200)
etc. etc. same as before.

On Tue, 2004-02-10 at 09:45, Nathan Bubna wrote:
> Matthew Van Horn said:
> ...
> > I keep seeing the following error in the
> > logs, and there seems to be no tools capability, even though velocity is
> > working somewhat.
> 
> yeah, it looks like there's classloader issues when trying to load/instantiate
> tool instances.  yuck.  i've never seen a ClassNotFoundException like that
> before, and don't understand what that means.  and i've never used jboss
> either.  hmm.
> 
> so, i really don't have the expertise to debug class loader issues with jboss.
> apparently it doesn't have any problem loading other classes in the
> org.apache.velocity.tools.view.servlet package (like VelocityViewServlet), so
> i'm guessing that Digester (which appears to be trying to load/instantiate the
> ServletToolInfo class there) must be somehow involved too.
> 
> my best advice is to respond with version numbers for the products involved
> (jdk, jboss, velocity-tools, servlet api, and digester).  that at least should
> help people duplicate the problem.
> 
> also, since it's classloading issues, the problem may be influenced by where
> the various jars are kept (e.g. in a common lib for the container or in a lib
> for the application).
> 
> and that's about the limits of my knowledge here. sorry. :-(
> 
> ...
> > Here's the relevant part of the stack trace as far as I can tell...
> >
> > 2004-02-09 17:47:04,945 INFO  [org.jboss.web.localhost.Engine]  Velocity
> > [info] ServletToolboxManager: Using config file '/WEB-INF/toolbox.xml'
> > 2004-02-09 17:47:04,945 INFO  [org.jboss.web.localhost.Engine]  Velocity
> > [debug] XMLToolboxManager: Loading toolbox... 2004-02-09 17:47:04,976
> > ERROR [org.apache.commons.digester.Digester] Begin event threw exception
> > java.lang.ClassNotFoundException: No ClassLoaders found for:
> > org.apache.velocity.tools.view.servlet.ServletToolInfo
> > at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:161)
> > at
> > org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.j
> > ava:175)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> > at
> > org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java
> > :252)
> > at org.apache.commons.digester.Rule.begin(Rule.java:200)
> > at
> > org.apache.commons.digester.Digester.startElement(Digester.java:1268)
> > at
> ...
> > org.apache.commons.digester.Digester.parse(Digester.java:1562)
> > at
> > org.apache.velocity.tools.view.XMLToolboxManager.load(XMLToolboxManager.
> > java:185)
> > at
> > org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance
> > (ServletToolboxManager.java:210)
> > at
> > org.apache.velocity.tools.view.servlet.VelocityViewServlet.initToolbox(V
> > elocityViewServlet.java:269)
> > at
> ...
> > at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run
> > (AbstractDeploymentScanner.java:190)
> 
> Nathan Bubna
> nathan@esha.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
-- 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Tools Problem

Posted by "Marino A. Jonsson" <ma...@hotmail.com>.
I urge you to check out the latest version of VelocityTools from CVS - we
are probably doing a release candidate in the next few days and the
TilesTool has been modified somewhat.  It also includes some demo apps that
should give you a clue (there's one that demonstrates mixed mode too) and
improved documentation.  I know Nathan had some trouble running the apps -
although I managed to run the struts.war with Tomcat 4.0.6 and 4.1.29
straight out of the box.  Some feedback would be much appreciated.

BTW I see nothing wrong with your code sample - $tiles.get() is returning
NULL for some reason.  If the problem persists it'd be cool if you could
send me the non-working sample so I can get a crack at debugging.

cheers,
Marin�

"Matthew Van Horn" <ma...@yahoo.com> wrote in message
news:1076415446.6979.6.camel@naginata.mattvanhorn.com...
> One last question on this topic:
> The velocityStruts docs say
>
> "Using the new TilesTool it is now possible to mix Velocity and JSP
> tiles in the same page/layout. For those using Tiles, this makes gradual
> migration between or integration of the two view technologies trivially
> easy!"
>
> Now, I just can't figure out how to do this.
>
> >From my tiles-defs.xml :
> <definition name="foobarLayout" path="/foobar.vm">
> <put name="title" value="Foo Title" />
> <put name="fooTile" value="/foo.jsp" />
> </definition>
>
> my foobar.vm layout:
> $tiles.getString("title")
> $tiles.fooTile
> $tiles.get("fooTile")
>
> my output:
> Foo Title  $tiles.fooTile  $tiles.get("fooTile")
>
> if fooTile -> foo.vm everythig works, so at least the tiles tool is
> working.
>
> This is not a showstopper for me, but it could be nice to mix jsp and vm
> although I am not sure yet why I would.
>
>
> On Tue, 2004-02-10 at 17:53, Matthew Van Horn wrote:
> > I have fixed my problem by modifying the source of
> > XMLToolboxManager's load method as follows:
> >
> >     public void load(InputStream input) throws Exception
> >     {
> >         Velocity.debug("XMLToolboxManager: Loading toolbox...");
> >
> >         Digester digester = new Digester();
> >         digester.setValidating(false);
> >
> > //added this line to fix JBoss ClassLoader issue.
> > digester.setClassLoader(Thread.currentThread().getContextClassLoader());
> >
> >         digester.push(this);
> >         digester.addRuleSet(getRuleSet());
> >         digester.parse(input);
> >
> >         Velocity.debug("XMLToolboxManager: Toolbox loaded.");
> >     }
> >
> > It seems to work for me - do you see any problems with doing this?




---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Tools Problem

Posted by Matthew Van Horn <ma...@yahoo.com>.
One last question on this topic:
The velocityStruts docs say 

"Using the new TilesTool it is now possible to mix Velocity and JSP
tiles in the same page/layout. For those using Tiles, this makes gradual
migration between or integration of the two view technologies trivially
easy!"

Now, I just can't figure out how to do this. 

>>From my tiles-defs.xml :
<definition name="foobarLayout" path="/foobar.vm">
	<put name="title" value="Foo Title" />
	<put name="fooTile" value="/foo.jsp" />
</definition>

my foobar.vm layout:
$tiles.getString("title")
$tiles.fooTile
$tiles.get("fooTile")

my output:
Foo Title  $tiles.fooTile  $tiles.get("fooTile")

if fooTile -> foo.vm everythig works, so at least the tiles tool is
working. 

This is not a showstopper for me, but it could be nice to mix jsp and vm
although I am not sure yet why I would.


On Tue, 2004-02-10 at 17:53, Matthew Van Horn wrote:
> I have fixed my problem by modifying the source of 
> XMLToolboxManager's load method as follows:
> 
>     public void load(InputStream input) throws Exception
>     {
>         Velocity.debug("XMLToolboxManager: Loading toolbox...");
> 
>         Digester digester = new Digester();
>         digester.setValidating(false);
> 
> 	//added this line to fix JBoss ClassLoader issue.
> 	digester.setClassLoader(Thread.currentThread().getContextClassLoader());
> 
>         digester.push(this);
>         digester.addRuleSet(getRuleSet());
>         digester.parse(input);
> 
>         Velocity.debug("XMLToolboxManager: Toolbox loaded.");
>     }
> 
> It seems to work for me - do you see any problems with doing this?



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Tools Problem

Posted by Matthew Van Horn <ma...@yahoo.com>.
On Wed, 2004-02-11 at 04:00, Nathan Bubna wrote:
> Nathan Bubna said:
> > Matthew Van Horn said:
> is there a reason you don't just use digester.setUseContextClassLoader(true)
> instead?

Uhh... I had a head cold, and setClassLoader() appeared first in
Eclipse's context menu? 

> if there's not, would you test it for us?  as far as i can see, it should have
> the same effect, but just to be sure...

Yep, it works just fine. I'll keep it this way, as it is what I had in
mind in the first place. 

-- 
Matthew Van Horn <ma...@yahoo.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Tools Problem

Posted by Nathan Bubna <na...@esha.com>.
Nathan Bubna said:
> Matthew Van Horn said:
> > I have fixed my problem by modifying the source of
> > XMLToolboxManager's load method as follows:
...
> > //added this line to fix JBoss ClassLoader issue.
> > digester.setClassLoader(Thread.currentThread().getContextClassLoader());
...
> > It seems to work for me - do you see any problems with doing this?

is there a reason you don't just use digester.setUseContextClassLoader(true)
instead?

if there's not, would you test it for us?  as far as i can see, it should have
the same effect, but just to be sure...

Nathan Bubna
nathan@esha.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Tools Problem

Posted by Nathan Bubna <na...@esha.com>.
Matthew Van Horn said:
> I have fixed my problem by modifying the source of
> XMLToolboxManager's load method as follows:
>
>     public void load(InputStream input) throws Exception
>     {
>         Velocity.debug("XMLToolboxManager: Loading toolbox...");
>
>         Digester digester = new Digester();
>         digester.setValidating(false);
>
> //added this line to fix JBoss ClassLoader issue.
> digester.setClassLoader(Thread.currentThread().getContextClassLoader());
>
>         digester.push(this);
>         digester.addRuleSet(getRuleSet());
>         digester.parse(input);
>
>         Velocity.debug("XMLToolboxManager: Toolbox loaded.");
>     }
>
> It seems to work for me - do you see any problems with doing this?

hmm.  seems to makes sense.  i'll look into it later this week when i have
some time, but i can't think offhand how it would hurt anything.  thanks for
the [self-]help. :)

Nathan Bubna
nathan@esha.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Tools Problem

Posted by Matthew Van Horn <ma...@ashleyassociates.co.jp>.
I have fixed my problem by modifying the source of 
XMLToolboxManager's load method as follows:

    public void load(InputStream input) throws Exception
    {
        Velocity.debug("XMLToolboxManager: Loading toolbox...");

        Digester digester = new Digester();
        digester.setValidating(false);

	//added this line to fix JBoss ClassLoader issue.
	digester.setClassLoader(Thread.currentThread().getContextClassLoader());

        digester.push(this);
        digester.addRuleSet(getRuleSet());
        digester.parse(input);

        Velocity.debug("XMLToolboxManager: Toolbox loaded.");
    }

It seems to work for me - do you see any problems with doing this?



On Tue, 2004-02-10 at 09:45, Nathan Bubna wrote:
> Matthew Van Horn said:
> ...
> > I keep seeing the following error in the
> > logs, and there seems to be no tools capability, even though velocity is
> > working somewhat.
> 
> yeah, it looks like there's classloader issues when trying to load/instantiate
> tool instances.  yuck.  i've never seen a ClassNotFoundException like that
> before, and don't understand what that means.  and i've never used jboss
> either.  hmm.
> 
> so, i really don't have the expertise to debug class loader issues with jboss.
> apparently it doesn't have any problem loading other classes in the
> org.apache.velocity.tools.view.servlet package (like VelocityViewServlet), so
> i'm guessing that Digester (which appears to be trying to load/instantiate the
> ServletToolInfo class there) must be somehow involved too.
> 
> my best advice is to respond with version numbers for the products involved
> (jdk, jboss, velocity-tools, servlet api, and digester).  that at least should
> help people duplicate the problem.
> 
> also, since it's classloading issues, the problem may be influenced by where
> the various jars are kept (e.g. in a common lib for the container or in a lib
> for the application).
> 
> and that's about the limits of my knowledge here. sorry. :-(
> 
> ...
> > Here's the relevant part of the stack trace as far as I can tell...
> >
> > 2004-02-09 17:47:04,945 INFO  [org.jboss.web.localhost.Engine]  Velocity
> > [info] ServletToolboxManager: Using config file '/WEB-INF/toolbox.xml'
> > 2004-02-09 17:47:04,945 INFO  [org.jboss.web.localhost.Engine]  Velocity
> > [debug] XMLToolboxManager: Loading toolbox... 2004-02-09 17:47:04,976
> > ERROR [org.apache.commons.digester.Digester] Begin event threw exception
> > java.lang.ClassNotFoundException: No ClassLoaders found for:
> > org.apache.velocity.tools.view.servlet.ServletToolInfo
> > at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:161)
> > at
> > org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.j
> > ava:175)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> > at
> > org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java
> > :252)
> > at org.apache.commons.digester.Rule.begin(Rule.java:200)
> > at
> > org.apache.commons.digester.Digester.startElement(Digester.java:1268)
> > at
> ...
> > org.apache.commons.digester.Digester.parse(Digester.java:1562)
> > at
> > org.apache.velocity.tools.view.XMLToolboxManager.load(XMLToolboxManager.
> > java:185)
> > at
> > org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance
> > (ServletToolboxManager.java:210)
> > at
> > org.apache.velocity.tools.view.servlet.VelocityViewServlet.initToolbox(V
> > elocityViewServlet.java:269)
> > at
> ...
> > at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run
> > (AbstractDeploymentScanner.java:190)
> 
> Nathan Bubna
> nathan@esha.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
-- 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Tools Problem

Posted by Nathan Bubna <na...@esha.com>.
Matthew Van Horn said:
...
> I keep seeing the following error in the
> logs, and there seems to be no tools capability, even though velocity is
> working somewhat.

yeah, it looks like there's classloader issues when trying to load/instantiate
tool instances.  yuck.  i've never seen a ClassNotFoundException like that
before, and don't understand what that means.  and i've never used jboss
either.  hmm.

so, i really don't have the expertise to debug class loader issues with jboss.
apparently it doesn't have any problem loading other classes in the
org.apache.velocity.tools.view.servlet package (like VelocityViewServlet), so
i'm guessing that Digester (which appears to be trying to load/instantiate the
ServletToolInfo class there) must be somehow involved too.

my best advice is to respond with version numbers for the products involved
(jdk, jboss, velocity-tools, servlet api, and digester).  that at least should
help people duplicate the problem.

also, since it's classloading issues, the problem may be influenced by where
the various jars are kept (e.g. in a common lib for the container or in a lib
for the application).

and that's about the limits of my knowledge here. sorry. :-(

...
> Here's the relevant part of the stack trace as far as I can tell...
>
> 2004-02-09 17:47:04,945 INFO  [org.jboss.web.localhost.Engine]  Velocity
> [info] ServletToolboxManager: Using config file '/WEB-INF/toolbox.xml'
> 2004-02-09 17:47:04,945 INFO  [org.jboss.web.localhost.Engine]  Velocity
> [debug] XMLToolboxManager: Loading toolbox... 2004-02-09 17:47:04,976
> ERROR [org.apache.commons.digester.Digester] Begin event threw exception
> java.lang.ClassNotFoundException: No ClassLoaders found for:
> org.apache.velocity.tools.view.servlet.ServletToolInfo
> at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:161)
> at
> org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.j
> ava:175)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> at
> org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java
> :252)
> at org.apache.commons.digester.Rule.begin(Rule.java:200)
> at
> org.apache.commons.digester.Digester.startElement(Digester.java:1268)
> at
...
> org.apache.commons.digester.Digester.parse(Digester.java:1562)
> at
> org.apache.velocity.tools.view.XMLToolboxManager.load(XMLToolboxManager.
> java:185)
> at
> org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance
> (ServletToolboxManager.java:210)
> at
> org.apache.velocity.tools.view.servlet.VelocityViewServlet.initToolbox(V
> elocityViewServlet.java:269)
> at
...
> at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run
> (AbstractDeploymentScanner.java:190)

Nathan Bubna
nathan@esha.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org