Announcement Announcement Module
Collapse
No announcement yet.
Spring + JSF double bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring + JSF double bean

    Hi!
    I am using Spring + JSF and I found a problem when testing my application, namely, every bean (I use session beans configured in spring context) is created two times... It slows down application (when reading data from database) and is annoying...
    Do You know something about this?

  • #2
    Hi could you explain it a little more?
    May be post some code and the logs where you believe such a thing is happening.


    --
    Pankaj

    Comment


    • #3
      Thank You for post!

      I can see that placing logger in some function in a bean.
      For example in constructor:

      Code:
      public CalendarBean(Reporter reporter, ReporterUtil reporterUtil) {
          log.debug("CalendarBean created");
          this.reporter = reporter;
          user = reporterUtil.getUser();
      }
      Every log form a bean looks like:
      Code:
      2009-01-02 16:07:53 DEBUG [http-8080-2] CalendarBean created
      2009-01-02 16:07:53 DEBUG [http-8080-2] CalendarBean created
      Interesting fragments from configuration:

      faces-context.xml:
      Code:
      <application>
      <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> 
      (...)
      + navigation rules

      Example bean from Spring context:
      Code:
      <bean id="calendarBean" class="blablabla.bean.CalendarBean" scope="session">
          <constructor-arg index="0" ref="reporterSqlMap" />
          <constructor-arg index="1" ref="reporterUtil" />
      </bean>
      Listeners from web.xml:
      Code:
      <listener>
          <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
      
      <listener>
          <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
      </listener>
      I am using Spring 2.5.5, MyFaces 1.2.4, RichFaces 3.2.2.

      Comment


      • #4
        It seems to me that it is simply the logger that prints the logs twice.

        If you have several loggers in your file, you can specify that you want no additivity.

        You can also simply try to make a System.out.println instead of the log, and see if the problem is still here.

        Comment

        Working...
        X