简体   繁体   English

使用命令提示符将Mule 3.4 CE部署为jar文件

[英]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 我是一个在Mule Studio上运行良好的项目,我将其导出为jar文件,并希望使用以下命令从命令提示符将其部署为Java应用程序

java -jar newproject.jar java -jar newproject.jar

It throws a ClassnotFound Exception and I noticed that the jar file does not contain all Mule dependencies. 它引发了ClassnotFound异常,我注意到jar文件并不包含所有的Mule依赖项。 What am I doing the wrong? 我做错了什么? Its there a better approach to this 它有一个更好的方法

You can't run Mule like that. 您不能像那样运行Mule。

Take a look at the documentation: http://www.mulesoft.org/documentation/display/33X/Running+Mule+ESB+3 看一下文档: 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. 使用Maven Assembly Plug-in生成具有依赖关系的单个JAR,它将包含您的应用程序和所有Mule的依赖关系。

See: http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies 请参阅: 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. 请注意,如果使用任何EE功能,则需要使用EE Nexus作为存储库。 If you use DataMapper, you will have to bring a license on your classpath as well. 如果使用DataMapper,则还必须在类路径上带一个许可证。

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, ... 请记住,将Mule作为单个JAR运行会使您错过独立容器提供的所有功能,例如热应用程序重新加载(显然),类加载器隔离,...

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; 我将其导出为可运行的jar文件,然后选择选项。 Copy required libraries into a sub-folder next to the generated JAR. 将所需的库复制到生成的JAR旁边的子文件夹中。 After exporting, I created a .bat file from here I specify the location of my java classpath. 导出后,我从此处创建了一个.bat文件,并指定了Java类路径的位置。 Double Clicking the bat files starts the program. 双击bat文件启动程序。

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 http://www.mulesoft.org/documentation/display/current/Embedding+Mule+in+a+Java+Application+or+Webapp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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