8 Replies Latest reply on Feb 13, 2009 5:48 AM by Manik Surtani

    ObjectName with invalid character

    Isaac Peel Newbie

      I'm following the information in the cache user guide and no matter what I do I keep getting the same exception.

      Using the most basic cache config:

      <jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
      </jbosscache>


      I'm attempting to create the cache like this:
      CacheFactory factory = new DefaultCacheFactory();
      Cache cache = factory.createCache("cache-config.xml", true);


      I keep getting the following exception:
      14:18:24,646 ERROR [STDERR] org.jboss.cache.CacheException: java.lang.reflect.InvocationTargetException
      14:18:24,647 ERROR [STDERR] at org.jboss.cache.util.reflect.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:148)
      14:18:24,647 ERROR [STDERR] at org.jboss.cache.factories.ComponentRegistry$PrioritizedMethod.invoke(ComponentRegistry.java:970)
      14:18:24,647 ERROR [STDERR] at org.jboss.cache.factories.ComponentRegistry.internalStart(ComponentRegistry.java:746)
      14:18:24,647 ERROR [STDERR] at org.jboss.cache.factories.ComponentRegistry.start(ComponentRegistry.java:610)
      14:18:24,647 ERROR [STDERR] at org.jboss.cache.invocation.CacheInvocationDelegate.start(CacheInvocationDelegate.java:355)
      14:18:24,647 ERROR [STDERR] at org.jboss.cache.DefaultCacheFactory.createCache(DefaultCacheFactory.java:121)
      14:18:24,647 ERROR [STDERR] at org.jboss.cache.DefaultCacheFactory.createCache(DefaultCacheFactory.java:93)
      14:18:24,647 ERROR [STDERR] at net.ussouth.incomm.security.domain.DomainAuthenticator.authenticate(DomainAuthenticator.java:29)
      14:18:24,647 ERROR [STDERR] at net.ussouth.incomm.security.AuthenticatorBean.authenticate(AuthenticatorBean.java:20)
      14:18:24,648 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:18:24,648 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      14:18:24,648 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      14:18:24,648 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
      14:18:24,648 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
      14:18:24,648 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
      14:18:24,648 ERROR [STDERR] at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
      14:18:24,648 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
      14:18:24,648 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
      14:18:24,648 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:18:24,648 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      14:18:24,648 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      14:18:24,648 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
      14:18:24,648 ERROR [STDERR] at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
      14:18:24,649 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,649 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
      14:18:24,649 ERROR [STDERR] at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_17267367.invoke(InvocationContextInterceptor_z_fillMethod_17267367.java)
      14:18:24,649 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,649 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
      14:18:24,649 ERROR [STDERR] at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_17267367.invoke(InvocationContextInterceptor_z_setup_17267367.java)
      14:18:24,649 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,649 ERROR [STDERR] at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
      14:18:24,649 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,649 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
      14:18:24,649 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,649 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      14:18:24,649 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,649 ERROR [STDERR] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
      14:18:24,650 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,650 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
      14:18:24,650 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,650 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      14:18:24,650 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
      14:18:24,650 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,650 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      14:18:24,650 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,650 ERROR [STDERR] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
      14:18:24,651 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,651 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:159)
      14:18:24,651 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,651 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
      14:18:24,651 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,651 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      14:18:24,651 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,651 ERROR [STDERR] at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:65)
      14:18:24,651 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,651 ERROR [STDERR] at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
      14:18:24,652 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      14:18:24,652 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:486)
      14:18:24,652 ERROR [STDERR] at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:56)
      14:18:24,652 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
      14:18:24,652 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      14:18:24,652 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
      14:18:24,652 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
      14:18:24,652 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
      14:18:24,652 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
      14:18:24,652 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
      14:18:24,653 ERROR [STDERR] Caused by: java.lang.reflect.InvocationTargetException
      14:18:24,653 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:18:24,653 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      14:18:24,653 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      14:18:24,653 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
      14:18:24,653 ERROR [STDERR] at org.jboss.cache.util.reflect.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:144)
      14:18:24,653 ERROR [STDERR] ... 65 more
      14:18:24,654 ERROR [STDERR] Caused by: org.jboss.cache.CacheException: Failure while registering mbeans
      14:18:24,654 ERROR [STDERR] at org.jboss.cache.jmx.JmxRegistrationManager.registerAllMBeans(JmxRegistrationManager.java:163)
      14:18:24,654 ERROR [STDERR] at org.jboss.cache.jmx.PlatformMBeanServerRegistration.registerToPlatformMBeanServer(PlatformMBeanServerRegistration.java:70)
      14:18:24,654 ERROR [STDERR] ... 70 more
      14:18:24,654 ERROR [STDERR] Caused by: javax.management.MalformedObjectNameException: Invalid character ':' in value part of property
      14:18:24,654 ERROR [STDERR] at javax.management.ObjectName.construct(ObjectName.java:602)
      14:18:24,654 ERROR [STDERR] at javax.management.ObjectName.<init>(ObjectName.java:1403)
      14:18:24,655 ERROR [STDERR] at org.jboss.cache.jmx.JmxRegistrationManager.registerAllMBeans(JmxRegistrationManager.java:147)
      14:18:24,655 ERROR [STDERR] ... 71 more



      How can I make sure the ':' character doesn't end up in the ObjectName?

        • 1. Re: ObjectName with invalid character
          Elias Ross Master

          What's in your cache-config.xml file?

          As an aside, probably JBoss should escape that character.

          • 2. Re: ObjectName with invalid character
            Isaac Peel Newbie

            my cache config is this

            <jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
            </jbosscache>


            • 3. Re: ObjectName with invalid character
              Isaac Peel Newbie

               

              "genman" wrote:

              As an aside, probably JBoss should escape that character.


              I'm looking at the source code right now and it doesn't seem to be escaping anything. I can get around the ':' appearing in the object name but it then adds a ',' which will end up throwing the same exception .

              • 4. Re: ObjectName with invalid character
                Manik Surtani Master

                What environment is this in? E.g., app server, etc? Specifically, the MBean server impl?

                • 5. Re: ObjectName with invalid character
                  Isaac Peel Newbie

                  I'm running this in linux, jdk6, as 5.0.0.GA and jboscache 3.0.1

                  • 6. Re: ObjectName with invalid character
                    Manik Surtani Master

                    This is odd, I have started an "all" instance of JBoss AS 5 (Sun JDK 6, Fedora 10) and the JBC MBeans register just fine and I can see them in the JMX console. And this includes the : and , characters. I even see other MBeans (e.g., JBoss Messaging queues, etc) that use these characters and register just fine.

                    AFAIK, it is just IBM's MBean server impl that doesn't like the ':' character and hence the reason for JBCACHE-1444.

                    When you run AS 5 with the "all" configuration, do you see the other JBC instances that the AS starts up in your jmx console?

                    • 7. Re: ObjectName with invalid character
                      Scott Tatum Newbie

                      I've noticed the same problem. I'm running JBC 3.0.0-GA under WebLogic 9.2, Sun JDK 1.5.0_10.

                      What I've found is that this only happens when I set CacheMode to LOCAL. If I use REPL_SYNC or REPL_ASYNC, then it starts up fine.

                      Below is my config file, FWIW:

                      <?xml version="1.0" encoding="UTF-8" ?>
                      
                      <server>
                       <mbean code="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper"
                       name="jboss.cache:service=PojoCache">
                      
                       <depends>jboss:service=TransactionManager</depends>
                      
                       <!-- Configure the TransactionManager -->
                       <attribute name="TransactionManagerLookupClass">
                       <!-- org.jboss.cache.transaction.DummyTransactionManagerLookup -->
                       org.jboss.cache.transaction.JBossTransactionManagerLookup
                       </attribute>
                      
                       <!-- Isolation level : SERIALIZABLE
                       REPEATABLE_READ (default)
                       READ_COMMITTED
                       READ_UNCOMMITTED
                       NONE
                       -->
                       <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
                      
                       <!-- Valid modes are LOCAL, REPL_ASYNC and REPL_SYNC -->
                       <!-- LOCAL causes the ":" error, REPL_* does not. -->
                       <attribute name="CacheMode">LOCAL</attribute>
                      
                       <!-- Name of cluster. Needs to be the same for all caches,
                       in order for them to find each other
                       -->
                       <attribute name="ClusterName">dev-mwDevCluster</attribute>
                      
                       <!-- JGroups protocol stack properties. -->
                       <attribute name="ClusterConfig">
                       <config>
                       <!-- UDP: if you have a multihomed machine, set the bind_addr
                       attribute to the appropriate NIC IP address
                      -->
                       <!-- UDP: On Windows machines, because of the media sense feature
                       being broken with multicast (even after disabling media sense)
                       set the loopback attribute to true
                      -->
                       <UDP mcast_addr="228.1.2.3" mcast_port="48866"
                       ip_ttl="64" ip_mcast="true"
                       mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
                       ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
                       loopback="false"/>
                       <PING timeout="2000" num_initial_members="3"/>
                       <MERGE2 min_interval="10000" max_interval="20000"/>
                       <FD shun="true"/>
                       <FD_SOCK/>
                       <VERIFY_SUSPECT timeout="1500"/>
                       <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
                       max_xmit_size="8192"/>
                       <UNICAST timeout="600,1200,2400,4800"/>
                       <pbcast.STABLE desired_avg_gossip="400000"/>
                       <FC max_credits="2000000" min_threshold="0.10"/>
                       <FRAG2 frag_size="8192"/>
                       <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
                       shun="true" print_local_addr="true"/>
                       <pbcast.STATE_TRANSFER/>
                       </config>
                       </attribute>
                      
                       <!-- Whether or not to fetch state on joining a cluster -->
                       <attribute name="FetchInMemoryState">true</attribute>
                      
                       <!-- The max amount of time (in milliseconds) we wait until the
                       initial state (ie. the contents of the cache) are retrieved from
                       existing members in a clustered environment
                       -->
                       <attribute name="InitialStateRetrievalTimeout">15000</attribute>
                      
                       <!-- Number of milliseconds to wait until all responses for a
                       synchronous call have been received.
                       -->
                       <attribute name="SyncReplTimeout">15000</attribute>
                      
                       <!-- Max number of milliseconds to wait for a lock acquisition -->
                       <attribute name="LockAcquisitionTimeout">10000</attribute>
                      
                       </mbean>
                      </server>
                      
                      


                      It would be nice to set LOCAL mode on the single server setups I have, so any info on this would be appreciated. Hope this helps.

                      -Scott

                      • 8. Re: ObjectName with invalid character
                        Manik Surtani Master

                        A workaround was introduced in 3.0.2.GA : JBCACHE-1465