Announcement Announcement Module
Collapse
No announcement yet.
javax.servlet.jsp.JspTagException: No message found under code 'menu.home' for locale Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • javax.servlet.jsp.JspTagException: No message found under code 'menu.home' for locale

    Hi

    I am trying to add i18n support in a sample app but getting error as mentioned in the subject. I am using total Java based configuration and Glassfish app server. Below is the snippet of the configuration.
    Code:
    @Configuration
    // @ImportResource({ "classpath*:/rest_config.xml" })
    @ComponentScan(basePackages = "main.java.net.bornil")
    public class AppConfig {
    
        @Bean
        public ReloadableResourceBundleMessageSource getMessageSource() {
            ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
            messageSource.setBasenames(new String[] { "classpath:lebels", "classpath:messages" });
            return messageSource;
        }
    I have four .properties file under WEB-INF/classes;
    • labels_en.properties
    • labels_jp.properties
    • messages_en.properties
    • messages_jp.properties

    labels properties file contain the code "menu.home".

    Error from the log below

    Code:
     20036 [DEBUG] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping  - Returning handler method [public java.lang.String main.java.net.bornil.controller.HomeController.home()]
     20036 [DEBUG] org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'homeController'
     20036 [DEBUG] org.springframework.web.servlet.DispatcherServlet  - Last-Modified value for [/module-partner] is: -1
     20036 [DEBUG] main.java.net.bornil.controller.HomeController  - Showing the base page...
     20036 [DEBUG] org.springframework.web.servlet.DispatcherServlet  - Rendering view [org.springframework.web.servlet.view.JstlView: name 'home'; URL [/WEB-INF/views/home.jsp]] in DispatcherServlet with name 'module-partner'
     20037 [DEBUG] org.springframework.web.servlet.view.JstlView  - Forwarding to resource [/WEB-INF/views/home.jsp] in InternalResourceView 'home'
     20038 [ERROR] org.springframework.web.servlet.tags.MessageTag  - No message found under code 'menu.home' for locale 'en_US'.
    javax.servlet.jsp.JspTagException: No message found under code 'menu.home' for locale 'en_US'.
    	at org.springframework.web.servlet.tags.MessageTag.doStartTagInternal(MessageTag.java:185)
    	at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:80)
    	at org.apache.jsp.WEB_002dINF.views.home_jsp._jspx_meth_spring_message_0(home_jsp.java from :123)
    	at org.apache.jsp.WEB_002dINF.views.home_jsp._jspService(home_jsp.java from :72)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
    	at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:809)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:671)
    	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:505)
    	at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:476)
    	at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:355)
    	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:305)
    	at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    	at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:264)
    	at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
    	at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
    	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
    	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
    	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
    	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
    	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    	at java.lang.Thread.run(Thread.java:680)
     20039 [DEBUG] org.springframework.web.servlet.DispatcherServlet  - Could not complete request
    javax.servlet.ServletException: javax.servlet.jsp.JspTagException: No message found under code 'menu.home' for locale 'en_US'.
    	at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:947)
    	at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:879)
    	at org.apache.jsp.WEB_002dINF.views.home_jsp._jspService(home_jsp.java from :104)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
    	at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:809)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:671)
    	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:505)
    	at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:476)
    	at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:355)
    	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:305)
    	at
    Last edited by mamun; Mar 3rd, 2013, 04:10 AM.

  • #2
    Same is working if I go for XML based configuration as below:
    Code:
        <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
            <property name="basenames">
                <list>
                    <value>classpath:messages</value>
                    <value>classpath:labels</value>
                </list>
            </property>
        </bean>
    Any help please?

    Comment


    • #3
      Problem is solved.
      In java based configuration, classpath:lebels should be classpath:labels

      Comment

      Working...
      X