Friday, 15 July 2011

spring - multi module maven project module expose as soap web service -


I have a multi module Moeven-spring project I have the following structure -

  Mother -Service Services- Child Services-Services --- Child Services-Main --- Child Services-Web- Child Service- wsClient --- Child-Service-Demand  

I have created a new module called ChildService-wsService, where I will write the methods and expose them as Axis 2 SOAP web service. I am able to write independent modules in the sections of this module project and are exposed as service but I want to call the methods of the Child Services Service module.

I have errors like NoClassDefFoundError when I try to call methods of the Child Services Service module.

The sample code is low -

  public class HelloWorld {@Autowired Private ITestService iTestService; @ Etword icimman service general service; Public string getVal (strings) {returns S + "... test ..."; } Public string getValFfmService () {iTestService = New TestServiceImpl (); Return iTestService.test (); }  

I'm getting the error as the following -

  error: java.lang.NoClassDefFound error: in Java / service / trial / business / Itext service Lang.Class.forName0  

I still can not find any error if I include the following line in the class.

  Extended SpringBeanAutowiringSupport  

For example, you need to include the dependencies, for example, in your pom.xml:

  & lt; Dependency & gt; & Lt; Dependency & gt; & Lt; Group & gt; $ {Project.groupId} & lt; / Group & gt; & Lt; ArtifactId & gt; ChildService Services & lt; / ArtifactId> & Lt; Version & gt; $ {Project.version} & lt; / Edition & gt; & Lt; Scope & gt; Collection & lt; / Scope & gt; & Lt; / Dependencies & gt; ... & lt; / Dependencies & gt;  

Then you need to establish these dependencies in your local store ( install mvn cleaner ), or, in Eclipse, you will see Workspace Resolution (Click on Enable your module, Maven> Workspace resolution).


No comments:

Post a Comment