You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Andy Gumbrecht (JIRA)" <ji...@apache.org> on 2010/03/31 20:17:27 UTC

[jira] Created: (OPENEJB-1249) SimpleServiceManager.stop() not processing ResourceAdapters

SimpleServiceManager.stop() not processing ResourceAdapters
-----------------------------------------------------------

                 Key: OPENEJB-1249
                 URL: https://issues.apache.org/jira/browse/OPENEJB-1249
             Project: OpenEJB
          Issue Type: Bug
          Components: server
    Affects Versions: 3.1.3
         Environment: NA
            Reporter: Andy Gumbrecht
             Fix For: 3.1.3


SimpleServiceManager.stop() not processing ResourceAdapters on a standalone remote stop due an oversight.

Current implementation calls containerSystem.getJNDIContext().listBindings("openejb/resourceAdapters"); and then hides the naming exception.

The following snippet resolves this issue, and also checks for instances of ResourceAdapter.

try {
            ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
            NamingEnumeration<Binding> namingEnumeration = null;

            try {
                namingEnumeration = containerSystem.getJNDIContext().listBindings("openejb/Resource");
            } catch (NamingException ignored) {
                logger.debug("No resource adapters were created");
            }

            if (namingEnumeration != null) {

                while (namingEnumeration.hasMoreElements()) {

                    Binding binding = namingEnumeration.nextElement();
                    Object object = binding.getObject();

                    if (object instanceof ResourceAdapter) {

                        ResourceAdapter resourceAdapter = (ResourceAdapter) object;

                        logger.debug("Stopping ResourceAdapter: " + binding.getName());

                        try {
                            resourceAdapter.stop();
                        } catch (Exception e) {
                            logger.fatal("ResourceAdapter Shutdown Failed: " + binding.getName(), e);
                        }
                    }
                }

            } else {
                logger.warning("No resources were found");
            }
        } catch (Throwable e) {
            logger.fatal("Unable to get ResourceAdapters from JNDI.  Stop must be called on them for proper vm shutdown.", e);
        } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENEJB-1249) SimpleServiceManager.stop() not processing ResourceAdapters

Posted by "Andy Gumbrecht (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-1249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Gumbrecht updated OPENEJB-1249:
------------------------------------

    Attachment: SSM Patch.patch

Fix for this issue

> SimpleServiceManager.stop() not processing ResourceAdapters
> -----------------------------------------------------------
>
>                 Key: OPENEJB-1249
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1249
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.1.3
>         Environment: NA
>            Reporter: Andy Gumbrecht
>             Fix For: 3.1.3
>
>         Attachments: SSM Patch.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> SimpleServiceManager.stop() not processing ResourceAdapters on a standalone remote stop due an oversight.
> Current implementation calls containerSystem.getJNDIContext().listBindings("openejb/resourceAdapters"); and then hides the naming exception.
> The following snippet resolves this issue, and also checks for instances of ResourceAdapter.
> try {
>             ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
>             NamingEnumeration<Binding> namingEnumeration = null;
>             try {
>                 namingEnumeration = containerSystem.getJNDIContext().listBindings("openejb/Resource");
>             } catch (NamingException ignored) {
>                 logger.debug("No resource adapters were created");
>             }
>             if (namingEnumeration != null) {
>                 while (namingEnumeration.hasMoreElements()) {
>                     Binding binding = namingEnumeration.nextElement();
>                     Object object = binding.getObject();
>                     if (object instanceof ResourceAdapter) {
>                         ResourceAdapter resourceAdapter = (ResourceAdapter) object;
>                         logger.debug("Stopping ResourceAdapter: " + binding.getName());
>                         try {
>                             resourceAdapter.stop();
>                         } catch (Exception e) {
>                             logger.fatal("ResourceAdapter Shutdown Failed: " + binding.getName(), e);
>                         }
>                     }
>                 }
>             } else {
>                 logger.warning("No resources were found");
>             }
>         } catch (Throwable e) {
>             logger.fatal("Unable to get ResourceAdapters from JNDI.  Stop must be called on them for proper vm shutdown.", e);
>         } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENEJB-1249) SimpleServiceManager.stop() not processing ResourceAdapters

Posted by "David Blevins (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-1249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Blevins updated OPENEJB-1249:
-----------------------------------

    Attachment: Server.java.patch

> SimpleServiceManager.stop() not processing ResourceAdapters
> -----------------------------------------------------------
>
>                 Key: OPENEJB-1249
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1249
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.1.3
>         Environment: NA
>            Reporter: Andy Gumbrecht
>             Fix For: 3.1.3
>
>         Attachments: Server.java.patch, SSM Patch.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> SimpleServiceManager.stop() not processing ResourceAdapters on a standalone remote stop due an oversight.
> Current implementation calls containerSystem.getJNDIContext().listBindings("openejb/resourceAdapters"); and then hides the naming exception.
> The following snippet resolves this issue, and also checks for instances of ResourceAdapter.
> try {
>             ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
>             NamingEnumeration<Binding> namingEnumeration = null;
>             try {
>                 namingEnumeration = containerSystem.getJNDIContext().listBindings("openejb/Resource");
>             } catch (NamingException ignored) {
>                 logger.debug("No resource adapters were created");
>             }
>             if (namingEnumeration != null) {
>                 while (namingEnumeration.hasMoreElements()) {
>                     Binding binding = namingEnumeration.nextElement();
>                     Object object = binding.getObject();
>                     if (object instanceof ResourceAdapter) {
>                         ResourceAdapter resourceAdapter = (ResourceAdapter) object;
>                         logger.debug("Stopping ResourceAdapter: " + binding.getName());
>                         try {
>                             resourceAdapter.stop();
>                         } catch (Exception e) {
>                             logger.fatal("ResourceAdapter Shutdown Failed: " + binding.getName(), e);
>                         }
>                     }
>                 }
>             } else {
>                 logger.warning("No resources were found");
>             }
>         } catch (Throwable e) {
>             logger.fatal("Unable to get ResourceAdapters from JNDI.  Stop must be called on them for proper vm shutdown.", e);
>         } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OPENEJB-1249) SimpleServiceManager.stop() not processing ResourceAdapters

Posted by "David Blevins (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-1249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Blevins closed OPENEJB-1249.
----------------------------------

      Assignee: Andy Gumbrecht
    Resolution: Fixed

Committed the Server.java version that undeploys all apps and stops all resource adapters.

> SimpleServiceManager.stop() not processing ResourceAdapters
> -----------------------------------------------------------
>
>                 Key: OPENEJB-1249
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1249
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.1.3
>         Environment: NA
>            Reporter: Andy Gumbrecht
>            Assignee: Andy Gumbrecht
>             Fix For: 3.1.3
>
>         Attachments: Server.java.patch, SSM Patch.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> SimpleServiceManager.stop() not processing ResourceAdapters on a standalone remote stop due an oversight.
> Current implementation calls containerSystem.getJNDIContext().listBindings("openejb/resourceAdapters"); and then hides the naming exception.
> The following snippet resolves this issue, and also checks for instances of ResourceAdapter.
> try {
>             ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
>             NamingEnumeration<Binding> namingEnumeration = null;
>             try {
>                 namingEnumeration = containerSystem.getJNDIContext().listBindings("openejb/Resource");
>             } catch (NamingException ignored) {
>                 logger.debug("No resource adapters were created");
>             }
>             if (namingEnumeration != null) {
>                 while (namingEnumeration.hasMoreElements()) {
>                     Binding binding = namingEnumeration.nextElement();
>                     Object object = binding.getObject();
>                     if (object instanceof ResourceAdapter) {
>                         ResourceAdapter resourceAdapter = (ResourceAdapter) object;
>                         logger.debug("Stopping ResourceAdapter: " + binding.getName());
>                         try {
>                             resourceAdapter.stop();
>                         } catch (Exception e) {
>                             logger.fatal("ResourceAdapter Shutdown Failed: " + binding.getName(), e);
>                         }
>                     }
>                 }
>             } else {
>                 logger.warning("No resources were found");
>             }
>         } catch (Throwable e) {
>             logger.fatal("Unable to get ResourceAdapters from JNDI.  Stop must be called on them for proper vm shutdown.", e);
>         } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENEJB-1249) Undeploy apps and stop ResourceAdapters on shutdown

Posted by "Andy Gumbrecht (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-1249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Gumbrecht updated OPENEJB-1249:
------------------------------------

    Attachment: OPENEJB-1249.patch

With ASF inclusion ...oops.

> Undeploy apps and stop ResourceAdapters on shutdown
> ---------------------------------------------------
>
>                 Key: OPENEJB-1249
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1249
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.1.3
>         Environment: NA
>            Reporter: Andy Gumbrecht
>            Assignee: Andy Gumbrecht
>             Fix For: 3.1.3
>
>         Attachments: OPENEJB-1249.patch, OPENEJB-1249.patch, Server.java.patch, SSM Patch.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> SimpleServiceManager.stop() not processing ResourceAdapters on a standalone remote stop due an oversight.
> Current implementation calls containerSystem.getJNDIContext().listBindings("openejb/resourceAdapters"); and then hides the naming exception.
> The following snippet resolves this issue, and also checks for instances of ResourceAdapter.
> try {
>             ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
>             NamingEnumeration<Binding> namingEnumeration = null;
>             try {
>                 namingEnumeration = containerSystem.getJNDIContext().listBindings("openejb/Resource");
>             } catch (NamingException ignored) {
>                 logger.debug("No resource adapters were created");
>             }
>             if (namingEnumeration != null) {
>                 while (namingEnumeration.hasMoreElements()) {
>                     Binding binding = namingEnumeration.nextElement();
>                     Object object = binding.getObject();
>                     if (object instanceof ResourceAdapter) {
>                         ResourceAdapter resourceAdapter = (ResourceAdapter) object;
>                         logger.debug("Stopping ResourceAdapter: " + binding.getName());
>                         try {
>                             resourceAdapter.stop();
>                         } catch (Exception e) {
>                             logger.fatal("ResourceAdapter Shutdown Failed: " + binding.getName(), e);
>                         }
>                     }
>                 }
>             } else {
>                 logger.warning("No resources were found");
>             }
>         } catch (Throwable e) {
>             logger.fatal("Unable to get ResourceAdapters from JNDI.  Stop must be called on them for proper vm shutdown.", e);
>         } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENEJB-1249) Undeploy apps and stop ResourceAdapters on shutdown

Posted by "Andy Gumbrecht (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-1249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Gumbrecht updated OPENEJB-1249:
------------------------------------

    Attachment: OPENEJB-1249.patch

This call returns a 'null' object as a/the Server.class instance is never registered with the SystemInstance.
Server server = SystemInstance.get().getComponent(Server.class);


Server.stop() call should call manager.stop(); 'after' OpenEJB.destroy(); as this initiates a vm shutdown.

This patch resolves the above issues.


> Undeploy apps and stop ResourceAdapters on shutdown
> ---------------------------------------------------
>
>                 Key: OPENEJB-1249
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1249
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.1.3
>         Environment: NA
>            Reporter: Andy Gumbrecht
>            Assignee: Andy Gumbrecht
>             Fix For: 3.1.3
>
>         Attachments: OPENEJB-1249.patch, Server.java.patch, SSM Patch.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> SimpleServiceManager.stop() not processing ResourceAdapters on a standalone remote stop due an oversight.
> Current implementation calls containerSystem.getJNDIContext().listBindings("openejb/resourceAdapters"); and then hides the naming exception.
> The following snippet resolves this issue, and also checks for instances of ResourceAdapter.
> try {
>             ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
>             NamingEnumeration<Binding> namingEnumeration = null;
>             try {
>                 namingEnumeration = containerSystem.getJNDIContext().listBindings("openejb/Resource");
>             } catch (NamingException ignored) {
>                 logger.debug("No resource adapters were created");
>             }
>             if (namingEnumeration != null) {
>                 while (namingEnumeration.hasMoreElements()) {
>                     Binding binding = namingEnumeration.nextElement();
>                     Object object = binding.getObject();
>                     if (object instanceof ResourceAdapter) {
>                         ResourceAdapter resourceAdapter = (ResourceAdapter) object;
>                         logger.debug("Stopping ResourceAdapter: " + binding.getName());
>                         try {
>                             resourceAdapter.stop();
>                         } catch (Exception e) {
>                             logger.fatal("ResourceAdapter Shutdown Failed: " + binding.getName(), e);
>                         }
>                     }
>                 }
>             } else {
>                 logger.warning("No resources were found");
>             }
>         } catch (Throwable e) {
>             logger.fatal("Unable to get ResourceAdapters from JNDI.  Stop must be called on them for proper vm shutdown.", e);
>         } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENEJB-1249) Undeploy apps and stop ResourceAdapters on shutdown

Posted by "David Blevins (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENEJB-1249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Blevins updated OPENEJB-1249:
-----------------------------------

    Summary: Undeploy apps and stop ResourceAdapters on shutdown  (was: SimpleServiceManager.stop() not processing ResourceAdapters)

> Undeploy apps and stop ResourceAdapters on shutdown
> ---------------------------------------------------
>
>                 Key: OPENEJB-1249
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1249
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.1.3
>         Environment: NA
>            Reporter: Andy Gumbrecht
>            Assignee: Andy Gumbrecht
>             Fix For: 3.1.3
>
>         Attachments: Server.java.patch, SSM Patch.patch
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> SimpleServiceManager.stop() not processing ResourceAdapters on a standalone remote stop due an oversight.
> Current implementation calls containerSystem.getJNDIContext().listBindings("openejb/resourceAdapters"); and then hides the naming exception.
> The following snippet resolves this issue, and also checks for instances of ResourceAdapter.
> try {
>             ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
>             NamingEnumeration<Binding> namingEnumeration = null;
>             try {
>                 namingEnumeration = containerSystem.getJNDIContext().listBindings("openejb/Resource");
>             } catch (NamingException ignored) {
>                 logger.debug("No resource adapters were created");
>             }
>             if (namingEnumeration != null) {
>                 while (namingEnumeration.hasMoreElements()) {
>                     Binding binding = namingEnumeration.nextElement();
>                     Object object = binding.getObject();
>                     if (object instanceof ResourceAdapter) {
>                         ResourceAdapter resourceAdapter = (ResourceAdapter) object;
>                         logger.debug("Stopping ResourceAdapter: " + binding.getName());
>                         try {
>                             resourceAdapter.stop();
>                         } catch (Exception e) {
>                             logger.fatal("ResourceAdapter Shutdown Failed: " + binding.getName(), e);
>                         }
>                     }
>                 }
>             } else {
>                 logger.warning("No resources were found");
>             }
>         } catch (Throwable e) {
>             logger.fatal("Unable to get ResourceAdapters from JNDI.  Stop must be called on them for proper vm shutdown.", e);
>         } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.