xjar icon indicating copy to clipboard operation
xjar copied to clipboard

xjar命令之后之后报错ArrayIndexOutOfBoundsException

Open luckyxue opened this issue 2 years ago • 0 comments

 ./xjar java -jar das-0.0.1-SNAPSHOT.xjar
Exception in thread "main" java.lang.IllegalStateException: java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 4
        at org.springframework.boot.loader.ExecutableArchiveLauncher.<init>(ExecutableArchiveLauncher.java:52)
        at org.springframework.boot.loader.JarLauncher.<init>(JarLauncher.java:48)
        at io.xjar.boot.XJarLauncher.<init>(XJarLauncher.java:17)
        at io.xjar.boot.XJarLauncher.main(XJarLauncher.java:22)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 4
        at org.springframework.boot.loader.jar.AsciiBytes.hashCode(AsciiBytes.java:208)
        at org.springframework.boot.loader.jar.JarFileEntries.add(JarFileEntries.java:136)
        at org.springframework.boot.loader.jar.JarFileEntries.visitFileHeader(JarFileEntries.java:131)
        at org.springframework.boot.loader.jar.CentralDirectoryParser.visitFileHeader(CentralDirectoryParser.java:91)
        at org.springframework.boot.loader.jar.CentralDirectoryParser.parseEntries(CentralDirectoryParser.java:69)
        at org.springframework.boot.loader.jar.CentralDirectoryParser.parse(CentralDirectoryParser.java:57)
        at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:159)
        at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:144)
        at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:108)
        at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:99)
        at org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:57)
        at org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:53)
        at org.springframework.boot.loader.Launcher.createArchive(Launcher.java:164)
        at org.springframework.boot.loader.ExecutableArchiveLauncher.<init>(ExecutableArchiveLauncher.java:48)
        ... 3 more
panic: exit status 1

goroutine 1 [running]:
main.main()

luckyxue avatar Jul 08 '22 14:07 luckyxue

<plugin>
    <groupId>com.github.core-lib</groupId>
    <artifactId>xjar-maven-plugin</artifactId>
    <version>4.0.2</version>
    <executions>
        <execution>
            <goals>
                <goal>build</goal>
            </goals>
            <phase>install</phase>
            <configuration>
                <includes>
                    <include>/org/xxx/xxx/**/*.class</include>
                    <include>/mybatis/mapper/**/*Mapper.xml</include>
                    <include>/application-test.yml</include>
                    <include>/application-prod.yml</include>
                </includes>
                <excludes>
                    <exclude>/templates/**.*</exclude>
                    <exclude>/static/**.*</exclude>
                    <exclude>/application.yml</exclude>
                    <exclude>/application-dev.yml</exclude>
                    <exclude>/application-deploy.yml</exclude>
                </excludes>
            </configuration>
        </execution>
    </executions>
</plugin>

The project depends on cross-platform dependency packages such as ffmpeg. After all compilation and encryption, the project will fail to start, but these dependencies cannot be removed. Therefore, the scope of the scan package needs to be set when encrypting.

luckyxue avatar Sep 18 '22 14:09 luckyxue