Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Java Development with the Spring Framework
This is the forum to discuss the Wrox book Professional Java Development with the Spring Framework by Rod Johnson, Juergen Hoeller, Alef Arendsen, Thomas Risberg, Colin Sampaleanu; ISBN: 9780764574832
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Java Development with the Spring Framework section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 15th, 2005, 09:17 PM
Registered User
 
Join Date: Oct 2005
Location: Chennai, Tamilanadu, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Spring-ojb

I tried for Springframework to interact with Oracle9i using apache's ojb throw spring beans.
 i had given OJB-repository.xml as
<descriptor-repository version="1.0">
 <jdbc-connection-descriptor
   jcd-alias="oraSource" default-connection="true"
   platform="Oracle9i" jdbc-level="3.0" useAutoCommit="1" username="scott" password="tiger">
    <object-cache
class="org.apache.ojb.broker.cache.ObjectCachePerB rokerImpl">
    </object-cache>
    <connection-pool maxActive="10" maxIdle="2" maxWait="3"
validationQuery=""
     logAbandoned="true" removeAbandoned="true" removeAbandonedTimeout="8"/>
    </jdbc-connection-descriptor>

   <class-descriptor class="com.htc.springdemos.ojbs.StudentVO" table="STUDENTS">
      <field-descriptor name="stuId" column="STU_ID" primarykey="true" autoincrement="true"/>
  <field-descriptor name="stuName" column="STU_NAME" />
  <field-descriptor name="course" column="COURSE" />
        </class-descriptor>
</descriptor-repository>

in the ojb.properties i had given
ConnectionFactoryClass=org.springframework.orm.ojb .support.TransactionAwareDataSourceConnectionFacto ry as the only change

in beans.xml file (ojb1.xml)

<?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="ojbConfigurer" class="org.springframework.orm.ojb.support.LocalOj bConfigurer" />
  <bean id="oraSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
   <property name="driverClassName">
    <value>oracle.jdbc.driver.OracleDriver</value>
   </property>
      <property name="url"> <value>jdbc:oracle:thin:@localhost:1521:oracle10 </value>
   </property>
   <property name="username">
    <value>scott</value>
   </property>
   <property name="password">
    <value>tiger</value>
   </property>
  </bean>

  <bean id="transactionManager" class="org.springframework.orm.ojb.PersistenceBrok erTransactionManager">
  </bean>

 <bean id="studentDao" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
   <property name="transactionManager">
    <ref bean="transactionManager" />
   </property>
   <property name="target">
    <bean class="com.htc.springdemos.ojbs.StudentDAOImpl" />
   </property>
   <property name="transactionAttributes">
    <props>
       <prop key="insert*">
         PROPAGATION_REQUIRED
       </prop>
      <prop key="update*">
         PROPAGATION_REQUIRED
       </prop>
      <prop key="delete*">
         PROPAGATION_REQUIRED
       </prop>
      <prop key="*">
         PROPAGATION_REQUIRED,readOnly
       </prop>
    </props>
   </property>
   </bean>
</beans>


but when i run it is constantly giving only one error

[java] caused by:java.lang.IllegalStateException: No Bean Factory

Configuration-LocalOjbConfigurer must be defined as Spring bean

  please can any one suggest where the mistake is
 my EMAIL is rajendra32@yahoo.co.uk







DTR Prasad
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning Spring Framework 2 cateyesmale All Other Wrox Books 2 December 7th, 2007 10:03 AM
configuration of spring jadavmanoj Spring 0 July 29th, 2007 06:27 AM
AJAX and Spring GameOne Ajax 1 September 21st, 2006 01:40 AM
Spring Framework tilakkalyan J2EE 1 February 2nd, 2006 06:28 PM



All times are GMT -4. The time now is 08:23 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.