วันเสาร์ที่ 16 กรกฎาคม พ.ศ. 2559

การใช้ Spring Boot บน Websphere 8, 8.5

เพราะว่าเป็น Enterprise เลยต้องมีเวลา Customize เพิ่มครับ 1. ต้อง Downgrade ให้ไปใช้ JPA2.0 แทนเพราะ Spring Boot ใช้ JPA2.1 (JPA จะโหลดจาก Application Server ไม่สามารถ Config ให้โหลดจาก Web  Project ได้ครับ) ทีนี่ 2. Spring Boot จะ config แบบ no web.xml โดยการ extend SpringInitializer ถ้า Websphere...

การ Config SpringBoot ให้ใช้งานแบบมี web.xml

การ Config แบบนี้จะต้องย้ายพวก filter ออกมาจาก annotation แล้วมา config บน web.xml ให้หมดด้วยครับ ไม่งั้นจะใช้งานไม่ได้ ใน web.xml ผมมีตัวอย่างของการ Config CXF ด้วย ว่าต้องย้ายมาไว้บน web.xml ด้วยไม่งั้นใช้งานไม่ได้ <context-param> <param-name>contextConfigLocation</param-name> ...

วิธี Downgrade JPA จาก 2.1 เป็น 2.0 ของ SpringBoot

1. เริ่มจากเอา Config  JPA ออกจาก SpringBoot ก่อนครับ โดยใช้ exclusion org.hibernate <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> <exclusions> <exclusion> <groupId>org.hibernate</groupId> ...