Re: Migrating from 3.14 to 3.17 and JDK7 to JDK9: Issues with Package accessibility:

2018-02-08 Thread Markus Sandmann
Hi everyone,

I was finally able to nail this issue(s) down and fix them. So in case
someone is struggeling with the same problems here is my solution:
The problem ist NOT caused by the apache-poi 3.17 library directly. Same
goes for the JDK9 thing.

It looks like Eclipse 4.7.2 has some problems with JDK9 compiler levels in
cause of overlapping errors (sorry don't know how to say this better in
english).
The actual problem was triggered through the update from v3.14 to 3.17
witch brought some API changes (especially all those migrations to the new
XXXType ENUMS like HyperLink, BorderStyle, FillPatternType, etc.).

My Project uses the apache POI library in two separate classes
(SwingWorkers) to read and/or write Excel documents.
One class was marked as contains errors by eclipse (that class from witch i
took the screenshots for the StackOverflow Post). The Second class did not
have any errors (in Eclipse).

After migrating the Errors in that one class based on the guide in the
Apache POI Changelogs those "cannot be resolved" import issues appeared.
The second class still had zero errors!

I found out about those additional errors in the second class only by
compiling the stuff by hand on the command line instead of from within
eclipse.
After fixing those parts (migrating from HyperLink.LINK_DOCUMENT to
HyperlinkType.DOCUMENT) the import issues in the other class disappeared!

So it looks like eclipse somehow messed up the imports / accessibility of
some classes of the library for the whole project because of a completly
other issue in another class of the project. Never had this kind of
problems before

So thank you all for your time, hope this helps others with similar issues
:).

It was definitly NOT a direct problem of the apache poi 3.17 alongside with
jdk9!

Greetings,
Markus


Re: Migrating from 3.14 to 3.17 and JDK7 to JDK9: Issues with Package accessibility:

2018-02-07 Thread Dominik Stadler
Hi,

We have some support for JDK 9 which we verify via
https://builds.apache.org/view/P/view/POI/job/POI-DSL-1.9/, it was started
in 3.17 and refined slightly in 4.0, albeit there is still some work
necessary, even in 4.0 as we do not set any module information yet. Patches
welcome!

Can you try the steps listed at http://poi.apache.org/faq.html#faq-N102B0
which tries to disable some of the JDK 9 module system stuff.

However when not done we usually saw different error messages, not
unresolvable classes, so I would not rule out some Eclipse related problem.
Can you try to run the same via some build-system on the commandline?

Dominik.

On Wed, Feb 7, 2018 at 3:07 PM, Markus Sandmann  wrote:

> Hi,
>
> yes i do.
> One Reason is that the executing machines will be updated to jre9 in a few
> days although I could try to use the jave 7 compliance level, at least
> temporary.
> The other Reason is that I could make very good use of the new Taskbar
> Features in JDK9.
>
> A colegue of mine is desperatly waiting for the lamda expressions from jdk8
> to "reduce" his code (I don't really care because i find them very hard to
> read compared to the old way) but we skipped JDK8 until now because of
> other issues (those are fixed when using jdk9 which is also weird but
> another storry concerning another library not related to this issue :) ).
>
> Greetings,
> Markus
>
>
>
>
> 2018-02-07 14:11 GMT+01:00 Jörn Franke :
>
> > I think only poi 4.0 officially supports JDK 8 only and not JDK7 anymore.
> > Poi 3.17 supports 6,7,8.
> >
> > I am not sure if Poi is jdk 9 ready rested yet. Maybe the upcoming
> release
> > 4.0 will be but the release manager can give you some definitive answer.
> >
> > Do you need any specific jdk9 feature ?
> >
> > > On 7. Feb 2018, at 13:15, Markus Sandmann  wrote:
> > >
> > > Hi there,
> > >
> > > currently I try to migrate my Projects to the latest JDK9 as well as
> > > updating used libaries like apache poi.
> > > Comming from v3.14 and JDK7 I have a strange problem that i can't find
> > the
> > > solution to:
> > >
> > > After updating apache poi I had to adjust some parts of my code because
> > of
> > > deprecated/removed functions. (Migration to the new Color and
> FillPattern
> > > enums for example).
> > >
> > > This step works just fine. After that I started the migration from JDK7
> > to
> > > JDK9. As soon as i switch die compiler level and system library to jdk9
> > > some of the Apache POI classes become unresolveable and/or
> unaccessible.
> > >
> > > I already have a StackOverFlow post concerning this matter here with
> more
> > > details:
> > > https://stackoverflow.com/questions/48640064/migrating-
> > apache-poi-3-14-to-3-17-and-jdk9
> > >
> > > The offending classes are:
> > >
> > > import org.apache.poi.ss.usermodel.Row;
> > > import org.apache.poi.xssf.usermodel.XSSFColor;
> > > import org.apache.poi.xssf.usermodel.XSSFFont;
> > > import org.apache.poi.xssf.usermodel.XSSFWorkbook;
> > >
> > > All result in either "cannot be resolved" or "is not accessible"
> > depending
> > > on whether i do a rebuild or a save after edit (which is strange and
> > might
> > > be an eclipse bug?).
> > >
> > > Other imports from the library like:
> > > import org.apache.poi.ss.usermodel.BorderStyle;
> > > import org.apache.poi.ss.usermodel.Cell;
> > > import org.apache.poi.ss.usermodel.FillPatternType;
> > > import org.apache.poi.ss.usermodel.IndexedColors;
> > > import org.apache.poi.xssf.usermodel.XSSFCellStyle;
> > > import org.apache.poi.xssf.usermodel.XSSFSheet;
> > >
> > > work just fine.
> > >
> > > When I switch the project back to JDK7 without touching any code the
> > stuff
> > > compiles again just fine.
> > >
> > > What's wrong here?
> > >
> > > Greetings,
> > > Markus
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
> > For additional commands, e-mail: user-h...@poi.apache.org
> >
> >
>


Re: Migrating from 3.14 to 3.17 and JDK7 to JDK9: Issues with Package accessibility:

2018-02-07 Thread Markus Sandmann
Hi,

yes i do.
One Reason is that the executing machines will be updated to jre9 in a few
days although I could try to use the jave 7 compliance level, at least
temporary.
The other Reason is that I could make very good use of the new Taskbar
Features in JDK9.

A colegue of mine is desperatly waiting for the lamda expressions from jdk8
to "reduce" his code (I don't really care because i find them very hard to
read compared to the old way) but we skipped JDK8 until now because of
other issues (those are fixed when using jdk9 which is also weird but
another storry concerning another library not related to this issue :) ).

Greetings,
Markus




2018-02-07 14:11 GMT+01:00 Jörn Franke :

> I think only poi 4.0 officially supports JDK 8 only and not JDK7 anymore.
> Poi 3.17 supports 6,7,8.
>
> I am not sure if Poi is jdk 9 ready rested yet. Maybe the upcoming release
> 4.0 will be but the release manager can give you some definitive answer.
>
> Do you need any specific jdk9 feature ?
>
> > On 7. Feb 2018, at 13:15, Markus Sandmann  wrote:
> >
> > Hi there,
> >
> > currently I try to migrate my Projects to the latest JDK9 as well as
> > updating used libaries like apache poi.
> > Comming from v3.14 and JDK7 I have a strange problem that i can't find
> the
> > solution to:
> >
> > After updating apache poi I had to adjust some parts of my code because
> of
> > deprecated/removed functions. (Migration to the new Color and FillPattern
> > enums for example).
> >
> > This step works just fine. After that I started the migration from JDK7
> to
> > JDK9. As soon as i switch die compiler level and system library to jdk9
> > some of the Apache POI classes become unresolveable and/or unaccessible.
> >
> > I already have a StackOverFlow post concerning this matter here with more
> > details:
> > https://stackoverflow.com/questions/48640064/migrating-
> apache-poi-3-14-to-3-17-and-jdk9
> >
> > The offending classes are:
> >
> > import org.apache.poi.ss.usermodel.Row;
> > import org.apache.poi.xssf.usermodel.XSSFColor;
> > import org.apache.poi.xssf.usermodel.XSSFFont;
> > import org.apache.poi.xssf.usermodel.XSSFWorkbook;
> >
> > All result in either "cannot be resolved" or "is not accessible"
> depending
> > on whether i do a rebuild or a save after edit (which is strange and
> might
> > be an eclipse bug?).
> >
> > Other imports from the library like:
> > import org.apache.poi.ss.usermodel.BorderStyle;
> > import org.apache.poi.ss.usermodel.Cell;
> > import org.apache.poi.ss.usermodel.FillPatternType;
> > import org.apache.poi.ss.usermodel.IndexedColors;
> > import org.apache.poi.xssf.usermodel.XSSFCellStyle;
> > import org.apache.poi.xssf.usermodel.XSSFSheet;
> >
> > work just fine.
> >
> > When I switch the project back to JDK7 without touching any code the
> stuff
> > compiles again just fine.
> >
> > What's wrong here?
> >
> > Greetings,
> > Markus
>
> -
> To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
> For additional commands, e-mail: user-h...@poi.apache.org
>
>


Re: Migrating from 3.14 to 3.17 and JDK7 to JDK9: Issues with Package accessibility:

2018-02-07 Thread Jörn Franke
I think only poi 4.0 officially supports JDK 8 only and not JDK7 anymore.
Poi 3.17 supports 6,7,8.

I am not sure if Poi is jdk 9 ready rested yet. Maybe the upcoming release 4.0 
will be but the release manager can give you some definitive answer.

Do you need any specific jdk9 feature ?

> On 7. Feb 2018, at 13:15, Markus Sandmann  wrote:
> 
> Hi there,
> 
> currently I try to migrate my Projects to the latest JDK9 as well as
> updating used libaries like apache poi.
> Comming from v3.14 and JDK7 I have a strange problem that i can't find the
> solution to:
> 
> After updating apache poi I had to adjust some parts of my code because of
> deprecated/removed functions. (Migration to the new Color and FillPattern
> enums for example).
> 
> This step works just fine. After that I started the migration from JDK7 to
> JDK9. As soon as i switch die compiler level and system library to jdk9
> some of the Apache POI classes become unresolveable and/or unaccessible.
> 
> I already have a StackOverFlow post concerning this matter here with more
> details:
> https://stackoverflow.com/questions/48640064/migrating-apache-poi-3-14-to-3-17-and-jdk9
> 
> The offending classes are:
> 
> import org.apache.poi.ss.usermodel.Row;
> import org.apache.poi.xssf.usermodel.XSSFColor;
> import org.apache.poi.xssf.usermodel.XSSFFont;
> import org.apache.poi.xssf.usermodel.XSSFWorkbook;
> 
> All result in either "cannot be resolved" or "is not accessible" depending
> on whether i do a rebuild or a save after edit (which is strange and might
> be an eclipse bug?).
> 
> Other imports from the library like:
> import org.apache.poi.ss.usermodel.BorderStyle;
> import org.apache.poi.ss.usermodel.Cell;
> import org.apache.poi.ss.usermodel.FillPatternType;
> import org.apache.poi.ss.usermodel.IndexedColors;
> import org.apache.poi.xssf.usermodel.XSSFCellStyle;
> import org.apache.poi.xssf.usermodel.XSSFSheet;
> 
> work just fine.
> 
> When I switch the project back to JDK7 without touching any code the stuff
> compiles again just fine.
> 
> What's wrong here?
> 
> Greetings,
> Markus

-
To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
For additional commands, e-mail: user-h...@poi.apache.org