Announcement Announcement Module
Collapse
No announcement yet.
org.hibernate.LazyInitializationException specific case probably Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.hibernate.LazyInitializationException specific case probably

    Currently I working on implementing web based application with persistence to DB . I use Spring 3.2.3.RELEASE , Hibernate 3.5.6-Final , JSF 2.1.6 + PrimeFaces 3.5 .

    I get org.hibernate.LazyInitializationException not a first time , before I solve it by adding FetchType.EAGER to problematic fields of bean , but this time it don't solve problem , I am suspecting that it is because collection that I try to fetch is enum . Also I try to implement org.springframework.orm.hibernate3.support.OpenSes sionInViewFilter , but it also not solve the problem or I just fail to implement it correctly .

    Here is code / configs :

    web.xml :
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    	id="WebApp_ID" version="2.5">
    
    
    	<!-- Spring Context Configuration' s Path definition -->
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
    			/WEB-INF/dispatcher-servlet.xml
    			/WEB-INF/applicationContext-security.xml
    		</param-value>
    	</context-param>
    
    	<context-param>
    		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    		<param-value>client</param-value>
    	</context-param>
    
    	<context-param>
    		<param-name>facelets.DEVELOPMENT</param-name>
    		<param-value>true</param-value>
    	</context-param>
    
    	<filter>
    		<filter-name>sessionFilter</filter-name>
    		<filter-class>
    			org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
    		</filter-class>
    		 <init-param>
                <param-name>sessionFactoryBeanName</param-name>
                <param-value>mySessionFactory</param-value>
            </init-param>
    	</filter>
    	<filter-mapping>
    		<filter-name>sessionFilter</filter-name>
    		<url-pattern>*.xhtml</url-pattern>
    	</filter-mapping>
    
    
    	<filter>
    		<filter-name>springSecurityFilterChain</filter-name>
    		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    	</filter>
    	<filter-mapping>
    		<filter-name>springSecurityFilterChain</filter-name>
    		<url-pattern>/*</url-pattern>
    		<dispatcher>FORWARD</dispatcher>
    		<dispatcher>REQUEST</dispatcher>
    	</filter-mapping>
    
    	<!-- The Bootstrap listener to start up and shut down Spring's root WebApplicationContext. 
    		It is registered to Servlet Container -->
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    	<listener>
    		<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    	</listener>
    
    	<!-- Welcome Page -->
    	<welcome-file-list>
    		<welcome-file>pages/index.xhtml</welcome-file>
    	</welcome-file-list>
    
    	<!-- JSF Servlet is defined to container -->
    	<servlet>
    		<servlet-name>DispatcherServlet</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value>classpath:dispatcher-servlet.xml</param-value>
    		</init-param>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	<servlet>
    		<servlet-name>Faces Servlet</servlet-name>
    		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    
    	<!-- Mapping with servlet and url for the http requests. -->
    	<servlet-mapping>
    		<servlet-name>Faces Servlet</servlet-name>
    		<url-pattern>*.xhtml</url-pattern>
    	</servlet-mapping>
    	
    
    	<servlet-mapping>
    		<servlet-name>DispatcherServlet</servlet-name>
    		<url-pattern>/</url-pattern>
    	</servlet-mapping>
    
    </web-app>
    dispatcher.servlet.xml :
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:tx="http://www.springframework.org/schema/tx"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context
    	http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
    
    	<context:annotation-config />
    	<context:component-scan base-package="......" />
    	<context:component-scan base-package="........." />
    	<tx:annotation-driven proxy-target-class="true" />
    
    	<bean
    		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    		<property name="location">
    			<value>database.properties</value>
    		</property>
    	</bean>
    
    	<bean id="myDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
    		<property name="jdbcUrl" value="${db.url}" />
    		<property name="driverClass" value="com.mysql.jdbc.Driver" />
    		<property name="user" value="${db.username}" />
    		<property name="password" value="${db.password}" />
    		<property name="preferredTestQuery" value="select 1;" />		
    		<property name="initialPoolSize" value="20" />
    		<property name="minPoolSize" value="5" />
    		<property name="maxPoolSize" value="150" />
    		<property name="maxIdleTime" value="1800" />
    		<property name="idleConnectionTestPeriod" value="3600" />
    	</bean>
    
    	<bean id="mySessionFactory"
    		class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    		<property name="dataSource" ref="myDataSource" />
    		<property name="annotatedClasses">
    			<list>
    				...................
    			</list>
    		</property>
    		<property name="hibernateProperties">
    			<props>
    				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
    				<prop key="hibernate.show_sql">false</prop>
    				<prop key="hibernate.hbm2ddl.auto">validate</prop>
    			</props>
    		</property>
    	</bean>
    
    	<bean id="transactionManager"
    		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    		<property name="dataSource" ref="myDataSource" />
    		<property name="sessionFactory" ref="mySessionFactory" />
    	</bean>
    
    </beans>
    problematic bean :
    Code:
    @Entity
    @Table(name = "SchedulingSettings")
    public class SchedulingSettings implements Serializable
    {
        private static final long serialVersionUID = -8319141036288318816L;
    
        @Id
        @GeneratedValue
        private int id;
    
        @Column(name = "name", unique = true, nullable = false)
        private String name;
    
        @ManyToOne
        @JoinColumn(name = "domainId", unique = false, nullable = false)
        private Domain domain;
    
        @Enumerated(EnumType.ORDINAL)
        @Column(name = "language", unique = false, nullable = false)
        private Language language;
    
        @ManyToOne
        @JoinColumn(name = "releaseId", unique = false, nullable = true)
        private ReleaseEntity releaseEntity;
    
        @Column(name = "maxTimeOfChanges", unique = false, nullable = true, columnDefinition = "timestamp")
        private Date maxTimeOfChanges;
    
        @ElementCollection(fetch = FetchType.EAGER)
        @Enumerated(EnumType.ORDINAL)
        @CollectionTable(name = "SchedulingSettings_BrowserType")
        @Column(name = "browserTypes", unique = false, nullable = false, columnDefinition = "binary")
        private Set<BrowserType> browserTypes;
    
        @ManyToOne
        @JoinColumn(name = "testCaseId", unique = false, nullable = true)
        private TestCase testCase;
    
        @ManyToOne
        @JoinColumn(name = "testSuiteId", unique = false, nullable = true)
        private TestSuite testSuite;
    
    ///  ..... getters / setters / helper methods 
    }
    Exception happens when I try to save entity but before i get to SchedulingSettingsManagedBean.onSave .
    Could you please give me a tip how to solve it ?

  • #2
    I exceed char limit of one post , here part that not fit :

    ManagedBean
    Code:
    
    @ManagedBean(name = "schedMB")
    @SessionScoped
    public class SchedulingSettingsManagedBean
    {
        private static Logger log = LoggerFactory
    	    .getLogger(SchedulingSettingsManagedBean.class);
    
        private List<SchedulingSettings> schedulingSettingList;
    
        private SchedulingSettings selectedSetting;
    
        @ManagedProperty(value = "#{SchedulingSettingsDAO}")
        private SchedulingSettingsDAO schedulingSettingsDAO;
    
        @ManagedProperty(value = "#{DomainDAO}")
        private DomainDAO domainDAO;
    
        @ManagedProperty(value = "#{ReleaseEntityDAO}")
        private ReleaseEntityDAO releaseEntityDAO;
    
        @ManagedProperty(value = "#{TestCaseDAO}")
        private TestCaseDAO testCaseDAO;
    
        @ManagedProperty(value = "#{TestSuiteDAO}")
        private TestSuiteDAO testSuiteDAO;
    
        @ManagedProperty(value = "#{RunEntityDAO}")
        private RunEntityDAO runEntityDAO;
    
        @ManagedProperty(value = "#{UserDAO}")
        private UserDAO userDAO;
    
        private List<Domain> allDomains;
    
        private ArrayList<Language> allLanguages = Lists.newArrayList(Language
    	    .values());
    
        private List<ReleaseEntity> allReleases;
    
        private Map<String, String> browsers;
    
        private List<TestCase> allTestCases;
    
        private List<TestSuite> allTestSuites;
    
        public void onEdit(RowEditEvent event)
        {
    	SchedulingSettings settingItem = (SchedulingSettings) event.getObject();
    	log.trace("Saving changes for {} to DB", settingItem);
    	schedulingSettingsDAO.saveOrUpdate(settingItem);
        }
    
        public void onScheduleRun(SchedulingSettings setting)
        {
    	try
    	{
    	    SchedulingSettingValidation.isValid(setting, setting.getName());
    	    Set<TestCase> scheduledTestCases = setting.getAllTestCases();
    	    String userMail = LoginBean.getCurrentUserEmail();
    	    log.trace("Currently logged user {} ", userMail);
    	    User user = userDAO.getByEmail(userMail);
    	    for (TestCase testCaseToRun : scheduledTestCases)
    	    {
    		for (BrowserType browserType : setting.getBrowserTypes())
    		{
    		    RunEntity runEntity = RunEntityFactory.buildScheduled(
    			    browserType, testCaseToRun, user);
    		    log.trace("Adding {}", runEntity);
    		    runEntityDAO.saveOrUpdate(runEntity);
    		}
    	    }
    	} catch (AFWrongArgException exception)
    	{
    	    log.error(exception.getLocalizedMessage());
    	    FacesContext context = FacesContext.getCurrentInstance();
    	    context.addMessage(null,
    		    new FacesMessage("ERROR", exception.getLocalizedMessage()));
    	}
        }   
    }

    xhtml page for this view :
    Code:
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:p="http://primefaces.org/ui"
    	xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
    	<title>Step</title>
    </h:head>
    <h:body>
    	<h:form id="form">
    		<p:growl id="message" showDetail="true" />
    		<p:dataTable id="sche" value="#{schedMB.schedulingSettingList}"
    			var="settingItem" scrollable="true" editable="true" paginator="true"
    			rows="10"
    			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
    			rowsPerPageTemplate="10,20,30" rowKey="#{settingItem.name}">
    
    			<f:facet name="header">
                        Scheduling Settings:
                    </f:facet>
    
    			<p:column headerText="Name" id="scheName" width="10%">
    				<p:cellEditor>
    					<f:facet name="output">
    				#{settingItem.name}
    				</f:facet>
    					<f:facet name="input">
    						<h:inputText value="#{settingItem.name}" />
    					</f:facet>
    				</p:cellEditor>
    			</p:column>
    
    			<p:column headerText="Domain" width="15%">
    				<p:cellEditor>
    					<f:facet name="output">
    				#{settingItem.domain.alias}
    				</f:facet>
    					<f:facet name="input">
    						<h:selectOneMenu id="editDomain"
    							value="#{settingItem.domain.alias}" filter="true"
    							filterMatchMode="startsWith">
    							<f:selectItem itemLabel="Select One" itemValue="" />
    							<f:selectItems value="#{schedMB.allDomains}" var="domain"
    								itemLabel="#{domain.alias}" itemValue="#{domain.alias}" />
    						</h:selectOneMenu>
    					</f:facet>
    				</p:cellEditor>
    			</p:column>
    
    			<p:column headerText="Language" width="5%">
    				<p:cellEditor>
    					<f:facet name="output">
    				#{settingItem.language}
    				</f:facet>
    					<f:facet name="input">
    						<h:selectOneMenu id="editLanguage" value="#{settingItem.language}"
    							filter="true" filterMatchMode="startsWith">
    							<f:selectItem itemLabel="Select One" itemValue="" />
    							<f:selectItems value="#{schedMB.allLanguages}" var="lang"
    								itemLabel="#{lang}" itemValue="#{lang}" />
    						</h:selectOneMenu>
    					</f:facet>
    				</p:cellEditor>
    			</p:column>
    
    			<p:column headerText="Release" width="15%">
    				<p:cellEditor>
    					<f:facet name="output">
    				#{empty settingItem.releaseEntity ? 'N/A':settingItem.releaseEntity.name}
    				</f:facet>
    					<f:facet name="input">
    						<h:selectOneMenu value="#{settingItem.releaseEntity}"
    							filter="true" filterMatchMode="startsWith">
    							<f:selectItem itemLabel="Select One" itemValue="" />
    							<f:selectItems value="#{schedMB.allReleases}" var="release"
    								itemLabel="#{release.name}" itemValue="#{release.name}" />
    						</h:selectOneMenu>
    					</f:facet>
    				</p:cellEditor>
    			</p:column>
    
    			<p:column headerText="Max Time Of Changes" width="10%">
    				<p:cellEditor>
    					<f:facet name="output">
    						<h:outputText value="#{settingItem.maxTimeOfChanges}">
    							<f:convertDateTime pattern="dd/MM" />
    						</h:outputText>
    					</f:facet>
    					<f:facet name="input">
    						<p:calendar value="#{settingItem.maxTimeOfChanges}"
    							pattern="dd/MM" />
    					</f:facet>
    				</p:cellEditor>
    			</p:column>
    
    			<p:column headerText="Browsers" width="20%">
    				<p:cellEditor>
    					<f:facet name="output">
    				#{settingItem.browserTypes}
    				</f:facet>
    					<f:facet name="input">
    						<p:selectCheckboxMenu value="#{settingItem.browserTypes}"
    							label="Browsers">
    							<f:selectItems value="#{schedMB.browsers}" />
    						</p:selectCheckboxMenu>
    					</f:facet>
    				</p:cellEditor>
    			</p:column>
    
    			<p:column headerText="TestCase" width="15%">
    				<p:cellEditor>
    					<f:facet name="output">					
    			#{empty settingItem.testCase ? 'N/A':settingItem.testCase.name}			
    			</f:facet>
    					<f:facet name="input">
    						<h:selectOneMenu value="#{settingItem.testCase}" filter="true"
    							filterMatchMode="startsWith">
    							<f:selectItem itemLabel="Select One" itemValue="#{null}"
    								noSelectionOption="true" />
    							<f:converter converterId="testCaseConverter" />
    							<f:selectItems value="#{schedMB.allTestCases}" var="varTestCase"
    								itemLabel="#{varTestCase.name}" itemValue="#{varTestCase}" />
    						</h:selectOneMenu>
    					</f:facet>
    				</p:cellEditor>
    			</p:column>
    
    			<p:column headerText="TestSuite" width="10%">
    				<p:cellEditor>
    					<f:facet name="output">
    			#{empty settingItem.testSuite ? 'N/A':settingItem.testSuite.name}
    			</f:facet>
    					<f:facet name="input">
    						<h:selectOneMenu value="#{settingItem.testSuite}" filter="true"
    							filterMatchMode="startsWith">
    							<f:selectItem itemLabel="Select One" itemValue="#{null}"
    								noSelectionOption="true" />
    							<f:converter converterId="testSuiteConverter" />
    							<f:selectItems value="#{schedMB.allTestSuites}" var="testSuite"
    								itemLabel="#{testSuite.name}" itemValue="#{testSuite}" />
    						</h:selectOneMenu>
    					</f:facet>
    				</p:cellEditor>
    			</p:column>
    
    			<p:column width="3%">
    				<p:rowEditor />
    				<p:commandButton icon="ui-icon-play"
    					actionListener="#{schedMB.onScheduleRun(settingItem)}"
    					style="width: auto; height: 20px" />
    			</p:column>
    
    			<p:ajax event="rowEdit" listener="#{schedMB.onEdit}"
    				update=":form:message" />
    
    		</p:dataTable>
    	</h:form>
    </h:body>
    </html>

    Comment


    • #3
      I exceed char limit of one post , here part that not fit :

      ManagedBean
      Code:
      
      @ManagedBean(name = "schedMB")
      @SessionScoped
      public class SchedulingSettingsManagedBean
      {
          private static Logger log = LoggerFactory
      	    .getLogger(SchedulingSettingsManagedBean.class);
      
          private List<SchedulingSettings> schedulingSettingList;
      
          private SchedulingSettings selectedSetting;
      
          @ManagedProperty(value = "#{SchedulingSettingsDAO}")
          private SchedulingSettingsDAO schedulingSettingsDAO;
      
          @ManagedProperty(value = "#{DomainDAO}")
          private DomainDAO domainDAO;
      
          @ManagedProperty(value = "#{ReleaseEntityDAO}")
          private ReleaseEntityDAO releaseEntityDAO;
      
          @ManagedProperty(value = "#{TestCaseDAO}")
          private TestCaseDAO testCaseDAO;
      
          @ManagedProperty(value = "#{TestSuiteDAO}")
          private TestSuiteDAO testSuiteDAO;
      
          @ManagedProperty(value = "#{RunEntityDAO}")
          private RunEntityDAO runEntityDAO;
      
          @ManagedProperty(value = "#{UserDAO}")
          private UserDAO userDAO;
      
          private List<Domain> allDomains;
      
          private ArrayList<Language> allLanguages = Lists.newArrayList(Language
      	    .values());
      
          private List<ReleaseEntity> allReleases;
      
          private Map<String, String> browsers;
      
          private List<TestCase> allTestCases;
      
          private List<TestSuite> allTestSuites;
      
          public void onEdit(RowEditEvent event)
          {
      	SchedulingSettings settingItem = (SchedulingSettings) event.getObject();
      	log.trace("Saving changes for {} to DB", settingItem);
      	schedulingSettingsDAO.saveOrUpdate(settingItem);
          }
      
          public void onScheduleRun(SchedulingSettings setting)
          {
      	try
      	{
      	    SchedulingSettingValidation.isValid(setting, setting.getName());
      	    Set<TestCase> scheduledTestCases = setting.getAllTestCases();
      	    String userMail = LoginBean.getCurrentUserEmail();
      	    log.trace("Currently logged user {} ", userMail);
      	    User user = userDAO.getByEmail(userMail);
      	    for (TestCase testCaseToRun : scheduledTestCases)
      	    {
      		for (BrowserType browserType : setting.getBrowserTypes())
      		{
      		    RunEntity runEntity = RunEntityFactory.buildScheduled(
      			    browserType, testCaseToRun, user);
      		    log.trace("Adding {}", runEntity);
      		    runEntityDAO.saveOrUpdate(runEntity);
      		}
      	    }
      	} catch (AFWrongArgException exception)
      	{
      	    log.error(exception.getLocalizedMessage());
      	    FacesContext context = FacesContext.getCurrentInstance();
      	    context.addMessage(null,
      		    new FacesMessage("ERROR", exception.getLocalizedMessage()));
      	}
          }   
      }

      xhtml page for this view :
      Code:
      <?xml version='1.0' encoding='UTF-8' ?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
      	xmlns:h="http://java.sun.com/jsf/html"
      	xmlns:p="http://primefaces.org/ui"
      	xmlns:f="http://java.sun.com/jsf/core">
      <h:head>
      	<title>Step</title>
      </h:head>
      <h:body>
      	<h:form id="form">
      		<p:growl id="message" showDetail="true" />
      		<p:dataTable id="sche" value="#{schedMB.schedulingSettingList}"
      			var="settingItem" scrollable="true" editable="true" paginator="true"
      			rows="10"
      			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
      			rowsPerPageTemplate="10,20,30" rowKey="#{settingItem.name}">
      
      			<f:facet name="header">
                          Scheduling Settings:
                      </f:facet>
      
      			<p:column headerText="Name" id="scheName" width="10%">
      				<p:cellEditor>
      					<f:facet name="output">
      				#{settingItem.name}
      				</f:facet>
      					<f:facet name="input">
      						<h:inputText value="#{settingItem.name}" />
      					</f:facet>
      				</p:cellEditor>
      			</p:column>
      
      			<p:column headerText="Domain" width="15%">
      				<p:cellEditor>
      					<f:facet name="output">
      				#{settingItem.domain.alias}
      				</f:facet>
      					<f:facet name="input">
      						<h:selectOneMenu id="editDomain"
      							value="#{settingItem.domain.alias}" filter="true"
      							filterMatchMode="startsWith">
      							<f:selectItem itemLabel="Select One" itemValue="" />
      							<f:selectItems value="#{schedMB.allDomains}" var="domain"
      								itemLabel="#{domain.alias}" itemValue="#{domain.alias}" />
      						</h:selectOneMenu>
      					</f:facet>
      				</p:cellEditor>
      			</p:column>
      
      			<p:column headerText="Language" width="5%">
      				<p:cellEditor>
      					<f:facet name="output">
      				#{settingItem.language}
      				</f:facet>
      					<f:facet name="input">
      						<h:selectOneMenu id="editLanguage" value="#{settingItem.language}"
      							filter="true" filterMatchMode="startsWith">
      							<f:selectItem itemLabel="Select One" itemValue="" />
      							<f:selectItems value="#{schedMB.allLanguages}" var="lang"
      								itemLabel="#{lang}" itemValue="#{lang}" />
      						</h:selectOneMenu>
      					</f:facet>
      				</p:cellEditor>
      			</p:column>
      
      			<p:column headerText="Release" width="15%">
      				<p:cellEditor>
      					<f:facet name="output">
      				#{empty settingItem.releaseEntity ? 'N/A':settingItem.releaseEntity.name}
      				</f:facet>
      					<f:facet name="input">
      						<h:selectOneMenu value="#{settingItem.releaseEntity}"
      							filter="true" filterMatchMode="startsWith">
      							<f:selectItem itemLabel="Select One" itemValue="" />
      							<f:selectItems value="#{schedMB.allReleases}" var="release"
      								itemLabel="#{release.name}" itemValue="#{release.name}" />
      						</h:selectOneMenu>
      					</f:facet>
      				</p:cellEditor>
      			</p:column>
      
      			<p:column headerText="Max Time Of Changes" width="10%">
      				<p:cellEditor>
      					<f:facet name="output">
      						<h:outputText value="#{settingItem.maxTimeOfChanges}">
      							<f:convertDateTime pattern="dd/MM" />
      						</h:outputText>
      					</f:facet>
      					<f:facet name="input">
      						<p:calendar value="#{settingItem.maxTimeOfChanges}"
      							pattern="dd/MM" />
      					</f:facet>
      				</p:cellEditor>
      			</p:column>
      
      			<p:column headerText="Browsers" width="20%">
      				<p:cellEditor>
      					<f:facet name="output">
      				#{settingItem.browserTypes}
      				</f:facet>
      					<f:facet name="input">
      						<p:selectCheckboxMenu value="#{settingItem.browserTypes}"
      							label="Browsers">
      							<f:selectItems value="#{schedMB.browsers}" />
      						</p:selectCheckboxMenu>
      					</f:facet>
      				</p:cellEditor>
      			</p:column>
      
      			<p:column headerText="TestCase" width="15%">
      				<p:cellEditor>
      					<f:facet name="output">					
      			#{empty settingItem.testCase ? 'N/A':settingItem.testCase.name}			
      			</f:facet>
      					<f:facet name="input">
      						<h:selectOneMenu value="#{settingItem.testCase}" filter="true"
      							filterMatchMode="startsWith">
      							<f:selectItem itemLabel="Select One" itemValue="#{null}"
      								noSelectionOption="true" />
      							<f:converter converterId="testCaseConverter" />
      							<f:selectItems value="#{schedMB.allTestCases}" var="varTestCase"
      								itemLabel="#{varTestCase.name}" itemValue="#{varTestCase}" />
      						</h:selectOneMenu>
      					</f:facet>
      				</p:cellEditor>
      			</p:column>
      
      			<p:column headerText="TestSuite" width="10%">
      				<p:cellEditor>
      					<f:facet name="output">
      			#{empty settingItem.testSuite ? 'N/A':settingItem.testSuite.name}
      			</f:facet>
      					<f:facet name="input">
      						<h:selectOneMenu value="#{settingItem.testSuite}" filter="true"
      							filterMatchMode="startsWith">
      							<f:selectItem itemLabel="Select One" itemValue="#{null}"
      								noSelectionOption="true" />
      							<f:converter converterId="testSuiteConverter" />
      							<f:selectItems value="#{schedMB.allTestSuites}" var="testSuite"
      								itemLabel="#{testSuite.name}" itemValue="#{testSuite}" />
      						</h:selectOneMenu>
      					</f:facet>
      				</p:cellEditor>
      			</p:column>
      
      			<p:column width="3%">
      				<p:rowEditor />
      				<p:commandButton icon="ui-icon-play"
      					actionListener="#{schedMB.onScheduleRun(settingItem)}"
      					style="width: auto; height: 20px" />
      			</p:column>
      
      			<p:ajax event="rowEdit" listener="#{schedMB.onEdit}"
      				update=":form:message" />
      
      		</p:dataTable>
      	</h:form>
      </h:body>
      </html>

      Comment


      • #4
        You are loading the dispatcher-servlet.xml twice, which makes your OpenSessionInViewFilter operate on a different SessioNFactory then your dispatcher servlet...

        Basically you are laoding all your beans twice...

        Comment


        • #5
          Originally posted by Marten Deinum View Post
          You are loading the dispatcher-servlet.xml twice, which makes your OpenSessionInViewFilter operate on a different SessioNFactory then your dispatcher servlet...

          Basically you are laoding all your beans twice...
          First of all I already found a solution to my problem . It described here http://stackoverflow.com/questions/8...l-session-bean .

          But if you are right I need to fix this problem too , can you please elaborate where you see first and second time I load dispatcher-servlet and all my beans ?

          Comment

          Working...
          X