What does your code to read the xml file look like?
I spend 3 hrs to search for solutions, it is appear wildfly generate a vfs (virtual file system) on the fly when deploy the apps. So for anyone have same issue, this is a working code that I have a slightly change to return InputStream.
URL url = Thread.currentThread().getContextClassLoader().getResource(xmlLocation); (This is NOT working code, complain not found FileNotFound exception xml)
InputStream xmlStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(xmlLocation); (this is working code, return xmlStream and then I use jax-rs to post the input stream instead of using url.getPath() where it failed)
Response response = webTarget.request().post(Entity.entity(xmlStream,MediaType.APPLICATION_XML));
Using the InputStream is the right way to deal with resources that are part of your deployment. So what you did is the correct change.
I also wondered why wildfly-maven-plugin deploy my war to standalone/data/content directory other than standalone/deployments ? and how to configure wildfly-maven-plugin that can deploy my war file to standalone/deployments?
Thanks in advance!