Я разрабатываю приложение vaadin.
Все хорошо работает под Eclipse (последняя версия), JDK 22.
При развертывании в Tomcat приложение висит со следующей (я обнаружил множество пользователей
, которые получили одну и ту же проблему). [com.vaadin.flow.server.startup.servletContextListeners]
Java.lang.illegalstateException: экземпляр поиска приложений не найден в Vaadincontext. Предполагается, что экземпляр будет создан ServletContainerInitializer. Проблемы, известные по этой проблеме,: < /p>
Приложение Spring Boot, развернутое в качестве боевого файла, но основной класс приложений не расширяет Springbootservletinitializer < /li>
Встроенный сервер, который не настроен на выполнение ServiteContainerInitialializers < /li>
. тест < /li>
< /ul>
at com.vaadin.flow.server.startup.ApplicationConfiguration.lambda$get$0(ApplicationConfiguration.java:53)
at com.vaadin.flow.server.VaadinServletContext.getAttribute(VaadinServletContext.java:73)
at com.vaadin.flow.server.startup.ApplicationConfiguration.get(ApplicationConfiguration.java:47)
at com.vaadin.flow.server.DeploymentConfigurationFactory.createPropertyDeploymentConfiguration(DeploymentConfigurationFactory.java:75)
at com.vaadin.flow.server.startup.ServletDeployer$StubServletConfig.createDeploymentConfiguration(ServletDeployer.java:138)
at com.vaadin.flow.server.startup.ServletDeployer.lambda$getServletConfigurations$0(ServletDeployer.java:195)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
< /code>
Ошибка --------------- < /p>
Это неделя, когда я пробовал все, включая множество комбинаций комбинаций: < /p>
mvn dependency:purge-local-repository
mvn eclipse:eclipse
mvn clean
mvn clean package -Pproduction
mvn package -Pproduction
mvn clean package -Pproduction -Dvaadin.force.production.build=true -DskipTests -Dmaven.javadoc.skip=true -Dmaven.test.skip
mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Pproduction -Dmaven.test.skip -DskipTests
< /code>
есть ли способ понять, кто является виновником? Я включил все возможные журналы,
, но никаких полезных ошибок.server.port=9090
logging.level.root=INFO
logging.level.org.atmosphere = INFO
spring.data.mongodb.uri=mongodb://localhost:27017/zzzzzz
spring.data.mongodb.username=xxxx
spring.data.mongodb.password=xxxxx
#spring.data.mongodb.database=springBootMongoDB
server.tomcat.max-swallow-size=100MB
server.tomcat.max-http-post-size=100MB
spring.servlet.multipart.enabled=true
spring.servlet.multipart.fileSizeThreshold=100MB
spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=100MB
spring.main.lazy-initialization=true
spring.mustache.check-template-location = false
server.servlet.session.persistent=false
produces="application/json"
vaadin.launch-browser=true
vaadin.react.enable=false
vaadin.allowed-packages=com.flowingcode
vaadin.productionMode=true
vaadin.frontend.hotdeploy=false
vaadin.whitelisted-packages = com.vaadin,org.vaadin,dev.hilla
vaadin.exclude-urls=/filetreez
vaadin.devmode-caching = false
spring.sql.init.mode = always
spring.jpa.open-in-view=false
upload.folder = "/data/uploads/"
logging.level.org.atmosphere = warn
spring.mustache.check-template-location = false
#vaadin.allowed-packages = com.vaadin,org.vaadin,dev.hilla,com.example.application
#spring.jpa.defer-datasource-initialization = true
spring.sql.init.mode = never
< /code>
файл POM < /p>
& l t ; p r o j e c t x m l n s = & q u o t ; h t t p : / / m a v e n . a p a c h e . o r g / P O M / 4 . 0 . 0 & q u o t ; < b r / > x m l n s : x s i = & q u o t ; h t t p : / / w w w . w 3 . o r g / 2 0 0 1 / X M L S c h e m a - i n s t a n c e & q u o t ; < b r / > x s i : s c h e m a L o c a t i o n = & q u o t ; h t t p : / / m a v e n . a p a c h e . o r g / P O M / 4 . 0 . 0 h t t p s : / / m a v e n . a p a c h e . o r g / x s d / m a v e n - 4 . 0 . 0 . x s d & q u o t ; & g t ; < b r / > & l t ; m o d e l V e r s i o n & g t ; 4 . 0 . 0 & l t ; / m o d e l V e r s i o n & g t ; < b r / > & l t ; g r o u p I d & g t ; x x x x . x x x x & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; x x x x x & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; n a m e & g t ; x x x x x & l t ; / n a m e & g t ; < b r / > & l t ; v e r s i o n & g t ; 1 . 0 . 0 - S N A P S H O T & l t ; / v e r s i o n & g t ; < b r / > & l t ; p a c k a g i n g & g t ; w a r & l t ; / p a c k a g i n g & g t ; < b r / > < b r / > & l t ; p r o p e r t i e s & g t ; < b r / > & l t ; j a v a . v e r s i o n & g t ; 2 1 & l t ; / j a v a . v e r s i o n & g t ; < b r / > & l t ; j u n i t . v e r s i o n & g t ; 5 . 1 8 . 2 & l t ; / j u n i t . v e r s i o n & g t ; < b r / > & l t ; v a a d i n . v e r s i o n & g t ; 2 4 . 7 . 3 & l t ; / v a a d i n . v e r s i o n & g t ; < b r / > & l t ; / p r o p e r t i e s & g t ; < b r / > < b r / > & l t ; p a r e n t & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - p a r e n t & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; 3 . 4 . 5 & l t ; / v e r s i o n & g t ; < b r / > & l t ; r e l a t i v e P a t h / & g t ; < b r / > & l t ; / p a r e n t & g t ; < b r / > < b r / > & l t ; r e p o s i t o r i e s & g t ; < b r / > & l t ; r e p o s i t o r y & g t ; < b r / > & l t ; i d & g t ; V a a d i n D i r e c t o r y & l t ; / i d & g t ; < b r / > & l t ; u r l & g t ; h t t p s : / / m a v e n . v a a d i n . c o m / v a a d i n - a d d o n s & l t ; / u r l & g t ; < b r / > & l t ; s n a p s h o t s & g t ; < b r / > & l t ; e n a b l e d & g t ; f a l s e & l t ; / e n a b l e d & g t ; < b r / > & l t ; / s n a p s h o t s & g t ; < b r / > & l t ; / r e p o s i t o r y & g t ; < b r / > & l t ; / r e p o s i t o r i e s & g t ; < b r / > < b r / > & l t ; d e p e n d e n c y M a n a g e m e n t & g t ; < b r / > & l t ; d e p e n d e n c i e s & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; c o m . v a a d i n & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; v a a d i n - b o m & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; $ { v a a d i n . v e r s i o n } & l t ; / v e r s i o n & g t ; < b r / > & l t ; t y p e & g t ; p o m & l t ; / t y p e & g t ; < b r / > & l t ; s c o p e & g t ; i m p o r t & l t ; / s c o p e & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; m y . d a t a & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; d a t a & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; 1 . 0 . 0 - S N A P S H O T & l t ; / v e r s i o n & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > < b r / > & l t ; / d e p e n d e n c i e s & g t ; < b r / > & l t ; / d e p e n d e n c y M a n a g e m e n t & g t ; < b r / > < b r / > & l t ; d e p e n d e n c i e s & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; n e t . s o u r c e f o r g e . o w l a p i & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; o w l a p i - a p i & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; 5 . 5 . 1 & l t ; / v e r s i o n & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; n e t . s o u r c e f o r g e . o w l a p i & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; o w l a p i - d i s t r i b u t i o n & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; 5 . 5 . 1 & l t ; / v e r s i o n & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; c o m . v a a d i n & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; v a a d i n - c o r e & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; c o m . v a a d i n & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; v a a d i n - s p r i n g - b o o t - s t a r t e r & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; e x c l u s i o n s & g t ; < b r / > & l t ; e x c l u s i o n & g t ; < b r / > & l t ; g r o u p I d & g t ; c o m . v a a d i n & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; h i l l a & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; / e x c l u s i o n & g t ; < b r / > & l t ; / e x c l u s i o n s & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . p a r t t i o & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; l i n e - a w e s o m e & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; 2 . 1 . 0 & l t ; / v e r s i o n & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . d a t a & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; s p r i n g - d a t a - m o n g o d b & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - d a t a - m o n g o d b & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - a c t u a t o r & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - v a l i d a t i o n & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; e x c l u s i o n s & g t ; < b r / > & l t ; e x c l u s i o n & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; t o m c a t - e m b e d - e l & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . a p a c h e . t o m c a t . e m b e d & l t ; / g r o u p I d & g t ; < b r / > & l t ; / e x c l u s i o n & g t ; < b r / > & l t ; e x c l u s i o n & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - t o m c a t & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; / e x c l u s i o n & g t ; < b r / > & l t ; / e x c l u s i o n s & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - w e b & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; e x c l u s i o n s & g t ; < b r / > & l t ; e x c l u s i o n & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; t o m c a t - e m b e d - e l & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . a p a c h e . t o m c a t . e m b e d & l t ; / g r o u p I d & g t ; < b r / > & l t ; / e x c l u s i o n & g t ; < b r / > & l t ; e x c l u s i o n & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; t o m c a t - e m b e d - c o r e & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . a p a c h e . t o m c a t . e m b e d & l t ; / g r o u p I d & g t ; < b r / > & l t ; / e x c l u s i o n & g t ; < b r / > & l t ; e x c l u s i o n & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; t o m c a t - e m b e d - w e b s o c k e t & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . a p a c h e . t o m c a t . e m b e d & l t ; / g r o u p I d & g t ; < b r / > & l t ; / e x c l u s i o n & g t ; < b r / > & l t ; / e x c l u s i o n s & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - t o m c a t & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; s c o p e & g t ; p r o v i d e d & l t ; / s c o p e & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . s p r i n g f r a m e w o r k . b o o t & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; s p r i n g - b o o t - s t a r t e r - s e c u r i t y & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; / d e p e n d e n c y & g t ; < b r / > & l t ; d e p e n d e n c y & g t ; < b r / > & l t ; g r o u p I d & g t ; o r g . v a a d i n . k l a u d e t a & l t ; / g r o u p I d & g t ; < b r / > & l t ; a r t i f a c t I d & g t ; g r i d - p a g i n a t i o n & l t ; / a r t i f a c t I d & g t ; < b r / > & l t ; v e r s i o n & g t ; 4 . 0 . 1 & l t ; / v e r s i o n & g t ; < b r / > & l t ; / d e p e ndency>
org.vaadin.crudui
crudui
7.2.0
org.projectlombok
lombok
javax.faces
jsf-api
2.1
provided
jakarta.servlet
jakarta.servlet-api
provided
jakarta.inject
jakarta.inject-api
com.google.code.gson
gson
com.google.guava
guava
33.4.8-jre
com.fasterxml.jackson.core
jackson-databind
commons-io
commons-io
2.19.0
org.apache.commons
commons-text
1.13.1
org.slf4j
slf4j-api
org.vaadin.tatu
tree
3.3.0
org.apache.poi
poi-ooxml
5.4.1
software.xdev
vaadin-maps-leaflet-flow
4.6.0
spring-boot:run
org.springframework.boot
spring-boot-maven-plugin
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5493
--add-opens=java.base/java.lang=ALL-UNNAMED
500
240
com.vaadin
vaadin-maven-plugin
${vaadin.version}
prepare-frontend
build-frontend
production
prod
com.vaadin
vaadin
com.vaadin
vaadin-dev
com.vaadin
vaadin-maven-plugin
${vaadin.version}
prepare-frontend
build-frontend
compile
it
org.springframework.boot
spring-boot-maven-plugin
start-spring-boot
pre-integration-test
start
stop-spring-boot
post-integration-test
stop
org.apache.maven.plugins
maven-failsafe-plugin
integration-test
verify
false
true
false
< /code>
appication.java < /p>
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import com.vaadin.flow.component.page.AppShellConfigurator;
import com.vaadin.flow.component.page.Push;
import com.vaadin.flow.server.LoadDependenciesOnStartup;
import com.vaadin.flow.spring.annotation.EnableVaadin;
import com.vaadin.flow.theme.Theme;
@EnableVaadin
@SpringBootApplication(exclude = { org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration.class,org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration.class})
@Theme(value = "myapp")
//@LoadDependenciesOnStartup
@Push(value = com.vaadin.flow.shared.communication.PushMode.MANUAL)//, transport = com.vaadin.shared.ui.ui.Transport.LONG_POLLING)
@ComponentScan(basePackages = {"my.app","my.app.views.maint","my.app.data","my.app.data.flow","my.app.data.repository"}/*,excludeFilters={@ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE, value=StaticApplicationLoader.class)}*/)
public class MyApp implements AppShellConfigurator {//, CommandLineRunner {
private static final long serialVersionUID = 1L;
public static StaticApplicationLoader sessionData;
public static void main(String[] args) {
SpringApplication.run(MyApp.class, args);
}
}
< /code>
staticApplicationloader.java // Для хранения сеанса пользователя < /p>
import java.util.concurrent.ConcurrentHashMap;
import jakarta.servlet.ServletContextListener;
import jakarta.servlet.annotation.WebListener;
@WebListener
public class StaticApplicationLoader implements ServletContextListener{
public static ConcurrentHashMap userSessions = new ConcurrentHashMap();
}
< /code>
servlectinitializer.java
import org.springframework.boot.SpringApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.web.WebApplicationInitializer;
@SuppressWarnings("unused")
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(MyApp.class); // Replace DemoApplication with your main class
}
public static void main(String[] args) {
SpringApplication.run(MyApp.class, args);
}
}
< /code>
Согласно предложениям CFRICH,
я изменяю класс инициирования следующим образом: < /p>
@SpringBootApplication(exclude={org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration.class})
public class MyApp extends SpringBootServletInitializer implements AppShellConfigurator {
public static StaticApplicationLoader sessionData;
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(ChangesApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(ChangesApplication.class, args);
sessionData = new StaticApplicationLoader();
}
}
< /code>
Таким образом, я удалил класс Springbootservletinitializer. Однако это не решает проблему.
Подробнее здесь: https://stackoverflow.com/questions/795 ... r-instance