[jira] Commented: (MYFACES-3055) META-INF/faces-config.xml files in JARs are loaded twice
[ https://issues.apache.org/jira/browse/MYFACES-3055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12998351#comment-12998351 ] vvasabi commented on MYFACES-3055: -- Thanks for the comments. I think my workaround is more or less a hack. For a container that does not provide buggy results, the workaround may produce an undesirable effect. Therefore, unless the problem is widespread, e.g. affecting certain versions of Eclipse-based ClassLoaders, I don't think it would be suitable for MyFaces to incorporate it. Glyn, I will try to produce a narrowed testcase and file that against Virgo. From my experience, its ClassLoader has been buggy since the day one I used it. I have many hacks that exist just to get classes from OSGi bundles loaded properly. :-) META-INF/faces-config.xml files in JARs are loaded twice Key: MYFACES-3055 URL: https://issues.apache.org/jira/browse/MYFACES-3055 Project: MyFaces Core Issue Type: Bug Affects Versions: 2.0.3, 2.0.4 Environment: Mac OS X, EclipseRT Virgo 2.1.0 Reporter: vvasabi META-INF/faces-config.xml files in the jars of component libraries are loaded twice, causing OpenFaces to give the following error: Second notification for the same phase in the same request occurred. Below is the server log. Note that same config files, 99/1/bundlefile!/META-INF/faces-config.xml and 101/1/bundlefile!/META-INF/faces-config.xml are loaded twice. [2011-02-22 17:00:55.245] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.246] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.277] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.277] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/101/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.290] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.291] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.369] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.370] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/101/1/bundlefile!/META-INF/faces-config.xml However, /WEB-INF/faces-config.xml in the war is only loaded once, so I suspect that this is a bug with org.apache.myfaces.config.DefaultFacesConfigurationProvider. My current workaround to install OpenFaces is, therefore, extract META-INF/faces-config.xml out of the jar, and load it with the war. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Created: (MYFACES-3055) META-INF/faces-config.xml files in JARs are loaded twice
META-INF/faces-config.xml files in JARs are loaded twice Key: MYFACES-3055 URL: https://issues.apache.org/jira/browse/MYFACES-3055 Project: MyFaces Core Issue Type: Bug Affects Versions: 2.0.4, 2.0.3 Environment: Mac OS X, EclipseRT Virgo 2.1.0 Reporter: vvasabi META-INF/faces-config.xml files in the jars of component libraries are loaded twice, causing OpenFaces to give the following error: Second notification for the same phase in the same request occurred. Below is the server log. Note that same config files, 99/1/bundlefile!/META-INF/faces-config.xml and 101/1/bundlefile!/META-INF/faces-config.xml are loaded twice. [2011-02-22 17:00:55.245] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.246] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.277] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.277] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/101/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.290] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.291] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.369] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.370] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/101/1/bundlefile!/META-INF/faces-config.xml However, /WEB-INF/faces-config.xml in the war is only loaded once, so I suspect that this is a bug with org.apache.myfaces.config.DefaultFacesConfigurationProvider. My current workaround to install OpenFaces is, therefore, extract META-INF/faces-config.xml out of the jar, and load it with the war. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MYFACES-3055) META-INF/faces-config.xml files in JARs are loaded twice
[ https://issues.apache.org/jira/browse/MYFACES-3055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12998072#comment-12998072 ] vvasabi commented on MYFACES-3055: -- EclipseRT's Virgo, which appears to be based on Tomcat 6. META-INF/faces-config.xml files in JARs are loaded twice Key: MYFACES-3055 URL: https://issues.apache.org/jira/browse/MYFACES-3055 Project: MyFaces Core Issue Type: Bug Affects Versions: 2.0.3, 2.0.4 Environment: Mac OS X, EclipseRT Virgo 2.1.0 Reporter: vvasabi META-INF/faces-config.xml files in the jars of component libraries are loaded twice, causing OpenFaces to give the following error: Second notification for the same phase in the same request occurred. Below is the server log. Note that same config files, 99/1/bundlefile!/META-INF/faces-config.xml and 101/1/bundlefile!/META-INF/faces-config.xml are loaded twice. [2011-02-22 17:00:55.245] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.246] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.277] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.277] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/101/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.290] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.291] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.369] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.370] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/101/1/bundlefile!/META-INF/faces-config.xml However, /WEB-INF/faces-config.xml in the war is only loaded once, so I suspect that this is a bug with org.apache.myfaces.config.DefaultFacesConfigurationProvider. My current workaround to install OpenFaces is, therefore, extract META-INF/faces-config.xml out of the jar, and load it with the war. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MYFACES-3055) META-INF/faces-config.xml files in JARs are loaded twice
[ https://issues.apache.org/jira/browse/MYFACES-3055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12998089#comment-12998089 ] vvasabi commented on MYFACES-3055: -- Thanks Mike. It does seem to be an issue specific to the Virgo server. I just tested with GlassFish v3, and this problem could not be reproduced. I will try other OSGi environments later and see if I could reproduce the same problem. META-INF/faces-config.xml files in JARs are loaded twice Key: MYFACES-3055 URL: https://issues.apache.org/jira/browse/MYFACES-3055 Project: MyFaces Core Issue Type: Bug Affects Versions: 2.0.3, 2.0.4 Environment: Mac OS X, EclipseRT Virgo 2.1.0 Reporter: vvasabi META-INF/faces-config.xml files in the jars of component libraries are loaded twice, causing OpenFaces to give the following error: Second notification for the same phase in the same request occurred. Below is the server log. Note that same config files, 99/1/bundlefile!/META-INF/faces-config.xml and 101/1/bundlefile!/META-INF/faces-config.xml are loaded twice. [2011-02-22 17:00:55.245] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.246] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.277] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.277] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/101/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.290] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.291] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.369] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.370] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/101/1/bundlefile!/META-INF/faces-config.xml However, /WEB-INF/faces-config.xml in the war is only loaded once, so I suspect that this is a bug with org.apache.myfaces.config.DefaultFacesConfigurationProvider. My current workaround to install OpenFaces is, therefore, extract META-INF/faces-config.xml out of the jar, and load it with the war. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MYFACES-3055) META-INF/faces-config.xml files in JARs are loaded twice
[ https://issues.apache.org/jira/browse/MYFACES-3055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12998101#comment-12998101 ] vvasabi commented on MYFACES-3055: -- You are right. I just grabbed the following code from DefaultFacesConfigurationProvider: FacesConfigResourceProvider provider = FacesConfigResourceProviderFactory. getFacesConfigResourceProviderFactory(ectx).createFacesConfigResourceProvider(ectx); CollectionURL facesConfigs = provider.getMetaInfConfigurationResources(ectx); The FacesConfigResourceProvider implementation did not disappointment me and returned duplicate results. I'll see if I could create a simple implementation and pass it in to filter out the duplicate results. Thanks for your tips. META-INF/faces-config.xml files in JARs are loaded twice Key: MYFACES-3055 URL: https://issues.apache.org/jira/browse/MYFACES-3055 Project: MyFaces Core Issue Type: Bug Affects Versions: 2.0.3, 2.0.4 Environment: Mac OS X, EclipseRT Virgo 2.1.0 Reporter: vvasabi META-INF/faces-config.xml files in the jars of component libraries are loaded twice, causing OpenFaces to give the following error: Second notification for the same phase in the same request occurred. Below is the server log. Note that same config files, 99/1/bundlefile!/META-INF/faces-config.xml and 101/1/bundlefile!/META-INF/faces-config.xml are loaded twice. [2011-02-22 17:00:55.245] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.246] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.277] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.277] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/101/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.290] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.291] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.369] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.370] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/101/1/bundlefile!/META-INF/faces-config.xml However, /WEB-INF/faces-config.xml in the war is only loaded once, so I suspect that this is a bug with org.apache.myfaces.config.DefaultFacesConfigurationProvider. My current workaround to install OpenFaces is, therefore, extract META-INF/faces-config.xml out of the jar, and load it with the war. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MYFACES-3055) META-INF/faces-config.xml files in JARs are loaded twice
[ https://issues.apache.org/jira/browse/MYFACES-3055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12998131#comment-12998131 ] vvasabi commented on MYFACES-3055: -- Okay, after hacking around for a bit, here's the solution that I have. Web.xml: context-param param-nameorg.apache.myfaces.FACES_INIT_PLUGINS/param-name param-valuemy.package.MyFacesStartupListener/param-value /context-param MyFacesStartupListener: public class MyFacesStartupListener implements StartupListener { private static final String FACTORY_KEY = FacesConfigResourceProviderFactory.class.getName(); @Override public void postDestroy(ServletContextEvent event) { } @Override public void postInit(ServletContextEvent event) { } @Override public void preDestroy(ServletContextEvent event) { } @Override public void preInit(ServletContextEvent event) { ServletContext context = event.getServletContext(); context.setAttribute(FACTORY_KEY, new MyFacesConfigResourceProviderFactory()); } } MyFacesConfigResourceProviderFactory: public class MyFacesConfigResourceProviderFactory extends FacesConfigResourceProviderFactory { @Override public FacesConfigResourceProvider createFacesConfigResourceProvider( ExternalContext ectx) { return new MyFacesConfigResourceProvider(); } } MyFacesConfigResourceProvider: public class MyFacesConfigResourceProvider extends DefaultFacesConfigResourceProvider { @Override public CollectionURL getMetaInfConfigurationResources( ExternalContext ectx) throws IOException { CollectionURL resources = super.getMetaInfConfigurationResources(ectx); CollectionURL filtered = new HashSetURL(); for (URL resource : resources) { if (!filtered.contains(resource)) { filtered.add(resource); } } return filtered; } } This workaround may be helpful for people who also have a buggy ClassLoader. META-INF/faces-config.xml files in JARs are loaded twice Key: MYFACES-3055 URL: https://issues.apache.org/jira/browse/MYFACES-3055 Project: MyFaces Core Issue Type: Bug Affects Versions: 2.0.3, 2.0.4 Environment: Mac OS X, EclipseRT Virgo 2.1.0 Reporter: vvasabi META-INF/faces-config.xml files in the jars of component libraries are loaded twice, causing OpenFaces to give the following error: Second notification for the same phase in the same request occurred. Below is the server log. Note that same config files, 99/1/bundlefile!/META-INF/faces-config.xml and 101/1/bundlefile!/META-INF/faces-config.xml are loaded twice. [2011-02-22 17:00:55.245] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.246] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.277] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.277] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/101/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.290] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider getClassloaderFacesConfig [2011-02-22 17:00:55.291] start-signalling-1 System.err INFO: Reading config : jar:file:/usr/local/virgo-web-server/work/osgi/configuration/org.eclipse.osgi/bundles/36/data/store/org.eclipse.osgi/bundles/99/1/bundlefile!/META-INF/faces-config.xml [2011-02-22 17:00:55.369] start-signalling-1 System.err Feb 22, 2011 5:00:55 PM org.apache.myfaces.config.DefaultFacesConfigurationProvider