[jboss-user] [Beginners Corner] - Velocity issue
cristi_cioriia
do-not-reply at jboss.com
Wed Mar 5 07:58:51 EST 2008
Hi all,
I am pretty new to JBOSS and I have some hard times integrating Velocity into JBOSS. I hope that this is the right place to ask for help.
Basically, what I would like to do is is the following: I have an EJB which uses a helper class for creating some content. The helper class creates the content using the Velocity framework. The code from the helper class looks like this:
| VelocityEngine velocityEngine = new VelocityEngine();
| velocityEngine.setProperty(
| //set the template location to where my templates reside
|
| VelocityEngine.FILE_RESOURCE_LOADER_PATH,
| RESOURCE_LOADER_PATH);
| velocityEngine.init();
| StringWriter out = new StringWriter();
| velocityEngine.mergeTemplate(mailMessageTemplate, templateContext.getContext(), out);
|
In order to be able to do that I have placed Velocity in the classpath of my application. I am wondering if this is the right why to use Velocity inside JBOSS(and EJBs). The reason I am in doubt about this is the JBOSS log when I start the server:
anonymous wrote :
| 12:25:45,828 INFO [VelocityEngine] Starting Jakarta Velocity v1.4
| 12:25:45,828 INFO [VelocityEngine] RuntimeInstance initializing.
| 12:25:45,828 INFO [VelocityEngine] Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties
| 12:25:45,859 INFO [VelocityEngine] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
| 12:25:45,875 INFO [VelocityEngine] Resource Loader Instantiated: org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
| 12:25:45,875 INFO [VelocityEngine] ClasspathResourceLoader : initialization starting.
| 12:25:45,875 INFO [VelocityEngine] ClasspathResourceLoader : initialization complete.
| 12:25:45,890 INFO [VelocityEngine] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
| 12:25:45,890 INFO [VelocityEngine] Default ResourceManager initialization complete.
| 12:25:45,953 INFO [VelocityEngine] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
| 12:25:45,968 INFO [VelocityEngine] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
| 12:25:45,968 INFO [VelocityEngine] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
| 12:25:45,968 INFO [VelocityEngine] Loaded System Directive: org.apache.velocity.runtime.directive.Include
| 12:25:45,968 INFO [VelocityEngine] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
| 12:25:46,015 INFO [VelocityEngine] Created: 20 parsers.
| 12:25:46,015 INFO [VelocityEngine] Velocimacro : initialization starting.
| 12:25:46,015 INFO [VelocityEngine] Velocimacro : adding VMs from VM library template : VM_global_library.vm
| 12:25:46,031 ERROR [VelocityEngine] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
| 12:25:46,031 INFO [VelocityEngine] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.Reso
| urceNotFoundException: Unable to find resource 'VM_global_library.vm'
| 12:25:46,031 INFO [VelocityEngine] Velocimacro : VM library template macro registration complete.
| 12:25:46,031 INFO [VelocityEngine] Velocimacro : allowInline = true : VMs can be defined inline in templates
| 12:25:46,031 INFO [VelocityEngine] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
|
| 12:25:46,031 INFO [VelocityEngine] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
| 12:25:46,031 INFO [VelocityEngine] Velocimacro : messages on : VM system will output logging messages
| 12:25:46,031 INFO [VelocityEngine] Velocimacro : autoload off : VM system will not automatically reload global library macros
| 12:25:46,031 INFO [VelocityEngine] Velocimacro : initialization complete.
| 12:25:46,031 INFO [VelocityEngine] Velocity successfully started.
As I have pointed out above, it seems that there is a problem starting Velocity. Any help would be greatly appreciated. Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134218#4134218
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134218
More information about the jboss-user
mailing list