1

I have a JAVA application deployed on Websphere. This application is looking for a local WSDL file to do a SOAP request. However whenever the Websphere reboots which is nightly scheduled, this below line throws a NullPointer as it couldn't find the path of the WSDL. When we cycle the JVM everything works fine until the next reboot.

Url baseUrl = MyJavaClass.class.getClassLoader().getResource("MyInterface.wsdl");  

I will need this baseUrl later to continue with my SOAP request.

service = new ServiceInstance(baseUrl, new QName("http://myinterface.blah","ServiceInstance"));  

Of course with the baseUrl being Null this throws error. But once the JVM cycles everything works fine until it breaks again randomly. I have the WSDL inside my src/main/resources folder which I set it as a Source folder.
Below is how my classLoading options are set in Websphere to make this work. I have tried every other possibility which fails.
enter image description here Any ideas?

james2611nov
  • 473
  • 2
  • 10
  • 27
  • 1
    What are you referring to by "the Websphere reboots"? Is that something different than the restart of the JVM you mention later? – Jarid Feb 06 '19 at 21:30
  • We cycle the JVM from the console whenever we get this issue. The actual server itself reboots every night. – james2611nov Feb 06 '19 at 21:49
  • 1
    "Actual server" as in the physical machine (or VM, I guess)? I'm not sure why restarting the server would trigger something like this on the subsequent JVM restart, unless maybe there's an issue with a network storage location being unavailable, or a corruption in the app deployment when the system reboots. – Jarid Feb 07 '19 at 05:38
  • Where is the code that sets `baseUrl`? In a constructor/initializer? Class object? In what kind of class? (Servlet, etc.) – dbreaux Feb 12 '19 at 15:55
  • MyJavaClass is the class which sets `baseUrl`. It is located in my `src\main\java` source folder in a package `com.common.service`. – james2611nov Feb 12 '19 at 19:22

1 Answers1

0

I can't tell for sure, but... if this doesn't happen on JVM recycle, but does happen on reboot, it serves as a hint that some files went missing on reboot.

On most non-Windows platforms, temporary directories are mounted on memory-backed storage, which is why the contents of directories such as /tmp are discarded on reboot.

WebSphere keeps a cache of compiled WSDL artifacts. It keeps them in a directory called wstemp inside the profile directory. It is possible (though I'm not sure) that wstemp holds pointers to files in /tmp. In that case, a reboot is certain to cause your issue.

(Or, maybe, your system administrator made a configuration change whereby the wstemp directory itself points to memory-backed storage?)

What you can try is this: next time when the machine reboots, delete the wstemp directory completely, before restarting WebSphere. Then try your application. If it works, then it means that there's some truth in what I wrote above. If it doesn't, then maybe it's time to open a PMR with IBM.

Isaac
  • 16,458
  • 5
  • 57
  • 81