2

I tried to use "java -jar " commandto boot the spring packaged fat jar after I installed my own security manager. It is just merely delegate all functions to its parent class. Then I can't start my application in command line, and it gives me the following exception:

java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
    at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:587)
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/builder/SpringApplicationBuilder
    at demo.Test.main(Test.java:57)
    ... 8 more
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.builder.SpringApplicationBuilder
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 9 more

My security policy file is nothing but simply grant all permissions to the code, e.g.grant { permission java.security.AllPermission; };

In my pom file I've also included spring web component(embeded tomcat), I thought it could also maybe some issue related to that?

I've been having a hard time solving this problem still can't resolve it yet. So please help and correct me if there's anything wrong or if you need more detailed information.

Landy Li
  • 21
  • 2
  • I did play with spring boot and security manager 3 years ago and I have experienced similar issues. Like turning on the security manager would break the class loading mechanism of the fat jar. Issue still not solved. I believe this could be reported back to spring. – Marek Puchalski Jul 03 '20 at 20:17

0 Answers0