【问题标题】:Best to way to re-load java classes without WebSphere re-start?在不重新启动 WebSphere 的情况下重新加载 java 类的最佳方法是什么?
【发布时间】:2009-08-31 19:40:47
【问题描述】:

在 WebSphere App Server 上将动态类重新加载功能实现到 J2EE WebApp 中的任何资源或最佳实践?

关键是我不想在某些类更新时关闭我的网络应用程序。

【问题讨论】:

    标签: java class dynamic jakarta-ee


    【解决方案1】:

    您可能想看看javarebel,这是热重载 AFIK 的最新技术

    【讨论】:

      【解决方案2】:

      有一个 Maven 任务,而不是将所有项目文件复制到 WebSphere installedapps 目录。现在无需通过管理界面更新应用程序,只需运行 maven install 并将所有文件复制到服务器。不要忘记将 ibm-web-bnd.xmi 和 ibm-web-ext.xmi 文件添加到您的 WEB_INF 以启用类重新加载

      <properties>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
          <websphere.was.path>L:\WebSphere\AppServer</websphere.was.path>
          <websphere.portal.path>L:\WebSphere\PortalServer</websphere.portal.path>
          <deploy.path>L:\WebSphere\wp_profile\installedApps\LIPETSK-WPSCell\PA_Services_Search.ear</deploy.path>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
      
      ...
      
      <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <executions>
              <execution>
                  <phase>install</phase>
                  <configuration>
                      <tasks>
                          <property name="src" location="target/${project.artifactId}"/>
                          <property name="dst" location="${deploy.path}/${project.artifactId}.${project.packaging}"/>
                          <copy todir="${dst}" overwrite="true" verbose="true">
                              <fileset dir="${src}" casesensitive="yes">
                                  <include name="**/*.*"/>
                                  <exclude name="WEB-INF/lib/*.*"/>
                              </fileset>
                          </copy>
                      </tasks>
                  </configuration>
                  <goals>
                      <goal>run</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>
      

      【讨论】:

        【解决方案3】:

        只需按照WebSphere Infocenter 上的说明进行操作即可。该部分的标题为“热部署和动态重新加载”。这似乎正是您想要的。

        【讨论】:

        • 链接正在重定向到信息中心的默认页面。请更新
        猜你喜欢
        • 2012-05-13
        • 2014-03-11
        • 1970-01-01
        • 1970-01-01
        • 2013-12-02
        • 2015-05-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多