You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Yura Ushakhow <yu...@excimer.ru> on 2002/11/09 15:52:44 UTC
"Class not found" and logging
Hi. For hours I can't figure what is wrong here...
I have a VelocityServlet which is similar to the 2nd example. Trying to
run it, Tomcat says:
javax.servlet.ServletException: Error initializing Velocity:
java.lang.ClassNotFoundException:
org/apache/velocity/runtime/log/AvalonLogSystem,org/apache/velocity/runtime/log/SimpleLog4JLogSystem
at
org.apache.velocity.servlet.VelocityServlet.initVelocity(VelocityServlet.java:236)
at
org.apache.velocity.servlet.VelocityServlet.init(VelocityServlet.java:198)
...and so on.
Velocity version is 1.3.1-rc2, Tomcat 4.1.12, J2SE 1.4.0_02.
web.xml has this entry:
<init-param>
<param-name>properties</param-name>
<param-value>/WEB-INF/velocity.properties</param-value>
</init-param>
and velocity.properties has this:
file.resource.loader.path = /WEB-INF/templates
runtime.log = /WEB-INF/velocity.log
Any tips..?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: "Class not found" and logging
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Monday, November 11, 2002, at 01:17 AM, Yura Ushakhow wrote:
>> > jar's file and in 1.4-dev package. I fixed the file and everything
>> > runs well. Tested my first VelocityServlet to-day. Much thanks. :)
>>
>> What do you mean 'fixed'? Nothing should have to be changed.
>
> Geir,
>
> I changed the CSV in o/a/v/runtime/defaults/velocity.properties - left
> only one logging module. Otherwise, neither 1.4-dev nor 1.3.1-rc2
> wants to understand the comma.
Somethings wrong then. You should not have to change anything...
--
Geir Magnusson Jr 203-355-2219(w)
Adeptra, Inc. 203-247-1713(m)
geirm@adeptra.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: "Class not found" and logging
Posted by Yura Ushakhow <yu...@excimer.ru>.
> > jar's file and in 1.4-dev package. I fixed the file and everything
> > runs well. Tested my first VelocityServlet to-day. Much thanks. :)
>
> What do you mean 'fixed'? Nothing should have to be changed.
Geir,
I changed the CSV in o/a/v/runtime/defaults/velocity.properties - left
only one logging module. Otherwise, neither 1.4-dev nor 1.3.1-rc2 wants
to understand the comma.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: "Class not found" and logging
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Sunday, November 10, 2002, at 10:45 AM, Yura Ushakhow wrote:
>
>
> Geir,
>
> I've finally solved my problem. It was indeed due to the default
> properties file located in the jar. It (the CSV thing which caused all
> confusion) appears to be both in newly downloaded 1.3.1-rc2 version
> jar's file and in 1.4-dev package. I fixed the file and everything
> runs well. Tested my first VelocityServlet to-day. Much thanks. :)
What do you mean 'fixed'? Nothing should have to be changed.
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
--
Geir Magnusson Jr
203-355-2219(w)
Adeptra, Inc.
203-247-1713(m)
geirm@adeptra.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: "Class not found" and logging
Posted by Yura Ushakhow <yu...@excimer.ru>.
Geir,
I've finally solved my problem. It was indeed due to the default
properties file located in the jar. It (the CSV thing which caused all
confusion) appears to be both in newly downloaded 1.3.1-rc2 version
jar's file and in 1.4-dev package. I fixed the file and everything runs
well. Tested my first VelocityServlet to-day. Much thanks. :)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: "Class not found" and logging
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Sunday, November 10, 2002, at 01:38 AM, Yura Ushakhow wrote:
> Geir,
>
> Thanks for your answer. I suspect this might be not my case. For test,
> I
> placed all build/lib/*jar files into my WEB-INF/lib/ (except commons
> and servlet), without visible result.
>
You are right - I didn't look closely enough at the error.
> What worries me is the error message:
>
> java.lang.ClassNotFoundException:
> org/apache/velocity/runtime/log/AvalonLogSystem,
> org/apache/velocity/runtime/log/SimpleLog4JLogSystem
>
> It cannot find org.apache.velocity.runtime.log.* , and looking
> inside the velocity*jar file, those classes are there.
>
> I've also been told by somebody that the error may be in some
> mysterious "properties" files, where those two classes are listed with
> comma, which is pure syntactical error.
>
> Unfortunately, I cannot find where or what it might be. :(
Yes - in recent versions of Velocity - I don't remember when it showed
up - we let velocity automatically find either logkit or log4j to be
the logger. In the default properties file, contained in the vel jar,
we define the property runtime.log.logsystem.class to be o.a.v.r.lALS,
o.a.v.r.SL4JLS, so then Velocity will try one, then the other.
It almost sounds like you have a velocity jar with that default
properties file, but the code that's executing is older, and doesn't
know what to do with the comma-separated value.
Or the version of collections doesn't know how to deal with the comma,
which I doubt, as collections has done that for a long time.
Can you start clean - use only the latest v1.3-rc2, remove all jars
from WEB-INF/lib that you put in from build/lib, and just use the -dep
jar from the 1.3-rc2 disto?
--
Geir Magnusson Jr
203-355-2219(w)
Adeptra, Inc.
203-247-1713(m)
geirm@adeptra.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: "Class not found" and logging
Posted by Yura Ushakhow <yu...@excimer.ru>.
Geir,
Thanks for your answer. I suspect this might be not my case. For test, I
placed all build/lib/*jar files into my WEB-INF/lib/ (except commons and
servlet), without visible result.
What worries me is the error message:
java.lang.ClassNotFoundException:
org/apache/velocity/runtime/log/AvalonLogSystem,
org/apache/velocity/runtime/log/SimpleLog4JLogSystem
It cannot find org.apache.velocity.runtime.log.* , and looking
inside the velocity*jar file, those classes are there.
I've also been told by somebody that the error may be in some mysterious
"properties" files, where those two classes are listed with comma, which
is pure syntactical error.
Unfortunately, I cannot find where or what it might be. :(
-Yura.
Geir Magnusson Jr. wrote:
> Easy - we produce two jars in our distro, one with "-deps" in the
> filename, and one w/o. The README notes that the one w/o requires you
> to include the dependencies when you deploy velocity, and the one w/
> is for lazy people (like me) who are happy w/ what comes in Velocity
> and don't need to avoid clashing with over versions of the same packages.
>
> We include the versions of the code in the -dep jar in the build/lib
> directory if you just want to drop the dependencies into your
> webapp/classpath.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: "Class not found" and logging
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Saturday, November 9, 2002, at 09:52 AM, Yura Ushakhow wrote:
> Hi. For hours I can't figure what is wrong here...
>
> I have a VelocityServlet which is similar to the 2nd example. Trying
> to run it, Tomcat says:
>
> javax.servlet.ServletException: Error initializing Velocity:
> java.lang.ClassNotFoundException:
> org/apache/velocity/runtime/log/AvalonLogSystem,org/apache/velocity/
> runtime/log/SimpleLog4JLogSystem
> at
> org.apache.velocity.servlet.VelocityServlet.initVelocity(VelocityServle
> t.java:236)
> at
> org.apache.velocity.servlet.VelocityServlet.init(VelocityServlet.java:1
> 98)
>
> ...and so on.
>
Easy - we produce two jars in our distro, one with "-deps" in the
filename, and one w/o. The README notes that the one w/o requires you
to include the dependencies when you deploy velocity, and the one w/ is
for lazy people (like me) who are happy w/ what comes in Velocity and
don't need to avoid clashing with over versions of the same packages.
We include the versions of the code in the -dep jar in the build/lib
directory if you just want to drop the dependencies into your
webapp/classpath.
geir
> Velocity version is 1.3.1-rc2, Tomcat 4.1.12, J2SE 1.4.0_02.
> web.xml has this entry:
> <init-param>
> <param-name>properties</param-name>
> <param-value>/WEB-INF/velocity.properties</param-value>
> </init-param>
>
> and velocity.properties has this:
> file.resource.loader.path = /WEB-INF/templates
> runtime.log = /WEB-INF/velocity.log
>
> Any tips..?
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
--
Geir Magnusson Jr
203-355-2219(w)
Adeptra, Inc.
203-247-1713(m)
geirm@adeptra.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>