Axis 1.2 Web Service with JDK 1.6.0
We ate one of our web services which was built using JDK 1.4 and axis 1.0.
We are trying to port it to JDK 1.6.0 using the 1.2 axis, but I am getting the following null pointer exception.
The same code works fine as soon as you switch to JDK 1.4.
Any help? Thanks in advance.
java.lang.NullPointerException
at au.com.michaelpage.placement.model.rdb.dao.StatusDAO.statusAlreadyExists(StatusDAO.java:275)
at au.com.michaelpage.placement.model.rdb.dao.StatusDAO.insert(StatusDAO.java:176)
at au.com.michaelpage.pseweb.migrator.MigratorManager.processOnlinePlacement(MigratorManager.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:388)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:283)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3495)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
New stack trace.
(404)Not Found
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
at org.apache.axis.client.Call.invoke(Call.java:2748)
at org.apache.axis.client.Call.invoke(Call.java:2424)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at au.com.michaelpage.pseweb.migrator.ws.PseMigratorSoapBindingStub.processOnlinePlacement(PseMigratorSoapBindingStub.java:115)
at au.com.michaelpage.pseweb.migrator.MigratorScheduledTask.run(MigratorScheduledTask.java:47)
at au.com.michaelpage.pseweb.migrator.MigratorScheduledTask.main(MigratorScheduledTask.java:35)
The exception looks like it comes from your code:
au.com.michaelpage.placement.model.rdb.dao.StatusDAO.statusAlreadyExists(StatusDAO.java:275)
Which version of WebLogic are you using? The only JDK 6 certified release is WebLogic 10.3.
I can't tell from the stack trace, but I'm willing to bet it has to do with proxy generation and conflicting JAR versions.
I think that lifting and downloading from JDK 1.4 and Axis 1.0 to JDK 6 and Axis 1.2 is fraught with danger. Much has changed there. No wonder you face difficulties.
source to share
You first investigate the reason for the NullPointerException in the StatusDAO.java class on line 275. See why the object is null.
Not sure what the root cause here might be, but I ran into a similar issue when upgrading to a newer version of Jibx. Jibx converts XML to Java object and vice versa. If a particular node list is empty, it is used to set it with an empty ArrayList, but in a newer version, it sets to null, which causes null pointers in many places. By following the null pointer, I was able to find the root cause and fix it.
source to share