Skip to content

MultiPart annotation scanning not done if metadata-complete==true #12981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lachlan-roberts opened this issue Apr 10, 2025 · 5 comments · Fixed by #12984
Closed

MultiPart annotation scanning not done if metadata-complete==true #12981

lachlan-roberts opened this issue Apr 10, 2025 · 5 comments · Fixed by #12984
Labels
Bug For general bugs on Jetty side

Comments

@lachlan-roberts
Copy link
Contributor

Jetty version(s)
Jetty 12 EE8-EE9

Description
There was a change made in PR #4587, so that if metadata-complete==true then MultipartConfig annotations are NOT introspected.

This is giving issues if a quickstart-web.xml file is generated from Jetty 9.4 and used with Jetty 12 EE8.

In Jetty 9.4 if you have a servlet annotated with @MuliparConfig, the quickstart-web.xml is generated with the <web-app tag with metadata-complete="true", but the XML has no <multipart-config> tag for the servlet. But now multipart annotations will not be scanned for this class if run with Jetty 12 EE8.

See also GoogleCloudPlatform/appengine-java-standard#358

@lachlan-roberts lachlan-roberts added the Bug For general bugs on Jetty side label Apr 10, 2025
@lachlan-roberts
Copy link
Contributor Author

@janbartel what are your thoughts on this?

I know we shouldn't need to do introspection of the annotations if metadata-complete==true, but is there any way we can make this work for EE8 so it is compatible for Jetty 9.4 migrations.

@janbartel
Copy link
Contributor

@lachlan-roberts it non-spec compliant that we parsed those annotations despite metadata-complete=true. I see 2 solutions:

  1. we backport the fix to jetty-9.4, re-release and then users regenerate their quickstart-web.xml
  2. users regenerate their quickstart-web.xml under jetty-12 ee8

Either way, a regenerate is necessary. I can't see how we could preserve old, incorrect behaviour without introducing it to ee9, considering that the ee8 code is mechanically produced from the ee9 code.

@lachlan-roberts
Copy link
Contributor Author

@janbartel for the GAE use case they are trying to migrate all users on Jetty 9.4 to Jetty 12 EE8, but this needs to be transparent without the users needing to redeploy their applications. So I don't think regenerating quickstart-web.xml can be part of the solution.

@janbartel
Copy link
Contributor

@lachlan-roberts mmmm, let me think about if/how a mode could be done.

@janbartel
Copy link
Contributor

@lachlan-roberts have a look at AnnotationIntrospector class, at this line here: https://github.com/jetty/jetty.project/blob/jetty-12.0.x/jetty-ee9/jetty-ee9-annotations/src/main/java/org/eclipse/jetty/ee9/annotations/AnnotationIntrospector.java#L166. It may be as simple as introducing a flag that will go ahead and do the introspection irregardless of if metadata-complete is true or not. It would be nice if this flag was only available in ee8, so maybe you'll have to grab the generated ee8 source of it and check it in and modify it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants