Java SpringMVC3Hibernate3.5BigDecimalJPA注释
实际上,我使用SpringMVC3、Hibernate3.5和extjs作为用户界面开发java web应用程序;我的问题是当我的模型类有像这样的BigDecimal属性时Java SpringMVC3Hibernate3.5BigDecimalJPA注释,java,hibernate,jpa,spring-mvc,extjs,Java,Hibernate,Jpa,Spring Mvc,Extjs,实际上,我使用SpringMVC3、Hibernate3.5和extjs作为用户界面开发java web应用程序;我的问题是当我的模型类有像这样的BigDecimal属性时 import java.math.BigDecimal; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.I
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.codehaus.jackson.annotate.JsonAutoDetect;
@JsonAutoDetect
@Entity
@Table(name="Articles")
public class Article {
@Id
@GeneratedValue
@Column(name="IDARTICLE")
private int id;
@Column(name="CODE")
private String code;
@Column(name="DESIGNATION")
private String designation;
@Column(name="PRIX", scale = 19, precision = 4, columnDefinition = "DECIMAL(19,4)")
private BigDecimal prix;
@Column(name="CPTARTICLE")
private int cptarticle;
@Column(name="IDPARCOM")
private int idparcom;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
public BigDecimal getPrix() {
return prix;
}
public void setPrix(BigDecimal prix) {
this.prix = prix;
}
public int getCptarticle() {
return cptarticle;
}
public void setCptarticle(int cptArticle) {
this.cptarticle = cptArticle;
}
public int getIdparcom() {
return idparcom;
}
public void setIdparcom(int idParcom) {
this.idparcom = idParcom;
}
}
当我这么做的时候
List<Article> articles = hibernateTemplate.find("from Articles");
List articles=hibernateTemplate.find(“来自文章”);
我有执行权,在cosole里什么都没有,就在这一天
Daemon Thread [http-bio-8080-exec-50] (Suspended)
ArticleService$$FastClassByCGLIB$$1bae6fb8.invoke(int, Object, Object[]) line: not available
MethodProxy.invoke(Object, Object[]) line: 191
Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint() line: 692
Cglib2AopProxy$CglibMethodInvocation(ReflectiveMethodInvocation).proceed() line: 150
TransactionInterceptor.invoke(MethodInvocation) line: 108
Cglib2AopProxy$CglibMethodInvocation(ReflectiveMethodInvocation).proceed() line: 172
Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Object, Method, Object[], MethodProxy) line: 625
ArticleService$$EnhancerByCGLIB$$f2eb83ca.getArticleList() line: not available
ArticleController.read() line: 25
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
Method.invoke(Object, Object...) line: not available
AnnotationMethodHandlerAdapter$ServletHandlerMethodInvoker(HandlerMethodInvoker).invokeHandlerMethod(Method, Object, NativeWebRequest, ExtendedModelMap) line: 174
AnnotationMethodHandlerAdapter.invokeHandlerMethod(HttpServletRequest, HttpServletResponse, Object) line: 421
AnnotationMethodHandlerAdapter.handle(HttpServletRequest, HttpServletResponse, Object) line: 409
DispatcherServlet.doDispatch(HttpServletRequest, HttpServletResponse) line: 771
DispatcherServlet.doService(HttpServletRequest, HttpServletResponse) line: 716
DispatcherServlet(FrameworkServlet).processRequest(HttpServletRequest, HttpServletResponse) line: 644
DispatcherServlet(FrameworkServlet).doGet(HttpServletRequest, HttpServletResponse) line: 549
DispatcherServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 621
DispatcherServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 722
ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 305
ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 210
StandardWrapperValve.invoke(Request, Response) line: 224
StandardContextValve.invoke(Request, Response) line: 169
NonLoginAuthenticator(AuthenticatorBase).invoke(Request, Response) line: 472
StandardHostValve.invoke(Request, Response) line: 168
ErrorReportValve.invoke(Request, Response) line: 98
AccessLogValve.invoke(Request, Response) line: 927
StandardEngineValve.invoke(Request, Response) line: 118
CoyoteAdapter.service(Request, Response) line: 407
Http11Processor(AbstractHttp11Processor<S>).process(SocketWrapper<S>) line: 987
Http11Protocol$Http11ConnectionHandler(AbstractProtocol$AbstractConnectionHandler<S,P>).process(SocketWrapper<S>, SocketStatus) line: 579
JIoEndpoint$SocketProcessor.run() line: 309
ThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line: not available
ThreadPoolExecutor$Worker.run() line: not available
TaskThread(Thread).run() line: not available
守护进程线程[http-bio-8080-exec-50](挂起)
ArticleService$$FastClassByCGLIB$$1bae6fb8.调用(int,Object,Object[])行:不可用
调用(对象,对象[])行:191
Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint()行:692
Cglib2AopProxy$CglibMethodInvocation(ReflectiveMethodInvocation).procedue()行:150
TransactionInterceptor.invoke(方法调用)行:108
Cglib2AopProxy$CglibMethodInvocation(ReflectiveMethodInvocation).procedue()行:172
Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(对象,方法,对象[],方法代理)行:625
ArticleService$$EnhancerByGlib$$f2eb83ca.getArticleList()行:不可用
ArticleController.read()行:25
NativeMethodAccessorImpl.invoke0(方法、对象、对象[])行:不可用[本机方法]
NativeMethodAccessorImpl.invoke(对象,对象[])行:不可用
DelegatingMethodAccessorImpl.invoke(对象,对象[])行:不可用
调用(对象,对象…)行:不可用
AnnotationMethodHandlerAdapter$ServletHandlerMethodInvoker(HandlerMethodInvoker)。invokeHandlerMethod(方法、对象、NativeWebRequest、ExtendedModelMap)行:174
AnnotationMethodHandlerAdapter.invokeHandlerMethod(HttpServletRequest,HttpServletResponse,Object)行:421
AnnotationMethodHandlerAdapter.handle(HttpServletRequest、HttpServletResponse、Object)行:409
DispatcherServlet.doDispatch(HttpServletRequest,HttpServletResponse)行:771
DispatcherServlet.doService(HttpServletRequest,HttpServletResponse)行:716
DispatcherServlet(FrameworkServlet).processRequest(HttpServletRequest,HttpServletResponse)行:644
DispatcherServlet(FrameworkServlet).doGet(HttpServletRequest,HttpServletResponse)行:549
DispatcherServlet(HttpServlet).service(HttpServletRequest,HttpServletResponse)行:621
DispatcherServlet(HttpServlet).service(ServletRequest,ServletResponse)行:722
ApplicationFilterChain.internalDoFilter(ServletRequest,ServletResponse)行:305
ApplicationFilterChain.doFilter(ServletRequest,ServletResponse)行:210
StandardWrapperValve.invoke(请求、响应)行:224
StandardContextValve.invoke(请求、响应)行:169
非登录身份验证程序(AuthenticatorBase)。调用(请求、响应)行:472
StandardHostValve.invoke(请求、响应)行:168
ErrorReportValve.invoke(请求、响应)行:98
AccessLogValve.invoke(请求、响应)行:927
StandardEngineValve.invoke(请求、响应)行:118
郊狼适配器。服务(请求、响应)热线:407
http11处理器(抽象http11处理器)。进程(SocketWrapper)行:987
Http11Protocol$Http11ConnectionHandler(AbstractProtocol$AbstractConnectionHandler)。进程(SocketRapper,SocketStatus)行:579
JIoEndpoint$SocketProcessor.run()行:309
ThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker)行:不可用
ThreadPoolExecutor$Worker.run()行:不可用
TaskThread(线程).run()行:不可用
有谁能帮我一个忙吗?这是一个愚蠢的错误,我必须做List articles=hibernateTemplate.find(“from Article”);文章中没有s,因为这是类的名称:-)而不是表的名称。您能显示完整的堆栈跟踪吗?我已在帖子中添加了跟踪您的堆栈跟踪中似乎缺少实际的异常…解决方法是什么?将实际异常和相关堆栈跟踪添加到问题中