How to integrate Spring Framework in a BW 6 application.

How to integrate Spring Framework in a BW 6 application.

book

Article ID: KB0084724

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Description:
Attached is a sample HelloWorld application (Filename:hello-world-spring-sample.zip) in a BW6 that shows integration with the Spring Framework.

Issue/Introduction

How to integrate Spring Framework in a BW 6 application.

Resolution

Review the following section in the attached sample.


+++


String[] ctxLocations = {"lib/applicationContext.xml"};

OsgiBundleXmlApplicationContext ctx = new OsgiBundleXmlApplicationContext(ctxLocations);

                BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();


                ctx.setBundleContext(bundleContext);

                ctx.refresh();


                 BeanFactory factory = (BeanFactory) ctx;

                 HelloWorld bean =  (HelloWorld) factory.getBean("helloWorld", HelloWorld.class);



+++


If the Spring configuration is part of an external JAR file, the context loading can be modified. A screenshot from Studio is attached for clarity (Filename: spring.png).


         String[] ctxLocations = {"classpath*:**/applicationContext*.xml"};



Note that this is a known issue with Spring integration in BW 6.3.1(AMBW-22073) due to Java being upgraded to 1.8 .



Attachments

How to integrate Spring Framework in a BW 6 application. get_app
How to integrate Spring Framework in a BW 6 application. get_app