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 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-guide.html#velocity_configuration_keys_and_values
 http://velocity.apache.org/engine/releases/velocity-1.5/developer-guide.html#configuring_logging

 For your reference, here is the content from
 velocity-1.5\src\java\org\apache\velocity\runtime\defaults\velocity.properties
 runtime.log.logsystem.class =
 org.apache.velocity.runtime.log.AvalonLogChute,org.apache.velocity.runtime.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.java:14
>  >  >>> 7)
>  >  >>> at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:208)
>  >  >>> at
>  >  >>> org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.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.rules.Temp
>  >  >>> la
>  >  >>> teBasedRule.setClasspathLoaderForVelocity(TemplateBasedRule.java:329)
>  >  >>> at
>  >  >>> org.eclipse.tigerstripe.workbench.internal.core.project.pluggable.rules.Arti
>  >  >>> fa
>  >  >>> ctBasedRule.trigger(ArtifactBasedRule.java:192)
>  >  >>> at
>  >  >>> org.eclipse.tigerstripe.workbench.internal.core.plugin.pluggable.PluginRuleE
>  >  >>> xe
>  >  >>> cutor.trigger(PluginRuleExecutor.java:102)
>  >  >>> at
>  >  >>> org.eclipse.tigerstripe.workbench.internal.core.plugin.pluggable.PluggablePl
>  >  >>> ug
>  >  >>> in.trigger(PluggablePlugin.java:123)
>  >  >>> at
>  >  >>> org.eclipse.tigerstripe.workbench.internal.core.plugin.PluginHousing.trigger
>  >  >>> (P
>  >  >>> luginHousing.java:40)
>  >  >>> at
>  >  >>> org.eclipse.tigerstripe.workbench.internal.core.plugin.PluginConfig.trigger(
>  >  >>> Pl
>  >  >>> uginConfig.java:250)
>  >  >>> at
>  >  >>> org.eclipse.tigerstripe.workbench.internal.core.generation.M1Generator.inter
>  >  >>> na
>  >  >>> lPluginLoop(M1Generator.java:610)
>  >  >>> at
>  >  >>> org.eclipse.tigerstripe.workbench.internal.core.generation.M1Generator.inter
>  >  >>> na
>  >  >>> lRun(M1Generator.java:553)
>  >  >>> at
>  >  >>> org.eclipse.tigerstripe.workbench.internal.core.generation.M1Generator.run(M
>  >  >>> 1G
>  >  >>> enerator.java:350)
>  >  >>> at
>  >  >>> org.eclipse.tigerstripe.workbench.eclipse.wizards.generate.NewTigerstripeRun
>  >  >>> Wi
>  >  >>> zard.finishPage(NewTigerstripeRunWizard.java:131)
>  >  >>> at
>  >  >>> org.eclipse.tigerstripe.workbench.eclipse.wizards.NewTSElementWizard$2.run(N
>  >  >>> ew
>  >  >>> TSElementWizard.java:193)
>  >  >>> at
>  >  >>> org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation
>  >  >>> .j
>  >  >>> ava:39)
>  >  >>> at
>  >  >>> org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java
>  >  >>> :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(WorkbenchRu
>  >  >>> nn
>  >  >>> ableAdapter.java:87)
>  >  >>> at
>  >  >>> org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext
>  >  >>> .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
>



-- 
Kalyan Abbaraju
Home +91 8066649703
Mobile +91 99005 16895


Back to the top