[Installation, Configuration & DEPLOYMENT] - Re: ClassLoader leak through TimedCachePolicy.resolutionTime
by huuskart
I tested with this patch to TimedCachePolicy. Yay, undeploy now works!
| --- TimedCachePolicy.java
| +++ TimedCachePolicy.java
| @@ -77,7 +77,17 @@ public class TimedCachePolicy
| public Object getValue();
| }
|
| - protected static Timer resolutionTimer = new Timer(true);
| + protected static Timer resolutionTimer;
| + static {
| + ClassLoader cl = Thread.currentThread().getContextClassLoader();
| + try {
| + Thread.currentThread().setContextClassLoader(
| + TimedCachePolicy.class.getClassLoader());
| + resolutionTimer = new Timer(true);
| + } finally {
| + Thread.currentThread().setContextClassLoader(cl);
| + }
| + }
|
| /** The map of cached TimedEntry objects. */
| protected Map entryMap;
| @@ -223,6 +233,8 @@ public class TimedCachePolicy
| entry = (TimedEntry) value;
| }
| entry.init(now);
| + if (! entry.isCurrent(now))
| + return;
| entryMap.put(key, entry);
| }
| /** Remove the entry associated with key and call destroy on the entry
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134234#4134234
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134234
18 years, 1 month
[JBoss Messaging] - Re: messages stuck in queues
by martin.wickus
I think I've found a bug in JBM 1.4.0.SP3.
I ran JBM 1.4.0.SP3 to reproduce my earlier problem in UAT.
I then went through each of the items listed as oversights before until the problem dissapeared. The order was:
1. Updated to latest schema. Problem still occurs.
2. Changed to non-EAP version of JBM and JBR libraries. Problem still occurs.
3. Turned clustering for PostOffice off. Problem still occurs.
4. Changed PrefetchSize to 1000 and SlowConsumers to false. Problem fixed.
I undid/repeated step 4 a few times and it this is definately my problem area.
I then switched to the JBM 1.4.0.GA libraries to see if I can reproduce the problem. I couldn't. It works stably whether SlowConsumers is true or false.
This makes me think that between JBM1.4.0.GA and JBM1.4.0.SP3, there must have been a change to the client consumer flow control.
I compared the source code for the revisions and noticed there was significant refactoring in org.jboss.jms.client.container.ClientConsumer.
Additionaly, since the behavior happens only after a period and only under heavy load, this sounded like a threading problem.....
I can't be sure by looking at the code as I'm not a JBM expert, but I do notice that most of the time when consumeCount gets modified, it is done so within the mainLock. However, not always .... so this might cause contention issues. Perhaps consumeCount should be declared as volatile to prevent threads storing local values for the variables.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134224#4134224
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134224
18 years, 1 month
[Beginners Corner] - Velocity issue
by cristi_cioriia
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
18 years, 1 month