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

Failure to compile against admin-template 1.5.1 #211

Closed larsgrefer closed 2 years ago

larsgrefer commented 2 years ago
Issue Overview

The .class files inside the admin-template-1.5.1.jar seem to be broken

Current Behaviour

Compiling against classes inside the jar produces weird compiler errors:

/Users/larsgrefer/git/joinfaces/joinfaces/joinfaces-autoconfigure/src/main/java/org/joinfaces/autoconfigure/adminfaces/AdminConfigWrapper.java:19: error: cannot access AdminConfig
import com.github.adminfaces.template.config.AdminConfig;
                                            ^
  bad class file: /Users/larsgrefer/.gradle/caches/modules-2/files-2.1/com.github.adminfaces/admin-template/1.5.1/312ffc26264b158f874abe3c43f6aa230a00dbbb/admin-template-1.5.1.jar(/com/github/adminfaces/template/config/AdminConfig.class)
    illegal start of class file
    Please remove or make sure it appears in the correct subdirectory of the classpath.
/Users/larsgrefer/git/joinfaces/joinfaces/joinfaces-autoconfigure/src/main/java/org/joinfaces/autoconfigure/adminfaces/AdminConfigWrapper.java:20: error: cannot access ControlSidebarConfig
import com.github.adminfaces.template.config.ControlSidebarConfig;
                                            ^
  bad class file: /Users/larsgrefer/.gradle/caches/modules-2/files-2.1/com.github.adminfaces/admin-template/1.5.1/312ffc26264b158f874abe3c43f6aa230a00dbbb/admin-template-1.5.1.jar(/com/github/adminfaces/template/config/ControlSidebarConfig.class)
    illegal start of class file
    Please remove or make sure it appears in the correct subdirectory of the classpath.
/Users/larsgrefer/git/joinfaces/joinfaces/joinfaces-autoconfigure/src/main/java/org/joinfaces/autoconfigure/adminfaces/AdminfacesAutoConfiguration.java:23: error: cannot access AccessDeniedException
import com.github.adminfaces.template.exception.AccessDeniedException;
                                               ^
  bad class file: /Users/larsgrefer/.gradle/caches/modules-2/files-2.1/com.github.adminfaces/admin-template/1.5.1/312ffc26264b158f874abe3c43f6aa230a00dbbb/admin-template-1.5.1.jar(/com/github/adminfaces/template/exception/AccessDeniedException.class)
    illegal start of class file
    Please remove or make sure it appears in the correct subdirectory of the classpath.
/Users/larsgrefer/git/joinfaces/joinfaces/joinfaces-autoconfigure/src/main/java/org/joinfaces/autoconfigure/adminfaces/AdminfacesAutoConfiguration.java:24: error: cannot access AdminServletContextListener
import com.github.adminfaces.template.session.AdminServletContextListener;
                                             ^
  bad class file: /Users/larsgrefer/.gradle/caches/modules-2/files-2.1/com.github.adminfaces/admin-template/1.5.1/312ffc26264b158f874abe3c43f6aa230a00dbbb/admin-template-1.5.1.jar(/com/github/adminfaces/template/session/AdminServletContextListener.class)
    illegal start of class file
    Please remove or make sure it appears in the correct subdirectory of the classpath.
/Users/larsgrefer/git/joinfaces/joinfaces/joinfaces-autoconfigure/src/main/java/org/joinfaces/autoconfigure/adminfaces/AdminfacesAutoConfiguration.java:25: error: cannot access AdminSession
import com.github.adminfaces.template.session.AdminSession;
                                             ^
  bad class file: /Users/larsgrefer/.gradle/caches/modules-2/files-2.1/com.github.adminfaces/admin-template/1.5.1/312ffc26264b158f874abe3c43f6aa230a00dbbb/admin-template-1.5.1.jar(/com/github/adminfaces/template/session/AdminSession.class)
    illegal start of class file
    Please remove or make sure it appears in the correct subdirectory of the classpath.

Trying to decompile some classes with javap also gives an error:

Error: error while reading constant pool for AdminConfig.class: unexpected tag at #1: 191
Expected Behaviour

An image may worth a thousand words

How to reproduce
wget https://repo1.maven.org/maven2/com/github/adminfaces/admin-template/1.5.1/admin-template-1.5.1.jar
unzip admin-template-1.5.1.jar -d tmp
javap -v javap -v tmp/com/github/adminfaces/template/config/AdminConfig.class
Additional Information
rmpestano commented 2 years ago

Hey @larsgrefer, not sure why I'm not getting notifications on this repo anymore. Yes someone just send me a direct email and I'm looking into it.

Thank you and sorry for the delay!

rmpestano commented 2 years ago

Hi @larsgrefer, if you upgrade to version 1.6.0 it should be ok now. Note that by default admin-template is compatible with JakartaEE 9 now, for JavaEE or Jakarta EE 8 you need to use the javax maven classifier:

<dependency>
            <groupId>com.github.adminfaces</groupId>
            <artifactId>admin-template</artifactId>
            <version>1.6.0</version>
            <classifier>javax</classifier>
            <exclusions>
                <exclusion>
                    <groupId>org.omnifaces</groupId>
                    <artifactId>omnifaces</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.primefaces</groupId>
                    <artifactId>primefaces</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
       <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>11.0.0</version>
        </dependency>
       <dependency>
                <groupId>org.omnifaces</groupId>
                <artifactId>omnifaces</artifactId>
                <version>3.11</version>
            </dependency>
larsgrefer commented 2 years ago

@rmpestano Unfortunately not. Please have a look at #215