0
Haben Sie eine Spring Bean, die nicht aus einem JNDI-Lookup erstellt werden kann. Ausnahme ist:JNDI Name nicht gefunden WildFly 10
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanRefFactoryEjb' defined in URL [vfs:/C:/work/wildfly-10.0.0.Final/bin/content/authorization-service-1.1.1.ear/authorization-service-core-1.1.1.jar/beanRefFactory.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorizationService' defined in class path resource [applicationContext-localEjb.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: authorization-service-1.1.1/ejb/org.drake.authorization.AuthorizationService -- service jboss.naming.context.java.global."authorization-service-1.1.1".ejb."org.drake.authorization.AuthorizationService"
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:451)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
... 38 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorizationService' defined in class path resource [applicationContext-localEjb.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: authorization-service-1.1.1/ejb/org.drake.authorization.AuthorizationService -- service jboss.naming.context.java.global."authorization-service-1.1.1".ejb."org.drake.authorization.AuthorizationService"
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authorizationService' defined in class path resource [applicationContext-localEjb.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: authorization-service-1.1.1/ejb/org.drake.authorization.AuthorizationService -- service jboss.naming.context.java.global."authorization-service-1.1.1".ejb."org.drake.authorization.AuthorizationService"
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1175)
... 51 more
Caused by: javax.naming.NameNotFoundException: authorization-service-1.1.1/ejb/org.drake.authorization.AuthorizationService -- service jboss.naming.context.java.global."authorization-service-1.1.1".ejb."org.drake.authorization.AuthorizationService"
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)
Hier ist meine application-localEJB.xml Datei:
<bean id="authorizationService" class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
<property name="jndiName"><value>java:global/authorization-service-1.1.1/ejb/org.dcri.authorization.AuthorizationService</value></property>
<property name="businessInterface"><value>org.dcri.authorization.AuthorizationService</value></property>
</bean>
<!-- AuthorizationAdminService -->
<bean id="authorizationAdminService" class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
<property name="jndiName"><value>java:global/authorization-service-1.1.1/ejb/org.dcri.authorization.AuthorizationAdminService</value></property>
<property name="businessInterface"><value>org.dcri.authorization.AuthorizationAdminService</value></property>
</bean>
<!-- AccountService -->
<bean id="accountService" class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
<property name="jndiName"><value>java:global/authorization-service-1.1.1/ejb/org.dcri.authorization.AccountService</value></property>
<property name="businessInterface"><value>org.dcri.authorization.AccountService</value></property>
</bean>
Und wenn Wildfly startet, das ist der JNDI-Name:
19:13:01,117 INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-5) WFLYEJB0473: JNDI bindings for session bean named 'AuthorizationService' in deployment unit 'subdeployment "authorization-service-core-1.1.1.jar" of deployment "authorization-service-1.1.1.ear"' are as follows:
java:global/authorization-service-1.1.1/authorization-service-core-1.1.1/AuthorizationService!org.drake.authorization.ejb.AuthorizationService
java:app/authorization-service-core-1.1.1/AuthorizationService!org.drake.authorization.ejb.AuthorizationService
java:module/AuthorizationService!org.drake.authorization.ejb.AuthorizationService
java:global/authorization-service-1.1.1/authorization-service-core-1.1.1/AuthorizationService!org.drake.authorization.ejb.AuthorizationServiceHome
java:app/authorization-service-core-1.1.1/AuthorizationService!org.drake.authorization.ejb.AuthorizationServiceHome
java:module/AuthorizationService!org.drake.authorization.ejb.AuthorizationServiceHome
19:13:01,119 INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-5) WFLYEJB0473: JNDI bindings for session bean named 'AuthorizationAdminService' in deployment unit 'subdeployment "authorization-service-core-1.1.1.jar" of deployment "authorization-service-1.1.1.ear"' are as follows:
java:global/authorization-service-1.1.1/authorization-service-core-1.1.1/AuthorizationAdminService!org.drake.authorization.ejb.AuthorizationAdminService
java:app/authorization-service-core-1.1.1/AuthorizationAdminService!org.drake.authorization.ejb.AuthorizationAdminService
java:module/AuthorizationAdminService!org.drake.authorization.ejb.AuthorizationAdminService
java:global/authorization-service-1.1.1/authorization-service-core-1.1.1/AuthorizationAdminService!org.drake.authorization.ejb.AuthorizationAdminServiceHome
java:app/authorization-service-core-1.1.1/AuthorizationAdminService!org.drake.authorization.ejb.AuthorizationAdminServiceHome
java:module/AuthorizationAdminService!org.drake.authorization.ejb.AuthorizationAdminServiceHome
19:13:01,124 INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-5) WFLYEJB0473: JNDI bindings for session bean named 'AccountService' in deployment unit 'subdeployment "authorization-service-core-1.1.1.jar" of deployment "authorization-service-1.1.1.ear"' are as follows:
java:global/authorization-service-1.3.3/authorization-service-core-1.1.1/AccountService!org.drake.authorization.ejb.AccountService
java:app/authorization-service-core-1.1.1/AccountService!org.drake.authorization.ejb.AccountService
java:module/AccountService!org.drake.authorization.ejb.AccountService
java:global/authorization-service-1.3.3/authorization-service-core-1.1.1/AccountService!org.drake.authorization.ejb.AccountServiceHome
java:app/authorization-service-core-1.1.1/AccountService!org.drake.authorization.ejb.AccountServiceHome
java:module/AccountService!org.drake.authorization.ejb.AccountServiceHome
Jede Hilfe würde sehr geschätzt werden. Ich habe versucht, den JNDI-Namen zu Java:/global zu ändern.
Haben Sie versucht, einfach den globalen JNDI-Namen zu platzieren, den WilFly gedruckt hat: 'java: global/authorization-service-1.1.1/autorisierung-service-core-1.1.1/AuthorizationService! Org.drake.authorization.ejb. AuthorizationServiceHome'? – aribeiro