You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "Gauntt, David" <da...@uabmc.edu> on 2019/04/25 16:34:53 UTC

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" <do...@gmx.at> 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 <da...@uabmc.edu>
>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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: EXT MSG Re: Error while building POI project

Posted by Dave Fisher <da...@comcast.net>.
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 <da...@uabmc.edu> 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" <do...@gmx.at> 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 <da...@uabmc.edu>
>> 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: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: EXT MSG Re: Error while building POI project

Posted by Dominik Stadler <do...@gmx.at>.
Problem with Ant:

Seems some unit tests are failing on your machine, we can take a closer
look if you provide the file
"build\ooxml-test-results\TEST-org.apache.poi.extractor.ooxml.TestExtractorFactory.txt".

Problem in Eclipse:

You will need at least poi-ooxml-schemas-* as dependency in your project.

Apache POI makes use of code from the schema-jars, there is no
"duplication" between them as far as I see.
ooxml-schemas-1.4.jar and ooxml-security-1.1.jar provide a "superset" of
classes compared to poi-ooxml-schemas-*, but no code from org.apache.poi
packages is in there so also not XSSFSheet. So no execution of other code
will take place even if you add the additional dependencies.

See also the "Component map" further down at
http://poi.apache.org/components/, especially look at the "prerequisites"
of "poi-ooxml" listed there.

Dominik.

On Fri, Apr 26, 2019 at 3:29 AM Gauntt, David <da...@uabmc.edu> 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" <do...@gmx.at> 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 <da...@uabmc.edu>
> >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: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>
>

Re: EXT MSG Re: Error while building POI project

Posted by "Gauntt, David" <da...@uabmc.edu>.
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" <do...@gmx.at> 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 <da...@uabmc.edu>
>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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org