Java.lang.IllegalArgumentException:interface Usermapper is isn't visible from class loader

Source: Internet
Author: User

Log a Java Jar package import path problem, resulting in the following error message:

Java.lang.illegalargumentexception: interface usermapper is not visible from &NBSP;CLASS&NBSP;LOADERJAVA.LANG.REFLECT.PROXY.GETPROXYCLASS0 (Unknown source) Java.lang.reflect.Proxy.newProxyInstance (Unknown source) Mybatisconnectionfactory$mapperproxy.bind ( mybatisconnectionfactory.java:81) mybatisconnectionfactory$mapperproxy.access$0 (MybatisConnectionFactory.java : Mybatisconnectionfactory.getsshfamemapper (mybatisconnectionfactory.java:55) userdataprovider.getinstance ( userdataprovider.java:30) Userserviceimpl.login (userserviceimpl.java:42) from code anomalies see:     @ Suppresswarnings ("Unchecked")     private static <t> t bind (Class <t> mapperclazz, sqlsessionfactory sqlsessionfactory)      {         return  (T)  proxy.newproxyinstance ( Sqlsessionfactory.getclass (). getClassLoader (), New class[]{mapperclazz}, nEw mapperproxy (Mapperclazz, sqlsessionfactory));     } 
It's a question of this sentence. Sqlsessionfactory.getclass (). getClassLoader ()

In fact, not so, do not understand why Java for the path of the jar file, import package duplication, there will always be a strange strange error message, torture me a day, search on Google to see someone is said to be a jar file path problem

Finally, the next environment: My Java application is configured in Eclipse run configurations, filling in Classpath, will application Lib below, already Tomcat bin, The jar packages below the lib are all imported into the classpath, resulting in errors such as escalation.

Solving this problem is simple, just keep the Tomcat jar, and remove the application jar package to resolve it.

Hope to encounter similar problems of coder, can help you!

This article is from the "-= lake-side Bamboo =-" blog, please be sure to keep this source http://bronte.blog.51cto.com/2418552/1834862

Java.lang.IllegalArgumentException:interface Usermapper is isn't visible from class loader

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.