velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Florin Vancea" <fvan...@maxiq.ro>
Subject Re: How to use Velocity inside JBOSS
Date Wed, 12 Mar 2008 12:23:39 GMT
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" <cristi-cioriia@criticalsoftware.com>
To: <user@velocity.apache.org>
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: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>



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


Mime
View raw message