You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2010/09/06 21:35:33 UTC

[jira] Created: (OWB-445) we must not use javassist ProxyFactory#setHandler(MethodHandler)

we must not use javassist ProxyFactory#setHandler(MethodHandler)
----------------------------------------------------------------

                 Key: OWB-445
                 URL: https://issues.apache.org/jira/browse/OWB-445
             Project: OpenWebBeans
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.0.0-alpha-2
            Reporter: Mark Struberg
            Assignee: Mark Struberg


ProxyFactory.setHandler is deprecated and if used creates memory leaks!

We must create the ProxyClass  without a default method handler and set it after we create a proxy instance of that very class:

Object proxyInstance = proxyClass.newInstance();
((ProxyObject) proxyInstance ).setHandler( ... ) 



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


[jira] Assigned: (OWB-445) we must not use javassist ProxyFactory#setHandler(MethodHandler)

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

Mark Struberg reassigned OWB-445:
---------------------------------

    Assignee: Joe Bergmark  (was: Mark Struberg)

Joe, could you please take a look at the two ProxyFactory invocations marked with //X TODO?
They are both in code you touched lately, so I guess you are faster than I with fixing them.
txs!

> we must not use javassist ProxyFactory#setHandler(MethodHandler)
> ----------------------------------------------------------------
>
>                 Key: OWB-445
>                 URL: https://issues.apache.org/jira/browse/OWB-445
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0-alpha-2
>            Reporter: Mark Struberg
>            Assignee: Joe Bergmark
>
> ProxyFactory.setHandler is deprecated and if used creates memory leaks!
> We must create the ProxyClass  without a default method handler and set it after we create a proxy instance of that very class:
> Object proxyInstance = proxyClass.newInstance();
> ((ProxyObject) proxyInstance ).setHandler( ... ) 

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


[jira] Commented: (OWB-445) we must not use javassist ProxyFactory#setHandler(MethodHandler)

Posted by "Joe Bergmark (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906961#action_12906961 ] 

Joe Bergmark commented on OWB-445:
----------------------------------

I'll take a look. 

I seem to remember the AbstractDecorator case is difficult, as we have the information we need at deploy time to create the Proxy class and place that constructor back into the ManagedBean.  I don't know if we have any hook to do this at runtime.

> we must not use javassist ProxyFactory#setHandler(MethodHandler)
> ----------------------------------------------------------------
>
>                 Key: OWB-445
>                 URL: https://issues.apache.org/jira/browse/OWB-445
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0-alpha-2
>            Reporter: Mark Struberg
>            Assignee: Joe Bergmark
>             Fix For: 1.0.0-alpha-3
>
>
> ProxyFactory.setHandler is deprecated and if used creates memory leaks!
> We must create the ProxyClass  without a default method handler and set it after we create a proxy instance of that very class:
> Object proxyInstance = proxyClass.newInstance();
> ((ProxyObject) proxyInstance ).setHandler( ... ) 

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


[jira] Assigned: (OWB-445) we must not use javassist ProxyFactory#setHandler(MethodHandler)

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

Joe Bergmark reassigned OWB-445:
--------------------------------

    Assignee: Mark Struberg  (was: Joe Bergmark)

In the AbstractDecorator code, I removed the usage of setHandler from the Factory, and moved it to the point where we create an instance from the constructor.

In your comment above you mentioned 2 places.  Where is the second one?

> we must not use javassist ProxyFactory#setHandler(MethodHandler)
> ----------------------------------------------------------------
>
>                 Key: OWB-445
>                 URL: https://issues.apache.org/jira/browse/OWB-445
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0-alpha-2
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.0.0-alpha-3
>
>
> ProxyFactory.setHandler is deprecated and if used creates memory leaks!
> We must create the ProxyClass  without a default method handler and set it after we create a proxy instance of that very class:
> Object proxyInstance = proxyClass.newInstance();
> ((ProxyObject) proxyInstance ).setHandler( ... ) 

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


[jira] Commented: (OWB-445) we must not use javassist ProxyFactory#setHandler(MethodHandler)

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12906584#action_12906584 ] 

Mark Struberg commented on OWB-445:
-----------------------------------

Looking at the new javassist code reveals that the javassist class cache is now working again and must be used to prevent memory leaks in serialization. This cache will only be used if no ProxyFactory#setHandler() gets called directly. We must only use the setHandler on the created ProxyObject instead!

> we must not use javassist ProxyFactory#setHandler(MethodHandler)
> ----------------------------------------------------------------
>
>                 Key: OWB-445
>                 URL: https://issues.apache.org/jira/browse/OWB-445
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0-alpha-2
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>
> ProxyFactory.setHandler is deprecated and if used creates memory leaks!
> We must create the ProxyClass  without a default method handler and set it after we create a proxy instance of that very class:
> Object proxyInstance = proxyClass.newInstance();
> ((ProxyObject) proxyInstance ).setHandler( ... ) 

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


[jira] Resolved: (OWB-445) we must not use javassist ProxyFactory#setHandler(MethodHandler)

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

Mark Struberg resolved OWB-445.
-------------------------------

    Fix Version/s: 1.0.0-GA
                       (was: 1.0.0-alpha-3)
       Resolution: Fixed

> we must not use javassist ProxyFactory#setHandler(MethodHandler)
> ----------------------------------------------------------------
>
>                 Key: OWB-445
>                 URL: https://issues.apache.org/jira/browse/OWB-445
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0-alpha-2
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.0.0-GA
>
>
> ProxyFactory.setHandler is deprecated and if used creates memory leaks!
> We must create the ProxyClass  without a default method handler and set it after we create a proxy instance of that very class:
> Object proxyInstance = proxyClass.newInstance();
> ((ProxyObject) proxyInstance ).setHandler( ... ) 

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


[jira] Updated: (OWB-445) we must not use javassist ProxyFactory#setHandler(MethodHandler)

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

Mark Struberg updated OWB-445:
------------------------------

    Fix Version/s: 1.0.0-alpha-3

> we must not use javassist ProxyFactory#setHandler(MethodHandler)
> ----------------------------------------------------------------
>
>                 Key: OWB-445
>                 URL: https://issues.apache.org/jira/browse/OWB-445
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0-alpha-2
>            Reporter: Mark Struberg
>            Assignee: Joe Bergmark
>             Fix For: 1.0.0-alpha-3
>
>
> ProxyFactory.setHandler is deprecated and if used creates memory leaks!
> We must create the ProxyClass  without a default method handler and set it after we create a proxy instance of that very class:
> Object proxyInstance = proxyClass.newInstance();
> ((ProxyObject) proxyInstance ).setHandler( ... ) 

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