From sanselan-dev-return-399-apmail-incubator-sanselan-dev-archive=incubator.apache.org@incubator.apache.org Sun Mar 01 21:32:19 2009 Return-Path: Delivered-To: apmail-incubator-sanselan-dev-archive@minotaur.apache.org Received: (qmail 71439 invoked from network); 1 Mar 2009 21:32:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Mar 2009 21:32:19 -0000 Received: (qmail 63213 invoked by uid 500); 1 Mar 2009 21:32:19 -0000 Delivered-To: apmail-incubator-sanselan-dev-archive@incubator.apache.org Received: (qmail 63192 invoked by uid 500); 1 Mar 2009 21:32:19 -0000 Mailing-List: contact sanselan-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sanselan-dev@incubator.apache.org Delivered-To: mailing list sanselan-dev@incubator.apache.org Received: (qmail 63181 invoked by uid 99); 1 Mar 2009 21:32:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Mar 2009 13:32:19 -0800 X-ASF-Spam-Status: No, hits=3.4 required=10.0 tests=HTML_MESSAGE,SPF_PASS,TVD_FW_GRAPHIC_NAME_MID X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kelly.boettcher@abs.gov.au designates 144.53.226.10 as permitted sender) Received: from [144.53.226.10] (HELO mail.abs.gov.au) (144.53.226.10) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Mar 2009 21:32:11 +0000 Received: from Damselfish.iprod.abs.gov.au (damselfish-public.iprod.abs.gov.au [10.35.200.56]) by mail.abs.gov.au (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id n21LVoDH003686 for ; Mon, 2 Mar 2009 08:31:51 +1100 Received: from domco5050.corp.abs.gov.au (unverified) by Damselfish.iprod.abs.gov.au (Clearswift SMTPRS 5.2.9) with ESMTP id for ; Mon, 2 Mar 2009 08:33:50 +1100 In-Reply-To: <1081172297.1235840532687.JavaMail.jira@brutus> References: <1713675150.1235702761735.JavaMail.jira@brutus> <1081172297.1235840532687.JavaMail.jira@brutus> Subject: Re: [jira] Resolved: (SANSELAN-19) JpegXMPWriter throws NullPointerException [SEC=UNCLASSIFIED] To: sanselan-dev@incubator.apache.org X-Mailer: Lotus Notes Release 8.0.2 August 07, 2008 Message-ID: From: Kelly Boettcher Date: Mon, 2 Mar 2009 07:31:42 +1000 X-MIMETrack: Serialize by Router on DomCO5050/SVR/ABS(Release 7.0.2|September 26, 2006) at 02/03/2009 08:31:45 MIME-Version: 1.0 Content-type: multipart/related; Boundary="0__=C5BBFFFFDFE5BEAB8f9e8a93df938690918cC5BBFFFFDFE5BEAB" X-Virus-Checked: Checked by ClamAV on apache.org --0__=C5BBFFFFDFE5BEAB8f9e8a93df938690918cC5BBFFFFDFE5BEAB Content-type: multipart/alternative; Boundary="1__=C5BBFFFFDFE5BEAB8f9e8a93df938690918cC5BBFFFFDFE5BEAB" --1__=C5BBFFFFDFE5BEAB8f9e8a93df938690918cC5BBFFFFDFE5BEAB Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: quoted-printable Oh, der. Sorry about that, silly mistake. Thanks for pointing it out though! = =20 From: "Charles Matthew Chen (JIRA)" = =20 = =20 To: sanselan-dev@incubator.apache.org = =20 = =20 Date: 01/03/2009 03:02 AM = =20 = =20 Subject: [jira] Resolved: (SANSELAN-19) JpegXMPWriter throws NullPoint= erException =20 = =20 [ https://issues.apache.org/jira/browse/SANSELAN-19?page=3Dcom.atlassian.jira= .plugin.system.issuetabpanels:all-tabpanel ] Charles Matthew Chen resolved SANSELAN-19. ------------------------------------------ Resolution: Fixed I don't think you are initializing the variable xmpWriter in that code snippet. Hence the NPE? > JpegXMPWriter throws NullPointerException > ----------------------------------------- > > Key: SANSELAN-19 > URL: https://issues.apache.org/jira/browse/SANSELAN-19 > Project: Sanselan > Issue Type: Bug > Environment: Windows XP, JDK 1.5 > Reporter: Kelly Boettcher > Attachments: TestJPG.jpg > > > I am try to use the JpegXMPWriter to write xmp values from a Jpeg file. Using JpegImageParser, I can retrieve existing xmp values out the file fine. However, attempting to write back into the file produces an exception. > byte[] b =3D null; > String existingXMP =3D null; > String newXMP =3D null; > XMPMeta meta =3D null; > Document licenseDoc =3D null; > JpegImageParser parser =3D null; > JpegXmpRewriter xmpWriter =3D null; > ByteArrayOutputStream baos =3D null; > b =3D new byte[is.available()]; // is is a jpeg input stream passed into the function. > is.read(b); > is.close(); > parser =3D new JpegImageParser(); > ByteSourceArray bs =3D new ByteSourceArray(b); > existingXMP =3D parser.getXmpXml(bs, null); // works fine, passes back valid xmp from the file > /* I did have other functionality here to manipulate the xmp which > works fine, but I also ran the test without changing the xmp, > with the same resulting exception. */ > baos =3D new ByteArrayOutputStream(); > xmpWriter.updateXmpXml(bs, baos, existingXMP); // NullPointerException occurs here. > b =3D baos.toByteArray(); > is =3D new ByteArrayInputStream(b); > return is; > Exception produced: > java.lang.NullPointerException > at au.gov.abs.manager.injector.jpeg.JPEGXMPInjector.doLicenseInsertionSan(JPEG= XMPInjector.java:230) > at au.gov.abs.manager.injector.jpeg.JPEGXMPInjector.doLicenseInsertionSan(JPEG= XMPInjector.java:170) > at au.gov.abs.manager.test.TestJPEGXMPInjector.testDoLicenseInsertionSan(TestJ= PEGXMPInjector.java:156) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3= 9) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp= l.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRun= ner.java:99) > at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner= .java:81) > at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfter= Runner.java:34) > at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java= :75) > at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) > at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClas= sMethodsRunner.java:66) > at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunne= r.java:35) > at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner= .java:42) > at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfter= Runner.java:34) > at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) > at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestRe= ference.java:38) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:= 38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestR= unner.java:460) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestR= unner.java:673) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner= .java:386) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunne= r.java:196) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. ---------------------------------------------------------------------------= --------------------- Free publications and statistics available on www.abs.gov.au --1__=C5BBFFFFDFE5BEAB8f9e8a93df938690918cC5BBFFFFDFE5BEAB Content-type: text/html; charset="us-ascii" Content-Disposition: inline Content-transfer-encoding: quoted-printable

Oh, der. Sorry about that, silly mistake. Thanks for pointing it out tho= ugh!


3D"Inactive"Charles Matthew Chen= (JIRA)" ---01/03/2009 03:02:01 AM--- [ https://issues.apache.org/jira/browse/SANSELAN-19?page=3Dcom.atlassi= an.jira.plugin.system.issue

3D"" From:
"Charles Matthew Chen (JIRA)" <jira@apache.or= g>
3D"" To:3D""
sanselan-dev@incubator.apache.org
3D"" Date:
01/03/2009 03:02 AM
3D"" Subject:<= img width=3D"1" height=3D"1" src=3D"cid:2__=3DC5BBFFFFDFE5BEAB8f9e8a93df938= @abs.gov.au" border=3D"0" alt=3D"">
[jira] Resolved: (SANSELAN-19) JpegXMPWriter throws NullPo= interException






    [
https://issues.apache.org/jira/browse/SANSELAN-19?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charles Matthew Chen resolved SANSELAN-19.
------------------------------------------

   Resolution: Fixed

I don't think you are initializing the variable xmpWriter in that code snip= pet.  Hence the NPE?

> JpegXMPWriter throws NullPointerException
> -----------------------------------------
>
>                 Key: SANSELAN-= 19
>                 URL:
= https://issue= s.apache.org/jira/browse/SANSELAN-19
>             Project: Sanselan
>          Issue Type: Bug
>         Environment: Windows XP, JDK 1.5
>            Reporter: Kelly Boettcher
>         Attachments: TestJPG.jpg
>
>
> I am try to use the JpegXMPWriter to write xmp values from a Jpeg file= . Using JpegImageParser, I can retrieve existing xmp values out the file fi= ne. However, attempting to write back into the file produces an exception.<= br> > byte[] b =3D null;
> String existingXMP =3D null;
> String newXMP =3D null;
> XMPMeta meta =3D null;
> Document licenseDoc =3D null;
> JpegImageParser parser =3D null;      
> JpegXmpRewriter xmpWriter =3D null;
> ByteArrayOutputStream baos =3D null;
> b =3D new byte[is.available()]; // is is a jpeg input stream passed in= to the function.
> is.read(b);
> is.close();
> parser =3D new JpegImageParser();
> ByteSourceArray bs =3D new ByteSourceArray(b);
> existingXMP =3D parser.getXmpXml(bs, null); // works fine, passes back= valid xmp from the file
> /* I did have other functionality here to manipulate the xmp which
>    works fine, but I also ran the test without changing the = xmp,
>    with the same resulting exception. */
> baos =3D new ByteArrayOutputStream();         &nbs= p;  
> xmpWriter.updateXmpXml(bs, baos, existingXMP);  // NullPointerExc= eption occurs here.
> b =3D baos.toByteArray();
> is =3D new ByteArrayInputStream(b);
> return is;
> Exception produced:
> java.lang.NullPointerException
> at au.gov.abs.manager.injector.jpeg.JPEGXMPInjector.doLicenseInsert= ionSan(JPEGXMPInjector.java:230)
> at au.gov.abs.manager.injector.jpeg.JPEGXMPInjector.doLicenseInsert= ionSan(JPEGXMPInjector.java:170)
> at au.gov.abs.manager.test.TestJPEGXMPInjector.testDoLicenseInserti= onSan(TestJPEGXMPInjector.java:156)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor= Impl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod= AccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.junit.internal.runners.TestMethodRunner.executeMethodBody(Te= stMethodRunner.java:99)
> at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestM= ethodRunner.java:81)
> at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(Bef= oreAndAfterRunner.java:34)
> at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethod= Runner.java:75)
> at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner= .java:45)
> at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMeth= od(TestClassMethodsRunner.java:66)
> at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassM= ethodsRunner.java:35)
> at org.junit.internal.runners.TestClassRunner$1.runUnprotected(Test= ClassRunner.java:42)
> at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(Bef= oreAndAfterRunner.java:34)
> at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.j= ava:52)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(J= Unit4TestReference.java:38)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExec= ution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(= RemoteTestRunner.java:460)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(= RemoteTestRunner.java:673)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Remot= eTestRunner.java:386)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Remo= teTestRunner.java:196)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



---------------------= ---------------------------------------------------------------------------=

Free publications and= statistics available on www.abs.gov.au

 

--1__=C5BBFFFFDFE5BEAB8f9e8a93df938690918cC5BBFFFFDFE5BEAB-- --0__=C5BBFFFFDFE5BEAB8f9e8a93df938690918cC5BBFFFFDFE5BEAB--