Java / JSF / Tomcat / Spring-代理对象与原始对象的方法不同 [英] Java/JSF/Tomcat/Spring - Proxy-Object has different methods than original object

查看:96
本文介绍了Java / JSF / Tomcat / Spring-代理对象与原始对象的方法不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我遇到了这个问题,确实让我感到烦恼,因为几乎所有代码都已经可以工作了(甚至在恢复到旧版本后也停止工作了。)

today I ran into this problem which really bugs me, as almost the code already worked (and stopped working even after reverting to the older version).

m访问Facelets页上的Spring Bean。 Spring将这些对象包装在Proxies中以使用方面和其他一些东西。

I'm accessing a Spring-Bean on a Facelets-Page. Spring wraps these objects in Proxies to use aspects and some other stuff.

问题是,当我尝试访问bean的属性时遇到异常。

The problem is, that I get an exception when trying to access the property of a bean. The exception is something like this:

javax.el.PropertyNotFoundException: /customers.xhtml @23,27 value="#{customerBean.customer}": Property 'customer' not found on type $Proxy88

类型中找不到属性'customer' !!)那里有相应的getter / setter方法。
到目前为止我尝试过的事情:

I know for sure (!!) that the according getter/setter methods are there. Things i tried so far:


  • 将应用程序部署到另一个tomcat安装

  • 清除所有tomcat缓存,webapp目录

  • 清理eclipse-project

  • 使用javap检查相应的方法(以及method /

  • 更改bean的范围

  • 更改bean的类名

  • 更改spring bean-id

  • 更改bean的serialVersionUID

  • Deploy the application to another tomcat-installation
  • Clear all tomcat-caches, the webapp-directory
  • Clean the eclipse-project
  • Check for the according methods using javap (and the methods/properties where there)
  • Change the scope of the bean
  • Change the class name of the bean
  • Change the spring bean-id
  • Change the serialVersionUID of the bean

无论我做什么,

有人知道什么会引起这样的问题吗?我不知道可以额外尝试什么,因此不胜感激!

Has anybody an idea what could cause a problem like this? I don't know what to try additionally, so any advice is greatly appreciated!

预先感谢!

注意,
Robert

Regards, Robert

推荐答案

如果未正确配置加载时间编织,通常会发生这些错误。确保您不仅配置了加载时间编织器,而且还加载了适当的Java代理,或者确保应用程序服务器为您完成了该任务。

These errors usually occur if the load time weaving isn't properly configured. Make sure that you do not just configure a load time weaver, but that you also load the an appropriate java agent, or that the application server does that for you.

请参见春季文档以获取有关如何配置此环境的更多信息,例如第章7.8.4.6特定于环境的配置。尽管这涵盖了AOP的加载时间波动主题,但对于弹簧的其他部分,需要进行加载时间波动的配置相同。

See the spring documentation for more information on how to configure this environment, e.g. chapter 7.8.4.6 Environment-specific configuration. Although, this covers the load time waving topic for AOP, it's the same configuration for other parts of spring that require load time weaving.

这篇关于Java / JSF / Tomcat / Spring-代理对象与原始对象的方法不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆