You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Pierre Smits (JIRA)" <ji...@apache.org> on 2015/03/28 21:50:52 UTC

[jira] [Comment Edited] (OFBIZ-6218) Unit tests throw exception in DBCP

    [ https://issues.apache.org/jira/browse/OFBIZ-6218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14385518#comment-14385518 ] 

Pierre Smits edited comment on OFBIZ-6218 at 3/28/15 8:49 PM:
--------------------------------------------------------------

This might be related to something I am experiencing with a piece of groovy code:

{code}
rolesIter = partyRelationRoles.iterator()
while (rolesIter){
thisItem = rolesIter.next()
partyNameView = delegator.findOne("PartyNameView",["partyId" : thisItem.partyIdFrom], false)
}

{code}

Which results in following log messages:
{code}
     [java] 2015-03-28 21:33:36,303 |http-bio-8443-exec-7 |                              |I| in community, getRoles:org.ofbiz.entity.util.EntityListIterator@12f4bdac
     [java] 2015-03-28 21:33:36,303 |http-bio-8443-exec-7 |EntityListIterator            |W| For performance reasons do not use the EntityListIterator.hasNext() method, just call next() until it returns null; see JavaDoc comments in the EntityListIterator class for details and an example
     [java] java.lang.Exception
     [java] at org.ofbiz.entity.util.EntityListIterator.hasNext(EntityListIterator.java:254) [ofbiz-entity.jar:?]
     [java] at org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean(DefaultGroovyMethods.java:7781) [groovy-all-2.2.1.jar:2.2.1]
     [java] at org.codehaus.groovy.runtime.dgm$28.doMethodInvoke(Unknown Source) [groovy-all-2.2.1.jar:2.2.1]
     [java] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085) [groovy-all-2.2.1.jar:2.2.1]
{code}
followed by:
{code}
     [java] 2015-03-28 21:36:39,424 |Finalizer            |EntityListIterator            |E| 
     [java] ====================================================================
     [java]  EntityListIterator Not Closed for Entity [PartyRelationship], caught in Finalize
     [java]  ====================================================================
     [java] 
     [java] 2015-03-28 21:36:39,425 |Finalizer            |SQLProcessor                  |E| Error closing the result, connection, etc in finalize SQLProcessor
     [java] java.lang.NullPointerException
     [java] 	at org.apache.commons.dbcp2.DelegatingConnection.closeInternal(DelegatingConnection.java:235) ~[commons-dbcp2-2.1.jar:2.1]
     [java] 	at org.apache.commons.dbcp2.DelegatingConnection.close(DelegatingConnection.java:218) ~[commons-dbcp2-2.1.jar:2.1]
     [java] 	at org.apache.commons.dbcp2.managed.ManagedConnection.close(ManagedConnection.java:166) ~[commons-dbcp2-2.1.jar:2.1]
     [java] 	at org.ofbiz.entity.jdbc.SQLProcessor.close(SQLProcessor.java:235) ~[ofbiz-entity.jar:?]
     [java] 	at org.ofbiz.entity.jdbc.SQLProcessor.finalize(SQLProcessor.java:844) [ofbiz-entity.jar:?]
     [java] 	at java.lang.System$2.invokeFinalize(System.java:1213) [?:1.7.0_71]
     [java] 	at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98) [?:1.7.0_71]
     [java] 	at java.lang.ref.Finalizer.access$100(Finalizer.java:34) [?:1.7.0_71]
     [java] 	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210) [?:1.7.0_71]
{code}
  


was (Author: pfm.smits):
This might be related to something I am experiencing with a piece of groovy code:

{code}
rolesIter = partyRelationRoles.iterator()
while (rolesIter){
thisItem = rolesIter.next()
partyNameView = delegator.findOne("PartyNameView",["partyId" : thisItem.partyIdFrom], false)
}

{code}

Which results in following log messages:
{code}
     [java] 2015-03-28 21:33:36,303 |http-bio-8443-exec-7 |                              |I| in community, getRoles:org.ofbiz.entity.util.EntityListIterator@12f4bdac
     [java] 2015-03-28 21:33:36,303 |http-bio-8443-exec-7 |EntityListIterator            |W| For performance reasons do not use the EntityListIterator.hasNext() method, just call next() until it returns null; see JavaDoc comments in the EntityListIterator class for details and an example
     [java] java.lang.Exception
     [java] at org.ofbiz.entity.util.EntityListIterator.hasNext(EntityListIterator.java:254) [ofbiz-entity.jar:?]
     [java] at org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean(DefaultGroovyMethods.java:7781) [groovy-all-2.2.1.jar:2.2.1]
     [java] at org.codehaus.groovy.runtime.dgm$28.doMethodInvoke(Unknown Source) [groovy-all-2.2.1.jar:2.2.1]
     [java] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085) [groovy-all-2.2.1.jar:2.2.1]
{code}

> Unit tests throw exception in DBCP
> ----------------------------------
>
>                 Key: OFBIZ-6218
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6218
>             Project: OFBiz
>          Issue Type: Bug
>            Reporter: Adrian Crum
>
> Details in comments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)