• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

OMException java.lang.NullPointerExce

Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have sented all my code. but i dont know where is wrong ... so please help me

//services.xml file
<service name="service" scope="application">
<description>Weather POJO Service</description>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
<parameter name="ServiceClass">edujinilabs.Service</parameter>

//service.java file

package edujinilabs;
import com.edujinilabs.aksh.quiz.Quiz;
public class Service

Quiz quiz;

public void submitQuiz(Quiz quiz)
public Quiz getQuiz()

return quiz;
//client file

package client;

import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;

import com.edujinilabs.aksh.quiz.Quiz;

public class QuizClient
public static void main(String[] args) throws AxisFault
RPCServiceClient client = new RPCServiceClient();
Options op = client.getOptions();
EndpointReference epr = new EndpointReference("http://localhost:8080/axis2/services/service");
// for Quiz

QName opSetQuiz = new QName("http://quiz.aksh.edujinilabs.com/xsd", "submitQuiz");
Quiz q=new Quiz();

Object[] opSetQuizArgs = new Object[] {q};
client.invokeRobust(opSetQuiz, opSetQuizArgs);
// Getting MyQuiz Parameter
QName GetInsert1 = new QName("http://quiz.aksh.edujinilabs.com/xsd", "getQuiz");
Object[] opGetQuizArg1 = new Object[] {};
Class[] returnTypes1 = new Class[] {Quiz.class};
Object[] response1 = client.invokeBlocking(GetInsert1, opGetQuizArg1, returnTypes1);
Quiz quiz=(Quiz)response1[0];
if(quiz == null)
System.out.println("Time didnot initialize!");
System.out.println("Title :" + quiz.getTitle());
System.out.println("Description :" + quiz.getDescription());
System.out.println("getQuiz methoid end......."+quiz.getQuizId());

///Exception after executing

Exception in thread "main" org.apache.axiom.om.OMException: java.lang.NullPointerException
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:211)
at org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:315)
at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:608)
at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:577)
at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:114)
at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:236)
at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:192)
at org.apache.axis2.client.ServiceClient.fillSOAPEnvelope(ServiceClient.java:631)
at org.apache.axis2.client.ServiceClient.sendRobust(ServiceClient.java:443)
at org.apache.axis2.client.ServiceClient.sendRobust(ServiceClient.java:426)
at org.apache.axis2.rpc.client.RPCServiceClient.invokeRobust(RPCServiceClient.java:132)
at client.QuizClient.main(QuizClient.java:29)
Caused by: java.lang.NullPointerException
at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:272)
at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.processProperties(ADBXMLStreamReaderImpl.java:926)
at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(ADBXMLStreamReaderImpl.java:780)
at org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:68)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:125)
... 11 more
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to use Axis2 SOAP Monitor tool and see what soap response and request looks like.
Check whether the problem is occurring at server side or at client side.

If the soap response looks fine, then check whether you are parsing soap reponse properly at client side.
Posts: 43081
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
continued here
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic