3 Replies Latest reply: Sep 27, 2010 7:13 AM by 701681 RSS

    A bug in message pattern?

    user639604
      We used a wrong cache factory class and seems to encounter a message pattern bug accidently...

      Here is the exception we got.

      java.util.MissingFormatArgumentException: Format specifier 's'
      at java.util.Formatter.format(Formatter.java:2431)
      at java.util.Formatter.format(Formatter.java:2366)
      at java.lang.String.format(String.java:2770)
      at com.oracle.coherence.common.logging.Logger.log(Logger.java:93)
      at com.oracle.coherence.patterns.messaging.MessagePublisher.initDestinationType(MessagePublisher.java:400)
      at com.oracle.coherence.patterns.messaging.MessagePublisher.<init>(MessagePublisher.java:133)
      at com.oracle.coherence.patterns.messaging.MessagePublisherManager.getPublisher(MessagePublisherManager.java:187)
      at com.oracle.coherence.patterns.messaging.MessagePublisherManager.ensurePublisher(MessagePublisherManager.java:98)
      at com.oracle.coherence.patterns.messaging.entryprocessors.PublishMessageProcessor.process(PublishMessageProcessor.java:118)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.invoke(DistributedCache.CDB:20)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onInvokeRequest(DistributedCache.CDB:49)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$InvokeRequest.run(DistributedCache.CDB:1)
      at com.tangosol.coherence.component.net.message.requestMessage.DistributedCacheKeyRequest.onReceived(DistributedCacheKeyRequest.CDB:12)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:9)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:136)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onNotify(DistributedCache.CDB:3)
      at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
      at java.lang.Thread.run(Thread.java:619)

      The interesting part is that the source code from message pattern website seems doesn't match with the jar file.

      We "decompile" coherence-messagepattern-2.6.1.14471.jar and the line numer 400 of MessagePublisher.class is

      Logger.log(1,"Destination %s is not found for Id "+this.destinationIdentifier, new Object[0]);

      * this is the one caused the exception since you can't provide Object[0] when you have %s in the format string expect an input.

      But if I look at the source code inside coherence-messagepattern-2.6.1.14471-src.zip from message pattern page, line 400 of MessagePublisher.class is

      Logger.log(1,"Destination %s is not found for Id "+this.destinationIdentifier);