Eclipse Maven Weblogic hot code swap

前端 未结 1 1233
梦毁少年i
梦毁少年i 2021-02-10 17:45

I have a basic question about running a Java EE application on Weblogic using maven in eclipse.

I use OEPE (Oracle Enterprise pack for Eclipse) which comes with some plu

1条回答
  •  醉梦人生
    2021-02-10 18:07

    Let me provide you with my checklist to make my web application hot-deployed on Weblogic. This checklist assumes a weblogic version which implements Servlet 2.5 and assumes your project is a maven one which is configured to run maven-compiler-plugin for JDK 1.6. In other words your weblogic version is 10.x.x and your POM includes the following snippet:

    org.apache.maven.plugins
    maven-compiler-plugin
    2.3.2
    
        1.6
        1.6
    
    

    To build a war

    Use OEPE plugin to create a new Weblogic Web module Weblogic.xml file:

    • Don’t enable spring extension
    • In FastSwap: Don’t enable class redefinition
    • Take note of the value

      myappcontextroot 
      

      it will be used later in the hot-deployment

    Execute Maven update project from Eclipse context menu of your project

    Execute Maven clean install

    For hot-deployment setup:

    • Add local weblogic as a runtime server in Windows->preferences->Server->Runtime. Remember to change its Java home to the Sun JDK instead of JRocket for development mode.
    • Add local server in Server->add server
    • Project context menu->properties->Project Facet-> add faceted nature
    • Make Sure Jave Facet is version 1.6
    • Check Dynamic web application version 2.5 and make the target runtime be the runtime server declared in the first step + In further configuration give “context root” the value "myappcontextroot" which was noted above and give “Content directory" the value "src\main\webapp”. Don't generate web.xml otherwise your web.xml is overwritten
    • Push OK to apply all the above facet changes to your project
    • Again open Project context menu->properties->Deployment Assembly->Add java build path->Maven dependencies
    • Finally, in the server window Add configured application to the running server

    Please follow these steps literally, it is really worth it!

    0 讨论(0)
提交回复
热议问题