Hello,
In order to use the hot deploy (re-deploy the app without restarting server), I'm using the server in development mode and using the following directory structure for my enterprise application.
domains/my_domain/applications/myapp
|
|-APP-INF
|-APP-INF/classes
|-APP-INF/lib
|-META-INF
|-META-INF/application.xml
|-META-INF/REDEPLOY
|-myejbs.jar
|-mywebapp.war
The jar file contains all the
EJB classes and deployment descriptor; the war file contains the JSPs,
servlet classes and web.xml; and the APP-INF/classes folder contains all the common classes.
Now to
test this after deploying first time with this structure, I changed one of the JSPs, and copied the modified war file and then changed the timestamp of the REDEPLOY file (by touching it). And it refreshed the changes, so logically it is redeploying the files without restarting the server.
Now, the problem is that there are some classes which are being instantiated dynamically (using Class.forName()). And when it tries to load the first class through Class.forName, it fails by giving "java.lang.NoClassDefFoundError".
I tried following alternatives to get rid of this error, but no luck so far:
- Tried adding the common classes directory explicitly in classpath
- Deploy the application as a bundled EAR file instead of exploded structure
- Tried adding the required classes in the jar and/or war files.
Any clues at this point?