aspose file tools*
The moose likes Web Services and the fly likes Null Pointer exception during run client code using Axis 1.4 on weblogic 8.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Null Pointer exception during run client code using Axis 1.4 on weblogic 8.1" Watch "Null Pointer exception during run client code using Axis 1.4 on weblogic 8.1" New topic
Author

Null Pointer exception during run client code using Axis 1.4 on weblogic 8.1

Sam Dec
Greenhorn

Joined: Aug 12, 2009
Posts: 5
I have created my web service using Axis 1.4 and it's sussces fully deployed on weblogic 8.1.
I have created WSDL file through Java2WSDL tool of Axis.However i run my client it 's throws following exception

Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NullPointerException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:xss-444

java.lang.NullPointerException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(Deserializ
ationContext.java:1087)
at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
at org.apache.crimson.parser.Parser2.content(Unknown Source)
at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
at org.apache.crimson.parser.Parser2.content(Unknown Source)
at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
at org.apache.crimson.parser.Parser2.parse(Unknown Source)
at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(Deserialization
Context.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders
tandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.xav.wssample.ws.generated.CalculatorSoapBindingStub.add(Calculato
rSoapBindingStub.java:118)
at com.xav.wsclient.CalcClient.main(CalcClient.java:24)

I am not able to understands what is reason behind it...?
Client code is ---

CalculatorService service = new CalculatorServiceLocator();
Calculator calc = service.getcalculator();
System.out.println("15 + 6 = " + calc.add(15, 6));
System.out.println("15 - 6 = " + calc.subtract(15, 6));
sammeta Phanikumar
Ranch Hand

Joined: Oct 25, 2007
Posts: 81
please check Calculator class. I dint see any null pointer exceptions can be raised at client side because of Client code...as requried classes and methods are generated by AXIS.



SCJP 5, SCWCD 5, SCDJWS 5
Sam Dec
Greenhorn

Joined: Aug 12, 2009
Posts: 5
Thanks for suggestion but Sammeta Calculator class is simple interface...so from my side there is no fault in the Calculator ...it might be some thing else....
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Have you tried to access your service using some web service testing tool, like soapUI or the one in Eclipse (at least in my installation)?
It looks like the problem is on the server side, since you receive a SOAP fault response with the fault code Server from it:

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException

Best wishes!
Sam Dec
Greenhorn

Joined: Aug 12, 2009
Posts: 5
I checked on server and found Axis was not prperly configured whenver i open http://localhost:7001/axis/happyaxis.jsp
likn say Error 503--Service Unavailable and on the weblogic console i am getting following exception

<Aug 13, 2009 12:53:43 PM IST> <Error> <Deployer> <BEA-149231> <Unable to set th
e activation state to true for the application _appsdir_axis_dir.
org.apache.commons.logging.LogConfigurationException: Invalid class loader hiera
rchy. You have more than one version of 'org.apache.commons.logging.Log' visibl
e, which is not allowed.
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogF
actoryImpl.java:385)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:529)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
Impl.java:235)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370)
at org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:3
7)
at org.apache.axis.transport.http.AxisHTTPSessionListener.><clinit>(AxisH
TTPSessionListener.java:33)


Even i have set <prefer-web-inf-classes>true</prefer-web-inf-classes> into weblogic.xml file in Axis application and copy /web-inf/lib folder (xml-apis.jar,xercesImpl.jar) after that it's not able to set.

Rajeswara badam
Greenhorn

Joined: Jun 15, 2012
Posts: 1
I made a long research on this kind of issue, and the only solution for this kind of issue is:
you just remove the .wsdl file from the soapui and andadd the wsdl after restarting the the soap. the same solution is also working for me.
 
jQuery in Action, 2nd edition
 
subject: Null Pointer exception during run client code using Axis 1.4 on weblogic 8.1