/hibernate.cfg.xml not found

noisebreath

Bekanntes Mitglied
hi

ich weiss das diese frage sicherlich schon oft gestellt wurde, aber ich kann grad nicht durch recherche sehen was ich falsch mache. Bin auch noch sehr neu in spring und hibernate daher würde ich mich über eure Unterstützung sehr freuen.

Also /hibernate.cfg.xml not found ist das Problem:

ich hab die ...-servlet.xml (Pfad: \WebContent\WEB-INF\...-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:mvc="http://www.springframework.org/schema/mvc"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/context 
       http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/mvc
       http://www.springframework.org/schema/mvc/spring-mvc.xsd">

	<mvc:annotation-driven />

	<context:component-scan base-package="....controller" />

	<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
		<property name="configLocation" value="/WEB-INF/hibernate.cfg.xml"></property>
	</bean>

	<!-- For decoupling the view from the controller -->
	<bean id="viewResolver"
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="viewClass"
			value="org.springframework.web.servlet.view.JstlView"></property>
		<property name="prefix" value="/WEB-INF/jsp/frontend/" />
		<property name="suffix" value=".jsp" />
	</bean>

</beans>

Die Zeilen

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="configLocation" value="/WEB-INF/hibernate.cfg.xml"></property>
</bean>

hatte ich auch schon mal in applicationContext.xml (Pfad: WebContent/WEB-INF/applicationContext.xml) ausgelagert, brachte aber den gleichen Fehler.

Meine hibernate.cfg.xml liegt in WebContent/WEB-INF/hibernate.cfg.xml

wie gebe ich das ganze richtig an, damit er das findet?

danke im voraus für die hilfe
greez noise
 

Ähnliche Java Themen

Neue Themen


Oben