我的系统里用hibernate +spring +struts2 +json 报以下的错,找了一天没有找出来 郁闷了 希望各位大虾帮忙指点一下
javax.servlet.ServletException: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: java.lang.IllegalAccessException: Class com.googlecode.jsonplugin.JSONWriter can not access a member of class org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with modifiers "public"
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)root cause
com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: java.lang.IllegalAccessException: Class com.googlecode.jsonplugin.JSONWriter can not access a member of class org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with modifiers "public"
com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:206)
com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:143)
com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:113)
com.googlecode.jsonplugin.JSONWriter.write(JSONWriter.java:81)
com.googlecode.jsonplugin.JSONUtil.serialize(JSONUtil.java:62)
com.googlecode.jsonplugin.JSONResult.execute(JSONResult.java:118)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
javax.servlet.ServletException: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: java.lang.IllegalAccessException: Class com.googlecode.jsonplugin.JSONWriter can not access a member of class org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with modifiers "public"
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)root cause
com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: com.googlecode.jsonplugin.JSONExeption: java.lang.IllegalAccessException: Class com.googlecode.jsonplugin.JSONWriter can not access a member of class org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with modifiers "public"
com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:206)
com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:143)
com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:113)
com.googlecode.jsonplugin.JSONWriter.write(JSONWriter.java:81)
com.googlecode.jsonplugin.JSONUtil.serialize(JSONUtil.java:62)
com.googlecode.jsonplugin.JSONResult.execute(JSONResult.java:118)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
解决方案 »
- 有没有hibernate非主键字段多对多配置例子?
- java 计时控制方法执行问题
- java web 首页 某一模块 轮询
- ognl valueStack
- Struts2中象{1}、{0}这样的标签是什么用的?
- struts-config.xml的问题(forward)
- 面试问题:Hibernate session接口的get和load方法有何异同?Struts中HttpServletRequest的getParameter和getAttribute方法有什么区别?
- struts2 select标签
- 请问java语法中函数的默认值如何写?
- 在weblogic里配置连接池连接mysql遇到问题,求助!!
- 请教一下为什么我把项目加入到SVN上时,总提示svn 提交 99%,然后N久没有反映,CPU占用率100% ?
- Exception in thread "main" org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not al
<result type="json"></result>
<struts>
<package name="json-default" extends="struts-default">
<result-types>
<result-type name="json" class="com.googlecode.jsonplugin.JSONResult"/>
</result-types>
<interceptors>
<interceptor name="json" class="com.googlecode.jsonplugin.JSONInterceptor"/>
</interceptors>
</package>
</struts>
,应该没什么错吧
<struts>
<include file="struts-default.xml"/>
<package name="com.json" extends="json-default" namespace="/jsp/fangtan">
<action name="fangtanroomJson" class="com.founder.edu.action.FangtanroomJson">
<result type="json"/>
</action>
</package> </struts>