• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Strange Problem - too many Connections?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange Problem - too many Connections?


  • Subject: Re: Strange Problem - too many Connections?
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 03 Feb 2004 09:17:12 -0800
  • Organization: Global Village Consulting, Inc.

Neither of these exceptions seem to have anything to do with the number of connections. Read the stack traces carefully - they contain a lot of information.

1. Reading past the cruft at the top, the first trace says
  StringIndexOutOfBoundsException: String index out of range:  62
and then shows
com.webobjects.appserver._CookieParser._parse(_CookieParser.java:87)

Which sounds like someone is sending along an invalid/malformed cookie. WO usually handles these, but not always. This might apply to your situation:
-------------------------
WO Cookie parser actually handles empty values as long as they are not the last value in the list, because often there is no trailing semi-colon.


The easiest fix is as follows, in Application.java:

    public WOResponse dispatchRequest(WORequest request) {
        String cookieHeader = request.headerForKey("cookie");
        if (cookieHeader != null && !cookieHeader.endsWith(";")) {
            request.setHeader(cookieHeader.concat(";"), "cookie");
        }
        return super.dispatchRequest(request);
    }

Which, thank the gods, actually results in the expected behavior:
CookieParser: Found a null cookie value in: 'woinst=-1; wosid=;'. Will continue by setting value to the empty string.


WHEREAS, confound it, I simply could not get WOApplication.handleMalformedCookieString() to correct the situation because you don't have access to the request object, and modifying the mutable dictionary simply had no effect.

Christopher Legan, Ph.D.
Partner, Kiwi InterNet Group, Inc.
http://www.king.net
-------------------------------


2. Reading past the cruft at the top, the second trace says JDBCAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.MySQLPe and then Next exception:SQL State:S1000 -- error code: 0 -- msg: Error during query: Unexpected Exception: ArrayIndexOutOfBoundsException message given: -1 which traces back to at Statistics.<init>(Statistics.java:52)

Looks to me like an error returned by the DB for a bad query. You will need to look at your model, the Statistics constructor, and probably a log of the SQL sent to the DB before you can go further with this. I've never seen anything like this one before.


Chuck



Christian Mittendorf wrote:

Hello,
perhaps somebody can explain these exceptions to me. What is happening here?


Some minutes ago I observed some strange exceptions in my application. There were about 40 concurrent sessions active. I watchted the log files and I found other exceptions, mainly occuring in the evening when the traffic is high.

How many concurrent sessions are possible? Is there any limit?

I'm running 1.5.2 on Debian Linux.

Thanks for any advice ;-)

Christian


[2004-02-02 18:57:23 CET] <WorkerThread14> <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request:
com.webobjects.foundation.NSForwardException [java.lang.StringIndexOutOfBoundsException] null
[2004-02-02 18:57:23 CET] <WorkerThread14> com.webobjects.foundation.NSForwardException for java.lang.StringIndexOutOfBoundsException: String index out of range: 62
at java.lang.String.charAt(String.java:460)
at com.webobjects.appserver._CookieParser._parse(_CookieParser.java:87)
at com.webobjects.appserver._CookieParser.parse(_CookieParser.java:173)
at com.webobjects.appserver.WORequest._cookieDictionary(WORequest.java: 1023)
at com.webobjects.appserver.WORequest.cookieValues(WORequest.java:1081)
at com.webobjects.appserver.WORequest.cookieValueForKey(WORequest.java: 1060)
at com.webobjects.appserver.WORequest._getSessionIDFromValuesOrCookie(WOReq uest.java:1605)
at com.webobjects.appserver.WORequest._getSessionIDFromValuesOrCookie(WOReq uest.java:1577)
at com.webobjects.appserver.WORequest.sessionID(WORequest.java:1549)
at com.webobjects.appserver.WOContext._synchronizeForDistribution(WOContext .java:484)
at com.webobjects.appserver.WOContext._setRequest(WOContext.java:536)
at com.webobjects.appserver.WOContext.<init>(WOContext.java:114)
at sun.reflect.GeneratedConstructorAccessor69.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons tructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.ja va:575)
at com.webobjects.appserver.WOApplication.createContextForRequest(WOApplica tion.java:1676)
at com.webobjects.appserver._private.WOComponentRequestHandler._handleReque st(WOComponentRequestHandler.java:353)
at com.webobjects.appserver._private.WOComponentRequestHandler.handleReques t(WOComponentRequestHandler.java:432)
at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.jav a:1308)
at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread. java:173)
at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java :254)
at java.lang.Thread.run(Thread.java:536)



[2004-02-03 17:19:42 CET] <WorkerThread44> <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request:
com.webobjects.foundation.NSForwardException [com.webobjects.jdbcadaptor.JDBCAdaptorException] null
[2004-02-03 17:19:42 CET] <WorkerThread44> com.webobjects.foundation.NSForwardException for com.webobjects.jdbcadaptor.JDBCAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.MySQLPe
Next exception:SQL State:S1000 -- error code: 0 -- msg: Error during query: Unexpected Exception: java.lang.ArrayIndexOutOfBoundsException message given: -1
at com.webobjects.jdbcadaptor.JDBCContext._jdbcErrorWithChannel(JDBCContext .java:138)
at com.webobjects.jdbcadaptor.JDBCChannel._evaluateExpression(JDBCChannel.j ava:304)
at com.webobjects.jdbcadaptor.JDBCChannel.evaluateExpression(JDBCChannel.ja va:255)
at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes(JDBCChannel.java :185)
at com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificationE ditingContext(EODatabaseChannel.java:879)
at com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecific ation(EODatabaseChannel.java:216)
at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecification EditingContext(EODatabaseContext.java:3178)
at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification( EODatabaseContext.java:3319)
at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecif ication(EOObjectStoreCoordinator.java:535)
at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification( EOEditingContext.java:4036)
at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification( EOEditingContext.java:4421)
at com.webobjects.eoaccess.EOUtilities.objectsForEntityNamed(EOUtilities.ja va:64)
at Statistics.<init>(Statistics.java:52)
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

--

Chuck Hill                                 email@hidden
Global Village Consulting Inc.             http://www.global-village.net

It is a funny thing about life; if you refuse to accept
anything but the best, you very often get it."
  --  W. Somerset Maugham

<shamelessPlug>
  Practical WebObjects
  http://www.amazon.com/exec/obidos/tg/detail/-/1590592964
</shamelessPlug>
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Displaying Values Through Flattened Relationships
      • From: "Janice M. Cheung" <email@hidden>
    • Re: Strange Problem - too many Connections?
      • From: Christian Mittendorf <email@hidden>
References: 
 >Strange Problem - too many Connections? (From: Christian Mittendorf <email@hidden>)

  • Prev by Date: Re: Strange Problem - too many Connections?
  • Next by Date: Re: Best Notification Framework
  • Previous by thread: Re: Strange Problem - too many Connections?
  • Next by thread: Re: Strange Problem - too many Connections?
  • Index(es):
    • Date
    • Thread