Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 16579 invoked from network); 18 Jun 2006 13:35:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Jun 2006 13:35:28 -0000 Received: (qmail 13156 invoked by uid 500); 18 Jun 2006 13:35:19 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 13110 invoked by uid 500); 18 Jun 2006 13:35:18 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 13099 invoked by uid 99); 18 Jun 2006 13:35:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Jun 2006 06:35:18 -0700 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [217.12.12.199] (HELO smtp809.mail.ukl.yahoo.com) (217.12.12.199) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 18 Jun 2006 06:35:15 -0700 Received: (qmail 4988 invoked from network); 18 Jun 2006 13:34:52 -0000 Received: from unknown (HELO ?127.0.0.1?) (scolebourne@btinternet.com@86.132.190.22 with plain) by smtp809.mail.ukl.yahoo.com with SMTP; 18 Jun 2006 13:34:52 -0000 Message-ID: <44955689.6080303@btopenworld.com> Date: Sun, 18 Jun 2006 14:35:05 +0100 From: Stephen Colebourne User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: LRUMap NullpointerException References: <20060618082325.255590@gmx.net> In-Reply-To: <20060618082325.255590@gmx.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 0624-2, 15/06/2006), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Can you also check all loops of the map are synchronized correctly: synchronied (map) { Iterator it = mpap.keySet().iterator(); while (it.hasNext()) { .. } } and so on. The synchronized MUST be around the whole looping. Stephen Thilko Richter wrote: > Hi there, > > we used Version 3.2 and synchronized all access to LRUMap. WE get this IllegalStateException. Can you reproduce this behauviour? > > > > > > 2006-06-14 00:26:22,359 [ERROR] BaseDataLoggerGate.com.sunreader.sr2.gate.BaseDataLoggerGate.doPost: > > java.lang.IllegalStateException: Entry.next=null, data[removeIndex]==org.objectstyle.cayenne.DataRo..f1d2ce[values={description=inserted, status=ins}, version=-9223372036854491432, replaces=-9223372036854775808] previous==org.objectstyle.cayenne.DataRow@4bac35[values={tempValue=31.35, efficiencyValue=1.0761, effBlockDataId=24455598, energyValue=8.16, efficiencyBlockId=767, status=ins, irradiationValue=673.98, earnings=4.4064, importEffBlockDataId=1042169, dataDate=Mon Jun 12 11:30:00 CEST 2006, co2Saving=6.12}, version=-9223372036854494908, replaces=-9223372036854495032] key= value=org.objectstyle.cayenne.DataRow@1a87890[values={plantId=923, newSerialNumber=null, commChannelType=analog, loggerProductId=1, loggerId=923, serialNumber=DL-NE101-01331, commChannelManufacturer=Conergy}, version=-9223372036854491407, replaces=-9223372036854775808] size=10000 maxSize=1000 0 > Please check that your keys are immutable, and that you have used synchronization properly. If so, then please report this to commons-de..akarta.apache.org as a bug. > at org.apache.commons.collections.map.LRUMap.reuseMapping(LRUMap.java:300) > at org.apache.commons.collections.map.LRUMap.addMapping(LRUMap.java:266) > at org.apache.commons.collections.map.AbstractHashedMap.put(AbstractHashedMap.java:283) > at org.objectstyle.cayenne.access.DataRowStore.processUpdatedSnapshots(DataRowStore.java:621) > at org.objectstyle.cayenne.access.DataRowStore.processSnapshotChanges(DataRowStore.java:575) > at org.objectstyle.cayenne.access.DataRowStore.snapshotsUpdatedForObjects(DataRowStore.java:314) > at org.objectstyle.cayenne.access.ObjectResolver.objectsFromDataRows(ObjectResolver.java:159) > at org.objectstyle.cayenne.access.ObjectResolver.synchronizedObjectsFromDataRows(ObjectResolver.java:134) > at org.objectstyle.cayenne.access.DataDomainQueryAction.interceptObjectConversion(DataDomainQueryAction.java:375) > at org.objectstyle.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:151) > at org.objectstyle.cayenne.access.DataDomain.onQuery(DataDomain.java:765) > at org.objectstyle.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:253) > at org.objectstyle.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:90) > at org.objectstyle.cayenne.access.DataContext.onQuery(DataContext.java:1422) > at org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:1411) > at com.conergy.sunreader.sr2.back.dao.ProductDAO.isLoggerAlreadyAvailable(Unknown Source) > > > Thanks a lot, > > Thilko > > > > After extensive testing, we can only reproduce this when the map has not > been correctly synchronized, or a mutable key has been used (as opposed > to an immutable one). > > If you upgrade to collections v3.2 you will get extra logging which may > help diagnose the problem. > > Stephen > > Thilko Richter wrote: > >>Hi all, >> >>I am working with Cayenne and I ´ve get the following Exception: >> >>Caused by: java.lang.NullPointerException >> at org.apache.commons.collections.map.LRUMap.reuseMapping(LRUMap.java:272) >> at org.apache.commons.collections.map.LRUMap.addMapping(LRUMap.java:243) >> at org.apache.commons.collections.map.AbstractHashedMap.put(AbstractHashedMap.java:282) >> at org.objectstyle.cayenne.access.DataRowStore.processUpdatedSnapshots(DataRowStore.java:621) >> at org.objectstyle.cayenne.access.DataRowStore.processSnapshotChanges(DataRowStore.java:575) >> at org.objectstyle.cayenne.access.DataRowStore.snapshotsUpdatedForObjects(DataRowStore.java:314) >> at org.objectstyle.cayenne.access.ObjectResolver.objectsFromDataRows(ObjectResolver.java:159) >> at org.objectstyle.cayenne.access.ObjectResolver.synchronizedObjectsFromDataRows(ObjectResolver.java:134) >> at org.objectstyle.cayenne.access.DataDomainQueryAction.interceptObjectConversion(DataDomainQueryAction.java:375) >> at org.objectstyle.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:151) >> at org.objectstyle.cayenne.access.DataDomain.onQuery(DataDomain.java:765) >> at org.objectstyle.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:253) >> at org.objectstyle.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:90) >> at org.objectstyle.cayenne.access.DataContext.onQuery(DataContext.java:1422) >> at org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:1411) >> at org.objectstyle.cayenne.access.DataContextFaults$ToOneFault.doResolveFault(DataContextFaults.java:144) >> at org.objectstyle.cayenne.access.DataContextFaults$ToOneFault.resolveFault(DataContextFaults.java:117) >> at org.objectstyle.cayenne.CayenneDataObject.readProperty(CayenneDataObject.java:245) >> at com.conergy.sunreader.sr2.back.auto._TblAccount.getTblPerson(Unknown Source) >> at com.conergy.sunreader.sr2.back.dao.UserDAO.setAccountPersonData(Unknown Source) >> at com.conergy.sunreader.sr2.back.dao.UserDAO.getUser(Unknown Source) >> at com.conergy.sunreader.sr2.back.dao.UserDAO.login(Unknown Source) >> at com.conergy.sunreader.sr2.back.proxy.CayenneProxy.login(Unknown Source) >> at com.conergy.sunreader.sr2.back.BusinessFacade.login(Unknown Source) >> at com.conergy.sunreader.sr2.struts.actions.Sr2BaseAction.loginUser(Unknown Source) >> ... 31 more >> >> >>We have posted this exception in cayenne newsgroup before and we found out, that the > > caller of LRUMap is responsible for the thread safety. We´ve changed some methods calls in > caeynne temporarily, but we still get this exception. Could anyone help us and tell, waht > was going wrong here? > >>We using commons-collection v.3.1 >> >>This behauvior occurs when the machine is under heavy load and a lot threads access are > > created. > >>Thanks in advance, >> >>Thilko > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org