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

What is the problem? #110

Closed
chenmrU opened this issue May 9, 2023 · 4 comments
Closed

What is the problem? #110

chenmrU opened this issue May 9, 2023 · 4 comments

Comments

@chenmrU
Copy link

chenmrU commented May 9, 2023

2023-05-09T02:22:12.094470240Z Exception in thread "main" java.lang.reflect.InvocationTargetException
2023-05-09T02:22:12.094513853Z at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2023-05-09T02:22:12.094517686Z at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2023-05-09T02:22:12.094520441Z at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2023-05-09T02:22:12.094523018Z at java.lang.reflect.Method.invoke(Method.java:498)
2023-05-09T02:22:12.094525623Z at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
2023-05-09T02:22:12.094528399Z at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
2023-05-09T02:22:12.094530903Z at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
2023-05-09T02:22:12.094596691Z at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
2023-05-09T02:22:12.094682593Z Caused by: java.lang.NoSuchMethodError: pl.tkowalcz.tjahzi.log4j2.LokiAppenderBuilder.getPropertyArray()[Lorg/apache/logging/log4j/core/config/Property;
2023-05-09T02:22:12.094689409Z at pl.tkowalcz.tjahzi.log4j2.LokiAppenderBuilder.build(LokiAppenderBuilder.java:154)
2023-05-09T02:22:12.094697614Z at pl.tkowalcz.tjahzi.log4j2.LokiAppenderBuilder.build(LokiAppenderBuilder.java:31)
2023-05-09T02:22:12.094733360Z at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
2023-05-09T02:22:12.094740494Z at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:958)
2023-05-09T02:22:12.094743538Z at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:898)
2023-05-09T02:22:12.094781600Z at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:890)
2023-05-09T02:22:12.094787580Z at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:513)
2023-05-09T02:22:12.094790485Z at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:237)
2023-05-09T02:22:12.094797435Z at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:249)

@tkowalcz
Copy link
Owner

tkowalcz commented May 9, 2023

Hello,

log4j2 version that you have on classpath is incompatible with the version Tjahzi was compiled against. Tjahzi was compiled against 2.17.2 and method getPropertyArray is present in log4j2 since year 2018 (since version 2.12.2 of log4j2 but I might be wrong about exact one). Please check which version of log4j2 is in use and let me know if you think it is the correct one.

Longer explanation of the error:
This error indicates that at runtime class LokiAppenderBuilder did not have a method getPropertyArray. That metod is part of log4j SPI and defined in class AbstractFilterable which LokiAppenderBuilder indirectly extends.

@chenmrU
Copy link
Author

chenmrU commented May 10, 2023

I have changed the version of Log4j to 2.17.2 , but the same error still appears.

@tkowalcz
Copy link
Owner

I'm sorry but I have no other ideas. Definitely there is a mismatch between compile time and runtime version of the class. Maybe you can share the class path? You could also run this code when you app starts to verify where AbstractFilterable comes from:

System.out.println(
    AbstractFilterable.class.getProtectionDomain().getCodeSource().getLocation().getPath()
);

@tkowalcz
Copy link
Owner

Closing due to inactivity. Feel free to re-open if you need more help.

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

2 participants