You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by dhaiwal jaspal <ja...@yahoo.com> on 2006/08/17 20:36:50 UTC

Error while loading velocity template using ear file (weblogic 8.1,SP5)

Hi, 

In one of our j2ee applications we have a web
application and an EJB application. 

Web application uses velocity(1.2). 
Application server is weblogic 8.1 with sp5. 

If web app and ejb app are deployed separately, web
app is able to load templates properly at runtime but
if we make an ear file bundling web app and ejb app,
we get following error at the time when application
tries to load even the first velocity template.


org.apache.velocity.exception.ResourceNotFoundException:
Unable to find resource 'login.vt'
at
org.apache.velocity.runtime.resource.ResourceManager.getResource(ResourceManager.java:438)
at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:736)
at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:718)
at
org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:337)
at
org.apache.velocity.servlet.VelocityServlet.getTemplate(VelocityServlet.java:499)
at
com.nfsmith.servlet.Controller.handleRequest(Controller.java:377)
at
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:331)
at
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:292)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

We have tried to configure and use all the resource
loader for velocity engine(FileResourceLoader,
ClasspathResourceLoader , JarResourceLoader etc.) but
noting is working. 

I have tried keeping all the templates under
WEB-INF\classes dir. This does not work. 

I have even tried keeping all the templates in a
separate jar file and kept the same under APP-INF/lib
and bundled the same in ear file, this does'nt work
either. 

Should I create a rar file archive and try bundling it
in ear file or is there any other way to achieve this?


Appreciate your responses.

Jaspal 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: Error while loading velocity template using ear file (weblogic 8.1,SP5)

Posted by Will Glass-Husain <wg...@forio.com>.
Hi Dhaiwal,

I notice you're using a pretty old version of Velocity (1.2).  The
latest is Velocity 1.4, and the (unreleased) Velocity 1.5 in source
control is stable and fixes many bugs.  My first suggestion would be
to try that.

How are you serving the files?  If you are using VelocityServlet (now
deprecated) I recommend you switch to VelocityViewServlet from
Velocity Tools.  More stable and actively maintained.  This uses the
WebAppResourceLoader which loads the files automatically from the web
file directory.

Hope this is helpful.  Let us know if this is feasible.

WILL

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