Hello,
we are using Integration Server 10.1. We created POJO’s as Java services (exposed via Application Platform in Designer). Everything was working fine. But know we wanted to change these IS POJO services into simple Java Services. The reason for this is that we are using Deployer for deployment and don’t want to expose services during deployment process. The problem is that the referring downloaded .jar package contains a .txt file for configuration. When we try to execute the Java Service we get the following exception:
com.wm.app.b2b.server.ServiceException: java.lang.IllegalStateException: Cant find resources/grib2/standardTableMap.txt
However, the jar file is in the directory <package>\code\jarsfile and contains the config file in the given subdirectory.
This problem only occurs when using simple java services and not the exposed services.
We created a simple example:
[/package dummy;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Calendar;
public class Dummy {
private URL url;
public String getMessage() throws URISyntaxException, IOException {
if(this.url == null){
this.url = this.getClass().getResource("/static/dummy.txt");
}
Path path = Paths.get(this.url.toURI());
return new String(Files.readAllBytes(path));
}
public String getFilename(){
if(this.url == null){
this.url = this.getClass().getResource("/static/dummy.txt");
}
return this.url.getFile();
}
public String getPath(){
if(this.url == null){
this.url = this.getClass().getResource("/static/dummy.txt");
}
return this.url.getPath();
}
public String getTime(){
return Calendar.getInstance().getTime().toString();
}
}
]
Building a jar and using this in java service leads to the following output of:
file:/C:/SoftwareAG/IntegrationServer/instances/default/packages/_TestPackage/code/jars/dummy-0.0.1-SNAPSHOT.jar!/static/dummy.txt
Thus, the path seems to be generated incorrectly.
How can we solve the problem?
Except for this problem, is there a possibility to easily deploy packages which are based on exposed POJO services using Deployer?
Thank you very much in advance.
dummy-0.0.1-SNAPSHOT.jar.zip (2.38 KB)