日期:2014-05-19 浏览次数:21029 次
private InstReservation instReservation;
private InstrumentReservationService instReservationService;//服务层接口
get、set省略
action中有一个方法调用了工具类如下:
TimeCompute.compute(instReservation,instReservationService);
让静态方法处理。
public static void compute(InstReservation instReservation,InstReservationService instReservationService) {
Calendar calendar = Calendar.getInstance(TimeZone.getDefault());
calendar.setTime(instReservation.getStartTime());
/**
* 开始时间
* */
int i = calendar.get(Calendar.DAY_OF_WEEK);// 星期
int j = calendar.get(Calendar.HOUR_OF_DAY);// 小时
int k = calendar.get(Calendar.MINUTE);// 分钟
int l = calendar.get(Calendar.DAY_OF_MONTH);// 日
System.out.println(l + "日、" + "星期" + i + "、" + j + "时、" + k + "分");
Calendar calendar2 = Calendar.getInstance();
calendar.setTime(instReservation.getEndTime());
/**
* 结束时间
* */
int m = calendar2.get(Calendar.DAY_OF_WEEK);// 星期
int n = calendar2.get(Calendar.HOUR_OF_DAY);// 时
int o = calendar2.get(Calendar.MINUTE);// 分
int p = calendar2.get(Calendar.DAY_OF_MONTH);// 日
System.out.println(p + "日、" + "星期" + m + "、" + n + "时、" + o + "分");
if (...) {
instReservation.setTimeA("XXX");
instReservationService.update(instReservation);
System.out.println("XXA区间");
System.out.println("XX");
}
java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
.......省略......
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
root cause
java.lang.NoSuchMethodError:
com.yax.util.TimeCompute.compute(Lcom/yax/entity/InstReservation;Lcom/yax/servi