From dev-return-103366-apmail-cocoon-dev-archive=cocoon.apache.org@cocoon.apache.org Tue Feb 28 15:14:21 2012 Return-Path: X-Original-To: apmail-cocoon-dev-archive@www.apache.org Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1E9639547 for ; Tue, 28 Feb 2012 15:14:21 +0000 (UTC) Received: (qmail 27806 invoked by uid 500); 28 Feb 2012 15:14:20 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 27739 invoked by uid 500); 28 Feb 2012 15:14:20 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Delivered-To: moderator for dev@cocoon.apache.org Received: (qmail 71577 invoked by uid 99); 28 Feb 2012 14:57:53 -0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) From: Ivan Lagunov To: "dev@cocoon.apache.org" CC: Robby Pelssers Date: Tue, 28 Feb 2012 15:57:16 +0100 Subject: NPE during source validity check for ValidatingTransformer Thread-Topic: NPE during source validity check for ValidatingTransformer Thread-Index: Acz2KUK6OfI+D86YSDqqrxK3aAbg0w== Message-ID: <32F7A2622283E6439A530B88726B731805EE717F@eu1rdcrdc1wx032.exi.nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_32F7A2622283E6439A530B88726B731805EE717Feu1rdcrdc1wx032_" MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.6.7498,1.0.260,0.0.0000 definitions=2012-02-28_06:2012-02-27,2012-02-28,1970-01-01 signatures=0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_32F7A2622283E6439A530B88726B731805EE717Feu1rdcrdc1wx032_ Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Hi, I've caught the following NullPointerException: org.apache.excalibur.source.impl.validity.AggregatedValidity.isValid(Aggreg= atedValidity.java:45) org.apache.cocoon.components.validation.impl.CachingValidator.getSchema(Cac= hingValidator.java:129) org.apache.cocoon.components.validation.impl.AbstractValidator.getValidatio= nHandler(AbstractValidator.java:330) org.apache.cocoon.components.validation.impl.AbstractValidator.getValidatio= nHandler(AbstractValidator.java:244) org.apache.cocoon.transformation.ValidatingTransformer.setup(ValidatingTran= sformer.java:135) So what is happening? It appeared that AggregatedValidity.m_list array list= held null element. The null element was added to m_list in ValidationResol= ver. resolveSource method: /* Record the current source in the validities to return */ this.sourceValidity.add(source.getValidity()); The javadoc for Source.getValidity() says: Get the Validity object. This can either wrap the last modification date or= some expiry information or anything else describing this object's validity= . If it is currently not possible to calculate such an information, null is r= eturned. The fact is that my Source is being loaded from XML DB by custom generator = and it seems to be correct that validity is null. I suppose it's a bug and = it can be fixed in the following way: /* Record the current source in the validities to return */ If (source.getValidity() !=3D null) this.sourceValidity.add(source.= getValidity()); This worked for me. I suggest this as an official commit. Best regards, Ivan Lagunov --_000_32F7A2622283E6439A530B88726B731805EE717Feu1rdcrdc1wx032_ Content-Type: text/html; charset="koi8-r" Content-Transfer-Encoding: quoted-printable

Hi,

 

I’ve= caught the following NullPointerException:

 

org.apache.excalibur.source.i= mpl.validity.AggregatedValidity.isValid(AggregatedValidity.java:45)

org.apache.cocoon.components.validation.impl.Ca= chingValidator.getSchema(CachingValidator.java:129)

org.apache.cocoon.components.validation.impl.AbstractValidator= .getValidationHandler(AbstractValidator.java:330)

org.apache.cocoon.components.validation.impl.AbstractValidator.ge= tValidationHandler(AbstractValidator.java:244)

org.apache.cocoon.transformation.ValidatingTransform= er.setup(ValidatingTransformer.java:135)

 

So= what is happening? It appeared that AggregatedValidity.m_list array list h= eld null element. The null element was added to m_list in ValidationResolve= r. resolveSource method:

=9A=9A=9A=9A=9A= =9A=9A /* Record the current source in the validities to return */

=9A=9A=9A=9A=9A=9A=9A this.sourceValidity.add(so= urce.getValidity());

 

The javadoc for Source.getValidity() says:

Get the Validity object. This can either wrap the= last modification date or some expiry information or anything else describ= ing this object's validity.

If it is cur= rently not possible to calculate such an information, null is returned.

 

T= he fact is that my Source is being loaded from XML DB by custom generator a= nd it seems to be correct that validity is null. I suppose it’s a bug= and it can be fixed in the following way:

=9A=9A=9A=9A=9A=9A=9A /* Record the current source in the validities to = return */

=9A=9A=9A=9A=9A=9A=9A If (sour= ce.getValidity() !=3D null) this.sourceValidity.add(source.getValidity());<= o:p>

 

This worked for me. I suggest this as an official commit.

<= p class=3DMsoNormal> 

Best regards,=

Ivan Lagunov

= --_000_32F7A2622283E6439A530B88726B731805EE717Feu1rdcrdc1wx032_--