Thanks...Build the deployer from source & deployed...Jboss 5 Beta 3 does not deploy my
ejb 3's. I know this has nothing to do with spring deployer & also the wrong forum
but nevetheless posting it...Any ideas would be welcome. Surprising thing is that this
whole thing works without one line code change in jboss 4.2.1 GA.
Struts Action with Spring DI
public class SpringEjb3Action extends DispatchAction {
|
| private SayHello sayhello;
|
| public ActionForward sayHello(ActionMapping m, @SuppressWarnings("unused")
| ActionForm f, HttpServletRequest request, @SuppressWarnings("unused")
| HttpServletResponse response) throws Exception {
| request.setAttribute("greeting", getSayhello().sayHelloWithEjb3DI());
| request.setAttribute("result", getSayhello().calulate());
| request.setAttribute("person", getSayhello().getPerson());
| return m.findForward("results");
|
| }
|
| public SayHello getSayhello() {
| return this.sayhello;
| }
|
| public void setSayhello(SayHello sayhello) {
| this.sayhello = sayhello;
| }
2 ejb 3's
@Local
| public interface SayHello {
| public String sayHelloWithEjb3DI() throws SQLException;
|
| public IPerson getPerson();
|
| public double calulate();
| }
|
| @Local
| public interface Calculator {
| public double calculate(int i, int j);
| }
|
| bean
|
| @Stateful
| @TransactionAttribute(REQUIRED)
| @ExcludeDefaultInterceptors
| public class SayHelloBean extends SimpleJdbcDaoSupport implements SayHello {
|
| @Resource(name = "jdbc/TestDs", type = DataSource.class, shareable = true,
mappedName = "java:jdbc/OracleDS")
| private DataSource ds;
|
| @EJB(beanName = "CalculatorBean")
| private Calculator calculator;
|
| @Resource(name = "sqlForEjb")
| private String sql;
|
| @Spring(jndiName = "spring-inject", bean = "person")
| private IPerson p;
|
| public String sayHelloWithEjb3DI() {
| return "Testing ejb3 DI & your age is "
| + getSimpleJdbcTemplate().queryForInt(sql);
| }
|
| public double calulate() {
| return calculator.calculate(2, 3);
| }
|
| @PostConstruct
| public void init() {
| setDataSource(ds);
| }
|
| @PreDestroy
| public void callThis() {
| System.out.println("Invoking method: preDestroy()");
| }
|
| public IPerson getPerson() {
| return this.p;
| }
|
| @Stateless
| @TransactionAttribute(REQUIRED)
| @ExcludeDefaultInterceptors
| public class CalculatorBean implements Calculator {
|
| public double calculate(int i, int j) {
| return i + j;
| }
|
| }
spring-ejb3.xml
|
| <?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: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/jee
http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
|
| <bean name="/home" class="com.ejb3.action.SpringEjb3Action"
| autowire="byName">
| <property name="sayhello"
ref="ejbLocalIntf"></property>
| </bean>
| <!-- Jboss 4.2 look up of ejb3 -->
| <jee:jndi-lookup id="ejbLocalIntf"
jndi-name="Ejb3/SayHelloBean/local" />
| </beans>
Error in Jboss 5 deployment
org.jboss.deployers.spi.DeploymentException: Error deploying Ejb3.jar: Error creating ejb
container CalculatorBean: java.lang.RuntimeException: Unable to load class for annotation
org.jboss.annotation.ejb.PoolClass using class loader
org.jboss.mx.loading.UnifiedClassLoader3@b8ec9b{
url=vfsfile:/C:/jboss-5.0.0.Beta3/server/default/deploy/Ejb3.ear ,addedOrder=21}
Surprising this is that this whole thing works like a charm in jboss 4.2.1, tried jboss 5
Beta 2, Beta 3 & still no success.......
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115250#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...