Hi,
When I'm trying to obtain remote reference to EJB usind JNDI or remote-slsb the following error occurs:
Here is code (very simple):Code:Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 19 in XML document from class path resource [pl/edu/uj/spring/ejb/remote/context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jee:jndi-lookup'.
Code:package pl.edu.uj.spring.ejb.remote; import javax.ejb.Stateless; @Stateless public class MyBean implements MyRemoteBean { public String getSomeString() { return "SOME STRING"; } }Code:package pl.edu.uj.spring.ejb.remote; import javax.ejb.Remote; @Remote public interface MyRemoteBean { String getSomeString(); }Code:package pl.edu.uj.spring.ejb.remote; public class MySpringComponent { private MyRemoteBean myBeanRemoteReference; public void setMyBeanRemoteReference(MyRemoteBean bean) { this.myBeanRemoteReference = bean; } public String service() { return myBeanRemoteReference.getSomeString(); } }Code:package pl.edu.uj.spring.ejb.remote; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class SpringApplication { public static void main(String[] args) { ApplicationContext ctx = new ClassPathXmlApplicationContext("pl/edu/uj/spring/ejb/remote/context.xml"); MySpringComponent component = ctx.getBean("mySpringComponent", MySpringComponent.class); System.out.println(component.service()); } }Code:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tool="http://www.springframework.org/schema/tool/" xmlns:jee="http://www.springframework.org/schema/jee" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <!-- remote-slsb also doesn't work. the same exception :( org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jee:remote-slsb' <jee:remote-slsb id="myStatelessRemoteBean" jndi-name="MyBean/remote" business-interface="pl.edu.uj.spring.ejb.remote.MyRemoteBean"/> --> <jee:jndi-lookup id="myStatelessRemoteBean" jndi-name="MyBean/remote"/> <bean id="myComponent" class="pl.edu.uj.spring.ejb.remote.MySpringComponent"> <property name="myBeanRemoteReference"> <ref local="myStatelessRemoteBean"/> </property> </bean> </beans>
I'm using the lates version of Spring framework (3.0.3) and (if it has any impact) IntelliJ IDEA. What I did wrong?
Thanks in advance!


Reply With Quote
