I am using Tomcat 5.0 and Eclipse 3.2, MyEclipse 5.0
first,i integrat jsf with spring,and the login.jsp display correctly.
when i add hibernate,i am getting following errors
type Status report
message /test/login.jsf
description The requested resource (/test/login.jsf) is not available.
Here are the snippets from web.xml
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
de.mindmatters.faces.spring.context.ContextLoaderListener
</listener-class>
</listener>
you should always include stack traces when posting errors. The "resource not available" error looks like the application didn't start properly at all. Maybe you haven't included all of hibernate's dependencies into WEB-INF/lib? Please consult the hibernate docs if this is the case.
HTH, Thomas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using Tomcat 5.0 and Eclipse 3.2, MyEclipse 5.0
first,i integrat jsf with spring,and the login.jsp display correctly.
when i add hibernate,i am getting following errors
type Status report
message /test/login.jsf
description The requested resource (/test/login.jsf) is not available.
Here are the snippets from web.xml
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
de.mindmatters.faces.spring.context.ContextLoaderListener
</listener-class>
</listener>
faces-config.xml :
<navigation-rule>
<from-view-id>/login.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/ok.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/ok.jsp</from-view-id>
</navigation-rule>
<managed-bean>
<managed-bean-name>user</managed-bean-name>
<managed-bean-class>com.backbean.UserBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>userValidator</property-name>
<value>#{userValidator}</value>
</managed-property>
</managed-bean>
applicationContext.xml :
<bean name="userValidator" class="com.validator.UserValidator"
id="userValidator">
<property name="userDAO">
<ref bean="userDAO" />
</property>
</bean>
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</property>
<property name="url">
<value>jdbc:microsoft:sqlserver://localhost:1433</value>
</property>
<property name="username">
<value>sa</value>
</property>
<property name="password">
<value>sa</value>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/hibernate/User.hbm.xml</value>
</list>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="userDAO" class="com.hibernate.UserDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
I have been looking forsolution to this problem since more than a week and posted it on all the Forums. Hoping to get some help from this forum
Regards
dufeng
Hi dufeng,
you should always include stack traces when posting errors. The "resource not available" error looks like the application didn't start properly at all. Maybe you haven't included all of hibernate's dependencies into WEB-INF/lib? Please consult the hibernate docs if this is the case.
HTH, Thomas