Could not initialize class org.apache.axis.client.AxisClient

I am getting below error 

java.lang.NoClassDefFoundError: Could not initialize class org.apache.axis.client.AxisClient at org.apache.axis.client.Service.getAxisClient(Service.java:104) at org.apache.axis.client.Service.<init>(Service.java:113) at com.polarion.alm.ws.client.tracker.TrackerWebServiceServiceLocator.<init>(TrackerWebServiceServiceLocator.java:16) at com.polarion.alm.ws.client.WebServiceFactory.<init>(WebServiceFactory.java:87) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source)

-----------------------------------------------------------------------------

MY CODE : -

import com.polarion.alm.ws.client.WebServiceFactory;
import com.polarion.alm.ws.client.session.SessionWebService;
import com.polarion.alm.ws.client.tracker.TrackerWebService;
import com.polarion.alm.ws.client.types.tracker.WorkItem;
import org.apache.axis.client.AxisClient
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

 

def myLog = LoggerFactory.getLogger("com.onresolve.jira.groovy")
myLog.info("Hello kunti from Jira")
try {
WebServiceFactory factory;
TrackerWebService trackerService;
SessionWebService sessionService;

factory = new WebServiceFactory("http://inchnsirplmvma1.india.tcs.com:7002/polarion/ws/services/");

sessionService = factory.getSessionService();
sessionService.logIn("admin", "admin");
myLog.info(("Login Started.... "));
trackerService = factory.getTrackerService();
String query = "project.id:" + "Kunti";
//query = "project.id:Kunti AND NOT HAS_VALUE:resolution AND id:KUNT-461";
query = "project.id:APTIV AND NOT HAS_VALUE:resolution AND id:APTIV-1215";

String sort = "id";
//String[] fields = {"id", "title", "status","linkedWorkItems"};
String[] fields = ["id", "title", "status","customFields"];
WorkItem[] workItems = trackerService.queryWorkItems(query, sort, fields);
WorkItem ws1 = null;

if (workItems.length != 1) {
myLog.info(("XYZ3 "+sessionService));
}
ws1 = workItems[0];

myLog.info("<p>work item: " + ws1.getId() + " " + ws1.getTitle());
myLog.info("<p>work item: " +ws1.getStatus().getId()+" "+ws1.getCustomFields());
} catch (Exception e) {
e.printStackTrace();
}

2 answers

0 votes
Gonchik Tsymzhitov Community Champion Jun 18, 2018

Yes I have tried as last comment then also I am getting same error

0 votes
Gonchik Tsymzhitov Community Champion Jun 18, 2018

Well. let's check step by step.

 

Are you using axis2 or just axis? 

If you use axis, let's try wrap into plugin. 

I am using in my plugin with compile scope. 

Because axis in WEB-INF/lib needs to be restarted after uploading library. Therefore I am using like this 

<!--  dependencies for Axis used in SF SOAP Integration  -->
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>axis</groupId>
<artifactId>axis-wsdl4j</artifactId>
<version>1.5.1</version>
<scope>compile</scope>
</dependency>

 

Summary: try to restart instance or wrap your code into own plugin.

Hope it helps. 

 

Cheers,

Gonchik Tsymzhitov

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Jira

Updates to jira.atlassian.com give you visibility into what's coming in Jira Server and Data Center

Hello, Community! My name is Gosia and I'm a Product Manager on Jira Server and Data Center here at Atlassian. Since 2002 when we launched our public issue tracker, jira.atlass...

629 views 1 15
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you