Several common exceptions during Spring development (3): java. lang. classCastException: com. sun. proxy. $ Proxy4 cannot be cast to com.edu. aop. arithmeticCalculatorImpl at com.edu. aop. main. main (Main. java: 11 ),
This exception was encountered during Spring case development.
Paste the complete exception information:
Exception in thread "main" java.lang.Clas
When you use Spring AOP, you encounter the following error:
Exception in thread "main" Java.lang.ClassCastException:com.sun.proxy. $Proxy 0 cannot is cast to Com.spring.test.setter.InstrumentalistAt Com.spring.test.setter.test.main (test.java:12)
Reading the wrong message shows that the class generated by the dynamic agent cannot be converted to our custom implementation class.Workaround:Add proxy-
java.lang.ClassCastException: $Proxy 9 cannot is cast to TEST.SPRING.SERVICE.IMPL.PERSONSERVICEIMPL2 at Test.junit. Testpersonservice.test (Testpersonservice.java: -) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke (Nativemethodaccessorimpl.java: the) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java: -) at Java.lang.reflect.Method.invoke (Method.java:59
Spring 4.0+spring Mvc4.0+freemarker Integration project, everything is all right, but javax.servlet.ServletException:Could not resolve view with name appears The problem. Here is a foreshadowing, first look at my integrated configuration:
Xml
Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"Xsi:schemalocation= "Http://java.sun.com/xml/ns/javaeeHttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd ">Org.spr
CAST function shocould support INT synonym for SIGNED. I. e. CAST (y AS INT), synonymi. e
Login/Register
Developer Zone
Bugs Home
Report a bug
Statistics
Advanced search
Saved searches
Tags
Bug #73054.
CAST function shocould support INT synonym for SIGNED. I. e. CAST (y AS INT)
Submitted
Java Class. cast method, javaclass. cast Method1. Java api
public T cast(Object obj);
Casts an object to the class or interface representedThe general explanation means to replace an object with a class or interface.2. Sample Code
/** * Created by shengke on 2016/10/22. */class A { public static void show() { System.out.println("Class A show() function"
processing. It is an advanced process of near-net forming.
Casting Method Classification
Ii. Common casting methods and their advantages and disadvantages
1.General Sand Casting
The basic raw materials for sand production are foundry sand and sand binder. The most common casting sand is Silicon Sand. When the High Temperature Performance of Silicon Sand cannot meet the requirements, Special Sand such as Zircon Sand, chromium iron ore sand and corundum sand will be used. The most widely used t
Clinical manifestations:
Use spring AOP dynamic proxy;
The Bean class that is managed with spring inherits from an interface;
The spring container has the ID of the bean you want to proxy, but the ID cannot be cast to the Bean class.
cases:To define a proxy class:@Transactional@Repositorypublic Us
Label:Original: http://www.2cto.com/database/201310/250880.html SQL cast and CONVERT usage detailed Summary: The following applies only to MySQL SELECT {fn CONCAT (CONVERT (User_id,char), user_name)} as Str from T_sys_user The following article applies only to sqlserver2008 SELECT {fn CONCAT (CONVERT (char,user_id), user_name)} as Str from T_sys_user The following SQL Server and MySQL compatible SELECT {fn CONCAT (
Abnormal:Exception in thread "main" java.lang.ClassCastException:com.sun.proxy. $Proxy 2 cannot is cast to Com.pro.service.impl.UserServiceImplAt Com.pro.test.TestSpring.main (testspring.java:12)first, the project of throwing anomaliesDefining the service Layer interface1 PackageCom.pro.service;2 3 /**4 * User Operation interface5 */6 Public InterfaceIuserservice {7 Public voidAdd ();//Add Method8 Public voidUpdate ();//Modify Method9
Once again, in this series of posts I look at the parts of the. NET Framework, which may seem trivial, but can help improve Your code by making it easier to write and maintain. The index of all my past little wonders posts can is found here. We ' ve seen how the Select () extension method lets you project a sequence from one type to a new type which is Han Dy for getting just parts of items, or building new items. But what happens when the items in the sequence was already the type you want, but
Issue : The following exception occurred when developing an application using Spring (v4.1.7) and Hibernate (v4.3.10.final):Java.lang.ClassCastException:org.springframework.orm.hibernate4.SessionHolder cannot is cast to Org.springframework.orm.hibernate3.SessionHoldercause : One possible reason is that the hibernatedaosupport of Hibernate v3 is used in the DAO class.Solve:An exception occurs using the follo
Enumerable. Cast
Used to convert ienumerable to a generic version of ienumerable
. After conversion, you can enjoy other enumerable methods (such as where and select), which greatly facilitates our coding.
However, only one example of converting arraylist is provided in msdn. Many people have seen that list is currently used.
Who else will use arraylist, cast?
It is of littl
The MYSQL Cast function is a very important MYSQL function. The following describes the syntax and usage of the MYSQL Cast function in detail, hoping that you can have a better understanding of the MYSQL Cast function.
BINARYThe BINARY operator returns a BINARY string. This is a simple way to promote column comparison by byte rather than by character. This makes
Differences between the four cast operators of C ++Not my original ----------------------------------------------------------------------
Q: What is C style conversion? What are static_cast, dynamic_cast, and reinterpret_cast? What is the difference? Why?
A: The meaning of conversion is to change the expression of a variable by changing its type to another type. To convert a simple object to another object of type conversion, you will use the traditio
The following exception was found when debugging Spring MVC:Java.lang.ClassCastException:org.springframework.web.servlet.DispatcherServlet cannot is cast to Javax.servlet.ServletThe problem is with Servlet-api.jar, when Tomcat deploys the SPRINGMVC project without this package, and when you build a project with Maven, you don't recognize classes like httpservletrequest if you don't reference that dependency
) the At Java.util.concurrent.threadpoolexecutor$worker.run (Unknown Source) -At Java.lang.Thread.run (Unknown Source)This is written in spring's documentation: the Spring AOP section uses JDK dynamic proxies or cglib to create proxies for target objects. If the target of the agent implements at least one interface, the JDK dynamic proxy is used. All interfaces implemented by this target type will be proxied. If the target object does not implement an
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.