facebook

Spring Bug?!

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #259665 Reply

    mimi_grebici
    Member

    Hi

    I try to use MyEclipse, and I have a very simple application with only one bean !!

    I have a problem… when I start a server, applicationContext.xml file is not loaded !! I dont know why!! I dont have any exception or error !!!

    this is my applicationContext.xml file

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE beans PUBLIC “-//SPRING//DTD BEAN//EN” “http://www.springframework.org/dtd/spring-beans.dtd”&gt;

    <beans>

    <bean id=”DataSource1″ class=”org.apache.commons.dbcp.BasicDataSource”>
    <property name=”driverClassName”>
    <value>org.postgresql.Driver</value>
    </property>
    <property name=”url”>
    <value>jdbc:postgresql://delta3177/Pims</value>
    </property>
    <property name=”username”>
    <value>pims</value>
    </property>
    <property name=”password”>
    <value>smip</value>
    </property>
    </bean>
    <bean id=”sessionFactory” class=”org.springframework.orm.hibernate.LocalSessionFactoryBean”>
    <property name=”dataSource”>
    <ref bean=”DataSource1″></ref>
    </property>
    <property name=”hibernateProperties”>
    <props>
    <prop key=”hibernate.dialect”>org.hibernate.dialect.PostgreSQLDialect</prop>

    <prop key=”hibernate.show_sql”>true</prop>
    <prop key=”hibernate.cglib.use_reflection_optimizer”>true</prop>
    <prop key=”hibernate.cache.provider_class”>net.sf.hibernate3.cache.HashtableCacheProvider</prop>
    </props>
    </property>
    <property name=”mappingResources”>
    <list>

    <value>mapping/Study.hbm.xml</value>

    </list>
    </property>

    </bean>

    <!– Spring Data Access Exception Translator Defintion –>
    <bean id=”jdbcExceptionTranslator” class=”org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator”>
    <property name=”dataSource”><ref bean=”DataSource1″/></property>
    </bean>

    <!– Hibernate Template Defintion –>
    <bean id=”hibernateTemplate” class=”org.springframework.orm.hibernate3.HibernateTemplate”>
    <property name=”sessionFactory”><ref bean=”sessionFactory”/></property>
    <property name=”jdbcExceptionTranslator”><ref bean=”jdbcExceptionTranslator”/></property>
    </bean>

    <bean id=”StudyDAO” class=”main.StudyDAO” factory-method=”getInstance”>
    <property name=”sessionFactory”>
    <ref bean=”hibernateTemplate” />
    </property>
    </bean>

    <!– *********************************************************** –>
    <!– ************* Start of SERVICE DEFINITIONS *********** –>

    <!– Hibernate Transaction Manager Definition –>
    <bean id=”transactionManager” class=”org.springframework.orm.hibernate.HibernateTransactionManager”>
    <property name=”sessionFactory”><ref bean=”sessionFactory”/></property>
    </bean>

    <bean id=”studyServiceTarget” class=”service.StudyService” >
    <property name=”StudyDao”>
    <ref bean=”StudyDAO”></ref></property>
    </bean>

    <!– Transactional proxy Services –>

    <bean id=”studyService” class=”org.springframework.transaction.interceptor.TransactionProxyFactoryBean”>
    <property name=”transactionManager”><ref local=”transactionManager”/></property>
    <property name=”target”><ref local=”studyServiceTarget”/></property>
    <property name=”transactionAttributes”>
    <props>
    <prop key=”get*”>PROPAGATION_REQUIRED,readOnly</prop>
    <prop key=”save*”>PROPAGATION_REQUIRED</prop>
    <prop key=”update*”>PROPAGATION_REQUIRED</prop>
    <prop key=”delete*”>PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean>

    </beans>


    and this is web.xml file

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <web-app xmlns=”http://java.sun.com/xml/ns/j2ee&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”&gt;

    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.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>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml,/WEB-INF/spring-services-beans.xml</param-value>
    </context-param>

    <filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>maxFileSize</param-name>
    <param-value>20m</param-value>

    </init-param>
    </filter>

    <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
    </filter-mapping>

    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
    <servlet-name>SpringContextServlet</servlet-name>
    <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
    <load-on-startup>0</load-on-startup>

    </servlet>

    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>

    </web-app>

    #259706 Reply

    Riyad Kalla
    Member

    Mimi,
    This is the 3rd thread you have posted this in and each time you post it, I ask you for details explaining what “doesn’t work” means and each time you simply post it again. If you’d like help, we are more than willing to help, but you need to answer our questions.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Spring Bug?!

You must be logged in to post in the forum log in