facebook

BeanDefinitionStoreException when running Spring App

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #271539 Reply

    mteng
    Member

    I 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&#8221;
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd”&gt;

    <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>

    #271563 Reply

    Riyad Kalla
    Member

    Moving 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

    #272730 Reply

    jisikoff
    Member

    I’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?

    #272888 Reply

    Check 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.

    #272908 Reply

    jisikoff
    Member

    How do I remove the spring 1.2.6 without getting an error from the xfire core library?

    #273005 Reply

    I 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.

    #273041 Reply

    Riyad Kalla
    Member

    Guys,
    You should be able to go into the XFire-Core library set and remove the Spring JAR from the screen below

    Attachments:
    You must be logged in to view attached files.
Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: BeanDefinitionStoreException when running Spring App

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