Ana içeriğe atla

creating a war serving web service both soap and rest style with spring

This evening I spend my time to create a war that serving web service both soap and rest style together with spring. Although it is easy to create it, the java developers often faced some annoying class cast or class not found exceptions. in fact responsible from these errors are not the developers but the designers, but I don't know why they are stay developing packages with same name and also put them into rt.jar and also another package and so on. It is clear that the way preventing these errors is putting one class only one package and also a package is must be ONLY one place, not two or more.
I want to prove it to you, if you have a big system that contains a lot of libraries, just grep the jars for packages and find it in your system. you will most probably see that packages are represent more than one jar. and the other thing is the jar names. why you don't give the jar name form the package name. I thing it must be a restrinction package names and jar names must identical as in java that Class name and file names are equal. whatever, you can check it out from https://github.com/farukonder/rest-jaxws-spring-maven here the pom that is containing your all the dependencies and also exclusions!!!!.

 4.0.0

 eu.tyrkiahus
 eu.tyrkiahus.web.webservice
 1.0
 war

 eu.tyrkiahus.web.webservice

 
  ${project.build.directory}/endorsed
  UTF-8
 

 

  
  
   com.sun.jersey
   jersey-server
   1.8
  

  


  
   org.springframework
   spring-core
   3.0.5.RELEASE
  

  
   org.springframework
   spring-context
   3.0.5.RELEASE
  

  
   org.springframework
   spring-web
   3.0.5.RELEASE
  

  
  
   com.sun.jersey.contribs
   jersey-spring
   1.8
   
    
     org.springframework
     spring
    
    
     org.springframework
     spring-core
    
    
     org.springframework
     spring-web
    
    
     org.springframework
     spring-beans
    
    
     org.springframework
     spring-context
    
    
     org.springframework
     spring-aop
    
   
  

  
   com.sun.xml.bind
   jaxb-impl
   2.1.6
  

  
   org.jvnet.jax-ws-commons.spring
   jaxws-spring
   1.8
   
    
     com.sun.xml.bind
     jaxb-impl
    
    
     spring
     org.springframework
    
    
     spring-core
     org.springframework
    
    
     spring-context
     org.springframework
    
   
  
 

 
  
   
    org.apache.maven.plugins
    maven-compiler-plugin
    2.3.2
    
     1.6
     1.6
     
      ${endorsed.dir}
     
    
   
   
    org.apache.maven.plugins
    maven-war-plugin
    2.1.1
    
     false
    
   
   
    org.mortbay.jetty
    maven-jetty-plugin
    6.1.10
    
     10
     foo
     9999
    
   
  
 

 
  
   maven2-repository.java.net
   Java.net Repository for Maven
   http://download.java.net/maven/2/
  
 



you can check it out from https://github.com/farukonder/rest-jaxws-spring-maven good luck

Yorumlar