vaadin / appsec-kit

Other
1 stars 0 forks source link

Can't run the Application.java directly #108

Open jcgueriaud1 opened 1 year ago

jcgueriaud1 commented 1 year ago

If I'm following the instructions and running the application through my IDE, my application does not start:

org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
    at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:357)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:156)
    at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:124)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:958)
    at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:611)
    at org.springframework.context.support.AbstractApplicationContext.jrLockAndRefresh(AbstractApplicationContext.java:41002)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:42008)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298)
    at -----.Application.main(Application.java:37)
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:229)
    at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:44)
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:179)
    ... 15 common frames omitted
Caused by: org.springframework.boot.web.server.WebServerException: Servlet [springServlet] in web application [] threw load() exception
    at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.load(TomcatEmbeddedContext.java:89)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
    at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
    at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
    at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:3250)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
    at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.lambda$deferredLoadOnStartup$0(TomcatEmbeddedContext.java:67)
    at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.doWithThreadContextClassLoader(TomcatEmbeddedContext.java:108)
    at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.deferredLoadOnStartup(TomcatEmbeddedContext.java:66)
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.performDeferredLoadOnStartup(TomcatWebServer.java:305)
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:216)
    ... 17 common frames omitted
Caused by: jakarta.servlet.ServletException: Servlet.init() for servlet [springServlet] threw exception
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:960)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
    at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.load(TomcatEmbeddedContext.java:84)
    ... 33 common frames omitted
Caused by: com.vaadin.appsec.backend.AppSecException: Maven SBOM file not found on path /resources/bom.json
    at com.vaadin.appsec.backend.AppSecConfiguration.getBomFilePath(AppSecConfiguration.java:124)
    at com.vaadin.appsec.backend.AppSecService.init(AppSecService.java:114)
    at com.vaadin.appsec.service.AppSecServiceInitListener.serviceInit(AppSecServiceInitListener.java:37)
    at com.vaadin.flow.server.VaadinService.lambda$init$0(VaadinService.java:230)
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
    at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
    at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
    at com.vaadin.flow.server.VaadinService.lambda$init$1(VaadinService.java:230)
    at com.vaadin.flow.server.VaadinService.runWithServiceContext(VaadinService.java:2305)
    at com.vaadin.flow.server.VaadinService.init(VaadinService.java:228)
    at com.vaadin.flow.spring.SpringVaadinServletService.init(SpringVaadinServletService.java:102)
    at com.vaadin.flow.spring.SpringServlet.createServletService(SpringServlet.java:115)
    at com.vaadin.flow.server.VaadinServlet.createServletService(VaadinServlet.java:336)
    at com.vaadin.flow.server.VaadinServlet.init(VaadinServlet.java:132)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:944)
    ... 35 common frames omitted

Process finished with exit code 1

I have to run the maven command to run the plugins (for example mvn package).

I'm expecting that my application is running and the AppSec will tell me that I need to generate the files.