如何在Java配置类中设置Spring weaver选项? [英] How to set Spring weaver options in Java config class?

查看:189
本文介绍了如何在Java配置类中设置Spring weaver选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Spring AOP与提供的默认 DefaultContextLoadTimeWeaver 一起使用。我希望能够编织持久的实体,并且我知道我必须设置一个编织器选项(从控制台发出警告):

I am using Spring AOP with the provided default DefaultContextLoadTimeWeaver. I would like to be able to weave persisted entities and I know I have to set a weaver option (warning from console):

warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified

我的搜索仅在.xml文件中找到了配置示例,但我真的希望它位于我的Java配置类中,其中包含所有配置。
有办法吗?

My search only found examples for the configuration in a .xml file, but I would really prefer this to be in my Java configuration class, where all my configurations are. Is there a way to do this?

推荐答案

如果仔细阅读警告,您会发现它仅仅是关于javax。*类型,您可能还是不想编织。如果是这样,您可以放心地忽略该警告。

If you read the warning carefully, you learn that it is only about javax.* types which probably you do not want to weave anyway. If so, you can safely ignore the warning.

如果您的方面还存在其他问题,请显示一些代码并说明无法解决的问题。理想情况下,请提供一个 SSCCE ,否则没人会帮助您。

If anything else is wrong with your aspects, please show some code and explain what is not working. Ideally, provide an SSCCE, otherwise nobody will be able to help you.

这篇关于如何在Java配置类中设置Spring weaver选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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