Olá Pessoal, estou comum problema no meu XML o erro é o seguinte:
org.springframework.beans.factory.BeanDefinitionStoreException: Line 5 in XML document from resource [/WEB-INF/applicationContext-hibernate.xml] of ServletContext is invalid; nested exception is org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:133)
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:123)
org.springframework.context.support.AbstractXmlApplicationContext.refreshBeanFactory(AbstractXmlApplicationContext.java:65)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:232)
org.springframework.web.context.support.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:131)
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:154)
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:95)
org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:80)
javax.servlet.GenericServlet.init(GenericServlet.java:256)
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:657)
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:476)
org.apache.catalina.startup.HostConfig.checkContextLastModified(HostConfig.java:874)
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1075)
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:372)
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
java.lang.Thread.run(Thread.java:534)
O Context é assim:
<?xml version=“1.0” encoding=“UTF-8”?>
<!DOCTYPE beans PUBLIC “-//SPRING//DTD BEAN//EN” “http://www.springframework.org/dtd/spring-beans.dtd”>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location"><value>/WEB-INF/jdbc.properties</value></property>
</bean>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>${jdbc.driverClassName}</value></property>
<property name="url"><value>${jdbc.url}</value></property>
<property name="username"><value>${jdbc.username}</value></property>
<property name="password"><value>${jdbc.password}</value></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="mappingResources">
<value>/WEB-INF/hibernate/CentroDeCustos.hbm</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${jdbc.hibernate.dialect}</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
Alguém pode me ajudar?
Grato,
Orlando Cesar Martins