Layout file is missing, CustomLayout

I am running Vaadin in an embedded Jetty and I think that is creating some problems with the themes.
I had this problem with sass compilation which is kind of solved here: https://vaadin.com/forum/#!/thread/10541054
(I add this info because maybe it can give hints for the current problem).

Now I am facing a problem with CustomLayout template. When I do

super("templateName") I get an error:

Layout file layouts/templateName.html is missing. Components will be drawn for debug purposes. To load the template I have to do like this:

PATH_TO_TEMPLATE = "VAADIN/themes/mytheme/layouts/templateName.html"; super(UI.getCurrent().getClass().getClassLoader().getResourceAsStream(PATH_TO_TEMPLATE)); As this is quite bad, since I have to have a hardcoded path, I tried to retrieve the theme
(VaadinService.getCurrent().getConfiguredTheme()
) to create this PATH_TO_TEMPLATE in a more dynamic way.

My surprise was that even my UI has the annotation
@Theme(“mytheme”) ,
the
VaadinService.getCurrent().getConfiguredTheme()
method is returning “reindeer”.

Shouldn’t it be returning “mytheme”? Also I tried to use the method setTheme with the same result. My theme is not even using reindeer, it’s using Valo as base.

Nobody who has gotten a different theme than the set one when calling getConfiguredTheme()? Can that be the source of my problem?