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

大神,xjar加密后的jar如何作为第三方jar包给其他项目引用呢 #14

Open
liuxiankai opened this issue Nov 22, 2021 · 2 comments

Comments

@liuxiankai
Copy link

大神,xjar加密后的jar如何作为第三方jar包给其他项目引用呢

@GordonHuangYong
Copy link

发现加密后的jar, 作为第三方jar包使用, 运行时会报错的;

./xjar.go java -jar xxx.jar错如下:

panic: invalid jar with MD5

goroutine 1 [running]:
main.main()
	/Users/huangyong/Documents/huangyong/svn/WT588FWebApi/wt588ftranscompress/target/xjar.go:47 +0x7b1

直接运行java -jar xxx.jar报错如下:

press-1.0.jar!/com/waytronic/wt588f/service/WT588fFile.class]; nested exception is java.lang.ArrayIndexOutOfBoundsException: Index 32840 out of bounds for length 17360
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:454) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:316) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:275) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:288) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:202) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:170) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:316) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.1.RELEASE.jar!/:2.0.1.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.0.1.RELEASE.jar!/:2.0.1.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) ~[spring-boot-2.0.1.RELEASE.jar!/:2.0.1.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) ~[spring-boot-2.0.1.RELEASE.jar!/:2.0.1.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) ~[spring-boot-2.0.1.RELEASE.jar!/:2.0.1.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) ~[spring-boot-2.0.1.RELEASE.jar!/:2.0.1.RELEASE]
	at com.waytronic.WT588fApiApplication.main(WT588fApiApplication.java:18) ~[classes!/:1.0.0]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) ~[wt588fwebapi-1.0.0.jar:1.0.0]
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) ~[wt588fwebapi-1.0.0.jar:1.0.0]
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) ~[wt588fwebapi-1.0.0.jar:1.0.0]
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) ~[wt588fwebapi-1.0.0.jar:1.0.0]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 32840 out of bounds for length 17360
	at org.springframework.asm.ClassReader.<init>(ClassReader.java:198) ~[spring-core-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.asm.ClassReader.<init>(ClassReader.java:168) ~[spring-core-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.asm.ClassReader.<init>(ClassReader.java:445) ~[spring-core-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:54) ~[spring-core-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[spring-core-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:123) ~[spring-core-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:430) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
	... 28 common frames omitted

@dz-java
Copy link

dz-java commented Oct 17, 2024

同问,请问大佬解决了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants