You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Martin Grigorov <mg...@apache.org> on 2020/02/11 14:49:41 UTC

Report issues with Jakarta EE migration tool

Hi,

What is the proper place to report issues with
https://github.com/apache/tomcat-jakartaee-migration ?
Since it is under `apache` org there is no 'Issues' tab.
Bugzilla ?!

I've faced an issue with Spring Boot jars.
Once migrated trying to use it fails with:


Exception in thread "main" java.lang.IllegalStateException: Failed to get
nested archive for entry
BOOT-INF/lib/spring-boot-starter-web-2.2.4.RELEASE.jar
at
org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:113)
at
org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87)
at
org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:69)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Caused by: java.io.IOException: Unable to open nested jar file
'BOOT-INF/lib/spring-boot-starter-web-2.2.4.RELEASE.jar'
at
org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:261)
at
org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:247)
at
org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:109)
... 4 more
Caused by: java.lang.IllegalStateException: Unable to open nested entry
'BOOT-INF/lib/spring-boot-starter-web-2.2.4.RELEASE.jar'. It has been
compressed and nested jar files must be stored without compression. Please
check the mechanism used to create your executable jar file
at
org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:287)
at
org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:269)
at
org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:258)
... 6 more


i.e. it needs to use `destEntry.setMethod(ZipEntry.STORED);` (for jars
nested in /BOOT-INF/lib/**.jar)
in org.apache.tomcat.jakartaee.Migration#migrateArchive()
I am reworking it to return a Result object instead of a boolean
(isSuccess) that will contain: the
isSuccess boolean, the accumulated size and CRC for all entries in the
nested jar.

If I am on the wrong track please share your ideas!

To reproduce it one can create a new application at https://start.spring.io/,
package it, migrate it and try to run it.

Martin

Re: Report issues with Jakarta EE migration tool

Posted by Martin Grigorov <mg...@apache.org>.
On Wed, Feb 12, 2020 at 3:20 PM Rémy Maucherat <re...@apache.org> wrote:

> On Tue, Feb 11, 2020 at 4:49 PM Mark Thomas <ma...@apache.org> wrote:
>
>> On 11/02/2020 15:29, Martin Grigorov wrote:
>> >
>> >
>> > On Tue, Feb 11, 2020, 17:12 Mark Thomas <markt@apache.org
>> > <ma...@apache.org>> wrote:
>> >
>> >     On 11/02/2020 14:49, Martin Grigorov wrote:
>> >     > Hi,
>> >     >
>> >     > What is the proper place to report issues
>> >     > with https://github.com/apache/tomcat-jakartaee-migration ?
>> >     > Since it is under `apache` org there is no 'Issues' tab.
>> >     > Bugzilla ?!
>> >
>> >     We don't have anywhere yet.
>> >
>> >     GitHub issues is an option. As is Jira and Bugzilla.
>> >
>> >     This could be an opportunity to experiment with GitHUb issues if we
>> >     want.
>> >
>> >
>> > For this we need to ask Infra team.
>>
>> Well, yes and no given that I am on the infra team...
>>
>> If we want to try it I can enable it.
>>
>>
>>  >     Don't you want to do something like:
>> >
>> >     destEntry.setMethod(jarEntry.getMethod);
>> >
>> >
>> > If the method is STORED then we also need to set the size and the CRC.
>> > And those are more complicated to get.
>>
>> Ah. I didn't see anything about that being required in the Javadoc for
>> setMethod().
>>
>> Looking at the source for ZipOutputStream it looks like we need 1 of
>> compressed size, size or CRC. Of those, I would have thought the size
>> was the easiest as we should be able to count the bytes written.
>>
>
> Setting the size sounds mundane but is rather horrible to implement, as
> the migration occurs after creating the entry. So it suddenly needs to be
> buffered, causing more problems. I don't think it should be supported.
>

Yes, I've tried a couple of different ways to implement it but it is not
working so far.

Martin


>
> Rémy
>
>

Re: Report issues with Jakarta EE migration tool

Posted by Rémy Maucherat <re...@apache.org>.
On Tue, Feb 11, 2020 at 4:49 PM Mark Thomas <ma...@apache.org> wrote:

> On 11/02/2020 15:29, Martin Grigorov wrote:
> >
> >
> > On Tue, Feb 11, 2020, 17:12 Mark Thomas <markt@apache.org
> > <ma...@apache.org>> wrote:
> >
> >     On 11/02/2020 14:49, Martin Grigorov wrote:
> >     > Hi,
> >     >
> >     > What is the proper place to report issues
> >     > with https://github.com/apache/tomcat-jakartaee-migration ?
> >     > Since it is under `apache` org there is no 'Issues' tab.
> >     > Bugzilla ?!
> >
> >     We don't have anywhere yet.
> >
> >     GitHub issues is an option. As is Jira and Bugzilla.
> >
> >     This could be an opportunity to experiment with GitHUb issues if we
> >     want.
> >
> >
> > For this we need to ask Infra team.
>
> Well, yes and no given that I am on the infra team...
>
> If we want to try it I can enable it.
>
>
>  >     Don't you want to do something like:
> >
> >     destEntry.setMethod(jarEntry.getMethod);
> >
> >
> > If the method is STORED then we also need to set the size and the CRC.
> > And those are more complicated to get.
>
> Ah. I didn't see anything about that being required in the Javadoc for
> setMethod().
>
> Looking at the source for ZipOutputStream it looks like we need 1 of
> compressed size, size or CRC. Of those, I would have thought the size
> was the easiest as we should be able to count the bytes written.
>

Setting the size sounds mundane but is rather horrible to implement, as the
migration occurs after creating the entry. So it suddenly needs to be
buffered, causing more problems. I don't think it should be supported.

Rémy

Re: Report issues with Jakarta EE migration tool

Posted by Mark Thomas <ma...@apache.org>.
On 11/02/2020 15:29, Martin Grigorov wrote:
> 
> 
> On Tue, Feb 11, 2020, 17:12 Mark Thomas <markt@apache.org
> <ma...@apache.org>> wrote:
> 
>     On 11/02/2020 14:49, Martin Grigorov wrote:
>     > Hi,
>     >
>     > What is the proper place to report issues
>     > with https://github.com/apache/tomcat-jakartaee-migration ?
>     > Since it is under `apache` org there is no 'Issues' tab.
>     > Bugzilla ?!
> 
>     We don't have anywhere yet.
> 
>     GitHub issues is an option. As is Jira and Bugzilla.
> 
>     This could be an opportunity to experiment with GitHUb issues if we
>     want.
> 
> 
> For this we need to ask Infra team.

Well, yes and no given that I am on the infra team...

If we want to try it I can enable it.


 >     Don't you want to do something like:
> 
>     destEntry.setMethod(jarEntry.getMethod);
> 
> 
> If the method is STORED then we also need to set the size and the CRC.
> And those are more complicated to get. 

Ah. I didn't see anything about that being required in the Javadoc for
setMethod().

Looking at the source for ZipOutputStream it looks like we need 1 of
compressed size, size or CRC. Of those, I would have thought the size
was the easiest as we should be able to count the bytes written.

Mark

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


Re: Report issues with Jakarta EE migration tool

Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Feb 11, 2020, 17:12 Mark Thomas <ma...@apache.org> wrote:

> On 11/02/2020 14:49, Martin Grigorov wrote:
> > Hi,
> >
> > What is the proper place to report issues
> > with https://github.com/apache/tomcat-jakartaee-migration ?
> > Since it is under `apache` org there is no 'Issues' tab.
> > Bugzilla ?!
>
> We don't have anywhere yet.
>
> GitHub issues is an option. As is Jira and Bugzilla.
>
> This could be an opportunity to experiment with GitHUb issues if we want.
>

For this we need to ask Infra team.


> > I've faced an issue with Spring Boot jars.
> > Once migrated trying to use it fails with:
>
> <snip/>
>
> > Caused by: java.lang.IllegalStateException: Unable to open nested entry
> > 'BOOT-INF/lib/spring-boot-starter-web-2.2.4.RELEASE.jar'. It has been
> > compressed and nested jar files must be stored without compression.
> > Please check the mechanism used to create your executable jar file
>
> Of course. That is a trick Spring Boot uses to provide better
> performance for nested JAR files.
>
> > i.e. it needs to use `destEntry.setMethod(ZipEntry.STORED);` (for jars
> > nested in /BOOT-INF/lib/**.jar)
> > in org.apache.tomcat.jakartaee.Migration#migrateArchive()
> > I am reworking it to return a Result object instead of a boolean
> > (isSuccess) that will contain: the
> > isSuccess boolean, the accumulated size and CRC for all entries in the
> > nested jar.
> >
> > If I am on the wrong track please share your ideas!
>
> The CRCs are always going to be different because the content has changed.
>
> The accumulated sizes are going to change for the same reason.
>
> In terms of being able to tell compressed / vs uncompressed I'm not sure
> you'll see enough difference (given that a JAR is already compressed
> with probably the exact same algorithm) to tell them apart.
>
> Don't you want to do something like:
>
> destEntry.setMethod(jarEntry.getMethod);
>

If the method is STORED then we also need to set the size and the CRC. And
those are more complicated to get.


> around line 119 of Migration.java ?
>
> Mark
>
>
> >
> > To reproduce it one can create a new application
> > at https://start.spring.io/, package it, migrate it and try to run it.
> >
> > Martin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

Re: Report issues with Jakarta EE migration tool

Posted by Mark Thomas <ma...@apache.org>.
On 11/02/2020 14:49, Martin Grigorov wrote:
> Hi,
> 
> What is the proper place to report issues
> with https://github.com/apache/tomcat-jakartaee-migration ?
> Since it is under `apache` org there is no 'Issues' tab.
> Bugzilla ?!

We don't have anywhere yet.

GitHub issues is an option. As is Jira and Bugzilla.

This could be an opportunity to experiment with GitHUb issues if we want.

> I've faced an issue with Spring Boot jars.
> Once migrated trying to use it fails with:

<snip/>

> Caused by: java.lang.IllegalStateException: Unable to open nested entry
> 'BOOT-INF/lib/spring-boot-starter-web-2.2.4.RELEASE.jar'. It has been
> compressed and nested jar files must be stored without compression.
> Please check the mechanism used to create your executable jar file

Of course. That is a trick Spring Boot uses to provide better
performance for nested JAR files.

> i.e. it needs to use `destEntry.setMethod(ZipEntry.STORED);` (for jars
> nested in /BOOT-INF/lib/**.jar)
> in org.apache.tomcat.jakartaee.Migration#migrateArchive() 
> I am reworking it to return a Result object instead of a boolean
> (isSuccess) that will contain: the 
> isSuccess boolean, the accumulated size and CRC for all entries in the
> nested jar.
> 
> If I am on the wrong track please share your ideas!

The CRCs are always going to be different because the content has changed.

The accumulated sizes are going to change for the same reason.

In terms of being able to tell compressed / vs uncompressed I'm not sure
you'll see enough difference (given that a JAR is already compressed
with probably the exact same algorithm) to tell them apart.

Don't you want to do something like:

destEntry.setMethod(jarEntry.getMethod);

around line 119 of Migration.java ?

Mark

 
> 
> To reproduce it one can create a new application
> at https://start.spring.io/, package it, migrate it and try to run it.
> 
> Martin 


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


Re: Report issues with Jakarta EE migration tool

Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Feb 11, 2020, 17:06 Rémy Maucherat <re...@apache.org> wrote:

> On Tue, Feb 11, 2020 at 3:50 PM Martin Grigorov <mg...@apache.org>
> wrote:
>
>> Hi,
>>
>> What is the proper place to report issues with
>> https://github.com/apache/tomcat-jakartaee-migration ?
>> Since it is under `apache` org there is no 'Issues' tab.
>> Bugzilla ?!
>>
>> I've faced an issue with Spring Boot jars.
>> Once migrated trying to use it fails with:
>>
>>
>> Exception in thread "main" java.lang.IllegalStateException: Failed to get
>> nested archive for entry
>> BOOT-INF/lib/spring-boot-starter-web-2.2.4.RELEASE.jar
>> at
>> org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:113)
>> at
>> org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87)
>> at
>> org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:69)
>> at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
>> at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
>> Caused by: java.io.IOException: Unable to open nested jar file
>> 'BOOT-INF/lib/spring-boot-starter-web-2.2.4.RELEASE.jar'
>> at
>> org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:261)
>> at
>> org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:247)
>> at
>> org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:109)
>> ... 4 more
>> Caused by: java.lang.IllegalStateException: Unable to open nested entry
>> 'BOOT-INF/lib/spring-boot-starter-web-2.2.4.RELEASE.jar'. It has been
>> compressed and nested jar files must be stored without compression. Please
>> check the mechanism used to create your executable jar file
>> at
>> org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:287)
>> at
>> org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:269)
>> at
>> org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:258)
>> ... 6 more
>>
>>
>> i.e. it needs to use `destEntry.setMethod(ZipEntry.STORED);` (for jars
>> nested in /BOOT-INF/lib/**.jar)
>> in org.apache.tomcat.jakartaee.Migration#migrateArchive()
>> I am reworking it to return a Result object instead of a boolean
>> (isSuccess) that will contain: the
>> isSuccess boolean, the accumulated size and CRC for all entries in the
>> nested jar.
>>
>> If I am on the wrong track please share your ideas!
>>
>> To reproduce it one can create a new application at
>> https://start.spring.io/, package it, migrate it and try to run it.
>>
>
> Ok, so I guess use of this tool got a bit experimental very quickly ;)
>

Right!
I'm pushing it to the limits! :-)

>
> The purpose of the tool is to run Java EE (web)apps on *Tomcat* 10+ (or
> another *compliant* EE 9 server I suppose). It seems you are trying to
> convert something like "Spring boot with an embedded app", which isn't the
> goal of the tool at the moment. If it works, great, but it's a bit hard to
> promise support for everything. So ... Does it work ?
>

I use tomcat-embed-*.jars from master, i.e. 10.x, but you are right that
the idea looks crazy :-)


> Rémy
>
>
>>
>> Martin
>>
>

Re: Report issues with Jakarta EE migration tool

Posted by Rémy Maucherat <re...@apache.org>.
On Tue, Feb 11, 2020 at 3:50 PM Martin Grigorov <mg...@apache.org>
wrote:

> Hi,
>
> What is the proper place to report issues with
> https://github.com/apache/tomcat-jakartaee-migration ?
> Since it is under `apache` org there is no 'Issues' tab.
> Bugzilla ?!
>
> I've faced an issue with Spring Boot jars.
> Once migrated trying to use it fails with:
>
>
> Exception in thread "main" java.lang.IllegalStateException: Failed to get
> nested archive for entry
> BOOT-INF/lib/spring-boot-starter-web-2.2.4.RELEASE.jar
> at
> org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:113)
> at
> org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87)
> at
> org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:69)
> at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
> at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
> Caused by: java.io.IOException: Unable to open nested jar file
> 'BOOT-INF/lib/spring-boot-starter-web-2.2.4.RELEASE.jar'
> at
> org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:261)
> at
> org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:247)
> at
> org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:109)
> ... 4 more
> Caused by: java.lang.IllegalStateException: Unable to open nested entry
> 'BOOT-INF/lib/spring-boot-starter-web-2.2.4.RELEASE.jar'. It has been
> compressed and nested jar files must be stored without compression. Please
> check the mechanism used to create your executable jar file
> at
> org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:287)
> at
> org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:269)
> at
> org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:258)
> ... 6 more
>
>
> i.e. it needs to use `destEntry.setMethod(ZipEntry.STORED);` (for jars
> nested in /BOOT-INF/lib/**.jar)
> in org.apache.tomcat.jakartaee.Migration#migrateArchive()
> I am reworking it to return a Result object instead of a boolean
> (isSuccess) that will contain: the
> isSuccess boolean, the accumulated size and CRC for all entries in the
> nested jar.
>
> If I am on the wrong track please share your ideas!
>
> To reproduce it one can create a new application at
> https://start.spring.io/, package it, migrate it and try to run it.
>

Ok, so I guess use of this tool got a bit experimental very quickly ;)

The purpose of the tool is to run Java EE (web)apps on *Tomcat* 10+ (or
another *compliant* EE 9 server I suppose). It seems you are trying to
convert something like "Spring boot with an embedded app", which isn't the
goal of the tool at the moment. If it works, great, but it's a bit hard to
promise support for everything. So ... Does it work ?

Rémy


>
> Martin
>