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