[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-3034) EJB Stateless Session Bean Injection using @In Glassfish server

Senthilkumar Muthusamy (JIRA) jira-events at lists.jboss.org
Fri May 23 15:23:42 EDT 2008


     [ http://jira.jboss.com/jira/browse/JBSEAM-3034?page=all ]

Senthilkumar Muthusamy updated JBSEAM-3034:
-------------------------------------------

    Description: 
I have 2 stateless ejbs, from MasterBean and SlaveBean, i am trying inject SlaveBeanusing @In annotation. I got below exception 
Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: slave
	at org.jboss.seam.Component.newInstance(Component.java:1970)
	at org.jboss.seam.Component.getInstance(Component.java:1873)
	at org.jboss.seam.Component.getInstance(Component.java:1840)
	at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2182)
	at org.jboss.seam.Component.getValueToInject(Component.java:2134)
	at org.jboss.seam.Component.injectAttributes(Component.java:1598)
	at org.jboss.seam.Component.inject(Component.java:1416)
	at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:118)
	at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
	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 com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:579)
	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:483)
	at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:205)
	at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3978)
	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:197)
	... 53 more
Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/evolve/SlaveBean/local
	at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:834)
	at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
	at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:396)
	at javax.naming.InitialContext.lookup(InitialContext.java:392)
	at org.jboss.seam.Component.instantiateSessionBean(Component.java:1287)
	at org.jboss.seam.Component.instantiate(Component.java:1273)
	at org.jboss.seam.Component.newInstance(Component.java:1966)
	... 78 more

Please look at the below link for more details and how to reproduce.
http://www.seamframework.org/Community/AuthenticationUsingSeamRemoting
http://www.seamframework.org/Community/EJBSLSBInjectionIssues



  was:
I have 2 stateless ejbs, from ejb1, i am trying inject ejb2 using @In annotation. I got below exception 
Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: slave
	at org.jboss.seam.Component.newInstance(Component.java:1970)
	at org.jboss.seam.Component.getInstance(Component.java:1873)
	at org.jboss.seam.Component.getInstance(Component.java:1840)
	at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2182)
	at org.jboss.seam.Component.getValueToInject(Component.java:2134)
	at org.jboss.seam.Component.injectAttributes(Component.java:1598)
	at org.jboss.seam.Component.inject(Component.java:1416)
	at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:118)
	at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
	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 com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:579)
	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:483)
	at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:205)
	at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3978)
	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:197)
	... 53 more
Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/evolve/SlaveBean/local
	at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:834)
	at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
	at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:396)
	at javax.naming.InitialContext.lookup(InitialContext.java:392)
	at org.jboss.seam.Component.instantiateSessionBean(Component.java:1287)
	at org.jboss.seam.Component.instantiate(Component.java:1273)
	at org.jboss.seam.Component.newInstance(Component.java:1966)
	... 78 more

Please look at the below link for more details and how to reproduce.
http://www.seamframework.org/Community/AuthenticationUsingSeamRemoting
http://www.seamframework.org/Community/EJBSLSBInjectionIssues





@Stateless
@Name("master")
public class MasterBean implements MasterLocal {
    @In(create=true)
/*    @EJB */
    SlaveLocal slave;
     @WebRemote
    public void checkDetails() {
        System.out.println("checkDetails called with @In");
        slave.asignedWork();
    }
 
}
-------------------------------------------------------------
@Stateless
@Name("slave")
public class SlaveBean implements SlaveLocal {

    public void asignedWork() {
        System.out.println("Asigned work called.");
    }

}
---------------------------------------------------
ejb reference in web.xml 

    <ejb-local-ref>
        <ejb-ref-name>evolve/MasterBean/local</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local>seam.test.ejb.MasterLocal</local>
        <ejb-link>MasterBean</ejb-link>
    </ejb-local-ref>
    <ejb-local-ref>
        <ejb-ref-name>evolve/SlaveBean/local</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local>seam.test.ejb.SlaveLocal</local>
        <ejb-link>SlaveBean</ejb-link>
    </ejb-local-ref>
---------------------------------------------------
components.xml 
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
            xmlns:core="http://jboss.com/products/seam/core"
            xmlns:security="http://jboss.com/products/seam/security"
            xmlns:transaction="http://jboss.com/products/seam/transaction"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation=
                "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd 
                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
                 http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">

    <core:init jndi-pattern="java:comp/env/evolve/#{ejbName}/local" debug="true"/>    

    <transaction:ejb-transaction/>

    <core:manager conversation-timeout="120000" 
                  concurrent-request-timeout="500"
                  conversation-id-parameter="cid"/>

    <component name="org.jboss.seam.remoting.remoting">
      <property name="debug">true</property>
    </component>
    <security:identity authenticate-method="#{serviceAuthenticator.authenticate}"/> 

</components>

Ejbs are enlisted under JNDI java:comp/env/evolve/MasterBean/local and java:comp/env/evolve/SlaveBean/local. It can be tested using plain jsp like below


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <%@ page import="dummy.com.*, javax.naming.*, evolve.user.ejb.*,seam.test.ejb.*, org.jboss.seam.*" %>

</head>
<body>
<%
	        InitialContext ctx;
        try {
            ctx = new InitialContext();
          //  MasterLocal nr = (MasterLocal) Component.getInstance("master") ;
          //MasterLocal nr = (MasterLocal) ctx.lookup("java:comp/env/evolve/MasterBean/local");          
          SlaveLocal sl = (SlaveLocal) ctx.lookup("java:comp/env/evolve/SlaveBean/local");          
          
        System.out.println("SlaveLocal--->" + sl);
            sl.asignedWork();
//        System.out.println("MasterLocal--->" + nr);
//            nr.checkDetails();
            
        } catch (Exception ex) {
           ex.printStackTrace();
        }



%>
Tested InitialContext1.....
</body>

</html>

> EJB Stateless Session Bean Injection using @In Glassfish server 
> ----------------------------------------------------------------
>
>                 Key: JBSEAM-3034
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-3034
>             Project: Seam
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.1.GA
>         Environment: Glassfish Application Server V2ur2
>            Reporter: Senthilkumar Muthusamy
>            Priority: Critical
>
> I have 2 stateless ejbs, from MasterBean and SlaveBean, i am trying inject SlaveBeanusing @In annotation. I got below exception 
> Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: slave
> 	at org.jboss.seam.Component.newInstance(Component.java:1970)
> 	at org.jboss.seam.Component.getInstance(Component.java:1873)
> 	at org.jboss.seam.Component.getInstance(Component.java:1840)
> 	at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2182)
> 	at org.jboss.seam.Component.getValueToInject(Component.java:2134)
> 	at org.jboss.seam.Component.injectAttributes(Component.java:1598)
> 	at org.jboss.seam.Component.inject(Component.java:1416)
> 	at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
> 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> 	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
> 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> 	at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
> 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> 	at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
> 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> 	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:118)
> 	at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
> 	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 com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:579)
> 	at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:483)
> 	at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:205)
> 	at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3978)
> 	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:197)
> 	... 53 more
> Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/evolve/SlaveBean/local
> 	at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:834)
> 	at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
> 	at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:396)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:392)
> 	at org.jboss.seam.Component.instantiateSessionBean(Component.java:1287)
> 	at org.jboss.seam.Component.instantiate(Component.java:1273)
> 	at org.jboss.seam.Component.newInstance(Component.java:1966)
> 	... 78 more
> Please look at the below link for more details and how to reproduce.
> http://www.seamframework.org/Community/AuthenticationUsingSeamRemoting
> http://www.seamframework.org/Community/EJBSLSBInjectionIssues

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list