It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

kunti pawar Jun 18, 2018

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 Leader Jun 18, 2018
kunti pawar Jun 18, 2018

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

0 votes
Gonchik Tsymzhitov Community Leader 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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira Software

Early Access: If you use Jenkins and Jira Software Cloud, you need to read this!

The Jira Software Cloud Team has been busy working on a simple, secure, and reliable way to integrate your build and deployment information from Jenkins with Jira Software Cloud. This means you don’t...

279 views 0 8
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you