The Artima Developer Community
Sponsored Link

Java Buzz Forum
Introspector problems

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Simon Brown

Posts: 636
Nickname: simonbrown
Registered: Jun, 2003

Simon Brown is a Java developer, architect and author.
Introspector problems Posted: Mar 1, 2005 7:11 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Simon Brown.
Original Post: Introspector problems
Feed Title: Simon Brown's weblog
Feed URL: http://www.simongbrown.com/blog/feed.xml?flavor=rss20&category=java
Feed Description: My thoughts on Java, software development and technology.
Latest Java Buzz Posts
Latest Java Buzz Posts by Simon Brown
Latest Posts From Simon Brown's weblog

Advertisement

I tried to upgrade my blog at the weekend to the latest version of Pebble and it failed miserably. I've been developing the recent changes against Resin and although my site is running on Tomcat, I didn't see there being any problems. Unfortunately, on requesting pages containing blog entries, I got the following error.

java.lang.StringIndexOutOfBoundsException: String index out of range: -3
        at java.lang.String.substring(String.java:1444) 
        at java.beans.Introspector.getTargetEventInfo(Introspector.java:885)
        at java.beans.Introspector.getBeanInfo(Introspector.java:372)
        at java.beans.Introspector.getBeanInfo(Introspector.java:145)

The full stack trace contained references to the JSTL <c:out> tag. Initially I thought that this was causing the problem because the exception was being thrown when trying to evaluate a JSTL expression. After compiling my own version of Apache's JSTL implementation I was able to see that this wasn't the case. Strangely, a call to Introspector.getBeanInfo(Class c) was causing the problem, which is interesting because the target class of the expression hasn't changed. A quick Google later and I found a forum post for a similar problem, although it magically went away after changing some code.

After creating a test case, I set out to apply the new changes to the previous version of the codebase, hoping that I'd find the point at which it would break. Thankfully it didn't take too long, but I still don't really understand why this happened. In the new codebase, one of the existing superclasses now implements the java.beans.PropertyChangeListener interface and, for some reason, this unrelated change caused the exception. Moving the listener implementation into an inner class did the trick. As I said, I don't know why this happened, but I imagine that this worked on Resin because it ships with a different JSTL implementation. Anybody else experienced this?

Read: Introspector problems

Topic: On the road to simplicity Previous Topic   Next Topic Topic: [Feb 24, 2005 04:28 PST] 15 Links

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use