How do you run it?
If using OSGi you have all the usual issues with class visibility.
You may need to add your class in the MANIFEST.MF files (OSGi stuff)
If you run it as a pure junit test outside OSGi I am sure it works.
hmm..the more i learn, the more difficult this seems.
I think Claus is really just pointing out that there isn't enough information in the post to make any guesses about how that exception is occurring. It's usually the case that exceptions are keenly tied to the environment in which your business logic is operating, rather than being "obviously" due to a code defect. So it's vital that anyone that is attempting to analyze an issue has full information of the environment, best case being a test case that manifests the problem.
"difficult" isn't the right word to use. a better word is "involved".
sorry about that...
I'm think I'm getting closer to the prob. In my log file, I see errors pertaining to finding my aggregation strategy class. I think it may be a MANIFEST file thing.
This post seems to relate to my problem: http://fusesource.com/forums/thread.jspa?messageID=4863ዿ
Could you point me to a good source for creating manifest files or is this outside the scope of this forum?
As best I can make out that exception, it says org.MyRouteBuilder is loading org.apache.camel.processor.aggregate.AggregationStrategy from one particular class loader and org.apache.camel.model.RouteType is loading the same AggregationStrategy using a different classloader. And this is causing problems.
The goal is to find out why this is being loaded by two different classloaders, and indeed why one of them is a JarFileClassLoader rather than a ModuleClassLoader.
Yes, it will definitely be MANIFEST-related. Want to post it here? Or better still zip up the offending project and attach?
I didn't answer your question, my apologies.
Could you point me to a good source for creating manifest files...?
Some ways to do this:
create it yourself, with a little help from an IDE - I use Eclipse PDE tools to do that - check out this tutorial for some information on how to do that.
let it be created for you - the maven-bundle-plugin will help if you are using a maven build - here's what the plugin does.
more let it be created for you with the pax stuff - again a mavenistic approach, check out this tutorial for more information.
Ok..making progress bit by bit.
I pulled together a few things:
- I followed the steps in "Migrating FUSE Mediation Router Applications to OSGi" (http://fusesource.com/docs/esb/4.1/migration/index.html?url=http://fusesource.com/docs/esb/4.1/migration/ESBMigrationFMR.html)
- I added the extensions == true tag to the maven-bundle-plugin
- I added a dependency to biz.aQute's bndlib jar
- I let maven generate what I needed
- I deployed my routing info as an OSGi, I believe. I didn't need to create a service assembly for it
- I deployed my http provider and consumers as a separate service assembly
After all this, I'm getting an error about failed delievery and the markup in the document following the root element must be well-formed.
At least it's deploying and it's hitting my webservice now. I'm marking this as answered.
Glad it's getting there for you!
Just to add closure, the error about the root element is due to the way the results are aggregated.
ie, using the below as an example
Now for a question:
Is there a way to that a root element can be added automatically before returning the results or do I need to add custom coding for my own root element to be added?