2 Replies Latest reply on Feb 1, 2008 10:03 AM by alex.alvarez

    Weird problem with resources-config.xml

    alex.alvarez

      Hello,

      i'm trying to a rewrite a Portlet to use RichFaces (i'm using JBoss portal 2.6.3). I'm using the latest version of RichFaces and ajax4jsf-1.1.1.jar and a4j-portlet-1.1.1.jar.


      While deploying the Portlet I get the following exception:

      Caused by: java.lang.IllegalArgumentException: argument type mismatch
       at org.apache.commons.digester.Digester.createSAXException(Digester.java:3181)
       at org.apache.commons.digester.Digester.createSAXException(Digester.java:3207)
       at org.apache.commons.digester.Digester.endElement(Digester.java:1225)
       at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
       at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
       at org.apache.commons.digester.Digester.parse(Digester.java:1765)
       at org.ajax4jsf.framework.resource.ResourceBuilderImpl.registerConfig(ResourceBuilderImpl.java:186)
       ... 99 more


      after some investigation i found out that the class org.ajax4jsf.framework.resource.ResourceBuilderImpl is reading the resources-config in the jar file
      (richfaces-impl-3.1.4.GA.jar!/META-INF/resources-config.xml)

      But these resources implement
      org.ajax4jsf.resource.InternetResource
      and not
      org.ajax4jsf.framework.resource.InternetResource


      Is there something that needs to be done in order to correct the mismatch between the resource-config.xml and the ResourceBuilder? Any help is most appreciated!

      Thanks,
      Alex

        • 1. Re: Weird problem with resources-config.xml
          alex.alvarez

          On closer look i noticed that there are actually 2 resources-config.xml, one with the "javascript" and one with the "framework" classes.

          And the loader is the ChameleonRenderKit, so i guess i just need to deactivate it then.

          regards,
          Alex

          • 2. Re: Weird problem with resources-config.xml
            alex.alvarez

            Nope, i looked at the source and what happens is the following:

            org.ajax4jsf.framework.resource.ResourceBuilderImpl.registerResources enumerates all resources with the name "resources-config.xml" and tries to parse them and load them, it works fine with the one inside the ajax jar, but as soon as it loads the one inside the richfaces jar it throws the IllegalArgumentException.

            So its a bug.