Hi Thilini, Thank you for the suggestion. The Shade plugin solved the problem.
Regards, Dilhasha *M.N.F. Dilhasha* Software Engineering Intern | *WSO2 Lanka* email : *[email protected] <[email protected]>*mobile : +94 77 8449321 On Fri, Mar 27, 2015 at 3:28 PM, Thilini Cooray <[email protected]> wrote: > Hi Fathima, > > [1] says that depending projects are not included when creating a jar. > It suggests using Maven Shade Plugin. > > Check whether this can help to resolve your issue. > > [1] > http://stackoverflow.com/questions/22990475/java-lang-noclassdeffounderror-when-running-maven-jgroups-project-build-with-net > > On Fri, Mar 27, 2015 at 3:03 PM, Fathima Dilhasha <[email protected]> > wrote: > >> Hi, >> >> This is the dependency tree for the project. >> >> *[INFO] +- axis:axis:jar:1.3:compile* >> *[INFO] | +- wsdl4j:wsdl4j:jar:1.5.1:compile* >> *[INFO] | +- commons-logging:commons-logging:jar:1.0.4:compile* >> *[INFO] | \- commons-discovery:commons-discovery:jar:0.2:compile* >> *[INFO] +- axis:axis-jaxrpc:jar:1.3:compile* >> *[INFO] +- axis:axis-saaj:jar:1.3:compile* >> *[INFO] \- axis:axis-wsdl4j:jar:1.5.1:compile* >> >> >> This project works fine when run. But when included as a jar only I get >> this *run time exception* I've mentioned. >> >> Thanks. >> >> >> *M.N.F. Dilhasha* >> Software Engineering Intern | *WSO2 Lanka* >> >> email : >> *[email protected] <[email protected]>*mobile : +94 77 8449321 >> >> On Fri, Mar 27, 2015 at 2:56 PM, Danushka Fernando <[email protected]> >> wrote: >> >>> Please update the thread with the maven dependency tree. >>> >>> Thanks & Regards >>> Danushka Fernando >>> Software Engineer >>> WSO2 inc. http://wso2.com/ >>> Mobile : +94716332729 >>> >>> On Fri, Mar 27, 2015 at 2:45 PM, Fathima Dilhasha <[email protected]> >>> wrote: >>> >>>> Hi Himasha, >>>> >>>> That dependency is already added in the project. >>>> >>>> Thanks. >>>> >>>> *M.N.F. Dilhasha* >>>> Software Engineering Intern | *WSO2 Lanka* >>>> >>>> email : >>>> *[email protected] <[email protected]>*mobile : +94 77 8449321 >>>> >>>> On Fri, Mar 27, 2015 at 2:41 PM, Himasha Guruge <[email protected]> >>>> wrote: >>>> >>>>> Hi Fathima, >>>>> >>>>> Can you try adding below dependency? According to a comment in [1], >>>>> "javax.xml.rpc >>>>> package is used only in Axis 1, and the jaxrpc.jar file that contains it >>>>> comes with Axis". >>>>> >>>>> <dependency> >>>>> <groupId>axis</groupId> >>>>> <artifactId>axis-jaxrpc</artifactId> >>>>> <version>1.3</version> >>>>> </dependency> >>>>> >>>>> [1] >>>>> http://www.coderanch.com/t/484223/Web-Services/java/java-lang-NoClassDefFoundError-javax-xml >>>>> >>>>> Thanks, >>>>> Himasha >>>>> >>>>> On Fri, Mar 27, 2015 at 2:04 PM, Fathima Dilhasha <[email protected]> >>>>> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I added it and tried . But it doesn't seem to fix the problem. >>>>>> >>>>>> Thanks. >>>>>> >>>>>> *M.N.F. Dilhasha* >>>>>> Software Engineering Intern | *WSO2 Lanka* >>>>>> >>>>>> email : >>>>>> *[email protected] <[email protected]>*mobile : +94 77 8449321 >>>>>> >>>>>> On Fri, Mar 27, 2015 at 2:00 PM, Lakshman Udayakantha < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> Hi Fathima, >>>>>>> >>>>>>> add this dependency to your pom to see whether it solves your >>>>>>> problem. >>>>>>> >>>>>>> <dependency> >>>>>>> <groupId>javax.xml</groupId> >>>>>>> <artifactId>jaxrpc-api</artifactId> >>>>>>> <version>1.1</version> >>>>>>> </dependency> >>>>>>> >>>>>>> Thanks >>>>>>> >>>>>>> On Fri, Mar 27, 2015 at 1:56 PM, Fathima Dilhasha <[email protected] >>>>>>> > wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I have created a SOAP client to create a project in a Jira >>>>>>>> Instance. It works fine and creates a project when the source project >>>>>>>> is >>>>>>>> run. >>>>>>>> >>>>>>>> But when I build a jar from the same project, it gives a run time >>>>>>>> exception as follows. >>>>>>>> >>>>>>>> *Exception in thread "main" java.lang.NoClassDefFoundError: >>>>>>>> javax/xml/rpc/ServiceException* >>>>>>>> * at >>>>>>>> org.wso2.carbon.appfactory.issuetracking.SOAPClient.test(SOAPClient.java:34)* >>>>>>>> * at Test.main(Test.java:9)* >>>>>>>> * at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)* >>>>>>>> * at >>>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)* >>>>>>>> * at >>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)* >>>>>>>> * at java.lang.reflect.Method.invoke(Method.java:606)* >>>>>>>> * at >>>>>>>> com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)* >>>>>>>> *Caused by: java.lang.ClassNotFoundException: >>>>>>>> javax.xml.rpc.ServiceException* >>>>>>>> * at java.net.URLClassLoader$1.run(URLClassLoader.java:366)* >>>>>>>> * at java.net.URLClassLoader$1.run(URLClassLoader.java:355)* >>>>>>>> * at java.security.AccessController.doPrivileged(Native Method)* >>>>>>>> * at java.net.URLClassLoader.findClass(URLClassLoader.java:354)* >>>>>>>> * at java.lang.ClassLoader.loadClass(ClassLoader.java:425)* >>>>>>>> * at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)* >>>>>>>> * at java.lang.ClassLoader.loadClass(ClassLoader.java:358)* >>>>>>>> * ... 7 more* >>>>>>>> >>>>>>>> >>>>>>>> The pom.xml for the project is as follows. >>>>>>>> >>>>>>>> <project xmlns="http://maven.apache.org/POM/4.0.0" >>>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>>>>>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >>>>>>>> http://maven.apache.org/maven-v4_0_0.xsd"> >>>>>>>> <modelVersion>4.0.0</modelVersion> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> <groupId>org.wso2.carbon</groupId> >>>>>>>> <artifactId>org.wso2.carbon.appfactory.issuetracking</artifactId> >>>>>>>> <version>2.1.0-SNAPSHOT</version> >>>>>>>> <name>JIRA SOAP Client</name> >>>>>>>> <description>A plugin which provides a sample SOAP >>>>>>>> implementation.</description> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> <repositories> >>>>>>>> <repository> >>>>>>>> <id>atlassian</id> >>>>>>>> <name>Atlassian Repository</name> >>>>>>>> <url>https://maven.atlassian.com/content/groups/public</url> >>>>>>>> </repository> >>>>>>>> </repositories> >>>>>>>> >>>>>>>> >>>>>>>> <pluginRepositories> >>>>>>>> <pluginRepository> >>>>>>>> <id>atlassian</id> >>>>>>>> <name>Atlassian Repository</name> >>>>>>>> >>>>>>>> <url>https://maven.atlassian.com/content/groups/public</url> >>>>>>>> </pluginRepository> >>>>>>>> </pluginRepositories> >>>>>>>> >>>>>>>> <build> >>>>>>>> <plugins> >>>>>>>> <plugin> >>>>>>>> <groupId>org.codehaus.mojo</groupId> >>>>>>>> <artifactId>axistools-maven-plugin</artifactId> >>>>>>>> <version>1.3</version> >>>>>>>> <dependencies> >>>>>>>> <dependency> >>>>>>>> <groupId>axis</groupId> >>>>>>>> <artifactId>axis</artifactId> >>>>>>>> <version>1.3</version> >>>>>>>> </dependency> >>>>>>>> </dependencies> >>>>>>>> <configuration> >>>>>>>> <wsdlFiles> >>>>>>>> <wsdlFile>jirasoapservice-v2.wsdl</wsdlFile> >>>>>>>> </wsdlFiles> >>>>>>>> >>>>>>>> <packageSpace>com.atlassian.jira.rpc.soap.client</packageSpace> >>>>>>>> </configuration> >>>>>>>> <executions> >>>>>>>> <execution> >>>>>>>> <id>wsdl2java-generation</id> >>>>>>>> <phase>generate-sources</phase> >>>>>>>> <goals> >>>>>>>> <goal>wsdl2java</goal> >>>>>>>> </goals> >>>>>>>> </execution> >>>>>>>> </executions> >>>>>>>> </plugin> >>>>>>>> <plugin> >>>>>>>> <artifactId>maven-assembly-plugin</artifactId> >>>>>>>> <configuration> >>>>>>>> <descriptorRefs> >>>>>>>> >>>>>>>> <descriptorRef>jar-with-dependencies</descriptorRef> >>>>>>>> </descriptorRefs> >>>>>>>> <archive> >>>>>>>> <manifest> >>>>>>>> <addClasspath>true</addClasspath> >>>>>>>> >>>>>>>> <mainClass>org.wso2.carbon.appfactory.issuetracking.SOAPClient</mainClass> >>>>>>>> </manifest> >>>>>>>> </archive> >>>>>>>> </configuration> >>>>>>>> </plugin> >>>>>>>> </plugins> >>>>>>>> </build> >>>>>>>> >>>>>>>> <profiles> >>>>>>>> <profile> >>>>>>>> <id>buildclient</id> >>>>>>>> <build> >>>>>>>> <defaultGoal>assembly:assembly</defaultGoal> >>>>>>>> </build> >>>>>>>> </profile> >>>>>>>> <profile> >>>>>>>> <id>fetch-wsdl</id> >>>>>>>> <build> >>>>>>>> <defaultGoal>generate-sources</defaultGoal> >>>>>>>> <plugins> >>>>>>>> <plugin> >>>>>>>> <artifactId>maven-antrun-plugin</artifactId> >>>>>>>> <executions> >>>>>>>> <execution> >>>>>>>> <phase>generate-sources</phase> >>>>>>>> <goals> >>>>>>>> <goal>run</goal> >>>>>>>> </goals> >>>>>>>> <configuration> >>>>>>>> <tasks> >>>>>>>> <get >>>>>>>> src="${jira.soapclient.jiraurl}/rpc/soap/jirasoapservice-v2?wsdl" >>>>>>>> >>>>>>>> dest="${basedir}/src/main/wsdl/jirasoapservice-v2.wsdl"/> >>>>>>>> </tasks> >>>>>>>> </configuration> >>>>>>>> </execution> >>>>>>>> </executions> >>>>>>>> <dependencies> >>>>>>>> <dependency> >>>>>>>> <groupId>axis</groupId> >>>>>>>> <artifactId>axis-ant</artifactId> >>>>>>>> <version>1.3</version> >>>>>>>> </dependency> >>>>>>>> </dependencies> >>>>>>>> </plugin> >>>>>>>> </plugins> >>>>>>>> </build> >>>>>>>> <properties> >>>>>>>> >>>>>>>> <jira.soapclient.jiraurl>http://wso2:2990/jira</jira.soapclient.jiraurl> >>>>>>>> </properties> >>>>>>>> </profile> >>>>>>>> </profiles> >>>>>>>> >>>>>>>> <dependencies> >>>>>>>> <dependency> >>>>>>>> <groupId>axis</groupId> >>>>>>>> <artifactId>axis</artifactId> >>>>>>>> <version>1.3</version> >>>>>>>> </dependency> >>>>>>>> <dependency> >>>>>>>> <groupId>axis</groupId> >>>>>>>> <artifactId>axis-jaxrpc</artifactId> >>>>>>>> <version>1.3</version> >>>>>>>> </dependency> >>>>>>>> <dependency> >>>>>>>> <groupId>axis</groupId> >>>>>>>> <artifactId>axis-saaj</artifactId> >>>>>>>> <version>1.3</version> >>>>>>>> </dependency> >>>>>>>> <dependency> >>>>>>>> <groupId>axis</groupId> >>>>>>>> <artifactId>axis-wsdl4j</artifactId> >>>>>>>> <version>1.5.1</version> >>>>>>>> <scope>compile</scope> >>>>>>>> </dependency> >>>>>>>> >>>>>>>> </dependencies> >>>>>>>> >>>>>>>> </project> >>>>>>>> >>>>>>>> It would be really helpful if anyone can point out why I'm getting >>>>>>>> this exception. >>>>>>>> >>>>>>>> Thanks. >>>>>>>> Regards, >>>>>>>> Dilhasha >>>>>>>> >>>>>>>> *M.N.F. Dilhasha* >>>>>>>> Software Engineering Intern | *WSO2 Lanka* >>>>>>>> >>>>>>>> email : >>>>>>>> *[email protected] <[email protected]>*mobile : +94 77 8449321 >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Dev mailing list >>>>>>>> [email protected] >>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Lakshman Udayakantha >>>>>>> WSO2 Inc. www.wso2.com >>>>>>> lean.enterprise.middleware >>>>>>> Mobile: *0711241005* >>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Dev mailing list >>>>>> [email protected] >>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Himasha Guruge >>>>> *Software Engineer* >>>>> WS*O2* *Inc.* >>>>> Mobile: +94 777459299 >>>>> [email protected] >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Dev mailing list >>>> [email protected] >>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>> >>>> >>> >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Best Regards, > > *Thilini Cooray* > Software Engineer > Mobile : +94 (0) 774 570 112 <%2B94%20%280%29%20773%20451194> > E-mail : [email protected] > > WSO2 Inc. www.wso2.com > lean.enterprise.middleware >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
