<!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.&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Remote interface: </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; package ejbserver.session.test;&#160; </p><p>&#160;&#160;&#160; import javax.ejb.Remote;&#160; </p><p>&#160;&#160;&#160; import javax.ejb.Remove;&#160; </p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; @Remote&#160; </p><p>&#160;&#160;&#160; public interface TestStateful {&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void test();&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; @Remove&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void remove();&#160; </p><p>&#160;&#160;&#160; } </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Stateful bean:&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; package ejbserver.session.test;&#160; </p><p>&#160;&#160;&#160; import javax.annotation.PreDestroy;&#160; </p><p>&#160;&#160;&#160; import javax.ejb.Remove;&#160; </p><p>&#160;&#160;&#160; import javax.ejb.Stateful;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; @Stateful </p><p>&#160;&#160;&#160; public class TestStatefulBean implements TestStateful {</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;@Override</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public void test() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;System.out.println("test");</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;@Override</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;@Remove</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public void remove() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;System.out.println("remove");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;@PreDestroy</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public void predestroy(){</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;System.out.println("predestroy");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Test client:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; package testclient;&#160; </p><p>&#160;&#160;&#160; import java.security.Security;&#160;&#160; </p><p>&#160;&#160;&#160; import java.util.Hashtable;&#160; </p><p>&#160;&#160;&#160; import javax.jms.JMSException;&#160; </p><p>&#160;&#160;&#160; import javax.naming.Context;&#160; </p><p>&#160;&#160;&#160; import javax.naming.InitialContext;&#160; </p><p>&#160;&#160;&#160; import javax.naming.NamingException;&#160; </p><p>&#160;&#160;&#160; import org.apache.log4j.BasicConfigurator;&#160; </p><p>&#160;&#160;&#160; import org.jboss.sasl.JBossSaslProvider;&#160; </p><p>&#160;&#160;&#160; import ejbserver.FacadeFactory;&#160; </p><p>&#160;&#160;&#160; import ejbserver.session.test.TestStateful;&#160; </p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160; public class Main {</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private static final String appName = "JBossModules";</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private static final String moduleName = "EjbModule";</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private static final String distinctName = "";</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;static {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Security.addProvider(new JBossSaslProvider());</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private static Context getInitialContext() throws NamingException {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Hashtable&lt;String, String&gt; environment = new Hashtable&lt;String, String&gt;();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;environment.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return new InitialContext(environment);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;} </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private static String getStatelessConnectionString(Class&lt;?&gt; facadeClass) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;final String beanName = facadeClass.getSimpleName() + "Bean";</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;final String viewClassName = facadeClass.getName();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private static String getStatefullConnectionString(Class&lt;?&gt; facadeClass) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return getStatelessConnectionString(facadeClass)+"?stateful";</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p>&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public static void main(String[] args) throws NamingException, JMSException {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;BasicConfigurator.configure();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;TestStateful remote = (TestStateful) getInitialContext().lookup(getStatefullConnectionString(TestStateful.class));</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;remote.test();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;remote.remove();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;} </p><p>&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>But when I run the client, I see the following log:&#160; </p><p>&#160;&#160;&#160; 12:20:20,163 INFO&#160; [stdout] (pool-8-thread-2) test&#160; </p><p>&#160;&#160;&#160; 12:20:20,194 INFO&#160; [stdout] (pool-8-thread-3) remove&#160; </p><p>&#160;&#160;&#160; 12:20:20,194 WARN&#160; [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]}&#160; </p><p>&#160;&#160;&#160; 12:20:20,194 INFO&#160; [stdout] (pool-8-thread-3) predestroy</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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>