[jira] Created: (MYFACES-1158) Use of context classloader as key in _registeredFactoryNames

View: New views
6 Messages — Rating Filter:   Alert me  

[jira] Created: (MYFACES-1158) Use of context classloader as key in _registeredFactoryNames

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Use of context classloader as key in _registeredFactoryNames
------------------------------------------------------------

         Key: MYFACES-1158
         URL: http://issues.apache.org/jira/browse/MYFACES-1158
     Project: MyFaces Core
        Type: Bug
  Components: General  
    Versions: 1.1.1    
 Environment: Any
    Reporter: Toh Kim Huat
    Priority: Minor
     Fix For: 1.1.1


In FactoryFinder.java, the context classloader is used as the key to set/retrieve the factoryClassNames Map from the _registeredFactoryNames map. Problems will occur if the context classloader used to put a factoryClassNames into the factoryClassNames Map is different from the context classloader used to retrieve a factoryClassNames from the factoryClassNames Map. The context classloader might be different if for instance the application uses a custom classloader which is inserted into the classloader hierarchy by setting the current context classloader as its parent classloader and then setting itself to be the current thread's context classloader.

Is it possible not to use the context classloader as the Map's key? Or perhaps if an entry cannot be retrieved from the Map using the current context classloader, can we use its parent (iteratively) to retrieve from the Map until we get an entry?

--
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: (MYFACES-1158) Use of context classloader as key in _registeredFactoryNames

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

     [ http://issues.apache.org/jira/browse/MYFACES-1158?page=all ]
     
Dennis Byrne closed MYFACES-1158:
---------------------------------

    Resolution: Invalid
     Assign To: Dennis Byrne

The behavior of FactoryFinder is defined by the JSF specification.  See section 10.2.6.1 .

> Use of context classloader as key in _registeredFactoryNames
> ------------------------------------------------------------
>
>          Key: MYFACES-1158
>          URL: http://issues.apache.org/jira/browse/MYFACES-1158
>      Project: MyFaces Core
>         Type: Bug
>   Components: General
>     Versions: 1.1.1
>  Environment: Any
>     Reporter: Toh Kim Huat
>     Assignee: Dennis Byrne
>     Priority: Minor
>      Fix For: 1.1.1

>
> In FactoryFinder.java, the context classloader is used as the key to set/retrieve the factoryClassNames Map from the _registeredFactoryNames map. Problems will occur if the context classloader used to put a factoryClassNames into the factoryClassNames Map is different from the context classloader used to retrieve a factoryClassNames from the factoryClassNames Map. The context classloader might be different if for instance the application uses a custom classloader which is inserted into the classloader hierarchy by setting the current context classloader as its parent classloader and then setting itself to be the current thread's context classloader.
> Is it possible not to use the context classloader as the Map's key? Or perhaps if an entry cannot be retrieved from the Map using the current context classloader, can we use its parent (iteratively) to retrieve from the Map until we get an entry?

--
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


Parent Message unknown RE: [jira] Closed: (MYFACES-1158) Use of context classloader as key in _registeredFactoryNames

by Toh Kim Huat NCS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Dennis,

Thank you for your fast reply. I downloaded the JSF specification and
referred to section 10.2.6.1. The only thing mentioned about the webapp
classloader there is that once the class name of the factory
implementation class is found, the webapp classloader is used to load
the factory implementation class.

It does not mention the constraint that the context classloader cannot
be changed during the lifetime of the application. If I follow the
specification correctly, the factory implementation class's name should
be able to be found even if the context classloader is changed.

But in the myFaces implementation of FactoryFinder, it seems that the
logic used to find the factory implementation class name is tied to the
classloader.

Therefore, I would appreciate if you can revisit this issue to see
whether the context classloader really cannot be changed during the
lifecycle of the application. Thank you very much.

Regards,

Kim Huat


-----Original Message-----
From: Dennis Byrne (JIRA) [mailto:dev@...]
Sent: Wednesday, March 01, 2006 2:31 PM
To: Toh Kim Huat NCS
Subject: [jira] Closed: (MYFACES-1158) Use of context classloader as key
in _registeredFactoryNames

     [ http://issues.apache.org/jira/browse/MYFACES-1158?page=all ]
     
Dennis Byrne closed MYFACES-1158:
---------------------------------

    Resolution: Invalid
     Assign To: Dennis Byrne

The behavior of FactoryFinder is defined by the JSF specification.  See
section 10.2.6.1 .

> Use of context classloader as key in _registeredFactoryNames
> ------------------------------------------------------------
>
>          Key: MYFACES-1158
>          URL: http://issues.apache.org/jira/browse/MYFACES-1158
>      Project: MyFaces Core
>         Type: Bug
>   Components: General
>     Versions: 1.1.1
>  Environment: Any
>     Reporter: Toh Kim Huat
>     Assignee: Dennis Byrne
>     Priority: Minor
>      Fix For: 1.1.1

>
> In FactoryFinder.java, the context classloader is used as the key to
set/retrieve the factoryClassNames Map from the _registeredFactoryNames
map. Problems will occur if the context classloader used to put a
factoryClassNames into the factoryClassNames Map is different from the
context classloader used to retrieve a factoryClassNames from the
factoryClassNames Map. The context classloader might be different if for
instance the application uses a custom classloader which is inserted
into the classloader hierarchy by setting the current context
classloader as its parent classloader and then setting itself to be the
current thread's context classloader.
> Is it possible not to use the context classloader as the Map's key? Or
perhaps if an entry cannot be retrieved from the Map using the current
context classloader, can we use its parent (iteratively) to retrieve
from the Map until we get an entry?

--
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] Reopened: (MYFACES-1158) Use of context classloader as key in _registeredFactoryNames

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

     [ http://issues.apache.org/jira/browse/MYFACES-1158?page=all ]
     
Toh Kim Huat reopened MYFACES-1158:
-----------------------------------


Hi Dennis,

Thank you for your fast reply. I downloaded the JSF specification and referred to section 10.2.6.1. The only thing mentioned about the webapp classloader there is that once the class name of the factory implementation class is found, the webapp classloader is used to load the factory implementation class.

It does not mention the constraint that the context classloader cannot be changed during the lifetime of the application. If I follow the specification correctly, the factory implementation class's name should be able to be found even if the context classloader is changed.

But in the myFaces implementation of FactoryFinder, it seems that the logic used to find the factory implementation class name is tied to the classloader.

Therefore, I would appreciate if you can revisit this issue to see whether the context classloader really cannot be changed during the lifecycle of the application. Thank you very much.

Regards,

Kim Huat


> Use of context classloader as key in _registeredFactoryNames
> ------------------------------------------------------------
>
>          Key: MYFACES-1158
>          URL: http://issues.apache.org/jira/browse/MYFACES-1158
>      Project: MyFaces Core
>         Type: Bug
>   Components: General
>     Versions: 1.1.1
>  Environment: Any
>     Reporter: Toh Kim Huat
>     Assignee: Dennis Byrne
>     Priority: Minor
>      Fix For: 1.1.1

>
> In FactoryFinder.java, the context classloader is used as the key to set/retrieve the factoryClassNames Map from the _registeredFactoryNames map. Problems will occur if the context classloader used to put a factoryClassNames into the factoryClassNames Map is different from the context classloader used to retrieve a factoryClassNames from the factoryClassNames Map. The context classloader might be different if for instance the application uses a custom classloader which is inserted into the classloader hierarchy by setting the current context classloader as its parent classloader and then setting itself to be the current thread's context classloader.
> Is it possible not to use the context classloader as the Map's key? Or perhaps if an entry cannot be retrieved from the Map using the current context classloader, can we use its parent (iteratively) to retrieve from the Map until we get an entry?

--
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: (MYFACES-1158) Use of context classloader as key in _registeredFactoryNames

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/MYFACES-1158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612620#action_12612620 ]

Sameer Nambiar commented on MYFACES-1158:
-----------------------------------------

Hello,

We are facing the exact issue stated above in the description while trying to get Myfaces to work within an OSGI environment. The initialization happening through the StartupServletContextListener and the servicing of the jsp request seem to be linking through to two different context class loaders.

Myfaces version: 1.2.3
OSGi framework: Equinox 3.3.2
Servlet engine: Jetty (wrapped by PAX)

The last comment on this issue was posted a while back. I am hoping there might be a solution to this issue since. Are there any workarounds or guidelines to follow while attempting to use Myfaces within OSGi?

Regards,
/Sameer.

> Use of context classloader as key in _registeredFactoryNames
> ------------------------------------------------------------
>
>                 Key: MYFACES-1158
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1158
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 1.1.1
>         Environment: Any
>            Reporter: Toh Kim Huat
>            Priority: Minor
>
> In FactoryFinder.java, the context classloader is used as the key to set/retrieve the factoryClassNames Map from the _registeredFactoryNames map. Problems will occur if the context classloader used to put a factoryClassNames into the factoryClassNames Map is different from the context classloader used to retrieve a factoryClassNames from the factoryClassNames Map. The context classloader might be different if for instance the application uses a custom classloader which is inserted into the classloader hierarchy by setting the current context classloader as its parent classloader and then setting itself to be the current thread's context classloader.
> Is it possible not to use the context classloader as the Map's key? Or perhaps if an entry cannot be retrieved from the Map using the current context classloader, can we use its parent (iteratively) to retrieve from the Map until we get an entry?

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


Parent Message unknown Out of Office AutoReply: [jira] Commented: (MYFACES-1158) Use of context classloader as key in _registeredFactoryNames

by Toh Kim Huat NCS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Out of Office AutoReply: [jira] Commented: (MYFACES-1158) Use of context classloader as key in _registeredFactoryNames

I am on leave from 3 July to 11 July, will be back on 14 July.
For iConnect matters, you can contact iConnect Support at iconnect-supp@...
For MDA Service Portal/ServiceConnect matters, you can contact ServiceConnect Support at sc_supp@...
For urgent matters, you can contact me on my handphone.

LightInTheBox - Buy quality products at wholesale price