• 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

Bean from one project to another project

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

I have two Projects I want to use service of one project into another project's service .. Both have different service.xml files .. How can I Refer one Bean into another in this scenario ?? Please help me out on this
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
add other project jar or dependecy to your main project

in your main project application context
while you are importing your own service.xml
also import other project service.xml file

then you can use other project bean as you use them in other project
 
Arpita Shah
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply.. I am still getting Error saying

Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.thegoldensource.be.rules.RulesProcessor] to required type [com.thegoldensource.be.service.BERulesProcessor] for property 'rulesProcessor'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.thegoldensource.be.rules.RulesProcessor] to required type [com.thegoldensource.be.service.BERulesProcessor] for property 'rulesProcessor': no matching editors or conversion strategy found


I have following implementation :

BERulesProcessor is an interface in com.thegoldensource.be.service and its implementation RulesProcessor is in com.thegoldensource.be.rules. interface is in different project and RulesProcessor is in different project.

I have two service.xml files :

This is the xml file of one project (BE Core ) in which we have imported service.xml file of another project (BE Rules Say)

<import resource="/../../be/rules/service.xml"/>
<bean id="EntityService" class="com.thegoldensource.model.service.BaseEntityService">
<property name="businessEntityReader" ref="EntityMetaObjectReader"/>
<property name="modelReader" ref="ModelMetaObjectReader"/>
<property name="converterFactory" ref="EntityConverterFactory"/>
<property name="parserFactory" ref="EntityParserFactory"/>
<property name="standardObjectFactory" ref="StandardObjectFactory"/>
<property name="transformerFactory" ref="TransformerFactory"/>
<property name="completenessDefinitionProvider" ref="CompletenessDefinitionProvider"/>
<property name="rulesProcessor" ref="BERulesProcessor"/>
</bean>

and the BE Rules contains service.xml is

<beans>

<bean id="BERulesProcessor" class="com.thegoldensource.be.rules.RulesProcessor"/>

</beans>

I have BaseEntityService class in BE Core and I am trying to setter inject the ruleProcessor and getting this error.

please suggest what is doing wrong in this ?
 
My first bit of advice is that if you are going to be a mime, you shouldn't talk. Even the tiny ad is nodding:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic