• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Spring boot themes source not found

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
/WEB-INF/classes/com package contains
SpringJspExample.class
springbootapplication

/WEB-INF/classes/com/config package contains
@Configuration @ComponentScan("com") @EnableWebMvc public class AppConfiguration extends WebMvcConfigurerAdapter { @Bean public ThemeSource themeSource() { ResourceBundleThemeSource source = new ResourceBundleThemeSource(); source.setBasenamePrefix("themes-"); return source; } @Bean public ThemeResolver themeResolver(){ CookieThemeResolver resolver = new CookieThemeResolver(); resolver.setCookieMaxAge(2400); resolver.setCookieName("mythemecookie"); resolver.setDefaultThemeName("default"); return resolver; } /* End */ ); return resolver; }
@Override public void addInterceptors(InterceptorRegistry registry) {  newThemeChangeInterceptor themeInterceptor = new ThemeChangeInterceptor(); themeInterceptor.setParamName("theme"); registry.addInterceptor(themeInterceptor); }   @Override public void addResourceHandlers(final ResourceHandlerRegistry registry) { registry.addResourceHandler("/themes/**").addResourceLocations("classpath:/themes/"); } }
and Initializer class
/WEB-INF/classes/com/config/Initializer.class
/WEB-INF/lib folder contain
spring-boot-starter-web
spring-boot-starter-thymeleaf
i compiled by
javac -cp ../lib/* com\SpringJspExample.java com\controller\HelloController.java com\config\*.java
and i packaged all files and folders using jar commad
jar -cv0mf manifest. txt SpringDemo. war WEB-INF resources themes org

when i run the springdemo. war using
java -jar SpringDemo. war
embedded tomcat server started successfully.
after i opened the browser and type
http://localhost:8080/index
browser display 500 internal server error
in the dos prompt following exception display
Theme ‘default’: No message found under code ‘css’ for locale ‘en_US’ ” 
please help me to correct  this problem..
 
Bartender
Posts: 2265
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe, what you can do is to use InteilliJ or Eclipse IDE to package your project.
And then run the main class to see if you can launch the http://localhost:8080/index

And I think most Spring boot application is packaged as jar , not war.
 
reply
    Bookmark Topic Watch Topic
  • New Topic