Page 1 of 1

Getting null pointer exception

PostPosted:Thu Apr 07, 2011 6:06 am
by gangadhara.k
Hi All,
When i tried to execute the following code i am getting null pointer exception, Please help me to come out of this.

Code
Code: Select all
public static void main(String[] args)throws Exception {
		 try{
			 OKMAuthServiceStub objStub = new OKMAuthServiceStub(); 
			 Login objLogin = (Login) Login.class.newInstance(); 
			 objLogin.setUser("okmAdmin");
			 objLogin.setPassword("admin");				 
			 LoginResponse token =  objStub.login(objLogin);
			 
			 OKMDocumentServiceStub documentService = new OKMDocumentServiceStub();	 
			 Document objDocument = (Document)Document.class.newInstance(); 
			 objDocument.setPath("/okm:root/test");
			 
			 Create objCreate = (Create)Create.class.newInstance();
			 System.out.println("objCreate "+ objCreate);
			 objCreate.setDoc(objDocument);
			 objCreate.setToken(token.toString());
			
			 documentService.create(objCreate);
		 } catch (AxisFault objAxisFault) {  
				objAxisFault.printStackTrace();
		 } catch (RemoteException objRemoteException) { 
				objRemoteException.printStackTrace();
		 }
	} 
Exception on console
Code: Select all
org.apache.axis2.AxisFault: java.lang.NullPointerException
	at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:446)
	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
	at com.openkm.ws.endpoint.OKMDocumentServiceStub.create(OKMDocumentServiceStub.java:5168)
	at com.openkm.ws.endpoint.BootLoaderTest.main(BootLoaderTest.java:44)
I am able to get the token for the username/password, after that i am getting the above exception. Please let me know if any info needed.

Thanks
Ganga

Re: Getting null pointer exception

PostPosted:Thu Apr 07, 2011 9:55 pm
by jllort
Any error on server.log ?

Re: Getting null pointer exception

PostPosted:Fri Apr 08, 2011 1:53 pm
by pavila
Which OpenKM version?