简体   繁体   English

sessionFactory的bean中的name属性在IDEA中为“红色”,即无法解析属性

[英]name attribute in bean for sessionFactory is in 'red' in IDEA i.e. cannot resolve property

My app-config.xml looks like: 我的app-config.xml看起来像:

 <!-- Hibernate SessionFactory -->
  <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
      <property name="dataSource" ref="dataSource"/>
      <!--<property name="configLocation" value="classpath:hibernate.cfg.xml"/>      -->
      <property name="hibernateProperties">
          <value>
              hibernate.dialect=org.hibernate.dialect.MySQLDialect
              hibernate.connection.url=jdbc:mysql://localhost/mydb
              hibernate.connection.username=devuser
              hibernate.connection.password=devpwd
              hibernate.query.substitutions=true 'Y', false 'N'
              hibernate.cache.use_query_cache=true
              hibernate.cache.use_second_level_cache=true
              hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
              hibernate.jdbc.batch_size=0
          </value>
      </property>
  </bean>

  <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
  <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
      <property name="sessionFactory" ref="sessionFactory"/>
  </bean>


   <bean id="userDao" class="com.blah.core.db.hibernate.UserDaoImpl">
      <property name="sessionFactory" ref="sessionFactory"/>
  </bean>

the line 线

What could the reason be? 原因可能是什么?

I loaded this in Intellij Idea and saw no red for name attributes, including uncommenting the configLocation property. 我将其加载到Intellij Idea中,发现名称属性没有红色,包括取消注释configLocation属性。

You probably want to check that you've got the correct versions of the libraries configured in Intellij, as the name attribute appears to be not matching fields in library classes, particularly the AnnotationSessionFactoryBean that you're using. 您可能要检查是否已在Intellij中配置了正确的库版本,因为name属性似乎与库类中的字段不匹配,尤其是所使用的AnnotationSessionFactoryBean。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法解析对bean&#39;sessionFactory&#39;的引用 - Cannot resolve reference to bean 'sessionFactory' Spring-data-cassandra:创建名为“sessionFactory”的bean时出错,并且无法解析对bean“cassandraTemplate”的引用 - Spring-data-cassandra: Error creating bean with name 'sessionFactory' and Cannot resolve reference to bean 'cassandraTemplate' Red5无法解析bean引用 - Red5 cannot resolve bean reference 创建名称为“ mongoTransactionManager”的bean时出错:设置bean属性“ datastore”时无法解析对bean“ mongoDatastore”的引用 - Error creating bean with name 'mongoTransactionManager': Cannot resolve reference to bean 'mongoDatastore' while setting bean property 'datastore' 创建名称为“ sessionFactory”的bean时出错 - Error creating bean with name 'sessionFactory' 创建名称为“ sessionFactory”的bean时出错 - Error creating bean with name 'sessionFactory' 创建名称为“ sessionFactory”的bean时出错 - Error creating bean with name “sessionFactory” 创建名称为&#39;org.springframework.security.filterChains的bean时出错,设置bean属性&#39;sourceList&#39;时无法解析对bean的引用 - Error creating bean with name 'org.springframework.security.filterChains Cannot resolve reference to bean while setting bean property 'sourceList' 如何解决在Hibernate4的ServletContext资源中创建名称为&#39;sessionFactory&#39;的bean时出错的问题 - How to resolve Error creating bean with name 'sessionFactory' defined in ServletContext resource in Hibernate4 设置 bean 属性“mongoOperations”时无法解析对 bean“mongoTemplate”的引用 - Cannot resolve reference to bean 'mongoTemplate' while setting bean property 'mongoOperations'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM