You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Ertio Lew (JIRA)" <de...@myfaces.apache.org> on 2012/08/31 07:47:08 UTC
[jira] [Created] (MYFACES-3599) Using Collections.EMPTY_LIST inside
converter leads to IllegalAccessException
Ertio Lew created MYFACES-3599:
----------------------------------
Summary: Using Collections.EMPTY_LIST inside converter leads to IllegalAccessException
Key: MYFACES-3599
URL: https://issues.apache.org/jira/browse/MYFACES-3599
Project: MyFaces Core
Issue Type: Bug
Affects Versions: 2.1.8
Environment: Glassfish 3.1 & JUEL EL Implementation
Reporter: Ertio Lew
While using a string->list(& viceversa) converter, I made use of Collections.EMPTY_LIST but it gives the following error. (This worked fine with Mojarra)
<error>
<error-name>java.lang.IllegalStateException</error-name>
<error-message>java.lang.RuntimeException: java.lang.IllegalAccessException: Class javax.faces.component.UIComponentBase can not access a member of class java.util.Collections$EmptyList with modifiers "private"</error-message>
</error>
Why cannot I use Collections.EMPTY_LIST but new ArrayList<Integer>() just works ?
Converter code as follows:
------------------
FacesConverter(value = "listConverter", forClass = px10.Utils.ListConverter.class)
public class ListConverter implements Converter {
@Override
public Object getAsObject(FacesContext fc, UIComponent uic, String stringVal) {
if (stringVal==null)
return Collections.EMPTY_LIST;
String[] split = stringVal.split(",");
List<Integer> list = new ArrayList<Integer>(split.length);
for (int i = 0; i < split.length; i++) {
list.add(Integer.parseInt(split[i]));
}
return list;
}
...
...
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3599) Using Collections.EMPTY_LIST
inside converter lead to IllegalAccessException
Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13446822#comment-13446822 ]
Leonardo Uribe commented on MYFACES-3599:
-----------------------------------------
It could be something related to the container. There is no evidence of a problem in MyFaces so far.
> Using Collections.EMPTY_LIST inside converter lead to IllegalAccessException
> ----------------------------------------------------------------------------
>
> Key: MYFACES-3599
> URL: https://issues.apache.org/jira/browse/MYFACES-3599
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.1.8
> Environment: Glassfish 3.1 & JUEL EL Implementation
> Reporter: Ertio Lew
>
> While using a string->list(& viceversa) converter, I made use of Collections.EMPTY_LIST but it gives the following error. (This worked fine with Mojarra)
> <error>
> <error-name>java.lang.IllegalStateException</error-name>
> <error-message>java.lang.RuntimeException: java.lang.IllegalAccessException: Class javax.faces.component.UIComponentBase can not access a member of class java.util.Collections$EmptyList with modifiers "private"</error-message>
> </error>
> Why cannot I use Collections.EMPTY_LIST but replacing with new ArrayList<Integer>() just works ?
> Converter code as follows:
> ------------------
> FacesConverter(value = "listConverter", forClass = px10.Utils.ListConverter.class)
> public class ListConverter implements Converter {
>
> @Override
> public Object getAsObject(FacesContext fc, UIComponent uic, String stringVal) {
> if (stringVal==null)
> return Collections.EMPTY_LIST;
>
> String[] split = stringVal.split(",");
> List<Integer> list = new ArrayList<Integer>(split.length);
> for (int i = 0; i < split.length; i++) {
> list.add(Integer.parseInt(split[i]));
> }
> return list;
> }
> ...
> ...
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (MYFACES-3599) Using Collections.EMPTY_LIST
inside converter lead to IllegalAccessException
Posted by "Ertio Lew (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13446222#comment-13446222 ]
Ertio Lew edited comment on MYFACES-3599 at 9/1/12 5:41 AM:
------------------------------------------------------------
Actually this runtime exception was not logged in my logs but instead I saw it in firebug as a postback response which included only this much detail.
was (Author: ertiop93):
Actually this runtime exception was not logged in my logs but instead I saw it in firebug as the postback response which included only this much response.
> Using Collections.EMPTY_LIST inside converter lead to IllegalAccessException
> ----------------------------------------------------------------------------
>
> Key: MYFACES-3599
> URL: https://issues.apache.org/jira/browse/MYFACES-3599
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.1.8
> Environment: Glassfish 3.1 & JUEL EL Implementation
> Reporter: Ertio Lew
>
> While using a string->list(& viceversa) converter, I made use of Collections.EMPTY_LIST but it gives the following error. (This worked fine with Mojarra)
> <error>
> <error-name>java.lang.IllegalStateException</error-name>
> <error-message>java.lang.RuntimeException: java.lang.IllegalAccessException: Class javax.faces.component.UIComponentBase can not access a member of class java.util.Collections$EmptyList with modifiers "private"</error-message>
> </error>
> Why cannot I use Collections.EMPTY_LIST but replacing with new ArrayList<Integer>() just works ?
> Converter code as follows:
> ------------------
> FacesConverter(value = "listConverter", forClass = px10.Utils.ListConverter.class)
> public class ListConverter implements Converter {
>
> @Override
> public Object getAsObject(FacesContext fc, UIComponent uic, String stringVal) {
> if (stringVal==null)
> return Collections.EMPTY_LIST;
>
> String[] split = stringVal.split(",");
> List<Integer> list = new ArrayList<Integer>(split.length);
> for (int i = 0; i < split.length; i++) {
> list.add(Integer.parseInt(split[i]));
> }
> return list;
> }
> ...
> ...
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3599) Using Collections.EMPTY_LIST
inside converter leads to IllegalAccessException
Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13445932#comment-13445932 ]
Mike Kienenberger commented on MYFACES-3599:
--------------------------------------------
Can you post the full stack trace, please, or at least the parts that immediately proceed the error, which include MyFaces classes?
> Using Collections.EMPTY_LIST inside converter leads to IllegalAccessException
> -----------------------------------------------------------------------------
>
> Key: MYFACES-3599
> URL: https://issues.apache.org/jira/browse/MYFACES-3599
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.1.8
> Environment: Glassfish 3.1 & JUEL EL Implementation
> Reporter: Ertio Lew
>
> While using a string->list(& viceversa) converter, I made use of Collections.EMPTY_LIST but it gives the following error. (This worked fine with Mojarra)
> <error>
> <error-name>java.lang.IllegalStateException</error-name>
> <error-message>java.lang.RuntimeException: java.lang.IllegalAccessException: Class javax.faces.component.UIComponentBase can not access a member of class java.util.Collections$EmptyList with modifiers "private"</error-message>
> </error>
> Why cannot I use Collections.EMPTY_LIST but replacing with new ArrayList<Integer>() just works ?
> Converter code as follows:
> ------------------
> FacesConverter(value = "listConverter", forClass = px10.Utils.ListConverter.class)
> public class ListConverter implements Converter {
>
> @Override
> public Object getAsObject(FacesContext fc, UIComponent uic, String stringVal) {
> if (stringVal==null)
> return Collections.EMPTY_LIST;
>
> String[] split = stringVal.split(",");
> List<Integer> list = new ArrayList<Integer>(split.length);
> for (int i = 0; i < split.length; i++) {
> list.add(Integer.parseInt(split[i]));
> }
> return list;
> }
> ...
> ...
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3599) Using Collections.EMPTY_LIST
inside converter leads to IllegalAccessException
Posted by "Ertio Lew (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13446222#comment-13446222 ]
Ertio Lew commented on MYFACES-3599:
------------------------------------
Actually this runtime exception was not logged in my logs but instead I saw it in firebug as the postback response which included only this much response.
> Using Collections.EMPTY_LIST inside converter leads to IllegalAccessException
> -----------------------------------------------------------------------------
>
> Key: MYFACES-3599
> URL: https://issues.apache.org/jira/browse/MYFACES-3599
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.1.8
> Environment: Glassfish 3.1 & JUEL EL Implementation
> Reporter: Ertio Lew
>
> While using a string->list(& viceversa) converter, I made use of Collections.EMPTY_LIST but it gives the following error. (This worked fine with Mojarra)
> <error>
> <error-name>java.lang.IllegalStateException</error-name>
> <error-message>java.lang.RuntimeException: java.lang.IllegalAccessException: Class javax.faces.component.UIComponentBase can not access a member of class java.util.Collections$EmptyList with modifiers "private"</error-message>
> </error>
> Why cannot I use Collections.EMPTY_LIST but replacing with new ArrayList<Integer>() just works ?
> Converter code as follows:
> ------------------
> FacesConverter(value = "listConverter", forClass = px10.Utils.ListConverter.class)
> public class ListConverter implements Converter {
>
> @Override
> public Object getAsObject(FacesContext fc, UIComponent uic, String stringVal) {
> if (stringVal==null)
> return Collections.EMPTY_LIST;
>
> String[] split = stringVal.split(",");
> List<Integer> list = new ArrayList<Integer>(split.length);
> for (int i = 0; i < split.length; i++) {
> list.add(Integer.parseInt(split[i]));
> }
> return list;
> }
> ...
> ...
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira