2014-10-18 188 views
1

好吧,这让我疯狂。我尝试了一切,无法解决这个问题。因此,这里的问题: 当我为messageSource cofigured这样的:无法解决符号错误,即使一切正常(IntelliJ IDEA)

<bean id="messageSource" 
     class="org.springframework.context.support.ResourceBundleMessageSource"> 
    <property name="basename" value="messages"/> 
    <property name="defaultEncoding" value="UTF-8"/> 
</bean> 

一切都很好,但是当我改变ReloadableBundleMessageSource,它没有找到一些原因,我的“消息”捆绑,所以我不得不添加类路径,像这样:

<bean id="messageSource" 
     class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> 
    <property name="basename" value="classpath:messages"/> 
    <property name="defaultEncoding" value="UTF-8"/> 
</bean> 

现在,它的作品,但不断的IntelliJ尖叫,有一个错误甚至尽管一切工作正常。类路径:消息突出显示,并表示无法解析符号类路径:消息。 请结束我的痛苦。

+1

尝试创建于YouTrack的bug报告。或者您也可以尝试禁用此特定检查(或至少将其级别降低为警告,以便它不那么突兀) – 2014-10-18 22:50:45

+0

我有完全相同的问题。 – skiabox 2015-04-22 11:12:04

+0

我刚刚在官方论坛发了一篇文章。 – skiabox 2015-04-22 11:21:39

回答

0

似乎没有解决这个问题,所以我最终禁用了这项检查。
感谢Bohuslav的建议。

+0

是的是一个bug。这里是链接https:// youtrack .jetbrains.com /问题/ IDEA-122239 – skiabox 2015-04-22 12:30:08

0

我找到了一个解决办法:

<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource" 
     p:basename="/resources/messages"> 
    <property name="defaultEncoding" value="UTF-8"/> 
</bean> 

Sikor,请使用号码:基本名称= “类路径:消息”

相关问题