Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tigerstripe-users] Velocity classloader error"java.lang.NoClassDefFoundError: org/apache/log/format/Formatter"

Hi Kalyan,

Glad to hear you were able to make progress!

Configuring the logger properly seems indeed like a must. I confirm that we
are not doing anything about the logger (it looks like you found the right
spot in the code).

Would you mind creating a bugzilla entry for this (probably cut-n-paste your
reponse below as the content)? We will do a bit of investigation and will
try to include this. The bugzilla will make it easier to track.

Thanks,
Eric


On 5/9/08 6:18 AM, "KV" <kalyan.abbaraju@xxxxxxxxx> wrote:

> Hi Steve/Eric,
> 
>  Thanks for the replies.
> Sorry, I was in a travel and could not check the mails.
> I noticed that I have some problems with velocity macros (not all of
> Iext are replaced and also Expander seems to be internal now. So, I
> have to change the templates a bit).
> The code generation is successful now.
> I am also doing with a freshly installed eclipse.
> But it looks like when ever there is a problem with velocity templates
> this error is appearing as default velocity.properties is referring to
> unavailable logger. This is not fatal to generation but it dumps error
> in velocity.log
> 
> I have request on the logger whether we can customize the same. I need
> to have all logs under specified directory (including velocity.log).
> Is there any possibility to provide this via "preferences" window?
> Here is some info from velocity that helps with this.
> http://velocity.apache.org/engine/releases/velocity-1.5/developer-guide.html#v
> elocity_configuration_keys_and_values
> http://velocity.apache.org/engine/releases/velocity-1.5/developer-guide.html#c
> onfiguring_logging
> 
> I checked part of tigerstipe source and found that only classpath and
> resourceloaders seem to be customized for velocity. It would be useful
> if the logger can be customizable too. Please let me know if this
> sounds feasible.
> 
> Thanks & Regards
> Kalyan
> 
> On Wed, May 7, 2008 at 7:37 PM, Steve Jerman (stjerman)
> <stjerman@xxxxxxxxx> wrote:
>> You also might want to use a fresh install of Eclipse. As Eric says we
>> have never run into this problem. I wonder - what version of Eclipse are
>> you using and do you have any other 'special' plugins installed? I
>> wonder if it is a conflict with something else.
>> 
>> Steve
>> 
>> -----Original Message-----
>> From: tigerstripe-users-bounces@xxxxxxxxxxx
>> [mailto:tigerstripe-users-bounces@xxxxxxxxxxx] On Behalf Of KV
>> Sent: Tuesday, May 06, 2008 5:29 PM
>> To: Tigerstripe Users list
>> Subject: Re: [tigerstripe-users] Velocity classloader
>> error"java.lang.NoClassDefFoundError: org/apache/log/format/Formatter"
>> 
>> Eric,
>> 
>> I logged a request in bugzilla.
>> I tried already with a clean workspace. I am planning to do it again and
>> i will update on this.
>> 
>> - Kalyan
>> 
>> On Wed, May 7, 2008 at 12:39 AM, Eric Dillon <erdillon@xxxxxxxxx> wrote:
>>> I am still confused. Why is it that you are running into this error,
>>> when we  don't. We have been using this for close to a year in
>> production at Cisco...
>>>  And didn't encounter that problem, although both our models and
>>> generation  plugins are quite involved.
>>> 
>>>  How about starting from scratch? Have you tried to use a clean
>>> workspace,  new project, simple template to isolate this issue?
>>> 
>>>  The Velocity-1.5.jar that we include in the plugins is straight
>>> out-of-the-box from the Apache velocity site (we can distribute the
>>> binary  without touching it. Distributing a modified version would
>>> need to be  reviewed by Eclipse Legal). We haven't had to change any
>>> of the default  settings yet to my best knowledge.
>>> 
>>>  Dumping the classpath of a generation plugin is certainly an option.
>>> Would  you mind logging this as bug in Bugzilla? I could add this in
>>> the code so  you could pick it up from a nightly build if that helps?
>>> 
>>>  Eric
>>> 
>>> 
>>> 
>>>  On 5/6/08 4:21 PM, "KV" <kalyan.abbaraju@xxxxxxxxx> wrote:
>>> 
>>>> Hi Eric,
>>>> 
>>> 
>>> 
>>>> Thanks for the details. I got a picture on the lib directory.
>>>> As you suggested I tried to add this Avalon logging jar to my
>>> plug-in  > dependency list velocity did not pick up. May be I have
>>> done some  > thing wrong. I still have to check on this.
>>>> 
>>>>> From the stack trace, class loading seems to be failing in  >
>>> VelocityEngine.init() itself. I do not think macro execution started
>>>>  at all. But to confirm it I am trying to debug it further.
>>>>  Based on velocity manuals (links below) and velocity-1.5 source
>>> code,  >  the default value for the log class is Apache Avalon. since
>>> the  >  relevant jar is not present velocity initialization is
>> failing.
>>>> 
>>>> 
>>> http://velocity.apache.org/engine/releases/velocity-1.5/developer-guid
>>> e.html#v  > elocity_configuration_keys_and_values
>>>> 
>>>> 
>>> http://velocity.apache.org/engine/releases/velocity-1.5/developer-guid
>>> e.html#c
>>>> onfiguring_logging
>>>> 
>>>>  For your reference, here is the content from  >  >
>>> velocity-1.5\src\java\org\apache\velocity\runtime\defaults\velocity.pr
>>> operties
>>>>  runtime.log.logsystem.class =
>>>> 
>>>> 
>>> org.apache.velocity.runtime.log.AvalonLogChute,org.apache.velocity.run
>>> time.log  > .Log4JLogChute,org.apache.velocity.runtime.log.JdkLogChute
>>>>  runtime.log = velocity.log
>>>> 
>>>>   I have some more questions:
>>>>   - Based on the above information is there any possibility of
>>>> changing run time logger for velocity in tigerstripe? At least can
>>> it  > be a
>>>>   minor requirement for future releases?
>>>>   - Is there any way to dump the classpath in tigerstipe.log or
>> some
>>>>   other log during the plugin generation?
>>>> 
>>>>   Regards
>>>>   Kalyan
>>>> 
>>>> 
>>>>>  On Tue, May 6, 2008 at 11:03 PM, Eric Dillon <erdillon@xxxxxxxxx>
>> wrote:
>>>>>> Hi Kalyan,
>>>>>> 
>>>>>>  See my comments/responses inline.
>>>>>> 
>>>>>>  Still, I'm surprise we haven't run into this here. Are you able
>>> to figure  >>>  out what is the trigger of all this in the velocity
>> templates you're using?
>>>>>> 
>>>>>>  Eric
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>  On 5/6/08 2:52 PM, "KV" <kalyan.abbaraju@xxxxxxxxx> wrote:
>>>>>> 
>>>>>>> Hi Eric,
>>>>>>> 
>>>>>>> Yes. The generation is completely failing. I did ensure that I
>>> am  >>>> using only one velocity jar file.
>>>>>>> And also I have posted this question in velocity users list
>>> also. But  >>>> at the moment i did not get any new answer. I am
>>> currently planning to  >>>> check the following two options.
>>>>>>> 
>>>>>>> 1) Include the relevant jar
>>>>>>> I checked for the class "org/apache/log/format/Formatter" and I
>>> found  >>>> it in avalon-logkit-current.jar from apache.
>>>>>>> I downloaded this jar and copied to tigerstripe/lib directory to
>> 
>>>>>>> verify it works. But no luck.
>>>>>>  Well, the tigerstripe/lib is only used when running Tigerstripe
>>> headless  >>>  (i.e. Outside of the IDE from Maven e.g.). So if you
>>> added the .jar there  >>> it  >>>  would not have been picked up.
>>>>>>  You want to package it with your generation plugin as an
>>> additional  >>>  classpath entry. This way the content of the .jar is
>>> going to be available  >>>  to velocity at runtime. To do so, copy it
>> in your generation project.
>>>>>>  Open the ts-plugin.xml and on the "runtime" tab, add the .jar as
>> 
>>> a  >>> classpath  >>>  entry. Save the ts-plugin.xml file.
>>>>>> 
>>>>>>  Try to re-deploy and run.
>>>>>> 
>>>>>> 
>>>>>>> 
>>>>>>> 2) Check with velocity if another log instance can be used. for
>>> example  >>>> log4j.
>>>>>>> At the moment i am working on this. I can update you once I am
>>>>>>> successful in this.
>>>>>>> 
>>>>>>> But I would like to understand the relevance of tigerstripe/lib
>> 
>>>>>>> directory under eclipse? Can you please enlighten me under what
>>>>>>> circumstances  I can use this directory?
>>>>>>> Also if you have any other suggestions it would help me a lot.
>>>>>>  As mentioned above, this tigerstripe/lib is only relevant when
>>> running  >>>  headless. Any .jar that needs to be visible from a
>>> generation plugin should  >>>  be packaged as an additional classpath
>> entry as explained above.
>>>>>> 
>>>>>>  This was designed so that you can include any .jar in the code
>>> of a  >>>  generation plugin.
>>>>>> 
>>>>>> 
>>>>>>> 
>>>>>>> Thanks & Best Regards
>>>>>>> Kalyan
>>>>>>> 
>>>>>>> On Tue, May 6, 2008 at 5:30 PM, Eric Dillon <erdillon@xxxxxxxxx>
>> wrote:
>>>>>>>> Hi Kalyan,
>>>>>>>> 
>>>>>>>>  I am afraid I don't know what is going on here. I am tempted
>>> however to  >>>>>  blame it on velocity :-).
>>>>>>>> 
>>>>>>>>  I did google the exception and saw your post on some other
>>> forum. I saw a  >>>>>  note there about having multiple instances of
>>> the velocity-1.5.jar which  >>>>> is  >>>>>  not the case here.
>>>>>>>> 
>>>>>>>>  Now, what are the symptoms of the error (beyond the log in the
>> mail)?
>>>>>>>> Does
>>>>>>>>  your generation fail completely?
>>>>>>>> 
>>>>>>>>  Eric
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>>  On 5/2/08 11:54 AM, "KV" <kalyan.abbaraju@xxxxxxxxx> wrote:
>>>>>>>> 
>>>>>>>>> Hi,
>>>>>>>>> 
>>>>>>>>>  I am getting the following class loader error while doing the
>> 
>>> code  >>>>>> generation with my plugin. I tried to include both log4j
>>> and  >>>>>> commons-logging explicitly to project class path. But it
>> did not help.
>>>>>>>>> 
>>>>>>>>> Can you please suggest a solution?
>>>>>>>>> 2008-05-02 19:41:51,515 - Log4JLogChute initialized using file
>> 
>>>>>>>>> 'velocity.log'
>>>>>>>>> 2008-05-02 19:41:51,515 - Starting Apache Velocity v1.5
>> (compiled:
>>>>>>>>> 2007-02-22 08:52:29)
>>>>>>>>> 2008-05-02 19:41:51,515 - Default Properties File:
>>>>>>>>> org\apache\velocity\runtime\defaults\velocity.properties
>>>>>>>>> 2008-05-02 19:41:51,515 - Trying to use logger class  >>>>>>
>>> org.apache.velocity.runtime.log.AvalonLogChute
>>>>>>>>> 2008-05-02 19:41:51,515 - Couldn't find class  >>>>>>
>>> org.apache.velocity.runtime.log.AvalonLogChute or necessary supporting
>> 
>>>>>>>>> classes in classpath.
>>>>>>>>> java.lang.NoClassDefFoundError:
>>> org/apache/log/format/Formatter  >>>>>> at
>>> java.lang.Class.forName0(Native Method)  >>>>>> at
>>> java.lang.Class.forName(Unknown Source)  >>>>>> at
>>> org.apache.velocity.util.ClassUtils.getClass(ClassUtils.java:63)
>>>>>>>>> at
>>> org.apache.velocity.util.ClassUtils.getNewInstance(ClassUtils.java:95)
>>>>>>>>> at
>>>>>>>>> 
>>> org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.j
>>> ava
>>>>>>>>> :14
>>>>>>>>> 7)
>>>>>>>>> at
>>>>>>>>> 
>>> org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:2
>>> 08)
>>>>>>>>> at
>>>>>>>>> 
>>> org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInsta
>>> nce
>>>>>>>>> .ja
>>>>>>>>> va
>>>>>>>>> :728)
>>>>>>>>> at
>>>>>>>>> 
>>> 
>>> org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:
>>> 240>>>>>>
>>>  )
>>>>>>>>> at
>>>>>>>>> 
>>> 
>>> org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:
>>> 534>>>>>>
>>>  )
>>>>>>>>> at
>>> org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:144)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.tigerstripe.workbench.internal.core.project.pluggable.rule
>>> s.T
>>>>>>>>> emp
>>>>>>>>> la
>>>>>>>>> 
>>> teBasedRule.setClasspathLoaderForVelocity(TemplateBasedRule.java:329)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.tigerstripe.workbench.internal.core.project.pluggable.rule
>>> s.A
>>>>>>>>> rti
>>>>>>>>> fa
>>>>>>>>> ctBasedRule.trigger(ArtifactBasedRule.java:192)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.tigerstripe.workbench.internal.core.plugin.pluggable.Plugi
>>> nRu
>>>>>>>>> leE
>>>>>>>>> xe
>>>>>>>>> cutor.trigger(PluginRuleExecutor.java:102)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.tigerstripe.workbench.internal.core.plugin.pluggable.Plugg
>>> abl
>>>>>>>>> ePl
>>>>>>>>> ug
>>>>>>>>> in.trigger(PluggablePlugin.java:123)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.tigerstripe.workbench.internal.core.plugin.PluginHousing.t
>>> rig
>>>>>>>>> ger
>>>>>>>>> (P
>>>>>>>>> luginHousing.java:40)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.tigerstripe.workbench.internal.core.plugin.PluginConfig.tr
>>> igg
>>>>>>>>> er(
>>>>>>>>> Pl
>>>>>>>>> uginConfig.java:250)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.tigerstripe.workbench.internal.core.generation.M1Generator
>>> .in
>>>>>>>>> ter
>>>>>>>>> na
>>>>>>>>> lPluginLoop(M1Generator.java:610)  >>>>>> at  >>>>>>
>>> org.eclipse.tigerstripe.workbench.internal.core.generation.M1Generator
>>> .in
>>>>>>>>> ter
>>>>>>>>> na
>>>>>>>>> lRun(M1Generator.java:553)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.tigerstripe.workbench.internal.core.generation.M1Generator
>>> .ru
>>>>>>>>> n(M
>>>>>>>>> 1G
>>>>>>>>> enerator.java:350)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.tigerstripe.workbench.eclipse.wizards.generate.NewTigerstr
>>> ipe
>>>>>>>>> Run
>>>>>>>>> Wi
>>>>>>>>> zard.finishPage(NewTigerstripeRunWizard.java:131)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.tigerstripe.workbench.eclipse.wizards.NewTSElementWizard$2
>>> .ru
>>>>>>>>> n(N
>>>>>>>>> ew
>>>>>>>>> TSElementWizard.java:193)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOpe
>>> rat
>>>>>>>>> ion
>>>>>>>>> .j
>>>>>>>>> ava:39)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperatio
>>> n.j
>>>>>>>>> ava
>>>>>>>>> :7
>>>>>>>>> 20)
>>>>>>>>> at
>>> org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
>>>>>>>>> at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4466)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(Workb
>>> enc
>>>>>>>>> hRu
>>>>>>>>> nn
>>>>>>>>> ableAdapter.java:87)
>>>>>>>>> at
>>>>>>>>> 
>>> org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalC
>>> ont
>>>>>>>>> ext
>>>>>>>>> .j
>>>>>>>>> ava:113)
>>>>>>>>> 2008-05-02 19:41:51,515 - Trying to use logger class  >>>>>>
>>> org.apache.velocity.runtime.log.Log4JLogChute
>>>>>>>>> 2008-05-02 19:41:51,515 - Using logger class  >>>>>>
>>> org.apache.velocity.runtime.log.Log4JLogChute
>>>>>>>>> 2008-05-02 19:41:51,515 - Default ResourceManager
>>> initializing. (class  >>>>>>
>>> org.apache.velocity.runtime.resource.ResourceManagerImpl)
>>>>>>>>> 2008-05-02 19:41:51,515 - ResourceLoader instantiated:
>>>>>>>>> org.apache.velocity.runtime.resource.loader.FileResourceLoader
>>>>>>>>> 
>>>>>>>>> Regards
>>>>>>>>> Kalyan
>>>>>>>>> _______________________________________________
>>>>>>>>> tigerstripe-users mailing list  >>>>>>
>>> tigerstripe-users@xxxxxxxxxxx  >>>>>>
>>> https://dev.eclipse.org/mailman/listinfo/tigerstripe-users
>>>>>>>> 
>>>>>>>>  _______________________________________________
>>>>>>>>  tigerstripe-users mailing list  >>>>>
>>> tigerstripe-users@xxxxxxxxxxx  >>>>>
>>> https://dev.eclipse.org/mailman/listinfo/tigerstripe-users
>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>>  _______________________________________________
>>>>>>  tigerstripe-users mailing list
>>>>>>  tigerstripe-users@xxxxxxxxxxx
>>>>>>  https://dev.eclipse.org/mailman/listinfo/tigerstripe-users
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>>  Kalyan Abbaraju
>>>>>  Home +91 8066649703
>>>>>  Mobile +91 99005 16895
>>>>> 
>>>> 
>>>> 
>>> 
>>>  _______________________________________________
>>>  tigerstripe-users mailing list
>>>  tigerstripe-users@xxxxxxxxxxx
>>>  https://dev.eclipse.org/mailman/listinfo/tigerstripe-users
>>> 
>> 
>> 
>> 
>> --
>> Kalyan Abbaraju
>> Home +91 8066649703
>> Mobile +91 99005 16895
>> _______________________________________________
>> tigerstripe-users mailing list
>> tigerstripe-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/tigerstripe-users
>> _______________________________________________
>> tigerstripe-users mailing list
>> tigerstripe-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/tigerstripe-users
>> 
> 
> 



Back to the top