简体   繁体   中英

Vaadin 23 not resolving URL's, instead showing errorpage

Problem summary: we've upgraded our Java 17 monolith application with multiple modules from Vaadin 21.0.1 to 23.3.5 and now our application routes don't resolve anymore, instead resulting in 404 Whitelabel errorpages. This not being our first Vaadin rodeo (originating from Vaadin 7), we followed the Vaadin upgrade guide generator and expanded accordingly upon that.

Steps we took, each having been validated seperately:

  • Upgraded our backend to use Spring 5.3.18 (coming from 5.3.10). No issue there
  • Upgraded our frontend to use Spring Boot 2.6.7 (coming from 2.5.4). No issue there
  • this step was project-specific and not in the guide Removed Vaadin-addons from pom.xml. Also removed those imports from our package.json. Naturally removed all addons-code from application (EnhancedDialog and MultiselectComboBox -> using v23's regular Dialog and MultiSelectComboBox)
  • Removed webpack.config.js, package-lock.json and the node_modules folder
  • Raised global (-g) npm version to 9.4.0 (coming from 8.3.3)
  • Cleared npm with commandline npm cache clear --force
  • Upgraded the Vaadin flow version to 23.3.5 (coming from 21.0.1)
  • added the following dependency and reloaded the pom.xml:
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>flow-maven-plugin</artifactId>
    <version>23.3.3</version>
</dependency>
  • Invalidated and restarted IntelliJ
  • ran clean-install Maven command through IntelliJ (with Production flag on/off makes no difference)

-> This results in a 404 whitelabel errorpage.

Next, I made sure that all our views annotated with com.vaadin.flow.router. @Route contained at least the javax.annotation.security. @PermitAll annotation. I added spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration to our application.properties trying to get a more descriptive message.

-> This results in the Apache Tomcat errorpage with description: "The origin server did not find a current representation for the target resource or is not willing to disclose that one exists." In both cases, the F12 DevTools are empty and showing nothing more than a 404 for the given URL.

So I continued debugging and validated that our custom security roles were validated correctly, a bit like this answer hinted at. I'm getting into the breakpoints placed in the configure(HttpSecurity http) method from the WebSecurityConfigurerAdapter, but I'm unable to enter the serviceInit(ServiceInitEvent event) from the VaadinServiceInitListener. I'm not a pro concerning servletRequests, but when hitting the isFrameworkInternalRequest(HttpServletRequest request) (called during the adapter's configuration), it seems only logical that for REQUEST_TYPE_PARAMETER a value of null is returned.

I was intrigued by these upgrade steps for an even higher Vaadin version , but nothing in there changed a bit for me.

When asked, I'd say that Spring isn't picking up on my views. Even the older @EnableVaadin() annotation did nothing. At this point I can't think straight anymore, even looking into the change of why Vaadin now uses vite.config.ts instead of webpack.config.js . Any pointers to where the issue might lay are immensely appreciated.

all credit to @Knoobie whose concise answer contained the correct solution.

Vaadin 23.3.x requires at least 2.7.x in order to work.

The Vaadin upgrade guide generator, when looking at the steps to migrate from v21 to v23, mistakenly referenced the minimum version of SpringBoot as 2.6.6. They will fix this in the immediate future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM