wood burning stoves*
The moose likes Spring and the fly likes Why this error? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Why this error?" Watch "Why this error?" New topic
Author

Why this error?

Neranja dileepa
Greenhorn

Joined: Aug 14, 2009
Posts: 1

00:56:25,281 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from file [C:\Documents and Settings\Dileepa\Desktop\newhib\bean.xml]
00:56:25,312 WARN [XmlBeanFactory] Ignored XML validation warning: org.xml.sax.SAXParseException: Valid documents must have a <!DOCTYPE declaration.
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Line 2 in XML document from file [C:\Documents and Settings\Dileepa\Desktop\newhib\bean.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Element type "beans" is not declared.
org.xml.sax.SAXParseException: Element type "beans" is not declared.
at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1322)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:126)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:84)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:58)
at pack.student.main(student.java:13


here I hv attached my bean file
<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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!-- /////////////////////////////////////////////////////////// -->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<bean id="studentintface" class="pack.studentdao">
<property name="hibernateTemplate" ref="hibernateTemplate" />
</bean>
<!-- /////////////////////////////////////////////////////////// -->

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>Honey.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect
</prop>
</props>
</property>
</bean>
<!--/////////////////////////////////////////////////////////// -->


<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost/db" />
<property name="username" value="root" />
<property name="password" value="" />
</bean>

</beans>
</code>
Nickolas Case
Ranch Hand

Joined: Apr 26, 2008
Posts: 98
Have you found your issue? For one you are missing your opening <beans> tag
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why this error?
 
Similar Threads
Dependency injection problem
I am getting org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity:
Spring Transaction Management doesn't roll back my transaction
HibernateDaoSupport and Transaction
login form with database and spring security