-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fully executable Jar does not scan typeAlias #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've added repro project for this. https://github.com/kazuki43zoo/mybatis-spring-boot-gh-38 $ git clone https://github.com/kazuki43zoo/mybatis-spring-boot-gh-38.git
$ cd mybatis-spring-boot-gh-38
$ ./mvnw install
$ java -jar target/mybatis-spring-boot-gh-38-1.0.0-SNAPSHOT.jar
...
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:118)
... 44 more
Caused by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'Message'. Cause: java.lang.ClassNotFoundException: Cannot find class: Message
at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:120)
at org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:149)
at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:116)
... 48 more
... |
I've confirmed to fix this issue using mybatis-spring 1.2.5-SNAPSHOT. How to install the mybatis-spring 1.2.5-SNAPSHOT into local repository. $ git clone https://github.com/mybatis/spring.git
$ cd spring
$ git checkout 1.2.x
$ mvn install And i changed a version of mybatis-spring. <dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.5-SNAPSHOT</version>
</dependency> Build a fully executable jar
Run a fully executable jar $ java -jar target/mybatis-spring-boot-gh-38-1.0.0-SNAPSHOT.jar
...
2016-03-29 02:15:06.045 INFO 50107 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-03-29 02:15:06.107 INFO 50107 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-03-29 02:15:06.110 INFO 50107 --- [ main] com.example.Application : Started Application in 2.711 seconds (JVM running for 3.05) Access to http://localhost:8080/ $ curl http://localhost:8080/
Hello!! |
This issue will fix via mybatis/spring#121. |
Thank you @kazuki43zoo !! @eddumelendez @kazuki43zoo Just let us know if we need a new release of the spring module to fix this. |
I think that spring-mybatis 1.2.5 and mybatis-spring-boot 1.0.2 should release as soon as possible. |
Thanks @kazuki43zoo to report this issue @emacarron I have tested version 1.2.5-SNAPSHOT and it is working fine. Do you think we can perform a release of mybatis-spring? Thanks in advance. |
Of course we can. Let me know if spring-boot is ready for a release and will make both releases asap. |
Ah, sorry, I see there are no changes in spring-boot so we only need a release of the spring module. Lets go then. |
Finally fixed by upgrading the MyBatis-Spring dependency with commit 8fe17c4 |
I am using spring boot version 1.5.4 along with spring-mybatis 1.3.0. mybatis-spring-boot-starter 1.3.0 |
@gituser786 Could you provide a small reproduce project via GitHub repository? |
I encountered the same problem.There is no problem in eclipse but package executor jar
|
@kazuki43zoo , Yes,the problem is solved.Thanks for your reply. |
Thanks for the solution, its not working fully though for me.
|
@shreyasGit |
Ok does that mean I need to provide a sample spring boot project which
replicates problem ? My application is quite huge, moving from spring 3.1
to boot. I will not be able to provide entire thing
…On Tue, May 29, 2018, 19:55 Kazuki Shimizu ***@***.***> wrote:
@shreyasGit <https://github.com/shreyasGit>
Could you provide a reproduce project on GitHub?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#38 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGUPNvioGkNi9toZq8QsNN1DX4wciJArks5t3VpagaJpZM4H5-69>
.
|
If you need my help, I want to a small reproduce project(maven or gradle). |
mybatis-spring-boot 1.0.1 does not scan typeAlias from specified package as follow:
mybatis.type-aliases-package=com.example.model
Specify a type alias in Mapper XML
Settings for building a fully executable jar
Build a fully executable jar
$ ./mvnw clean install
Run a fully executable jar
Related issue : #35
The text was updated successfully, but these errors were encountered: