[jbosscache-issues] [JBoss JIRA] Commented: (JBCACHE-1444) ObjectName's validation fails for Jbosscache 3.0 on WAS 6.1 due to ":" char in name.

Piotr Piastucki (JIRA) jira-events at lists.jboss.org
Wed Dec 10 07:20:36 EST 2008


    [ https://jira.jboss.org/jira/browse/JBCACHE-1444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12441891#action_12441891 ] 

Piotr Piastucki commented on JBCACHE-1444:
------------------------------------------

>From my point of view the issue has not been fixed - the deployment still fails under WL when local mode is selected, because of 

private void processBaseName(ObjectName baseName)
   {
...
      if (cacheSpi.getConfiguration().getCacheMode().equals(Configuration.CacheMode.LOCAL))
      {
         // CurrentTimeMillis is not good enaugh as an unique id generator. I am constantly
         // getting conflicts in several parallel tests on my box. Maybe some more sofisticated
         // unique id generator should be provided?
         objectNameBase = LOCAL_CACHE_PREFIX + Thread.currentThread().getName() + "-" + System.currentTimeMillis();
      }
...
   }

Obviously, no matter what is selected as prefix, thread name IS still used.

I did not find any workaround for the issue as:

1) I can properly register cache as MBean as described in user guide (correct object name is provided by me in this case):
		            JmxRegistrationManager jmxManager = new JmxRegistrationManager(server, cache, on);
		            jmxManager.registerAllMBeans();

BUT
2) When jmxStatistics are disabled in the config file then CacheMgmtInterceptor is not added to interceptor chain and I cannot get any statistics. 
3) Whe jmxStatistics are enabled in the config file then Jboss cache tries to register the MBean with the default name (the one with thread name) and it fails.

Question - why the same flag controls jmx registration and interceptor chain creation??

there should be a separate attribute in jmxStatistics tag to control whether the users whats to register the MBean automatically or do it manually later (as I try to do).

Thanks,
Piotr









> ObjectName's validation fails for Jbosscache 3.0 on WAS 6.1 due to ":" char in name.
> ------------------------------------------------------------------------------------
>
>                 Key: JBCACHE-1444
>                 URL: https://jira.jboss.org/jira/browse/JBCACHE-1444
>             Project: JBoss Cache
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JMX
>    Affects Versions: 3.0.0.CR3, 3.0.0.GA
>         Environment: WAS 6.1, IBM VM
>            Reporter: Peter Kovgan
>            Assignee: Manik Surtani
>            Priority: Critical
>             Fix For: 3.0.1.GA
>
>   Original Estimate: 5 hours
>  Remaining Estimate: 5 hours
>
> I deploy jboss cache on WAS 6.1(base install), and the problem is:
> new JmxRegistrationManager uses this function to create unique object name:
> private void processBaseName(ObjectName baseName)
> in LOCAL mode, name is
> objectNameBase = LOCAL_CACHE_PREFIX + Thread.currentThread().getName() + "-" + System.currentTimeMillis();
> the problem WAS returns <ContainerName>:<some number> as a Thread.currentThread().getName().
> This means you have something like WebContainer : 1 in name, but the ":" char fails during the validation in WAS's proprietary(!!!)
> javax.management.ObjectName.class.
> Probably needed some configurable option that excludes ":" 
> Thread.currentThread().getName() -  problem part - should be changed for WAS to exclude ":"
> below is WAS check for invalid characters:
> while ((in_index < len) && ((c1 = name_chars[in_index++]) != '='))
>                 switch (c1) {
>                     // '=' considered to introduce value part
>                     case  '*' :
>                     case  '?' :
>                     case  ',' :
>                     case  ':' :
>                     case  '\n' :
> 			final String ichar = ((c1=='\n')?"\\n":""+c1);
>                         throw new MalformedObjectNameException(
> 				  "Invalid character '" + ichar +
> 				  "' in key part of property");
>                     default: ;
>                 }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbosscache-issues mailing list