A web application using the approach described in 2.11.3 in
does not, the pojo web service client works with no issue, but it does not work
if a servlet of jsp using the generated web service client class.
Through debugging, the issue is (using the example code from the above link):
baseUrl = client.MtomService.class.getResource(".");
baseUrl returns null in this case.
In a pojo case, the System class loader resolves the baseUrl correctly, but the
classloader that loads the client.MtomService is WebappClassLoader, it can not
resolve the resource with "." at the end, instead, if the statement is written as:
baseUrl = client.MtomService.class.getResource("");
The baseUrl is returned correctly.
The implication is the web application as web service client can not work
properly across environment.
We have to modify the generated java code by replacing the "." to "", but it is