12 Replies Latest reply: Feb 16, 2012 10:28 AM by user9208525 RSS

    Redeploy a JSP file

    user9208525
      Hi everyone,

      I very new to weblogic administration and I have a newbie question.

      I've got an app called analytics deployed. I located my "analytics" deployment on the linux file system and I created a new file called redirect.jsp.

      I tested from the front end and I can see my new file via localhost:7101/analytics/redirect.jsp

      I made a few changes to my redirect.jsp file. Then I bounced everything (stopWebLogic.sh, startWeblogic.sh, stopNodeManager.sh startNodeManager.sh, stopped and started the weblogic server from the console, stop and started my analytics application). Then I went to test out the changes to my redirect.jsp file and I still see the original code. Nothing changed. Everything is still cached from the first run.

      I read some where I can redeploy using the following command:
      java weblogic.Deployer -adminurl localhost:7001 -user weblogic -password weblogic -name analytics -redeploy analytics10g/redirect.jsp

      Every time I run that command it fails though, with an error of:
      java.io.IOException: [DeploymentService:290066]Error occurred while downloading files from admin server for deployment request "1,329,162,971,346". Underlying error is: "null"


      Any clue what I'm doing wrong?

      How do I refresh my JSP page?

      -=Joe
        • 1. Re: Redeploy a JSP file
          806917
          When you say that you tested successfully from the front end, do you mean that you tested in JDeveloper using the integrated WLS?
          • 2. Re: Redeploy a JSP file
            user9208525
            Hi Scott,

            I mean I put the URL into my browser and it can access the file and the file does exactly what I want it to.

            It's a simple redirect script so I don't really use JDeveloper. Just Vi on linux.

            -=Joe
            • 3. Re: Redeploy a JSP file
              806917
              So you are manually writing all your code and are not using any IDE?
              • 4. Re: Redeploy a JSP file
                user9208525
                Correct. I manually wrote a jsp page, then I manually copied the jsp page to the folder that was created when I deployed the analytics.war file. Then I used a browser to navigate to where I copied the jsp file, localhost:<port num>/analytics/redriect.jsp

                -Joe
                • 5. Re: Redeploy a JSP file
                  806917
                  Joe -

                  In your command several posts up, you redeployed the .jsp. You need to redeploy the .war file that contains the .jsp, rather than deploying the .jsp directly as you are doing.

                  In general, you can deploy to WLS by:
                  1) Using weblogic.deployer like you are doing. Of course, this is all command-line driven.
                  2) sftp the .war file on to the same server where WLS resides. Then from the admin console, go to Deployments. Find your deployment, click on the checkbox, and then click update. Point at the new .war file on the OS and click finish.
                  3) Use JDeveloper. JDeveloper greatly simplifies your jsp development, and deployment to the remote WLS is literally at the click of a button. I personally use JDeveloper and really like it.
                  4) Use another IDE, such as Eclipse, to automate deployment to WLS. I have never used this method, so I cannot comment as to how hard or how easy this is to do.

                  By the way, you do not need to bounce services like you are doing. Totally unnecessary.

                  Overall, I recommend an IDE...any good IDE. However, you can deploy manually if you wish - it's just a lot more work. Good luck!

                  Scot
                  • 6. Re: Redeploy a JSP file
                    user9208525
                    Hi Scott,

                    Thanks for your response. That makes sense to me. But I'm not entirely sure how to add my .jsp to the .war file.

                    Here's how I first deployed everything:

                    1) analytics.war is an out-of-the-box .war file that comes with Oracle Business Intelligence. It's the web-tier plugin that communicates with the rest of the Oracle Business Intelligence components.
                    2) I ftp'd analytics.war to my weblogic server
                    3) I use tar -xvf analytics.war to expand the .war file to a folder called analytics
                    4) I go to Weblogic console and go to deployments -> browse to find the blown out folder "analytics" and deploy that
                    5) This action creates an analytics folder under the weblogic install
                    6) I then manually copied my custom .jsp to the analytics folder under the weblogic install.

                    So at this point, you are saying I need to combine my custom .jsp file, with the analytics.war file and then re-deploy the whole .war file.

                    How do I integrate my .jsp file with the pre-existing analytics.war file? Is it as simple as manually copying the file to the blown out analytics.war folder?

                    -Joe
                    • 7. Re: Redeploy a JSP file
                      806917
                      Go to the directory where your files reside (.jsp, .class, etc).
                      jar -cf foo.war *

                      Then call that war file from weblogic.deployer.
                      • 8. Re: Redeploy a JSP file
                        sandeep_singh
                        yes you can extract the analytics.war archive using the jar command :

                        jar -xcvf analytics.war

                        This will create the analytics folder. Then you can create a new folder inside the analytics folder saying "test" and paste your jsp file in that folder.
                        Then you can deploy the exploded analytics folder.

                        Then you can access your Jsp using : http://hostname:port/analytics/custom/your.jsp

                        Thanks,
                        Sandeep
                        • 9. Re: Redeploy a JSP file
                          user9208525
                          Quick question. Do I have to make a subfolder called custom or "test" under the main extracted folder? Or can it just be in the main folder?

                          -=Joe
                          • 10. Re: Redeploy a JSP file
                            806917
                            The jar command will archive from the current directory and recursively include all subdirectories. See below examples.

                            Note: The files I am adding to the war in these examples are empty. I quickly created them using the touch command simply to illustrate how the jar command works.

                            Example1 - all files in one directory:
                            [krausesc@t00539292 test]$ pwd
                            /home/krausesc/test
                            [krausesc@t00539292 test]$ ls -alR
                            .:
                            total 12
                            drwxrwxr-x 2 krausesc krausesc 4096 Feb 16 10:03 .
                            drwxr-xr-x 32 krausesc krausesc 4096 Feb 16 09:59 ..
                            -rw-rw-r-- 1 krausesc krausesc 0 Feb 16 10:00 scot.class
                            -rw-rw-r-- 1 krausesc krausesc 0 Feb 16 10:00 scot.jsp
                            -rw-rw-r-- 1 krausesc krausesc 0 Feb 16 10:00 scot.xml
                            [krausesc@t00539292 test]$ jar cvf scot.war *
                            added manifest
                            adding: scot.class(in = 0) (out= 0)(stored 0%)
                            adding: scot.jsp(in = 0) (out= 0)(stored 0%)
                            adding: scot.xml(in = 0) (out= 0)(stored 0%)
                            [krausesc@t00539292 test]$


                            *Example 2 - files in multiple directories, including a subdirectory of the main directory:
                            [krausesc@t00539292 test]$ pwd
                            /home/krausesc/test
                            [krausesc@t00539292 test]$ ls -alR
                            .:
                            total 16
                            drwxrwxr-x 3 krausesc krausesc 4096 Feb 16 10:02 .
                            drwxr-xr-x 32 krausesc krausesc 4096 Feb 16 09:59 ..
                            -rw-rw-r-- 1 krausesc krausesc 0 Feb 16 10:00 scot.class
                            -rw-rw-r-- 1 krausesc krausesc 0 Feb 16 10:00 scot.jsp
                            drwxrwxr-x 2 krausesc krausesc 4096 Feb 16 10:02 test_subdir

                            ./test_subdir:
                            total 8
                            drwxrwxr-x 2 krausesc krausesc 4096 Feb 16 10:02 .
                            drwxrwxr-x 3 krausesc krausesc 4096 Feb 16 10:02 ..
                            -rw-rw-r-- 1 krausesc krausesc 0 Feb 16 10:00 scot.xml
                            [krausesc@t00539292 test]$ jar cvf scot.war *
                            added manifest
                            adding: scot.class(in = 0) (out= 0)(stored 0%)
                            adding: scot.jsp(in = 0) (out= 0)(stored 0%)
                            adding: test_subdir/(in = 0) (out= 0)(stored 0%)
                            adding: test_subdir/scot.xml(in = 0) (out= 0)(stored 0%)
                            [krausesc@t00539292 test]$
                            • 11. Re: Redeploy a JSP file
                              sandeep_singh
                              no, creating another directory is not necessary , you can put your jsp file in main folder also. Another dir is required only to keep the out-of-box files separate from your custom files which is always recommended.

                              in case you place you files in the main folder than you can access you jsp from : http://hostname:port/analytics/your.jsp

                              Also, if you are running the Weblogic Server in Development mode than you can directly paste the application into autodeploy directory under the domain folder. By doing so you don't have to always stop and start your application for getting jsp change values .

                              see the below link for more information on autodeply dir
                              http://docs.oracle.com/cd/E11035_01/wls100/deployment/autodeploy.html

                              thanks,
                              Sandeep
                              • 12. Re: Redeploy a JSP file
                                user9208525
                                thanks guys!