如何使用Spring 3.0表达式语言参数化@Scheduled(fixedDelay)?(How to parameterize @Scheduled(fixedDelay) with Spring 3.0 expression language?)
当使用Spring 3.0功能来注释计划的任务时,我想将
fixedDelay
设置为我的配置文件中的参数,而不是将其fixedDelay
到我的任务类中,如当前的...@Scheduled(fixedDelay = 5000) public void readLog() { ... }
不幸的是,似乎使用Spring表达式语言(Spel)的方式
@Value
返回一个String对象,而该对象又不能根据fixedDelay
参数的要求自动装箱到一个较长的值。When using the Spring 3.0 capability to annotate a scheduled task, I would like to set the
fixedDelay
as parameter from my configuration file, instead of hard-wiring it into my task class, like currently...@Scheduled(fixedDelay = 5000) public void readLog() { ... }
Unfortunately it seems that with the means of the Spring Expression Language (SpEL)
@Value
returns a String object which in turn is not able to be auto-boxed to a long value as required by thefixedDelay
parameter.
原文:https://stackoverflow.com/questions/2598712
最满意答案
尝试重新安装看守人:
npm r -g watchman brew update && brew upgrade brew install watchman
如果这不能解决它,请尝试在这里发布的答案。
尝试通过以下方式重新安装libtool:
brew reinstall libtool --universal && brew unlink libtool && brew link libtool
如果无法帮助,请尝试将其彻底删除,然后重新尝试以上操作:
brew uninstall libtool
Try reinstalling watchman:
npm r -g watchman brew update && brew upgrade brew install watchman
If that doesn't fix it, try the answers posted here.
Try to re-install libtool by:
brew reinstall libtool --universal && brew unlink libtool && brew link libtool
If won't help, try to remove it completely and re-try above again:
brew uninstall libtool
相关问答
更多-
很高兴你已经用解决方法解决了这个问题,但请允许我解释当你运行npm install redux --save时为什么react-native模块被删除。 解: 将package-lock.json移出项目文件夹(不要删除它,因为您稍后需要检查它) 运行rm -rf node_modules && npm install 检查/ node_modules和react-native现在应该在那里 运行npm install redux (npm v5会默认保存)来安装redux而不删除现有的模块 什么是pack ...
-
无需生产节点服务器就可以运行React应用程序。 Facebook提供了一个易于使用的项目引导程序,您可以在这里阅读 也就是说,开发人员可能需要通过npm start在本地使用节点开发服务器,以及使用节点通过npm run build执行生产构建。 但是可以从npm run build获取构建输出,并从任何静态服务器提供它,并且有一个正在运行的反应应用程序。 It is absolutely possible to run a React app without a production node serv ...
-
尝试重新安装看守人: npm r -g watchman brew update && brew upgrade brew install watchman 如果这不能解决它,请尝试在这里发布的答案。 尝试通过以下方式重新安装libtool: brew reinstall libtool --universal && brew unlink libtool && brew link libtool 如果无法帮助,请尝试将其彻底删除,然后重新尝试以上操作: brew uninstall libtool T ...
-
我会假设你有先决条件 ,但在继续之前要仔细检查。 Homebrew,Watchman,Node 4+和Flow(可选)。 当您在Xcode中打开项目并按下构建按钮(播放?)时,它应该自动启动打包服务器。 但在你的情况下,它似乎没有。 在这种情况下,尝试在构建项目之前从项目的根目录中运行终端中的npm start 。 I'm going to assume you have the pre-requisites, but double check before moving on. Homebrew, Wat ...
-
Create-react-native-app与Expo创建一个新的项目,你可以弹出它变成一个反应本地项目(android / ios文件夹与本地代码+ src文件夹与javascript代码)。 您需要一个Xcode / Android Studio环境来运行没有Expo构建的react-native应用程序。 您无法使用Expo来运行带有自定义本机代码的React-Native应用程序。 相关链接: 从创建React本机应用程序弹出 Expo和React Native有什么区别? Create-reac ...
-
克隆后不要这样做 react-native init MyApp prompt: Directory MyApp already exists. Continue?: (no) I am typing - yes npm install [all dependencies] react-native link 只需转到克隆的应用程序目录XYZApp并执行 npm install 和所有设置使用运行应用程序 react-native run-android after cloning Do ...
-
你可以从第一个开始 步骤1打开终端并输入: create-react-native-app AwesomeProject 第2步一旦项目创建,它将显示选项列表:键入命令 cd AwesomeProject 步骤3添加软件包 npm install --save react-native-card-stack 步骤4运行该项目 npm start 这就是你需要做的。 现在您可以从您的博览应用程序扫描,直接在您的手机中运行该项目。 请注意,如果应用程序在运行运行npm install显示错误 You ...
-
尝试检查package.json并查看其中的内容。 如果你发现旧版本,你可以改变它然后运行npm install或者运行npm install --save react-native@
如果您遇到需要升级反应的错误,请运行npm install --save react@ 在我的情况下,我不得不使用这种替代方法,因为标准的(基于git)不起作用。 关于这个替代方案的更多细节以及这里的标准版本: https : //facebook.g ... -
您可以在终端尝试以下命令,可能会对您有所帮助。 brew卸载节点 sudo chown -R“$ USER”:admin / usr / local sudo chown -R“$ USER”:admin / Library / Caches / Homebrew brew安装节点 npm install -g create-react-native-app create-react-native-app Your_Project_Name cd Your_Project_Name npm开始 如果上述命令 ...
-
你有守望者吗? (有关macOS依赖关系的列表,请参见此处 )。 你可以用brew install watchman安装它(假设你有自制软件 )。 Do you have watchman installed? (see here for a list of macOS dependencies). You can install it with brew install watchman (assuming you have homebrew).