我正在创建一个使用 spring + ejb3.1 + glassfish 的项目
这里是文件配置:
豆类.xml
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/dbaas" />
<jee:jndi-lookup id="entityManagerFactory" jndi-name="dbaasPU"/>
<jpa:repositories base-package="com.manwin.dbaas.repository" />
<tx:jta-transaction-manager />
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<bean id="someId" class="org.springframework.orm.hibernate4.HibernateExceptionTranslator"/>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
持久性.xml
<persistence-unit name="dbaasPU" transaction-type="JTA">
<jta-data-source>jdbc/dbaas</jta-data-source>
</persistence-unit>
一类
@WebService
@Stateless
@Interceptors(SpringBeanAutowiringInterceptor.class)
public class JobServiceImpl implements JobService{
@Inject
JobDaoJpa jobDaoJpa;
我得到了以下错误:
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory': Invocation of init method failed; nested exception is javax.naming.NamingException: Lookup failed for 'cloud-dbaas-PU' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,