Uploaded image for project: 'CXF-Fediz'
  1. CXF-Fediz
  2. FEDIZ-161

FederationConfigImpl.init() calls loadConfig(File) which fails for war files with special characters in its name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.2
    • 1.2.3, 1.3.1
    • Plugin
    • None

    Description

      If the fediz_config.xml file resides within a war file with special characters in its name, like the hash (#) character, used in Tomcat's war naming convention, (e.g., example-app##1.0.1.war), the following exception is thrown at startup:

      java.io.FileNotFoundException: The system cannot find the file specified
      at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:221)
      at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:190)
      at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
      at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:162)
      at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:171)
      at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:189)
      at org.apache.cxf.fediz.core.config.FedizConfigurator.loadConfig(FedizConfigurator.java:43)
      at org.apache.cxf.fediz.spring.FederationConfigImpl.init(FederationConfigImpl.java:65)

      This is related to a known issue with the JAXB UnmarshallerImpl:
      https://community.oracle.com/thread/1626574?start=0&tstart=0

      This could be resolved by changing the following line in the loadConfig(File) method to implement the suggestion from the Oracle thread above from:
      rootConfig = (FedizConfig) getJaxbContext().createUnmarshaller().unmarshal(f);
      to:
      rootConfig = (FedizConfig) getJaxbContext().createUnmarshaller().unmarshal(new FileInputStream(f));

      Attachments

        Activity

          People

            coheigea Colm O hEigeartaigh
            1311 Marc Calello
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: