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