OOXML *is* part of POI. You will need XMLBeans if you wish to compile these.

Sent from my iPhone

> On Apr 25, 2019, at 6:29 PM, Gauntt, David <[email protected]> wrote:
> 
> I have updated Eclipse to version 2019-03, and pulled the latest version of 
> Poi trunk from the Git mirror.  Eclipse now builds POI without errors, but 
> apparently I cannot make use of it (see details below).  I am trying to get 
> around this by going back to using Ant to build build.xml with the "jar" 
> target, but it fails during the test phase.  I am an Ant newbie, so I can 
> only guess as to what is happening here.
> 
> When Ant fails, the following written is to the console:
> 
> [junit] Running org.apache.poi.TestXMLPropertiesTextExtractor
>       [junit] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 
> 1.028 sec
>       [junit] Running org.apache.poi.extractor.ooxml.TestExtractorFactory
>       [junit] Tests run: 15, Failures: 0, Errors: 4, Skipped: 0, Time 
> elapsed: 2.54 sec
> BUILD FAILED
> C:\Users\David M. Gauntt\git\poi\build.xml:1629: The following error occurred 
> while executing this line:
> C:\Users\David M. Gauntt\git\poi\build.xml:1595: The following error occurred 
> while executing this line:
> C:\Users\David M. Gauntt\git\poi\build.xml:1237: Tests failed
> 
> The lines of build.xml that cause the errors are:
> 
>   <target name="test-ooxml" 
> depends="compile-main,compile-ooxml,-test-ooxml-check,jacocotask,-ooxml-lite-agent"
>  unless="ooxml.test.notRequired"
>            description="test OOXML classes">
> //    Fails on the following line
>        <ooxml-test-runner classpath="test.ooxml.classpath" type="ooxml"/>
>        <delete file="${ooxml.testokfile}"/>
>        <antcall target="-test-ooxml-write-testfile"/>
>    </target>
> and
>   <macrodef name="ooxml-test-runner" xmlns:jacoco="antlib:org.jacoco.ant">
>        <attribute name="classpath"/>
>        <attribute name="type"/>
>        <sequential>
> //    Fails on the following line
>            <poiunit failureproperty="ooxml.test.failed" heap="768" 
> jacocodest="build/jacoco-@{type}.exec">
>                <classpath>
>                    <path refid="@{classpath}"/>
>                    <path refid="test.jar.classpath"/>
>                </classpath>
> 
> I will see if I can disable a test target as a jury-rig, but that doesn't 
> seem like the best possible solution.
> 
> Details on Eclipse failure
> 
> I had written a UnitTest project to run unit tests on Poi (and other 
> software).  In Eclipse, I have added ApachePOI as a "Required Project" in the 
> build path, but I get the following in the Problem window:
> "The type org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet 
> cannot be resolved. It is indirectly referenced from required .class files"
> I can get rid of this by adding two libarires that I downloaded from the 
> internet: "ooxml-schemas-1.4.jar" ad "ooxml-security-1.1.jar".  When I do 
> this I can build and run the UnitTest project, but it appears to be executing 
> the XSSFSheet code in "ooxml-schemas-1.4.jar" rather than in the ApachePOI 
> project, which defeats the whole purpose of the UnitTest project.
> 
> 
> ________________________________
> From: Gauntt, David
> Sent: Thursday, April 25, 2019 11:34:53 AM
> To: POI Developers List
> Subject: Re: EXT MSG Re: Error while building POI project
> 
> Thanks for looking into this; I will try updating Eclipse and rebuilding
> tonight.
> 
> I have also been working on building it using Ant within Eclipse; I will
> post a question in the next day or two about my current problem with that.
> 
> ‹
> David M. Gauntt, Ph.D.
> Associate Professor, Department of Radiology
> UAB Medical Center
> 
> 
> 
> 
> 
> 
>> On 4/25/19, 7:58 AM, "Dominik Stadler" <[email protected]> wrote:
>> 
>> Hi David,
>> 
>> Sorry that it took you some time to make it work, we try to make it easy,
>> but as things are constantly
>> 
>> Sounds like a limitation of Eclipse, I just tried with Eclipse 4.7.x and
>> saw the same error with latest trunk, it seems not many people working on
>> POI are using Eclipse nowadays.
>> 
>> I then tried with latest Eclipse 2019.03, there most of the compilation
>> errors are gone, 4 are remaining for casts that seem to be too complex for
>> Eclipse but are working with Oracle/OpenJDK/IBMJDK, we should probably
>> work
>> around those so we support at least the current version of Eclipse, even
>> if
>> it has limitations in its implementation of Java compilation.
>> 
>> I performed a few smaller changes that should make it work on Eclipse
>> 2019.03 again, so if you can switch Eclipse and update to latest trunk,
>> you
>> should be able to compile.
>> 
>> Thanks... Dominik.
>> 
>> 
>> On Thu, Apr 25, 2019 at 3:04 AM Gauntt, David <[email protected]>
>> wrote:
>> 
>>> I am getting close to my first successful build of the POI project, and
>>> have run into a couple of compiler errors that seem to be blocking me.
>>> The
>>> first of these is
>>> 
>>> 
>>> Cannot reference a field before it is defined
>>> 
>>> 
>>> This is caused 100 times in RecordTypes. java.  How is it that other
>>> people are getting this project to compile properly but not me?  I am
>>> building in Eclipse ver 2018-09 under Windows 10, using Java SE 1.8.
>>> The
>>> project is a copy of tag REL_4_1_0 from the Git mirror of POI.
>>> 
>>> 
>>> The following code illustrates this error.  Ironically, while the error
>>> message says that I am trying to reference a field, the error seems to
>>> be
>>> caused by a method reference (UnknownRecordPlaceholder::new).
>>> 
>>> 
>>> public final class SSCCE {
>>> 
>>>    static class UnknownRecordPlaceholder {
>>>    }
>>> 
>>>    enum RecordTypes {
>>> // Error caused by next line
>>>        UnknownRecordPlaceholder(UnknownRecordPlaceholder::new);
>>> 
>>>        @FunctionalInterface
>>>        public interface RecordConstructor {
>>>            void test();
>>>        }
>>> 
>>>        public final RecordConstructor recordConstructor;
>>> 
>>>        RecordTypes(RecordConstructor recordConstructor) {
>>>            this.recordConstructor = recordConstructor;
>>>        }
>>>    }
>>> 
>>> }
>>> 
>>> 
>>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to