Satish
Satish

Reputation: 6485

Best to way to re-load java classes without WebSphere re-start?

Any re-sources or best-practices for implementing dynamic class re-loading feature into a J2EE WebApp on WebSphere App Server?

The point is I don't want to bring down my web-application while certain classes are updated.

Upvotes: 1

Views: 5652

Answers (3)

Georgy Gobozov
Georgy Gobozov

Reputation: 13721

There is maven task than copy all project files to WebSphere installedapps directory. Now no need to update application through admin interface, just run maven install and all files will be copy to the server. Don't forget to add ibm-web-bnd.xmi and ibm-web-ext.xmi files to your WEB_INF to enable class reloading

<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>

Upvotes: 1

Ryan Fernandes
Ryan Fernandes

Reputation: 8526

Just follow the instructions on the WebSphere Infocenter. The Section is titled "Hot deployment and dynamic reloading". This seems to be just what you are looking for.

Upvotes: 0

krosenvold
krosenvold

Reputation: 77121

You probably want to have a look at javarebel, which is the state of the art in hot-reloading AFIK

Upvotes: 1

Related Questions