Hi Cristi. I think your first sample should work.
Where are your Velocity templates? Considering the code you posted initially, I think they should be inside the application jar. Make sure you refer to the templates with their full path _inside_ the jar. If you refer to the templates without a path, then they must reside at the root level of your application jar. P.S. The exception is normal. "class.resource.loader.class" is the class of the Velocity resource loader, _not_ the container classloader. ----- Original Message ----- From: "Cristi Cioriia" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Wednesday, March 12, 2008 1:33 PM Subject: Re: How to use Velocity inside JBOSS > Hi Will, > > My project is configured to use Velocity 1.5, and in the ear I have the > Velocity 1.5 jar. > I have to admit that I do not exactly understand what it means that it > will look in the thread context loader. I tried to modify my code this way: > prop.setProperty("class.resource.loader.class", Thread.currentThread() > .getContextClassLoader().getClass().getName());* > *but this gives this exception: > java.lang.Exception: Problem initializing template loader: > org.jboss.mx.loading.UnifiedClassLoader3 > Error is: java.lang.InstantiationException: > org.jboss.mx.loading.UnifiedClassLoader3 > at java.lang.Class.newInstance0(Class.java:340) > at java.lang.Class.newInstance(Class.java:308) > So, I think I still have the problem. Can u please provide a small piece > of code showing how could I use this inside an EJB? > Thanks. > > --------------------------------------------------------------------- > 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]
