Hi all!
Please can you tell me what's wrong or what Im am missing in order to access EJB within Spring?
here's my applicaation context file:
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:p="http://www.springframework.org/schema/p"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:context="http://www.springframework.org/schema/context"
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
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
<!--
<context:component-scan base-package="sk.skhplus.retail.controller" />
<jee:local-slsb id="material"
jndi-name="skh-retail/MaterialDaoBean"
business-interface="sk.skhplus.core.material.ejb.intf.MaterialDaoLocal"/>
-->
<bean id="hello" class="sk.skhplus.retail.controller.HelloWorldController"></bean>
<bean id="data" class="sk.skhplus.retail.controller.DataSourceController"></bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="materialBean"
class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
<property name="jndiName" value="skh-retail/MaterialDaoBean" />
<property name="businessInterface" value="sk.skhplus.core.material.ejb.intf.MaterialDaoLocal"/>
<property name="resourceRef" value="true" />
</bean>
<bean id="dataSource"
class="sk.skhplus.retail.controller.DataSourceController">
<property name="materialDaoBean" ref="materialBean" />
</bean>
</beans>
and here is what jBoss is saying:
I know this is perhaps trivial, but Im newbie in spring and I need this for my project. As I have read articles about accessing EJBs that declarations should be enought.Code:11:20:13,152 INFO [DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7796af5d: defining beans [hello,data,viewResolver,materialBean,dataSource]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@5f890954
11:20:13,152 ERROR [DispatcherServlet] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/springmvc-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type '$Proxy280 implementing sk.skhplus.core.material.ejb.intf.MaterialDaoLocal,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'sk.skhplus.core.material.ejb.MaterialDaoBean' for property 'materialDaoBean'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [$Proxy280 implementing sk.skhplus.core.material.ejb.intf.MaterialDaoLocal,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [sk.skhplus.core.material.ejb.MaterialDaoBean] for property 'materialDaoBean': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
excuse my english, its not my primary language .
Thanks for help!
