030010. Restful architecture (Weblogic 12- Spring 4- Jersey)


What you’ll need
  • About 30 minutes
  • JDK 1.8 or later. 
  • Eclipse <Oxigene>
  • Weblogic12c
  • Maven
  • Postman (Optional)

Last update:

 It has not been updated as Jersey face many problems to intregrate  with Spring.

 Pending to update all of the problems face with the integration.
 There are many problems as well to included in Weblogic. Version 1.8 by default try to include version 6.

 6 Hours estimated to document all...

 Name with project for Jersey Architecture DMS.

Preconditions:






Update dependencies to Pom.xml


Add dispatcherServlet to web.xml

Reference: Spring concepts - dispatcherServlet



<display-name>Archetype Created Web Application</display-name> 
Add webApplicationContext.xml to the project

Initially we will add just the basic setting, reference to the services package.

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
 http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
 http://www.springframework.org/schema/context
 http://www.springframework.org/schema/context/spring-context-4.0.xsd">
 <context:component-scan base-package="eu.cec.empl.dms.presentation.rest.services" />
</beans>

Add weblogic.xml to the project
 We will do the same as we have done with the webApplicationContext.xml, we just add the basic settings.


<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd">   
    <wls:context-root>dms</wls:context-root>
</wls:weblogic-web-app>

Add the Sources files 

- Domain object
- Persistence DAO
- RestService






(Pending code)  

Testing the installation



See Also



http://www.codingpedia.org/ama/restful-web-services-example-in-java-with-jersey-spring-and-mybatis/



Comments