|
#1
|
|||
|
|||
|
Hi all
I have an Enterprise project in NetBeans,this is the layout: Code:
Enterprice Application
|
|____EjbProject.jar
| |
| |
| |__ejb.service
| | |__ UtenteService.java (Remote Ejb Interface)
| | |__ UtenteServiceImpl.java (Stateless Ejb implementation)
| |
| |__ejb.dominio
| |__ Utente.java (Entity Ejb)
|
|
|
|
|____WebProject.war
|
|__webPages
| |
| |__WEBINF
| |
| |__ applicationContext.xml
|
|
|__spring.service
|
|__spring.service
|
|__ SpringUtenteService.java (Spring bean interface)
|
|__ SpringUtenteServiceImpl.java (implement. of interf.)
My application context is: Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
<jee:jndi-lookup id = "utenteService" jndi-name ="ejb.service.UtenteService" resource-ref = "true"/>
<bean id ="springUtenteService" class = "spring.service.SpringUtenteServiceImpl">
<property name = "utenteService" ref = "utenteService"/>
</bean>
</beans>
But when i run the project i have this exception: Code:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'utenteService': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: UtenteService not bound
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1362)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:540)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:407)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
..................
..................
regards |
![]() |
| Thread Tools | |
| Display Modes | |
|
|