I’m trying to turn a Java servlet into a Mule web service, but my program has more than one class. I’ve seen many tutorials about using POJOs with Mule in a Java component, but never a program with several classes. How can this be done?
Edit: My servlet is currently running on a tomcat server. It takes in an xml document with details for a search, searches a database, then outputs an xml document with the search results. The xml parsing and generation, and the database connection and queries are all handled by the servlet currently. I’d just like to be able to run it using Mule, rather than on the tomcat server.
Mule can run JavaEE web-apps thanks to its embedded Jetty container.
Look at the Bookstore example that comes bundled with the standalone distribution to see how it is done. This example indeed does deploy two web-apps, bookstore and bookstore-admin inside Mule standalone.
Assuming your web-app is xmlproc.war, the layout you want in your Mule application Zip is:
With mule-config.xml:
Non-provided libs means you shouldn’t embed libs that are found under $MULE_HOME/lib/**.