I wonder how object (if it matter I need EJB) can be plugged to JBoss (5.0) with JNDI?
I have following bean definition in my Spring applicationContext.xml:
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<context:annotation-config/>
<bean id="myServiceFacade" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="MyServiceFacadeBean/remote"/>
<property name="cache" value="true"/>
<property name="lookupOnStartup" value="true"/>
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory
</prop>
<prop key="java.naming.provider.url">localhost:1099</prop>
<prop key="java.naming.factory.url.pkgs">org.jboss.naming:org.jnp.interfaces
</prop>
</props>
</property>
<property name="proxyInterface" value="my.company.service.facade.MyServiceFacade"/>
</bean>
when I try to run JBoss I get:
Caused by: javax.naming.NameNotFoundException: MyServiceFacadeBean/remote
at org.jboss.ha.jndi.HAJNDI.lookupRemotely(HAJNDI.java:264)
at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:205)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:318)
at $Proxy165.lookup(Unknown Source)
Maybe some additional steps should be made for registering objects with JBoss/JNDI?
Note, I've tried already to put ejb specific files to JBoss (jboss.xml, ejb-jar.xml) but that doesn't help.