Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsf 4.0 compatibility #1191

Merged
merged 2 commits into from
Jan 4, 2024
Merged

Conversation

cdberkstresser
Copy link
Contributor

I'm able to build with gradle, and it works for my jsf 4.0 project that I upgraded.

@stephanrauh
Copy link
Collaborator

Whow! That looks like a tremendous amount of work. Thank you very much!

I'll try to review your pull request this week-end. I hope I manage to reach out to the owner of the project, so we can publish a new version and update the showcase.

Are you still working on the PR, or is it ready for merging?

@stephanrauh
Copy link
Collaborator

Just out of curiosity: did you use my Eclipse plugin?

@geopossachs
Copy link
Collaborator

it looks really nice 👍

@stephanrauh the code changes looks fine for me.
Only one question - is the conent under 'mavenResources/META-INF/resources' auto-generated or comes this channes froma a auto-code-formatter?

@geopossachs geopossachs added this to the v1.6.0 milestone Sep 27, 2023
@stephanrauh
Copy link
Collaborator

@cdberkstresser I guess you're more competent to answer the question, but I'll try nonetheless: I've seen renamed variables in the minified code. So I suppose there might be a better minifier involved - or a newer version of the minifier we used.

@geopossachs
Copy link
Collaborator

i check the imports - the versions matched jakarta-10 👍

source https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-web-api/10.0.0

@cdberkstresser
Copy link
Contributor Author

cdberkstresser commented Sep 27, 2023

@stephanrauh Thanks! I didn't try an eclipse plugin. The only outstanding issue I'm having is that it builds with gradle but not maven for my PR. I'm not a great build debugger.
Regarding the minified code, I did those renamed variables manually, so definitely not the best way.

@stephanrauh
Copy link
Collaborator

How did you compile the library? The Gradle task is not compatible to Java 17, but trying to update Gradle doesn't work either because the new version of Gradle run many new validations.

@stephanrauh
Copy link
Collaborator

I've compiled BootsFaces with Java 11 and uploaded it to the snapshot repository of Maven Central as BootsFaces 1.6.0-SNAPSHOT (see https://oss.sonatype.org/content/repositories/snapshots/net/bootsfaces/bootsfaces/1.6.0-SNAPSHOT).

@stephanrauh
Copy link
Collaborator

I've pushed your changes as branch "V1.6.0" to the BootsFaces repository. I'm afraid I've forgotten how to compile and run the showcase. I've left the JavaEE world a long time ago. So I need your help. I can publish the final version to Maven Central if someone tells me the version is good, but I can't test it myself.
@geopossachs

@cdberkstresser
Copy link
Contributor Author

Cool. I'm not in Java either these days. Just had an old project that needed updating. Maybe others are still using JavaEE?

@cdberkstresser
Copy link
Contributor Author

I can't get the generated build file to work in the sonatype.org link... Not sure what is different. The BootsFaces-OSP-1.6.0-SNAPSHOT.jar that gradle generates for me with ./gradlew buildJava17Jar works.

@stephanrauh
Copy link
Collaborator

Hm. Strictly speaking, the Sonartype link is not really a link - although it is - but it's meant to be used as a snapshot dependency, as described in #369.

I've compiled the Jar with Maven and Java 11 (Eclipse Temurin).

@cdberkstresser
Copy link
Contributor Author

yeah, here's the error I'm getting. It's definitely possible I'm doing something horribly wrong.
image

@stephanrauh
Copy link
Collaborator

That's really a strange error. Most people run into this error message when trying to build a JAR file with a manifest file that doesn't match the correct format. I guess that's not what you're doing. Maybe my manifest file is broken, but that'd be unexpected, too. Strange.

Can you add more lines to the stacktrace so I can see the context?

@cdberkstresser
Copy link
Contributor Author

Here's everything.

SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@71984c3]
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:873)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:846)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:241)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:918)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@71984c3]
	at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:130)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:161)
	at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:725)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4535)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4668)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
	... 21 more
Caused by: java.lang.IllegalArgumentException: java.io.IOException: invalid header field (line 3)
	at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:141)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:127)
	... 33 more
Caused by: java.io.IOException: invalid header field (line 3)
	at java.base/java.util.jar.Attributes.read(Attributes.java:406)
	at java.base/java.util.jar.Manifest.read(Manifest.java:290)
	at java.base/java.util.jar.Manifest.<init>(Manifest.java:100)
	at java.base/java.util.jar.JarFile.getManifestFromReference(JarFile.java:429)
	at java.base/java.util.jar.JarFile.getManifest(JarFile.java:406)
	at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:139)
	... 34 more

Oct 02, 2023 4:12:26 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:873)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:241)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:918)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:885)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:846)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
	... 13 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@71984c3]
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:873)
	... 21 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@71984c3]
	at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:130)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:161)
	at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:725)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4535)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4668)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
	... 21 more
Caused by: java.lang.IllegalArgumentException: java.io.IOException: invalid header field (line 3)
	at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:141)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:127)
	... 33 more
Caused by: java.io.IOException: invalid header field (line 3)
	at java.base/java.util.jar.Attributes.read(Attributes.java:406)
	at java.base/java.util.jar.Manifest.read(Manifest.java:290)
	at java.base/java.util.jar.Manifest.<init>(Manifest.java:100)
	at java.base/java.util.jar.JarFile.getManifestFromReference(JarFile.java:429)
	at java.base/java.util.jar.JarFile.getManifest(JarFile.java:406)
	at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:139)
	... 34 more

Oct 02, 2023 4:12:26 PM org.apache.catalina.startup.Catalina start
SEVERE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: A child container failed during start
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:885)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:241)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:918)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:873)
	... 13 more
Caused by: org.apache.catalina.LifecycleException: A child container failed during start
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:885)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:846)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
	... 13 more
Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@71984c3]
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:873)
	... 21 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@71984c3]
	at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:130)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:161)
	at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:725)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4535)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4668)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
	... 21 more
Caused by: java.lang.IllegalArgumentException: java.io.IOException: invalid header field (line 3)
	at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:141)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:127)
	... 33 more
Caused by: java.io.IOException: invalid header field (line 3)
	at java.base/java.util.jar.Attributes.read(Attributes.java:406)
	at java.base/java.util.jar.Manifest.read(Manifest.java:290)
	at java.base/java.util.jar.Manifest.<init>(Manifest.java:100)
	at java.base/java.util.jar.JarFile.getManifestFromReference(JarFile.java:429)
	at java.base/java.util.jar.JarFile.getManifest(JarFile.java:406)
	at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:139)
	... 34 more

Oct 02, 2023 4:12:26 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-nio-8080"]
Oct 02, 2023 4:12:26 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service [Catalina]
Oct 02, 2023 4:12:26 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-nio-8080"]

@stephanrauh
Copy link
Collaborator

Holy moly... the manifest file is really broken, and it seems to have been caused by my Java version (see below - there seems to be a line feed in the version number).

At the moment, I'm very busy, so it might take two or three weeks until I try again. Stay tuned! And nudge me if you don't hear from me for a long time. :)

Manifest-Version: 1.0
Created-By: 11.0.10 (AdoptOpenJDK
								11.0.10+9)
Build-Jdk: 11.0.10
Built-By: BootsFaces OSP Maven builder.
Bundle-Date: 20231001-11:34:56
Bundle-Name: BootsFaces
Bundle-Version: 1.6.0-SNAPSHOT
Implementation-Title: BootsFaces
Implementation-URL: http://www.bootsfaces.net
Implementation-Vendor: TheCoder4.eu
Implementation-Vendor-Id: eu.thecoder4
Implementation-Version: 1.6.0-SNAPSHOT
Maven-Version: 3.9.4

@cdberkstresser
Copy link
Contributor Author

No worries! Thanks so much for taking a look at it. I can build locally for debugging.

@geopossachs
Copy link
Collaborator

@stephanrauh i have the same error with your latest build and the jar. But a take your older jakarta 9 build and bring the showcase with this import up to wildfly 28 and the jakarta-framework on my fork at frist

-> https://stage-showcase.bootsfaces.de/miscellaneous/Video.jsf

in this page with the video for example i found something in one .js file, so i believe for jakarta 10 we need also the changes like in the mavenResources/META-INF/resources/bsf/js/bsf.js file here for the change form "jsf." to "faces."

@geopossachs
Copy link
Collaborator

@stephanrauh i have add on your working brunch some small changes - one to fix the linebreak error in the manifest and an other to switch to CDI-Beans instead of the deprecated ManangedBeans - have a nice day

@stephanrauh
Copy link
Collaborator

@geopossachs But you didn't push it, did you? At least I don't see your changes yet.

BTW: "brunch" made my day!

@geopossachs
Copy link
Collaborator

@geopossachs
Copy link
Collaborator

@stephanrauh i have open a folling MR, witch include our changes too, here #1194

@TheCoder4eu TheCoder4eu merged commit 0ddcdbf into TheCoder4eu:master Jan 4, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants