I have successfully created a spring boot project which works fines however it fails when I try to deploy it to an external tomcat. Here is my pom XML and below is my application.properties file.
server.servlet.context-path=/School
joinfaces.primefaces.theme=admin
joinfaces.jsf.project-stage=development
joinfaces.primefaces.csp=true
joinfaces.primefaces.font-awesome=true
server.servlet.session.cookie.http-only=true
server.servlet.session.cookie.secure=true
joinfaces.myfaces.clear-input-when-submitted-value-is-null-or-empty=true
spring.datasource.url= jdbc:postgresql://localhost:5432/mydb
spring.datasource.username=postgres
spring.datasource.password=password
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=false
server.error.whitelabel.enabled=false
spring.mvc.throw-exception-if-no-handler-found=true
server.max-http-header-size=10MB
server.port=8443
security.require-ssl=true
and here is the error stack trace am getting when I deploy to external tomcat.
09-Dec-2021 11:05:18.222 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [OCPsoft Rewrite Filter]
io.github.classgraph.ClassGraphException: Uncaught exception during scan
at io.github.classgraph.ClassGraphException.newClassGraphException(ClassGraphException.java:89)
at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1570)
at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1588)
at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1601)
at org.joinfaces.autoconfigure.rewrite.SpringBootAnnotationConfigProvider.scanClasses(SpringBootAnnotationConfigProvider.java:102)
at org.joinfaces.autoconfigure.rewrite.SpringBootAnnotationConfigProvider.lambda$getConfiguration$0(SpringBootAnnotationConfigProvider.java:79)
at java.util.Optional.orElseGet(Unknown Source)
at org.joinfaces.autoconfigure.rewrite.SpringBootAnnotationConfigProvider.getConfiguration(SpringBootAnnotationConfigProvider.java:79)
at org.joinfaces.autoconfigure.rewrite.SpringBootAnnotationConfigProvider.getConfiguration(SpringBootAnnotationConfigProvider.java:54)
at org.ocpsoft.rewrite.config.ConfigurationLoader.build(ConfigurationLoader.java:138)
at org.ocpsoft.rewrite.config.ConfigurationLoader.buildCached(ConfigurationLoader.java:118)
at org.ocpsoft.rewrite.config.ConfigurationLoader.loadConfiguration(ConfigurationLoader.java:81)
at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.init(DefaultHttpRewriteProvider.java:81)
at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.init(DefaultHttpRewriteProvider.java:55)
at org.ocpsoft.rewrite.servlet.RewriteFilter.init(RewriteFilter.java:142)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:106)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4554)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5197)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1015)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1895)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at nonapi.io.github.classgraph.fileslice.reader.ClassfileReader.readTo(ClassfileReader.java:196)
at nonapi.io.github.classgraph.fileslice.reader.ClassfileReader.readInt(ClassfileReader.java:322)
at nonapi.io.github.classgraph.fileslice.reader.ClassfileReader.readInt(ClassfileReader.java:381)
at io.github.classgraph.Classfile.<init>(Classfile.java:1938)
at io.github.classgraph.Scanner$ClassfileScannerWorkUnitProcessor.processWorkUnit(Scanner.java:734)
at io.github.classgraph.Scanner$ClassfileScannerWorkUnitProcessor.processWorkUnit(Scanner.java:657)
at nonapi.io.github.classgraph.concurrency.WorkQueue.runWorkLoop(WorkQueue.java:246)
at nonapi.io.github.classgraph.concurrency.WorkQueue.access$000(WorkQueue.java:50)
at nonapi.io.github.classgraph.concurrency.WorkQueue$1.call(WorkQueue.java:201)
at nonapi.io.github.classgraph.concurrency.WorkQueue$1.call(WorkQueue.java:198)
... 4 more
09-Dec-2021 11:05:18.236 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
I have no idea what I could be missing or what configuration I should do to make it work.
CodePudding user response:
Your JVM is running low on memory, try and increase your Java heap space by adding/modifying the following VM arguments:
-Xms64m -Xmx256m