You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "David Jencks (JIRA)" <de...@geronimo.apache.org> on 2006/09/19 19:05:27 UTC

[jira] Created: (GERONIMO-2416) ProxyMethodInterceptor should work with classes that have start,stop methods

ProxyMethodInterceptor should work with classes that have start,stop methods
----------------------------------------------------------------------------

                 Key: GERONIMO-2416
                 URL: http://issues.apache.org/jira/browse/GERONIMO-2416
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: kernel
    Affects Versions: 1.2
            Reporter: David Jencks
         Assigned To: Dain Sundstrom
            Priority: Critical
             Fix For: 1.2


jetty6 components usually have lifecycle methods start,stop, and possibly others.  If we write a gbean extending these objects ProxyMethodInterceptor blows up with an ArrayIndexOutOfBoundsException (-1).  I don't understand why this happens, and there might be a different cause, but the gbeans that have this problem all extend jetty objects with start methods.

A really bad workaround that lets the server start is this patch:

Index: modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
===================================================================
--- modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (revision 447903)
+++ modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (working copy)
@@ -110,14 +110,29 @@
             invokers[getSuperIndex(proxyType, proxyType.getMethod("equals", new Class[]{Object.class}))] = new EqualsInvoke(kernel);
             invokers[getSuperIndex(proxyType, proxyType.getMethod("hashCode", null))] = new HashCodeInvoke();
             invokers[getSuperIndex(proxyType, proxyType.getMethod("toString", null))] = new ToStringInvoke(proxyType.getName());
-            if(GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
-                invokers[getSuperIndex(proxyType, proxyType.getMethod("getState", null))] = new GetStateInvoke(kernel);
-                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))] = new GetStateInstanceInvoke(kernel);
-                invokers[getSuperIndex(proxyType, proxyType.getMethod("start", null))] = new StartInvoke(kernel);
-                invokers[getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))] = new StartRecursiveInvoke(kernel);
-                invokers[getSuperIndex(proxyType, proxyType.getMethod("stop", null))] = new StopInvoke(kernel);
-                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))] = new GetStartTimeInvoke(kernel);
-                invokers[getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))] = new GetObjectNameInvoke(kernel);
+            if (GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
+                int superIndex;
+                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getState", null))) > -1) {
+                    invokers[superIndex] = new GetStateInvoke(kernel);
+                }
+                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))) > -1) {
+                    invokers[superIndex] = new GetStateInstanceInvoke(kernel);
+                }
+                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("start", null))) > -1) {
+                    invokers[superIndex] = new StartInvoke(kernel);
+                }
+                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))) > -1) {
+                    invokers[superIndex] = new StartRecursiveInvoke(kernel);
+                }
+                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("stop", null))) > -1) {
+                    invokers[superIndex] = new StopInvoke(kernel);
+                }
+                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))) > -1) {
+                    invokers[superIndex] = new GetStartTimeInvoke(kernel);
+                }
+                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))) > -1) {
+                    invokers[superIndex] = new GetObjectNameInvoke(kernel);
+                }
             }
         } catch (Exception e) {
             // this can not happen... all classes must implement equals, hashCode and toString

Dain, do you have any clues why this is happening?

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

        

[jira] Commented: (GERONIMO-2416) ProxyMethodInterceptor should work with classes that have start,stop methods

Posted by "Dain Sundstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/GERONIMO-2416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474577 ] 

Dain Sundstrom commented on GERONIMO-2416:
------------------------------------------

you can't proxy a final method

> ProxyMethodInterceptor should work with classes that have start,stop methods
> ----------------------------------------------------------------------------
>
>                 Key: GERONIMO-2416
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-2416
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: kernel
>    Affects Versions: 1.2
>            Reporter: David Jencks
>         Assigned To: Dain Sundstrom
>            Priority: Critical
>             Fix For: 2.0
>
>
> jetty6 components usually have lifecycle methods start,stop, and possibly others.  If we write a gbean extending these objects ProxyMethodInterceptor blows up with an ArrayIndexOutOfBoundsException (-1).  I don't understand why this happens, and there might be a different cause, but the gbeans that have this problem all extend jetty objects with start methods.
> A really bad workaround that lets the server start is this patch:
> Index: modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
> ===================================================================
> --- modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (revision 447903)
> +++ modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (working copy)
> @@ -110,14 +110,29 @@
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("equals", new Class[]{Object.class}))] = new EqualsInvoke(kernel);
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("hashCode", null))] = new HashCodeInvoke();
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("toString", null))] = new ToStringInvoke(proxyType.getName());
> -            if(GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getState", null))] = new GetStateInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))] = new GetStateInstanceInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("start", null))] = new StartInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))] = new StartRecursiveInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("stop", null))] = new StopInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))] = new GetStartTimeInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))] = new GetObjectNameInvoke(kernel);
> +            if (GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
> +                int superIndex;
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getState", null))) > -1) {
> +                    invokers[superIndex] = new GetStateInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))) > -1) {
> +                    invokers[superIndex] = new GetStateInstanceInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("start", null))) > -1) {
> +                    invokers[superIndex] = new StartInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))) > -1) {
> +                    invokers[superIndex] = new StartRecursiveInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("stop", null))) > -1) {
> +                    invokers[superIndex] = new StopInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))) > -1) {
> +                    invokers[superIndex] = new GetStartTimeInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))) > -1) {
> +                    invokers[superIndex] = new GetObjectNameInvoke(kernel);
> +                }
>              }
>          } catch (Exception e) {
>              // this can not happen... all classes must implement equals, hashCode and toString
> Dain, do you have any clues why this is happening?

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


[jira] Assigned: (GERONIMO-2416) ProxyMethodInterceptor should work with classes that have start,stop methods

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

Dain Sundstrom reassigned GERONIMO-2416:
----------------------------------------

    Assignee: David Jencks  (was: Dain Sundstrom)

> ProxyMethodInterceptor should work with classes that have start,stop methods
> ----------------------------------------------------------------------------
>
>                 Key: GERONIMO-2416
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-2416
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: kernel
>    Affects Versions: 1.2
>            Reporter: David Jencks
>         Assigned To: David Jencks
>            Priority: Critical
>             Fix For: 2.0
>
>
> jetty6 components usually have lifecycle methods start,stop, and possibly others.  If we write a gbean extending these objects ProxyMethodInterceptor blows up with an ArrayIndexOutOfBoundsException (-1).  I don't understand why this happens, and there might be a different cause, but the gbeans that have this problem all extend jetty objects with start methods.
> A really bad workaround that lets the server start is this patch:
> Index: modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
> ===================================================================
> --- modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (revision 447903)
> +++ modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (working copy)
> @@ -110,14 +110,29 @@
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("equals", new Class[]{Object.class}))] = new EqualsInvoke(kernel);
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("hashCode", null))] = new HashCodeInvoke();
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("toString", null))] = new ToStringInvoke(proxyType.getName());
> -            if(GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getState", null))] = new GetStateInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))] = new GetStateInstanceInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("start", null))] = new StartInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))] = new StartRecursiveInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("stop", null))] = new StopInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))] = new GetStartTimeInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))] = new GetObjectNameInvoke(kernel);
> +            if (GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
> +                int superIndex;
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getState", null))) > -1) {
> +                    invokers[superIndex] = new GetStateInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))) > -1) {
> +                    invokers[superIndex] = new GetStateInstanceInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("start", null))) > -1) {
> +                    invokers[superIndex] = new StartInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))) > -1) {
> +                    invokers[superIndex] = new StartRecursiveInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("stop", null))) > -1) {
> +                    invokers[superIndex] = new StopInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))) > -1) {
> +                    invokers[superIndex] = new GetStartTimeInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))) > -1) {
> +                    invokers[superIndex] = new GetObjectNameInvoke(kernel);
> +                }
>              }
>          } catch (Exception e) {
>              // this can not happen... all classes must implement equals, hashCode and toString
> Dain, do you have any clues why this is happening?

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


[jira] Commented: (GERONIMO-2416) ProxyMethodInterceptor should work with classes that have start,stop methods

Posted by "David Jencks (JIRA)" <de...@geronimo.apache.org>.
    [ http://issues.apache.org/jira/browse/GERONIMO-2416?page=comments#action_12436411 ] 
            
David Jencks commented on GERONIMO-2416:
----------------------------------------

This appears to happen only if the methods in GeronimoManagedBean are implemented as final methods in the target class.

The stack trace shows geronimo is trying to create a reference:
        at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.createGBeanInvokers(ProxyMethodInterceptor.java:124)
        at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.<init>(ProxyMethodInterceptor.java:70)
        at org.apache.geronimo.kernel.basic.BasicProxyManager.getMethodInterceptor(BasicProxyManager.java:232)
        at org.apache.geronimo.kernel.basic.BasicProxyManager$ManagedProxyFactory.createProxy(BasicProxyManager.java:209)
        at org.apache.geronimo.kernel.basic.BasicProxyManager.createProxy(BasicProxyManager.java:103)
        at org.apache.geronimo.gbean.runtime.GBeanSingleReference.start(GBeanSingleReference.java:82)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:890)
        at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:267)
        at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
        at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:124)

I've worked around this by making the gbeans delegate to rather than extend the jetty6 classes involved.  I suspect that using an interface rather than class for the reference target would also work.

It might be nice to provide a more informative error message.

> ProxyMethodInterceptor should work with classes that have start,stop methods
> ----------------------------------------------------------------------------
>
>                 Key: GERONIMO-2416
>                 URL: http://issues.apache.org/jira/browse/GERONIMO-2416
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: kernel
>    Affects Versions: 1.2
>            Reporter: David Jencks
>         Assigned To: Dain Sundstrom
>            Priority: Critical
>             Fix For: 1.2
>
>
> jetty6 components usually have lifecycle methods start,stop, and possibly others.  If we write a gbean extending these objects ProxyMethodInterceptor blows up with an ArrayIndexOutOfBoundsException (-1).  I don't understand why this happens, and there might be a different cause, but the gbeans that have this problem all extend jetty objects with start methods.
> A really bad workaround that lets the server start is this patch:
> Index: modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
> ===================================================================
> --- modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (revision 447903)
> +++ modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (working copy)
> @@ -110,14 +110,29 @@
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("equals", new Class[]{Object.class}))] = new EqualsInvoke(kernel);
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("hashCode", null))] = new HashCodeInvoke();
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("toString", null))] = new ToStringInvoke(proxyType.getName());
> -            if(GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getState", null))] = new GetStateInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))] = new GetStateInstanceInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("start", null))] = new StartInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))] = new StartRecursiveInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("stop", null))] = new StopInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))] = new GetStartTimeInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))] = new GetObjectNameInvoke(kernel);
> +            if (GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
> +                int superIndex;
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getState", null))) > -1) {
> +                    invokers[superIndex] = new GetStateInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))) > -1) {
> +                    invokers[superIndex] = new GetStateInstanceInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("start", null))) > -1) {
> +                    invokers[superIndex] = new StartInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))) > -1) {
> +                    invokers[superIndex] = new StartRecursiveInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("stop", null))) > -1) {
> +                    invokers[superIndex] = new StopInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))) > -1) {
> +                    invokers[superIndex] = new GetStartTimeInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))) > -1) {
> +                    invokers[superIndex] = new GetObjectNameInvoke(kernel);
> +                }
>              }
>          } catch (Exception e) {
>              // this can not happen... all classes must implement equals, hashCode and toString
> Dain, do you have any clues why this is happening?

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

        

[jira] Closed: (GERONIMO-2416) ProxyMethodInterceptor should work with classes that have start,stop methods

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

David Jencks closed GERONIMO-2416.
----------------------------------

    Resolution: Won't Fix

As dain said, you can't proxy a final method.   If you have a final method wrapping and delegating to the implementation object is probably the best bet.  That's what I did with the jetty classes anyway.

> ProxyMethodInterceptor should work with classes that have start,stop methods
> ----------------------------------------------------------------------------
>
>                 Key: GERONIMO-2416
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-2416
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: kernel
>    Affects Versions: 1.2
>            Reporter: David Jencks
>         Assigned To: David Jencks
>            Priority: Critical
>             Fix For: 2.0
>
>
> jetty6 components usually have lifecycle methods start,stop, and possibly others.  If we write a gbean extending these objects ProxyMethodInterceptor blows up with an ArrayIndexOutOfBoundsException (-1).  I don't understand why this happens, and there might be a different cause, but the gbeans that have this problem all extend jetty objects with start methods.
> A really bad workaround that lets the server start is this patch:
> Index: modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
> ===================================================================
> --- modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (revision 447903)
> +++ modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (working copy)
> @@ -110,14 +110,29 @@
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("equals", new Class[]{Object.class}))] = new EqualsInvoke(kernel);
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("hashCode", null))] = new HashCodeInvoke();
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("toString", null))] = new ToStringInvoke(proxyType.getName());
> -            if(GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getState", null))] = new GetStateInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))] = new GetStateInstanceInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("start", null))] = new StartInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))] = new StartRecursiveInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("stop", null))] = new StopInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))] = new GetStartTimeInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))] = new GetObjectNameInvoke(kernel);
> +            if (GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
> +                int superIndex;
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getState", null))) > -1) {
> +                    invokers[superIndex] = new GetStateInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))) > -1) {
> +                    invokers[superIndex] = new GetStateInstanceInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("start", null))) > -1) {
> +                    invokers[superIndex] = new StartInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))) > -1) {
> +                    invokers[superIndex] = new StartRecursiveInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("stop", null))) > -1) {
> +                    invokers[superIndex] = new StopInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))) > -1) {
> +                    invokers[superIndex] = new GetStartTimeInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))) > -1) {
> +                    invokers[superIndex] = new GetObjectNameInvoke(kernel);
> +                }
>              }
>          } catch (Exception e) {
>              // this can not happen... all classes must implement equals, hashCode and toString
> Dain, do you have any clues why this is happening?

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


[jira] Updated: (GERONIMO-2416) ProxyMethodInterceptor should work with classes that have start,stop methods

Posted by "Matt Hogstrom (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/GERONIMO-2416?page=all ]

Matt Hogstrom updated GERONIMO-2416:
------------------------------------

    Fix Version/s: 2.0
                       (was: 1.2)

> ProxyMethodInterceptor should work with classes that have start,stop methods
> ----------------------------------------------------------------------------
>
>                 Key: GERONIMO-2416
>                 URL: http://issues.apache.org/jira/browse/GERONIMO-2416
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: kernel
>    Affects Versions: 1.2
>            Reporter: David Jencks
>         Assigned To: Dain Sundstrom
>            Priority: Critical
>             Fix For: 2.0
>
>
> jetty6 components usually have lifecycle methods start,stop, and possibly others.  If we write a gbean extending these objects ProxyMethodInterceptor blows up with an ArrayIndexOutOfBoundsException (-1).  I don't understand why this happens, and there might be a different cause, but the gbeans that have this problem all extend jetty objects with start methods.
> A really bad workaround that lets the server start is this patch:
> Index: modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
> ===================================================================
> --- modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (revision 447903)
> +++ modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java  (working copy)
> @@ -110,14 +110,29 @@
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("equals", new Class[]{Object.class}))] = new EqualsInvoke(kernel);
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("hashCode", null))] = new HashCodeInvoke();
>              invokers[getSuperIndex(proxyType, proxyType.getMethod("toString", null))] = new ToStringInvoke(proxyType.getName());
> -            if(GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getState", null))] = new GetStateInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))] = new GetStateInstanceInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("start", null))] = new StartInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))] = new StartRecursiveInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("stop", null))] = new StopInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))] = new GetStartTimeInvoke(kernel);
> -                invokers[getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))] = new GetObjectNameInvoke(kernel);
> +            if (GeronimoManagedBean.class.isAssignableFrom(proxyType)) {
> +                int superIndex;
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getState", null))) > -1) {
> +                    invokers[superIndex] = new GetStateInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStateInstance", null))) > -1) {
> +                    invokers[superIndex] = new GetStateInstanceInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("start", null))) > -1) {
> +                    invokers[superIndex] = new StartInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("startRecursive", null))) > -1) {
> +                    invokers[superIndex] = new StartRecursiveInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("stop", null))) > -1) {
> +                    invokers[superIndex] = new StopInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getStartTime", null))) > -1) {
> +                    invokers[superIndex] = new GetStartTimeInvoke(kernel);
> +                }
> +                if ((superIndex = getSuperIndex(proxyType, proxyType.getMethod("getObjectName", null))) > -1) {
> +                    invokers[superIndex] = new GetObjectNameInvoke(kernel);
> +                }
>              }
>          } catch (Exception e) {
>              // this can not happen... all classes must implement equals, hashCode and toString
> Dain, do you have any clues why this is happening?

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