• 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

Spring Cofiguratation error

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

Kindly help me how to solve the problem:

SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException:

Note : this is my dispatcher-servlet.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.5.xsd">



<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/JSP/"/>
<property name="suffix" value=".jsp"/>
</bean>


<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@10.100.1.1:1521:databasename" />
<property name="username" value="scoot" />
<property name="password" value="tiger" />
</bean>

<bean id="mySessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="annotatedClasses">
<list>
<value>com.model.UserVo</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
</bean>
<bean id="myUserDAO" class="com.dao.UserDaoImp">
<property name="sessionFactory" ref="mySessionFactory" />
</bean>

<bean name="/JSP/hello_world.html" class="com.contoraller.HelloWorldController">
<property name="userDAO" ref="myUserDAO" />
</bean>
</beans>


Thanks & regards,
Premkumar
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whenever you get an exception from Spring on your configuration, it is best to scroll to the bottom of your stack trace and work you way up till you see the root cause. This error message will tell you exactly what is the problem. You didn't post the stack trace here, so we can't see. Also you posted your configuration without using the CODE tag to keep the files indentation so it is easier for us to read.

Is this a typo for username

<property name="username" value="scoot" />

Isn't it supposed to be scott not scoot?
Also, I ask this when I see this in configuration. Are you new to Spring and starting to learn? If so, I recommend you look for more updated materials. Your use of <bean name="/JSP/hello_world.html" class="com.contoraller.HelloWorldController"> tells me you are using older style of Spring MVC, which isn't used in today's Spring applications. Today's Spring applications are still backwards compatible. But I highly recommend for new users to use the latest best practices instead.

Hope that helps

Mark
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic