<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Strange warning when ejb 3 stateful bean removing on JBossAS7.1
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/denis.pavlishin">Denis Pavlishin</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/641245#641245">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi! I deploy my simple stateful bean on JBossAS7.1.  </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Remote interface: </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    package ejbserver.session.test;  </p><p>    import javax.ejb.Remote;  </p><p>    import javax.ejb.Remove;  </p><p>    </p><p>    @Remote  </p><p>    public interface TestStateful {  </p><p>        public void test();  </p><p>        @Remove  </p><p>        public void remove();  </p><p>    } </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Stateful bean:  </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    package ejbserver.session.test;  </p><p>    import javax.annotation.PreDestroy;  </p><p>    import javax.ejb.Remove;  </p><p>    import javax.ejb.Stateful;      </p><p>    </p><p>    @Stateful </p><p>    public class TestStatefulBean implements TestStateful {</p><p>    </p><p>              @Override</p><p>              public void test() {</p><p>                        System.out.println("test");</p><p>    </p><p>              }</p><p>    </p><p>              @Override</p><p>              @Remove</p><p>              public void remove() {</p><p>                        System.out.println("remove");</p><p>              }</p><p>    </p><p>              @PreDestroy</p><p>              public void predestroy(){</p><p>                        System.out.println("predestroy");</p><p>              }</p><p>    </p><p>    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Test client:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    package testclient;  </p><p>    import java.security.Security;   </p><p>    import java.util.Hashtable;  </p><p>    import javax.jms.JMSException;  </p><p>    import javax.naming.Context;  </p><p>    import javax.naming.InitialContext;  </p><p>    import javax.naming.NamingException;  </p><p>    import org.apache.log4j.BasicConfigurator;  </p><p>    import org.jboss.sasl.JBossSaslProvider;  </p><p>    import ejbserver.FacadeFactory;  </p><p>    import ejbserver.session.test.TestStateful;  </p><p>    </p><p>    public class Main {</p><p>          private static final String appName = "JBossModules";</p><p>          private static final String moduleName = "EjbModule";</p><p>          private static final String distinctName = "";</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>              static {</p><p>                        Security.addProvider(new JBossSaslProvider());</p><p>              }</p><p>    </p><p>              private static Context getInitialContext() throws NamingException {</p><p>                        Hashtable<String, String> environment = new Hashtable<String, String>();</p><p>                        environment.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");</p><p>                        return new InitialContext(environment);</p><p>              } </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>          private static String getStatelessConnectionString(Class<?> facadeClass) {</p><p>                    final String beanName = facadeClass.getSimpleName() + "Bean";</p><p>                    final String viewClassName = facadeClass.getName();</p><p>                    return "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;</p><p>          }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>          private static String getStatefullConnectionString(Class<?> facadeClass) {</p><p>                    return getStatelessConnectionString(facadeClass)+"?stateful";</p><p>          }</p><p>    </p><p>              public static void main(String[] args) throws NamingException, JMSException {</p><p>                        BasicConfigurator.configure();</p><p>                        TestStateful remote = (TestStateful) getInitialContext().lookup(getStatefullConnectionString(TestStateful.class));</p><p>                        remote.test();</p><p>                        remote.remove();</p><p>              } </p><p>    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>But when I run the client, I see the following log:  </p><p>    12:20:20,163 INFO  [stdout] (pool-8-thread-2) test  </p><p>    12:20:20,194 INFO  [stdout] (pool-8-thread-3) remove  </p><p>    12:20:20,194 WARN  [org.jboss.as.ejb3] (pool-8-thread-3) JBAS014101: Could not find stateful bean to release {[-103, -76, 39, 39, 74, 102, 71, -83, -123, -27, 88, 87, 104, -93, 56, 61]}  </p><p>    12:20:20,194 INFO  [stdout] (pool-8-thread-3) predestroy</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>What this warning "Could not find stateful bean to release {[-103, -76, 39, 39, 74, 102, 71, -83, -123, -27, 88, 87, 104, -93, 56, 61]}" means and why the bean can't be finded?</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/641245#641245">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>