adminfaces / admin-template

JSF responsive admin template based on Bootstrap and AdminLTE
https://adminfaces.github.io/docs/latest/#admin_template
MIT License
209 stars 101 forks source link

Adminfaces 1.6.0 is not Jakarta EE 9 Compatible #215

Closed larsgrefer closed 2 years ago

larsgrefer commented 2 years ago

@rmpestano The classes in https://repo1.maven.org/maven2/com/github/adminfaces/admin-template/1.6.0/admin-template-1.6.0.jar (without the javax classifier) are compiled against javax classes.

In fact, admin-template-1.6.0.jar and admin-template-1.6.0-javax.jar contain the exact same class files and only differ in their META-INF folder.

Compiling against the non-javax variant from an Jakarta EE 9 project fails with:

class file for javax.servlet.ServletContextListener not found
larsgrefer commented 2 years ago

This is the full diff of both (unpacked) jars:

diff --git a/admin-template-1.6.0/META-INF/MANIFEST.MF b/admin-template-1.6.0-javax/META-INF/MANIFEST.MF
index 8f1bdec..5f9933b 100644
--- a/admin-template-1.6.0/META-INF/MANIFEST.MF
+++ b/admin-template-1.6.0-javax/META-INF/MANIFEST.MF
@@ -1,5 +1,4 @@
 Manifest-Version: 1.0
-Archiver-Version: Plexus Archiver
 Created-By: Apache Maven 3.8.5
 Built-By: runner
 Build-Jdk: 11.0.11
diff --git a/admin-template-1.6.0/META-INF/admin.taglib.xml b/admin-template-1.6.0-javax/META-INF/admin.taglib.xml
index a19238a..a634738 100644
--- a/admin-template-1.6.0/META-INF/admin.taglib.xml
+++ b/admin-template-1.6.0-javax/META-INF/admin.taglib.xml
@@ -3,4 +3,4 @@
                 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd">
     <namespace>http://github.com/adminfaces</namespace>
     <composite-library-name>admin</composite-library-name>
-</facelet-taglib>
\ No newline at end of file
+</facelet-taglib>
diff --git a/admin-template-1.6.0/META-INF/beans.xml b/admin-template-1.6.0-javax/META-INF/beans.xml
index 5d0de1b..79a4169 100644
--- a/admin-template-1.6.0/META-INF/beans.xml
+++ b/admin-template-1.6.0-javax/META-INF/beans.xml
@@ -3,4 +3,4 @@
       xsi:schemaLocation="       http://java.sun.com/xml/ns/javaee        http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">

-</beans>
\ No newline at end of file
+</beans>
diff --git a/admin-template-1.6.0/META-INF/faces-config.xml b/admin-template-1.6.0-javax/META-INF/faces-config.xml
index 67a5b7d..314cedc 100644
--- a/admin-template-1.6.0/META-INF/faces-config.xml
+++ b/admin-template-1.6.0-javax/META-INF/faces-config.xml
@@ -22,8 +22,8 @@
         </resource-bundle>
         <system-event-listener>
             <system-event-listener-class>com.github.adminfaces.template.event.AdminSystemEventListener</system-event-listener-class>
-            <system-event-class>jakarta.faces.event.PostConstructApplicationEvent</system-event-class>
-            <source-class>jakarta.faces.application.Application</source-class>
+            <system-event-class>javax.faces.event.PostConstructApplicationEvent</system-event-class>
+            <source-class>javax.faces.application.Application</source-class>
         </system-event-listener>
     </application>

diff --git a/admin-template-1.6.0/META-INF/resources/admin/breadcrumb.xhtml b/admin-template-1.6.0-javax/META-INF/resources/admin/breadcrumb.xhtml
index a15c65a..780334c 100644
--- a/admin-template-1.6.0/META-INF/resources/admin/breadcrumb.xhtml
+++ b/admin-template-1.6.0-javax/META-INF/resources/admin/breadcrumb.xhtml
@@ -14,4 +14,4 @@
         <f:event type="preRenderView" listener="#{breadCrumbMB.add(cc.attrs.link, cc.attrs.title, cc.attrs.clear, cc.rendered)}"/>
     </cc:implementation>

-</ui:composition>
\ No newline at end of file
+</ui:composition>
diff --git a/admin-template-1.6.0/META-INF/resources/admin/ripple.xhtml b/admin-template-1.6.0-javax/META-INF/resources/admin/ripple.xhtml
index 8fbabc5..0f8ccc5 100644
--- a/admin-template-1.6.0/META-INF/resources/admin/ripple.xhtml
+++ b/admin-template-1.6.0-javax/META-INF/resources/admin/ripple.xhtml
@@ -59,4 +59,4 @@
         </ui:fragment>
     </cc:implementation>

-</ui:composition>
\ No newline at end of file
+</ui:composition>
diff --git a/admin-template-1.6.0/META-INF/resources/admin/sidebar.xhtml b/admin-template-1.6.0-javax/META-INF/resources/admin/sidebar.xhtml
index e507a74..74b6ced 100644
--- a/admin-template-1.6.0/META-INF/resources/admin/sidebar.xhtml
+++ b/admin-template-1.6.0-javax/META-INF/resources/admin/sidebar.xhtml
@@ -67,4 +67,4 @@
         </ui:fragment>
     </cc:implementation>

-</ui:composition>
\ No newline at end of file
+</ui:composition>
diff --git a/admin-template-1.6.0/META-INF/resources/admin-base.xhtml b/admin-template-1.6.0-javax/META-INF/resources/admin-base.xhtml
index 7dd5dcd..0273ec3 100644
--- a/admin-template-1.6.0/META-INF/resources/admin-base.xhtml
+++ b/admin-template-1.6.0-javax/META-INF/resources/admin-base.xhtml
@@ -76,16 +76,16 @@
         <ui:insert name="template-menu"/>
         <!-- content -->
         <h:panelGroup layout="block" id="content" styleClass="content-wrapper">
-            <adm:breadcrumb title="#{title}" rendered="#{not empty title and empty requestScope['jakarta.servlet.error.exception_type'] and empty requestScope['jakarta.servlet.error.message']}"/>
+            <adm:breadcrumb title="#{title}" rendered="#{not empty title and empty requestScope['javax.servlet.error.exception_type'] and empty requestScope['javax.servlet.error.message']}"/>
             <ui:insert name="content-wrapper"/>
             <section class="content-header">
                 <h1>
                     <ui:insert name="title">
-                        <h:outputText value="#{title}" rendered="#{not empty title and empty requestScope['jakarta.servlet.error.exception_type'] and empty requestScope['jakarta.servlet.error.message']}"/>
+                        <h:outputText value="#{title}" rendered="#{not empty title and empty requestScope['javax.servlet.error.exception_type'] and empty requestScope['javax.servlet.error.message']}"/>
                     </ui:insert>
                     <small><ui:insert name="description"/></small>
                 </h1>
-                <ui:fragment rendered="#{(adminConfig.renderBreadCrumb) and (empty renderBreadCrumb or renderBreadCrumb) and (empty requestScope['jakarta.servlet.error.exception_type'] and empty requestScope['jakarta.servlet.error.message'])}">
+                <ui:fragment rendered="#{(adminConfig.renderBreadCrumb) and (empty renderBreadCrumb or renderBreadCrumb) and (empty requestScope['javax.servlet.error.exception_type'] and empty requestScope['javax.servlet.error.message'])}">
                     <ol class="breadcrumb" style="overflow: hidden;">
                         <li style="position: relative;">
                             <h:form prependId="false">
diff --git a/admin-template-1.6.0/META-INF/web-fragment.xml b/admin-template-1.6.0-javax/META-INF/web-fragment.xml
index 713929a..167beb0 100644
--- a/admin-template-1.6.0/META-INF/web-fragment.xml
+++ b/admin-template-1.6.0-javax/META-INF/web-fragment.xml
@@ -21,7 +21,7 @@
         <location>/403.xhtml</location>
     </error-page>
     <error-page>
-        <exception-type>jakarta.ejb.AccessLocalException</exception-type>
+        <exception-type>javax.ejb.AccessLocalException</exception-type>
         <location>/403.xhtml</location>
     </error-page>
     <error-page>
@@ -37,12 +37,12 @@
         <location>/500.xhtml</location>
     </error-page>
     <error-page>
-        <exception-type>jakarta.faces.application.ViewExpiredException</exception-type>
+        <exception-type>javax.faces.application.ViewExpiredException</exception-type>
         <location>/expired.xhtml</location>
     </error-page>
     <error-page>
-        <exception-type>jakarta.persistence.OptimisticLockException</exception-type>
+        <exception-type>javax.persistence.OptimisticLockException</exception-type>
         <location>/optimistic.xhtml</location>
     </error-page>

-</web-fragment>
\ No newline at end of file
+</web-fragment>
rmpestano commented 2 years ago

Hi @larsgrefer, this is really strange because it's working on Jakarta EE 9.1 server (wildfly 26.1.1) for me, maybe there's an issue with the deploy to maven central. Can you try to install admin-template locally (mvn install) and use that version?

rmpestano commented 2 years ago

If that's the case I'll release a new version "manually" instead of relying in gh actions and later try to figure it out

larsgrefer commented 2 years ago

A local mvn install on my machine seems to build a correct admin-template-1.6.1-SNAPSHOT.jar (but no -javax variant)

rmpestano commented 2 years ago

Alright, tomorrow morning I'll do a manual release of 1.6.1.

Thanks for checking!

rmpestano commented 2 years ago

Version 1.6.1 is available on maven central, please let me know if it works for you.

larsgrefer commented 2 years ago

1.6.1 looks good: https://github.com/joinfaces/joinfaces/runs/6849987874

rmpestano commented 2 years ago

Awesome, thank you again!