Ok I have had a look at passivation of JNDI ENC references, here is the session 
bean that I have created: -

package com.darranl.encstateful.implementation;
  | 
  | import javax.ejb.CreateException;
  | import javax.ejb.EJBException;
  | import javax.ejb.SessionBean;
  | import javax.ejb.SessionContext;
  | import javax.naming.Context;
  | import javax.naming.InitialContext;
  | import javax.naming.NamingException;
  | 
  | /**
  |  * 
  |  * @author Darran L
  |  */
  | public class ENCStatefulBean implements SessionBean {
  | 
  |   /** */
  |   private static final long serialVersionUID = 3257283621751632952L;
  | 
  |   /** */
  |   private SessionContext ejbContext;
  | 
  |   /** */
  |   private Context jndiContext;
  | 
  |   /** */
  |   private String message;
  | 
  |   /**
  |    * 
  |    * @throws CreateException
  |    */
  |   public void ejbCreate() {
  |     message = "";
  |   }
  | 
  |   public void addString(final String string) {
  |     message += string;
  |   }
  | 
  |   public String getString() {
  |     return message;
  |   }
  | 
  |   /**
  |    * @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
  |    */
  |   public void setSessionContext(final SessionContext ejbContext) {
  |     this.ejbContext = ejbContext;
  |     try {
  |       Context ctx = new InitialContext();
  |       jndiContext = (Context) ctx.lookup("java:comp/env");
  |     } catch (NamingException e) {
  |       throw new EJBException("Unable to lookup JNDI Context", e);
  |     }
  |   }
  | 
  |   /**
  |    * @see javax.ejb.SessionBean#ejbRemove()
  |    */
  |   public void ejbRemove() {
  |   }
  | 
  |   /**
  |    * @see javax.ejb.SessionBean#ejbActivate()
  |    */
  |   public void ejbActivate() {
  |     System.out.println("ejbActivate");
  |   }
  | 
  |   /**
  |    * @see javax.ejb.SessionBean#ejbPassivate()
  |    */
  |   public void ejbPassivate() {
  |     System.out.println("ejbPassivate");
  |   }
  | 
  | }

My client calls create followed by addString, the client then waits long enough 
for the bean to be passivated.

The bean is passivated with no error.

The client then calls the getString method, the bean is activated correctly and 
the string is returned.

In all of this not a single error is reported.

Can you please post the full code of your session bean and the error that you 
are getting.


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3871048#3871048

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3871048


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to