Results 1 to 7 of 7

Thread: StandardEntryFilter - StringIndexOutOfBoundsException

  1. #1
    Join Date
    Oct 2008
    Posts
    0

    Default StandardEntryFilter - StringIndexOutOfBoundsException

    Hi,

    Using beta6 I get this exception when some code in my web module does some simple logging using a static log4j logger.

    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    java.lang.String.substring(Unknown Source)
    com.springsource.platform.serviceability.output.in ternal.StandardEntryFilter.filter(StandardEntryFil ter.java:93)
    com.springsource.platform.serviceability.tracing.i nternal.EntryPublisherAccessor$FilteringEntryPubli sher.filter(EntryPublisherAccessor.java:180)
    com.springsource.platform.serviceability.tracing.i nternal.StandardTracer.isTraceEnabled(StandardTrac er.java:73)
    com.springsource.platform.serviceability.tracing.i nternal.StandardTracer.trace(StandardTracer.java:5 6)
    com.springsource.platform.serviceability.tracing.s lf4j.TracerToLoggerAdapter.trace(TracerToLoggerAda pter.java:521)
    com.springsource.platform.serviceability.tracing.s lf4j.TracerToLoggerAdapter.trace(TracerToLoggerAda pter.java:517)
    com.springsource.platform.serviceability.tracing.s lf4j.TracerToLoggerAdapter.debug(TracerToLoggerAda pter.java:58)
    org.apache.log4j.Category.debug(Category.java:180)
    at com.foo.webservice.ServerHandler.handleRequest(Ser verHandler.java:121)
    at org.springframework.web.servlet.mvc.HttpRequestHan dlerAdapter.handle(HttpRequestHandlerAdapter.java: 49)

    Has anyone else seen this before? What is weird is that I have other log statements that get printed in the same http request that don't exhibit this behaviour. Is there an easy way to change the tracing config so this filter is not used?

    Rob

  2. #2
    Join Date
    Jan 2006
    Location
    Zürich, Switzerland
    Posts
    423

    Default StandardEntryFilter - StringIndexOutOfBoundsException

    FYI: this thread is duplicated at:

    http://www.springsource.com/beta/applicationplatform/comments.php?DiscussionID=152&page=1#Item_1

  3. #3
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default StandardEntryFilter - StringIndexOutOfBoundsException

    Rob,

    What is the log message that you are writing?

    Rob

  4. #4
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default StandardEntryFilter - StringIndexOutOfBoundsException

    See https://issuetracker.springsource.com/browse/PLATFORM-82

  5. #5
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default StandardEntryFilter - StringIndexOutOfBoundsException

    Also, I should ask, what is the name of the Log4j Category that you are using?

    Rob

  6. #6
    Join Date
    Oct 2008
    Posts
    0

    Default StandardEntryFilter - StringIndexOutOfBoundsException

    Hi,

    Managed to find what was causing this and why it was only happening in a few classes. Most of the log4j loggers that are defined throughout the codebase are defined using the following:
    private static final Logger logger = Logger.getLogger(Foo.class);

    The exception I reported only occurs for loggers that for whatever reason don't follow the above convention and instead name the logger something other then the classname. In my case this was a string without any dots.

    Rob

  7. #7
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default StandardEntryFilter - StringIndexOutOfBoundsException

    Rob,

    I suspected that was the problem - a fix has been committed and will be included in Friday's beta refresh.

    Regards,

    Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •