We are happy to announce that the Mule module for MyBatis has been made available for public use under the Apache License 2.0. You can download the code from GitHub: https://github.com/Ricston/mule-module-mybatis.
Building the module is very easy. The module uses Maven, so a simple command will do it: mvn package. Maven 3.0.3 or above is required.
This will produce a jar for use within your application, but will also produce an update site for easy installation into Mule Studio.
A typical flow in Mule Studio might look like this:
Running examples can be found in this link: https://github.com/Ricston/mule-module-mybatis/tree/master/src/test/resources.
Thanks for looking.
Enjoy
I run this application but it points out “Failed to read schema document ‘http://www.mulesoft.org/schema/mule/mybatis/current/mule-mybatis.xsd’ ” what’s wrong !
You need to add the mule-module-mybatis dependency to your project. Download the source from github and follow the instructions to build. If you are using Mule Studio, the build also generates a Mule Studio plugin so you can even install it in Studio and use the GUI.
I’m trying to get started on this. I have also forked this on github. I cannot get this to build. Any ideas? Here are stack traces. While it claims to look at logs, there are no other logs to look at that I can find. I have tried various versions of devkit up trough 3.5.0-bighorn with same results in all cases.
[ERROR] Error validating example: cvc-complex-type.3.2.2: Attribute ‘idField’ is not allowed to appear in element ‘mybatis:execute’. Failing example:
[ERROR] error on execute: An error ocurred while the DevKit was generating Java code. Check the logs for further details.
[ERROR] Failed to execute goal org.mule.tools.devkit:mule-devkit-maven-plugin:3.4.0:generate-sources (default-generate-sources) on project mule-module-mybatis: An error ocurred while the DevKit was generating Java code. Check the logs for further details. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.mule.tools.devkit:mule-devkit-maven-plugin:3.4.0:generate-sources (default-generate-sources) on project mule-module-mybatis: An error ocurred while the DevKit was generating Java code. Check the logs for further details.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:46)
Caused by: org.apache.maven.plugin.MojoExecutionException: An error ocurred while the DevKit was generating Java code. Check the logs for further details.
at org.mule.devkit.maven.AbstractAnnotationProcessorMojo.execute(AbstractAnnotationProcessorMojo.java:127)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
… 20 more
Hi Jeremy,
there was a small change to be committed to the samples file. It’s committed now and you should be able to build from source using maven.
Cheers
Also, please note that idField was renamed to foreignKeyField, and idValue was renamed to foreignKeyValue to make it more readable
Hi Alan,
I successfully got it to build with your fix and installed into eclipse. Now to the real fun!
Thanks
Enjoy 😉 Let us know if you need any help.