Я уверен, что мое приложение работало прямо до вчерашнего дня, когда я получил эту ошибку:Spring автоматическое связывание перестало работать на GAE
Failed startup of context [email protected]1079ff{/,/ base/data/home/apps/s~trewnewmedia/1.357617962256387950} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scadenziarioController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void it.trew.prove.web.controllers.ScadenziarioController.setScadenzaService(it. trew.prove.services.ScadenzaService); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scadenzaService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void it.trew.prove.services.ScadenzaService.setSocietaService(it.trew.prove.serv ices.SocietaService); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'societaService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void it.trew.prove.services.SocietaService.setSocietaDao(it.trew.prove.model.dao .Dao); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory': Post-processing of the FactoryBean's object failed; nested exception is java.lang.SecurityException: Unable to get members for class org.hibernate.impl.SessionFactoryImpl
Я использую Hibernate с помощью Google Cloud SQL, и он всегда работал.
На моей локальной машине, с местным MySQL, она по-прежнему работает!
Я не думаю, что это проблема Cloud SQL, потому что удаление некоторой автоустановки (теста), которую оно все еще связывает и так далее. Вот мой XML:
<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="annotatedClasses">
<list>
<value>it.trew.prove.model.beans.Scadenza</value>
<value>it.trew.prove.model.beans.Fornitore</value>
<value>it.trew.prove.model.beans.Societa</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>
<!-- <prop key="hibernate.hbm2ddl.import_files">/setup.sql</prop> -->
</props>
</property>
</bean>
Кусок моего DAO:
@Component
public class Dao {
@Resource(name = "mySessionFactory")
private SessionFactory sessionFactory;
...
И моя служба:
@Service
@Transactional
public class SocietaService {
private Dao societaDao;
@Autowired
public void setSocietaDao(Dao societaDao) {
this.societaDao = societaDao;
}
...
Я не могу найти то, что отличается от GAE и мой местный (МВН GAE :бег). И почему на прошлой неделе это сработало отлично.
Прошу вас, ГАИ, поддержите меня! Я схожу с ума по этому вопросу
(я, вероятно, начать баунти, это слишком срочно)
EDIT мой pom.xml зимуют часть:
<!-- Hibernate framework -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.2.GA</version>
<type>pom</type>
<!--hibernate-dependencies is a pom, not needed for hibernate-core-->
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</version>
</dependency>
Основная проблема заключается в следующем: 'Не удалось получить членов класса org.hibernate.impl.SessionFactoryImpl', обновите модуль Hibernate или что-то еще? – vacuum
no ... :(см. Править –
Какова последняя модификация, которую вы сделали до этой ошибки? Вы должны были что-то сделать, если она работала раньше. –