Wednesday Apr 11, 2007
Wednesday Apr 11, 2007
I have posted an article JBI
Examples - Developing JBI Components
on open-esb project web site. This article describes various
steps and artifacts involved in
developing JBI Components by using examples. It has ant build scripts
to build and test components from command line. The build scripts used
in these examples does not depend on any IDE.
If you are interested
to use your favorite IDE, an ant based free-form project support for
Netbeans IDE and ant based project support for Eclipse IDE is in the
examples for your convenience. Watch the videos below to see how you
can use the IDE to run the examples.
Running JBI Examples from command line
Running JBI Examples as ant based free-form
project in Netbeans IDE
Running JBI Examples as ant based project in
Eclipse IDE
If you are looking for more help on developing your JBI Components, check out
JBI Component Development tools preview added in Netbeans 6.0 IDE bundled
in the OpenESB plus Addons bundle. Get the latest
from downloads
page. I will write another blog on how to use these tools
to quickly create, modify and test your JBI Components .
Sriniwasan,
I am a novice developer of the JBI components. I went through your BLOG on how to create jbi components. The MyBinding engine you provided worked fine. But I downloaded the open-esb and tried to create a service engine in that. I tried to mimic everything in your MyEngine project, but could not get it to work. Somehow after inserting some logging statements, I found that the ProviderSEServiceUnit never gets called. Could you describe the changes needed to make the MyEngine service engine to work with the auto-generated classes in Open-ESB. Your help would be highly appreciates.
Posted by Hunter on June 04, 2008 at 06:27 PM PDT #
Hi Hunter,
If you have created your service engine initial code using the project wizard, it would have created a test service assembly along with a complete working service engine that supports the deployment. You need to deploy this test service assembly ( see /test/testSA for the service assembly in your project root) to your component to see that service unit processing code execution in your component. (you can run this test using the "test component" action in the project node which first deploys the service assembly and runs the client that talk to the service activated by the service assembly using http/soap. check out the code under test directory).
Since the code that OpenESB component project wizard generates is capable of handling deployments, it is some what different from the simple example given in the jbi component examples article, but most of the concepts (like installation and lifecycle processing, endpoint activation) are very similar. I would recommend you to modify the code generated by OpenESB component project wizard to suite your requirement if you need to handle deployments in your component. If you don't need to handle deployments in your components ( i.e. if you create your component to directly initialize the known service endpoints without deployment) the jbi component example code in the article is fine to muck with.
Handling of the deployment in the OpenESB component project wizard generated code is based on wsdl and wsdl extensions. So, you should be careful in modifying the code that processes the wsdl and wsdl extensions ( specially, with your binding namespace and extension elements in the wsdl document in the runtime code and in the test service assembly artifacts ) during deployment processing.
If you describe what you have changed, I would be able to give you more detailed explanation of what might be going wrong and how to fix it. Feel free to contact me directly if you have any other questions or send your questions to dev@open-esb.dev.java.net community mailing list.
Posted by chikkala on June 05, 2008 at 12:28 PM PDT #
Srini,
Thanks for the information on how to create a binding component. It was very useful. Your simplified code was very useful in understanding the generated code in Netbeans IDE. I have one question: Do I need to maintain the package name as com.sun.jbi.sample.xxx or I can rename it to my own package?
Thanks
John
Posted by John on August 09, 2008 at 07:34 PM PDT #
Hi John,
Feel free to rename/modify any part of the generated code to make it part of your component. Hope you are using the latest JBI CDK from http://wiki.open-esb.java.net/Wiki.jsp?page=JbiComponentDevTools as it has couple of bug fixes in the generated code. With netbeans refactoring to rename packages/classes, it is very easy to refactor the generated common code into your component specific packaging.
regards,
Srinivasan Chikkala
Posted by chikkala on August 11, 2008 at 10:41 AM PDT #