tags:

views:

929

answers:

2

Hi all,

We ate migrating one of our axis web service which was built using JDK 1.4 and axis 1.0.

We are trying to migrate it to JDK 1.6.0 with axis 1.2, but I am getting the following null pointer exception.

The same code is working fine as soon as switch back 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)

A: 

The exception looks like it's coming from your code:

au.com.michaelpage.placement.model.rdb.dao.StatusDAO.statusAlreadyExists(StatusDAO.java:275)

What version of WebLogic are you using? The only version that's certified with JDK 6 is WebLogic 10.3.

I can't tell from the stack trace, but I'll bet it's got to do with proxy generation and conflicting JAR versions.

I think a lift and load from JDK 1.4 and Axis 1.0 to JDK 6 and Axis 1.2 is fraught with peril. There's a lot that changed. It's not a surprise that you're running into difficulties.

duffymo
Hi,Thank you for the reply.We are using Weblogic 10.3 only.Meanwhile I compiled and redployed the application and the stack trace is different now.(404)Not Found at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744) I posted full stack trace above.Thanks in advance.
A: 

You investigate the cause of NullPointerException first in class StatusDAO.java at line number 275. See why the object is null.

Not sure what could be the root cause here but I have faced similar issue while upgrading to newer version of Jibx. Jibx converts XML to Java object and vice versa. If a particular node list is blank it used to set it with blank ArrayList, but in newer version it set it to null which cause nullpointers at many places. By following the nullpointer I manage to find the root cause and fixed it.

Bhushan
Hi Bhushan,Thanks for the reply.Actually the method in StatusDAO is invoked by a method in MigratorManager. This method in turn in is invoked by the actual method which is exposed as web service.In the Stub if I put a break point and debug it, I could see an exception is thrown when 'invoke()' method of 'org.apache.axis.client.Call' is invoked.My problem is the same code without any changes works fine with JDK 1.4.2 but not with JDK 1.6.0.Any help?Thanks in advance.