2012-12-03 13 views
9

StrutsとStruts JSONプラグインを使用してSpringアプリケーションを開発しています。私は、アプリケーションを実行すると、それは(Firebugのでは)次のエラーを与える:は、修飾子を使用してorg.springframework.aop.TruePointcutクラスのメンバーにアクセスできませんpublic

org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers public 

は、これは完全なスタックトレースです:

org.apache.struts2.json.JSONException: 
org.apache.struts2.json.JSONException: 
org.apache.struts2.json.JSONException: 
org.apache.struts2.json.JSONException: 
java.lang.IllegalAccessException: Class 
org.apache.struts2.json.JSONWriter can not access a member of class 
org.springframework.aop.TruePointcut with modifiers "public" 
    org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:238) 
    org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:171) 
    org.apache.struts2.json.JSONWriter.process(JSONWriter.java:161) 
    org.apache.struts2.json.JSONWriter.value(JSONWriter.java:127) 
    org.apache.struts2.json.JSONWriter.write(JSONWriter.java:95) 
    org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:116) 
    org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:196) 
    org.apache.struts2.json.JSONResult.execute(JSONResult.java:170) 
    com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:374) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278) 
    org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    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:249) 
    com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) 
    org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) 
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211) 
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211) 
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) 
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) 
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:511) 
    org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:432) 

根本的な原因:

org.apache.struts2.json.JSONException: 
org.apache.struts2.json.JSONException: 
org.apache.struts2.json.JSONException: 
java.lang.IllegalAccessException: Class 
org.apache.struts2.json.JSONWriter can not access a member of class 
org.springframework.aop.TruePointcut with modifiers "public" 
    org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:238) 
    org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:171) 
    org.apache.struts2.json.JSONWriter.process(JSONWriter.java:161) 
    org.apache.struts2.json.JSONWriter.value(JSONWriter.java:127) 
    org.apache.struts2.json.JSONWriter.add(JSONWriter.java:363) 
    org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:223) 
    org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:171) 
    org.apache.struts2.json.JSONWriter.process(JSONWriter.java:161) 
    org.apache.struts2.json.JSONWriter.value(JSONWriter.java:127) 
    org.apache.struts2.json.JSONWriter.write(JSONWriter.java:95) 
    org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:116) 
    org.apache.struts2.json.JSONResult.createJSONString(JSONResult.java:196) 
    org.apache.struts2.json.JSONResult.execute(JSONResult.java:170) 
    com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:374) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278) 
    org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    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:249) 
    com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) 
    org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) 
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211) 
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211) 
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) 
    org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90) 
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249 

答えて

32

このクラスはパブリックではありません自体。パッケージ保護されています(here参照)。プライベートメンバーまたは保護されたメンバーにアクセスするときとまったく同じように、メンバーにアクセスする前にsetAccessible(true)に電話する必要があります。

EDIT。 残念ながら、完全なスタックトレースを提供していません。この例外があなたのアクティビティの結果である場合(私は自分でSpringクラスのメンバーにアクセスしようとしています)、上記の解決策があります。しかし、これがフレームワークの衝突の結果として起こった場合、詳細を送ってください。おそらくStrutsとSpringのあなたのバージョンは互換性がないか、あるいは追加の設定が必要です。

+0

私は完全なスタックトレースを追加しました –

+0

私はsetAccesible(真)と私はどこで行うべきですか? –

+0

私はpatientService answer.Iが私のstruts.xmlファイル<結果タイプ= "JSON"> ます。 ます。にして、これを追加した –

関連する問題