简体   繁体   中英

Deploying Mule 3.4 CE as a jar File Using Command Prompt

I a project running perfectly well on Mule Studio, I exported it as jar file and want to deploy it as a java app from command prompt using

java -jar newproject.jar

It throws a ClassnotFound Exception and I noticed that the jar file does not contain all Mule dependencies. What am I doing the wrong? Its there a better approach to this

You can't run Mule like that.

Take a look at the documentation: http://www.mulesoft.org/documentation/display/33X/Running+Mule+ESB+3

Use the Maven Assembly Plug-in to produce a single JAR with dependencies that will contain your application and all Mule's dependencies.

See: http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies

Note that if you use any EE feature, you will need to use the EE Nexus as a repository. If you use DataMapper, you will have to bring a license on your classpath as well.

Keep in mind that running Mule as a single JAR will make you miss all the features provided by the standalone container, like hot application reload (obviously), classloader isolation, ...

Thanks for all the responses, but this was how I was able to resolve it. I exported it as a runnable jar file and choose the option; Copy required libraries into a sub-folder next to the generated JAR. After exporting, I created a .bat file from here I specify the location of my java classpath. Double Clicking the bat files starts the program.

Note that I had earlier created a Class with a main method that starts the application using the procedure in this link

http://www.mulesoft.org/documentation/display/current/Embedding+Mule+in+a+Java+Application+or+Webapp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM