I am having a problem with accessing a web service running on a Tomcat server with an Apache HTTP server using SSL. This project was working correctly the last time I worked with it, but since then the following has changed.
1) I have a new workstation that I moved the project to.
2) The certificate on the server has expired and been replaced
3) The name of the server on the web was changed, so the URL has changed.
So at this point I am not sure what is causing my problem.
The error message I am getting is:
"Failed to access the WSDL at:
It failed with:
Got handshake alert: unrecognized_name while opening stream from
The code that I am executing at this point looks like the following:
public class OpenWS {
public static Object openWS (String serviceURN, String serviceClass, String portName) {
try {
//App.getHostURL returns the URL of my host, which has changed since
// the last time I ran this on my old workstation.
URL url = new URL(App.getHostURL() + "wsdl?targetURI=" + serviceURN);
Class classService = Class.forName(serviceClass);
Constructor constructorService = classService.getConstructor(URL.class);
//This is the line that is failing.
Object objectService = constructorService.newInstance(url);
Method portMethod = objectService.getClass().getMethod(portName);
Object port = portMethod.invoke(objectService);
return port;
} catch (MalformedURLException ex) {
Logger.getLogger(OpenWS.class.getName()).log(Level .SEVERE, null, ex);
} catch (ClassNotFoundException ex) {
Logger.getLogger(OpenWS.class.getName()).log(Level .SEVERE, null, ex);
} catch (NoSuchMethodException ex) {
Logger.getLogger(OpenWS.class.getName()).log(Level .SEVERE, null, ex);
} catch (SecurityException ex) {
Logger.getLogger(OpenWS.class.getName()).log(Level .SEVERE, null, ex);
} catch (InstantiationException ex) {
Logger.getLogger(OpenWS.class.getName()).log(Level .SEVERE, null, ex);
} catch (IllegalAccessException ex) {
Logger.getLogger(OpenWS.class.getName()).log(Level .SEVERE, null, ex);
} catch (IllegalArgumentException ex) {
Logger.getLogger(OpenWS.class.getName()).log(Level .SEVERE, null, ex);
} catch (InvocationTargetException ex) {
Logger.getLogger(OpenWS.class.getName()).log(Level .SEVERE, null, ex);
}
return null;
}
}
Below is the stack trace from the error.
java.lang.NullPointerException
at baseCode.LoginEmployeeController.serverLoginEmploy eeXml(LoginEmployeeController.java:99)
at baseCode.LoginEmployeeController.processLogin(Logi nEmployeeController.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java :75)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java :279)
at javafx.fxml.FXMLLoader$ControllerMethodEventHandle r.handle(FXMLLoader.java:1437)
at com.sun.javafx.event.CompositeEventHandler.dispatc hBubblingEvent(CompositeEventHandler.java:69)
at com.sun.javafx.event.EventHandlerManager.dispatchB ubblingEvent(EventHandlerManager.java:217)
at com.sun.javafx.event.EventHandlerManager.dispatchB ubblingEvent(EventHandlerManager.java:170)
at com.sun.javafx.event.CompositeEventDispatcher.disp atchBubblingEvent(CompositeEventDispatcher.java:38 )
at com.sun.javafx.event.BasicEventDispatcher.dispatch Event(BasicEventDispatcher.java:37)
at com.sun.javafx.event.EventDispatchChainImpl.dispat chEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatch Event(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispat chEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatch Event(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispat chEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatch Event(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispat chEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.EventUtil.fireEventImpl(Event Util.java:53)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil .java:28)
at javafx.event.Event.fireEvent(Event.java:171)
at javafx.scene.Node.fireEvent(Node.java:6863)
at javafx.scene.control.Button.fire(Button.java:179)
at com.sun.javafx.scene.control.behavior.ButtonBehavi or.mouseReleased(ButtonBehavior.java:193)
at com.sun.javafx.scene.control.skin.SkinBase$4.handl e(SkinBase.java:336)
at com.sun.javafx.scene.control.skin.SkinBase$4.handl e(SkinBase.java:329)
at com.sun.javafx.event.CompositeEventHandler.dispatc hBubblingEvent(CompositeEventHandler.java:64)
at com.sun.javafx.event.EventHandlerManager.dispatchB ubblingEvent(EventHandlerManager.java:217)
at com.sun.javafx.event.EventHandlerManager.dispatchB ubblingEvent(EventHandlerManager.java:170)
at com.sun.javafx.event.CompositeEventDispatcher.disp atchBubblingEvent(CompositeEventDispatcher.java:38 )
at com.sun.javafx.event.BasicEventDispatcher.dispatch Event(BasicEventDispatcher.java:37)
at com.sun.javafx.event.EventDispatchChainImpl.dispat chEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatch Event(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispat chEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatch Event(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispat chEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatch Event(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispat chEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatch Event(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispat chEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.EventUtil.fireEventImpl(Event Util.java:53)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil .java:33)
at javafx.event.Event.fireEvent(Event.java:171)
at javafx.scene.Scene$MouseHandler.process(Scene.java :3328)
at javafx.scene.Scene$MouseHandler.process(Scene.java :3168)
at javafx.scene.Scene$MouseHandler.access$1900(Scene. java:3123)
at javafx.scene.Scene.impl_processMouseEvent(Scene.ja va:1563)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Sc ene.java:2265)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$Mo useEventNotification.run(GlassViewEventHandler.jav a:250)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$Mo useEventNotification.run(GlassViewEventHandler.jav a:173)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.ha ndleMouseEvent(GlassViewEventHandler.java:292)
at com.sun.glass.ui.View.handleMouseEvent(View.java:5 28)
at com.sun.glass.ui.View.notifyMouse(View.java:922)
at com.sun.glass.ui.win.WinApplication._runLoop(Nativ e Method)
at com.sun.glass.ui.win.WinApplication.access$100(Win Application.java:29)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApp lication.java:73)
at java.lang.Thread.run(Thread.java:722)
I am pretty sure it is something simple that I am missing, but if anyone can point me in the right direction I would appreciate it.
Thank you