Domanda

I am trying to read smooks from remote location my code is :

    public Smooks createSmooks() throws Exception {             
        Smooks smooks = new Smooks("\\\\qa01\\conf\\order\\realec\\outbound.xml");
        return smooks;
     }

But it is giving following exception :

 java.io.IOException: Failed to access data stream for resource 
 [qa01/conf/order/realec/outbound.xml]. Tried filesystem, classpath and URL.

Previously, these files were placed with in jar. So I had no issues by reading it in such a way:

 public Smooks createSmooks() {
  Smooks smooks = new Smooks("./conf/order/realec/outbound.xml");
  return smooks;
 } 

Can you please help me creating smooks object for files placed at some remote location?

È stato utile?

Soluzione

From your code, I assume the file you're reading is a smooks config file. In any case, you should be able to open an InputStream to the remote config and then provide that to the Smooks constructor.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top