- This topic has 6 replies, 4 voices, and was last updated 17 years, 6 months ago by Riyad Kalla.
-
AuthorPosts
-
mtengMemberI ran the tutorial on Hibernate-Spring which executed fine. I then tried to create a Web Service with XFire. After I created the web service, I got the following error message:
org.springframework.beans.factory.BeanDefinitionStoreException: Line 5 in XML document from ServletContext resource [/WEB-INF/classes/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element “beans”, must match DOCTYPE root “null”.
Here’s the content of my applicationContext.xml:
<?xml version=”1.0″ encoding=”UTF-8″?>
<beans
xmlns=”http://www.springframework.org/schema/beans”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd”><bean id=”hibernateSession”
class=”org.springframework.orm.hibernate3.LocalSessionFactoryBean”>
<property name=”configLocation”
value=”file:src/hibernate.cfg.xml”>
</property>
</bean>
<bean id=”ConnectDAO” class=”com.ascendent.hibernate.ConnectDAO”>
<property name=”sessionFactory”>
<ref bean=”hibernateSession” />
</property>
</bean>
<bean id=”persistenceLayer”
class=”com.ascendent.hibernate.PersistenceLayer” abstract=”false”
scope=”singleton” lazy-init=”default” autowire=”default”
dependency-check=”default”>
<property name=”connectDAO”>
<ref bean=”ConnectDAO” />
</property>
</bean></beans>
Riyad KallaMemberMoving to OT > Soft Dev
I’m not sure what went south, I haven’t worked with WS+Hib+Spring yet… your spring config looks fine I wonder why it’s crapping out parsing it… I googled the error and it looks like it might be similar to this issue: http://forum.springframework.org/archive/index.php/t-23147.html%3C/a%3E%3C/span%3E%3C/font%3E%3C/t-9980.html
I hope that helps
jisikoffMemberI’m having exactly the same problem, runs fine in spring hibernate combo, but when moved to web service project i get the error. It’s not a tomcat problem because i’m not even deploying it to tomcat yet I’m running a test harness.
Any thoughts?
Jacques SingyMemberCheck if you have two versions of spring in your classpath. I believe that there is a problem with the MyEclipse libraries. If you are using their spring 2.0 libraries along with the xfire 1.2 core libraries, you will find that there is a version of spring 1.2.6 under xfire 1.2 and spring 2.0 under Spring 2.0. I think that this results in a conflict that creates your problem.
jisikoffMemberHow do I remove the spring 1.2.6 without getting an error from the xfire core library?
Jacques SingyMemberI have not found a way to remove the spring 1.2.6 jar from the MyEclipse xfire core library. What I do is to remove the spring 1.2.6 jar from the WEB-INF/lib directory where I deploy my application. It is annoying but it works.
Riyad KallaMemberGuys,
You should be able to go into the XFire-Core library set and remove the Spring JAR from the screen belowAttachments:
You must be logged in to view attached files. -
AuthorPosts