java ee - strange illegalArgumentException rooted from JBoss 5.0.1 GA -


we have java web application deployed jboss 5.0.1 ga. sometimes, observe such exceptions our server log

java.lang.illegalargumentexception @ java.nio.buffer.position(buffer.java:216) @ org.apache.tomcat.util.buf.b2cconverter.convert(b2cconverter.java:84) @ org.apache.catalina.connector.inputbuffer.realreadchars(inputbuffer.java:403) @ org.apache.tomcat.util.buf.charchunk.substract(charchunk.java:416) @ org.apache.catalina.connector.inputbuffer.read(inputbuffer.java:432) @ org.apache.catalina.connector.coyotereader.read(coyotereader.java:105) @ org.apache.catalina.connector.coyotereader.readline(coyotereader.java:158) 

....

the code our part triggered exception is

public static string getstringfromrequest(httpservletrequest request) {     string data = "";     try {         bufferedreader reader = request.getreader();         stringbuilder sb = new stringbuilder();          // line below the line blows exception         string line = reader.readline();          while (line != null) {             sb.append(line + "\n");             line = reader.readline();         }         reader.close();         data = sb.tostring();      }      catch (ioexception e) {          ...      }      return data; } 

we have never seen exception in our testing env. in production, when traffic heavier. has seen before? helpful if know trigger exception know how reproduce , fix it. hints/helps appreciated

a posible solution issue upgrade jbossweb.jar.

according jira issue, fix has been committed 2.x branch: java.lang.illegalargumentexception on jboss 5.0.1

possible workaround (java.lang.illegalargumentexception on jboss):

the following steps helped solve similar issues had on servers jboss-5.1.0.ga. (taking account have development environment eclipse , ant) :

  1. checkout snapshot includes above fix of jbossweb project anon svn:

  2. apply attached patch jbossweb.jar can generated (i commented unnecessary resource downloads , compilations).

    • note: used eclipse helios build jar, update jdt.home , jdt.jar properties in build.properties.default match locations of eclipse , jdt jar locations.
  3. run ant deploy target.

  4. if build successful, new jbossweb.jar fix generated under output/jars/jbossweb.jar.

  5. copy new jbossweb.jar on old <profile>/deploy/jbossweb.sar/jbossweb.jar

  6. restart jboss.

i hope help.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -