While developing applications in WebLogic Server, it is helpful to keep a few important points in mind. These points are listed here for the specific application deployment environments. Single-Server Environment The following points are important while developing in a single-server environment: While developing, keep your files in an exploded format. This will reduce your effort and the time overhead of creating archive files and redeploying each time you find an error in your program. Place the compiled servlet classes directly into the classes directory of your domain's applications/your web app/WEB-INF directory. In this way, every time you rewrite the servlet, the servlet gets reloaded automatically. You can place your JSPs in the Web application directory of your domain's applications directory directly to view changes in your application. To redeploy your Web application's deployment descriptors or any other file while deploying your application in an exploded format, you need to have a file called REDEPLOY in your WEB-INF directory or META-INF directory, depending on the kind of application you are deploying. The contents of this file are not important. It could be an empty file, too. When you wish to redeploy your Web application's classes, modify the REDEPLOY file (you could just add a space or a full stop to modify it!) after updating your files in the deployment directories. The change in timestamp of the REDEPLOY file will prompt the WebLogic server to reload the deployment descriptor files. To redeploy your application when you are using the archived files format, just copy the new file into the applications directory again. The server detects the new file and redeploys the application. To undeploy your application, just delete the archived file from the applications directory. Multiple-Server Environment While working in a multiple-server environment, it is recommended that you use the weblogic.Deployer tool. To redeploy any particular component or file, use the activate option along with the name of that component or file to redeploy that particular component or file. This results in the change being incorporated onto all the servers. General A few general tips for deploying your J2EE applications on WebLogic Server 7.0 are as follows: Any application having more than one module in it should always have a META-INF/application.xml file, which describes and enlists all the modules in the application. It is very convenient to take a few minutes to prepare a proper batch file, which will execute all the steps required to set the classpaths, delete the existing class files, compile the new files from your development directory into the deployment directories, or any other steps that would be required. This will reduce effort on your part, and it also reduces possible errors during development. Automatic deployment should be used only for development mode in single server environments. |