• 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

OMException java.lang.NullPointerExce

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
<parameter name="ServiceClass">edujinilabs.Service</parameter>
</service>

//service.java file

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

Quiz quiz;

public void submitQuiz(Quiz quiz)
{
this.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");
op.setTo(epr);
// for Quiz

QName opSetQuiz = new QName("http://quiz.aksh.edujinilabs.com/xsd", "submitQuiz");
Quiz q=new Quiz();
q.setDescription("QuizDesc");
q.setTitle("QuizTitle");
q.setQuizId("QuizID");

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!");
return;
}
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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
continued here
 
And then the flying monkeys attacked. My only defense was this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic