6 Replies Latest reply on Oct 8, 2008 3:30 PM by thitoh

    getting old DeploymentInfo (not case sensitive)

    thitoh

      I'm using method "getDeployment" of mbeam "MainDeployer" to get an Object DeploymentInfo.
      But a lot of times, it return an "old" DeploymentInfo...
      The same happens if I call "isDeployed" method.... sometimes it returns a wrong answer, so, I can't trust it...
      I discovered that if I use "file:/c:/apl.war", it returns the old object (perhaps a wrong answer), but if I use "file:/C:/apl.war" (look, drive C is with Capital letter, upercase), jboss return the right anwer, so, I can trust.
      Why Jboss return process diferent "C:" and "c:"??
      How do I solve this problem?
      I get this path by user's input, so, I he don't put "C" insted of "c", I have problems and isn't good check and replace before invoke methods....

        • 1. Re: getting old DeploymentInfo (not case sensitive)
          peterj

          First, which version of JBossAS are you using? I tried this on 4.2.3, and the deployment time changed, even when I passed a lower-case disk drive letter. Note, however, that my war file is in the deploy directory, not in an external location.

          Second, after updating the war file, are you calling deploy() on MainDeployer again? As far as I know, the hot deployer will not automatically redeploy an app unless it is in the deploy directory.

          See, didn't I say you had a better chance of getting a response in this forum? ;-)

          • 2. Re: getting old DeploymentInfo (not case sensitive)
            thitoh

            thanks for reply, PeterJ.
            I'm calling deploy() on MainDeployer...
            But I did another tests, some changes, and "C" or "c" isn't changing nothing anymore... I don't know why getDeployment on MainDeployer is returning old deploymentInfo.
            Look, I installed notificationListener on subDeployers of MainDeployer, and when deploy or undeploy occours, I can see de DeploymentInfo given by Notification, and I see the real deploymentInfo ('state' changes, 'lastDeployed' changes), but calling getDeployment I don't have the same object (and their fields aren't equals).
            I did another test:
            1- I called getDeployment and print the result
            2- I called deploy()
            3- NotificationListener sent me notifications and I print deploymentInfo given by these notifications (and I saw that the state changes, lastdeployed too, etc)
            4- I called getDeployment again and print the result. The result is equals the first time I called getDeployment (step 1). same state, same lastDeployed, same object (memory address), and totally differently as deploymentInfo of notifications, that has the right information.

            • 3. Re: getting old DeploymentInfo (not case sensitive)
              peterj

              Try this. After step 1, use the JMX console or twiddle to get the deployment info. Do the same after step 4. Compare those values. If they are different, then your code is hanging on to the old values.

              If that does not help, please post your code (or a simplified variation of your code) that exhibits the behavior. Remember to enclose your source code in 'code' tags (select the source code, click the Code button), and Preview your response to check the formatting before clicking Submit.

              • 4. Re: getting old DeploymentInfo (not case sensitive)
                thitoh

                PeterJ, I don't know why sometimes if I use "C:\" I have some answer and "c:\" a different answer... but I saw that if I invoke "undeploy()" before "deploy()", the problem is solved.
                Even if the application is already undeployed, I have to invoke undeploy(). So, I can get the right deploymentInfo when invoke getDeployment() after deploy().
                I don't know why sometimes, when I change some characters to UpperCase or LowerCase, I don't have to do nothing special..
                I'm curious, but at least the problem is solved!
                Thanks, PeterJ!!!!
                Just a question: Some methods (like deploy() and undeploy()) can be invoked using "java.lang.String" as ParamType, or java.net.URL as ParamType. What is the different between call with "string", or with "new java.net.URL(string)" ?

                • 5. Re: getting old DeploymentInfo (not case sensitive)
                  peterj

                  There is no functional difference between the two deploy() methods. The one that takes a String converts the string to a URL and then calls the one that takes a URL.

                  • 6. Re: getting old DeploymentInfo (not case sensitive)
                    thitoh

                    Thanks, Johnson!