• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

BeanDefinitionStoreException

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a war file which is a web application built on spring and jsf. I have one more jar file in the web-inf/lib folder of this web app.

This jar again is based only on Spring framework.

Now when I access any of the class files of the above jar which is in web-inf lib I get the error as "org.springframework.beans.factory.BeanDefinitionStoreException: Line 4 in XML document from class path resource [ApplicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null"."

The war has its own contxt file which is named different from the contect file in the jar.

I have no clue why it complaints of the context file of not being proper when it tries to access the class files of the jar which is spring based.

When I run the same stuff using the Junit test cases it runs fine for the jar file.

Also I have tested the same stuff on Spring test i.e AbstractDependencyInjectionSpringContextTests and it works just fine.

So there actually cannot be any issue of the context file that its complaining of.

Can anyone please suggest why could I be facing this error ?

Here are the contents of the context files

---------- JAR CONTEXT FILE ---------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
<bean id="ebiBulkLoaderDAO" class="com.gaic.services.EBIBulkLoader.dao.EBIBulkLoaderDAO">
<property name="dataSource" ref="dataSource"/>
</bean>

<bean id="cprProvider" class="com.gaic.util.cpr.client.CPRPropertyProvider"/>
<bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="maxIdleTime" value="60"/>
<property name="maxIdleTimeExcessConnections" value="10"/>
<property name="acquireIncrement" value="1"/>
<property name="initialPoolSize" value="1"/>
<property name="maxPoolSize" value="50"/>
<property name="minPoolSize" value="10"/>
<property name="maxConnectionAge" value="60"/>
<property name="driverClass">
<bean
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="cprProvider"/>
<property name="targetMethod" value="getStringProperty"/>
<property name="arguments"
value="com.gaic.services.EBIBulkLoader.db.driverClass"/>
</bean>
</property>
<property name="jdbcUrl">
<bean
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="cprProvider"/>
<property name="targetMethod" value="getStringProperty"/>
<property name="arguments"
value="com.gaic.services.EBIBulkLoader.db.url"/>
</bean>
</property>
<property name="user">
<bean
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="cprProvider"/>
<property name="targetMethod" value="getStringProperty"/>
<property name="arguments"
value="com.gaic.services.EBIBulkLoader.db.userName"/>
</bean>
</property>
<property name="password">
<bean
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="cprProvider"/>
<property name="targetMethod" value="getStringProperty"/>
<property name="arguments"
value="com.gaic.services.EBIBulkLoader.db.password"/>
</bean>
</property>
</bean>
</beans>


--------------------- WAR CONTEXT FILE -----------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>

<bean id="ebibulkloaderService" class="com.gaic.services.ebibulkloaderUI.service.EBIBulkLoaderServiceImpl"/>

</beans>
 
Danger, 10,000 volts, very electic .... tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic