facebook

Hot Deployment of Modified Resources [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #211047 Reply

    Hello,

    I looked around the forums and documentation, but could not find a definitive answer so I am posting my question here. My understanding is that, with hot deployment, all newly modified classes and resources get deployed automatically to the deployment location. Perhaps I am wrong, or am doing something incorrectly, but I have a situation where I do not see newly compiled resources hot-deployed.

    I use a plugin called JasperAssistant which provides a UI to a JasperReports xml report design (.jrxml file). The plugin works such that, when one saves a given report design, JasperReports compiles it into a .jasper file. This file is then loaded (from classpath via classloader) by my app. In my configuration, I have the report design files in my source path, and the resulting .jasper file winds up compiled in the appropriate build output location, along with its .jrxml source file, and right alongside my other project classes. However, the .jasper file does not get hot-deployed to the (exploded) enterprise app, while modified java classes do, and in fact, the .jrxml file also gets hot-deployed. Only the .jasper file is ignored. Is there something I can do to get them hot-deployed? Is this a feature of MyEclipse, or a bug? Or is this an issue I should take up with the developer of JasperAssistant?
    Note this is not a request for hot code-swapping, as the .jasper files get loaded on demand by application code. I need only that the files get copied automatically upon modification.
    TIA,
    -Armen

    My setup is as follows

    Win2k SP4
    Eclipse platform Version: 3.0.0
    Build id: 200406251208
    Eclipse freshly installed for MyEclipse
    JasperAssistant, VSS Plugin, RMI Plugin
    8 plugins in the <eclipse>/plugins directory are like org.eclipse.pde.*
    MyEclipse Version: 3.7.200
    Build id: 200407091200-3.8-Beta2
    JDK version 1.4.2_04
    JDK version 1.4.2_04 to launch your application server
    Save .jrxml file
    WebLogic 8.1 SP2
    No errors in the Eclipse log

    #211049 Reply

    Riyad Kalla
    Member

    Armen:

    deployed automatically to the deployment location.

    Yes you are correct. However, please be aware of the difference of us deploying a new class and your app server actually loading the new class

    However, it does not get hot-deployed to the (exploded) enterprise app, while modified java classes do.

    How do you know its not getting deployed? Have you checked the timestamp on the deployed file to see if it is changing? You mentioned that your app loads the file from the classpath, if your app isn’t written to refresh itself or check for a changed file, then that might be one fo the problems. Even if a new jasper file is written out, unless your app reloads it, you will continue to see the old jasper file during runtime.

    A good test would be this:

    1) Stop app server
    2) Redeploy app (just to make sure)
    3) Start app server
    4) Change a jasper file like you were doing, save it.
    5) Shut down app server
    6) Start up app server
    7) Is the changed jasper file in your app now? If so then its a reloading issue, if not then its a deployment issue and we can look into it further.

    Note this is not a request for hot code-swapping, as the .jasper files get loaded on demand by application code.

    Hmm ok, I’m still curious what the result of the above process would be.

    #211054 Reply

    @support-rkalla wrote:

    However, please be aware of the difference of us deploying a new class and your app server actually loading the new class

    My awareness is such that I explicitly stated that I do not have a loading problem. I load it via app code. I do not need hot code-swapping.

    How do you know its not getting deployed? Have you checked the timestamp

    Why yes, yes I did.

    Even if a new jasper file is written out, unless your app reloads it, you will continue to see the old jasper file during runtime.

    Yes you are correct. However, and please believe me, that is not my problem. My problem is that the .jasper file is not copied to the deployment location, while the .jrxml file is. MyEclipse seems to selectively copy only the source design file, but not the compiled design file.

    1) Stop app server
    2) Redeploy app (just to make sure)
    3) Start app server
    4) Change a jasper file like you were doing, save it.
    5) Shut down app server
    6) Start up app server
    7) Is the changed jasper file in your app now?

    Nope. It does not get copied over on a change. Ever. The classes do, the .jrxml files do, the .jasper files do not. I need to do it manually, or do a full redeployment. And I can do it manually at any time, because I actually wrote my inputstream loading code correctly. So, uh, don’t know how else to explain it. I don’t have a coding issue. I do see hot-deployment of other types of files. I see a seemingly selective file hot-deployment process by MyEclipse. Can you reproduce? I am using the latest JasperAssistant and JasperReports.

    #211059 Reply

    Riyad Kalla
    Member

    Yes you are correct. However, and please believe me, that is not my problem. My problem is that the .jasper file is not copied to the deployment location, while the .jrxml file is. MyEclipse seems to selectively copy only the source design file, but not the compiled design file.

    I do believe you, but I need to rule out everything simple right away and it looks like we did…

    Can you reproduce? I am using the latest JasperAssistant and JasperReports.

    I will look into this ASAP.

    #211066 Reply

    Riyad Kalla
    Member

    ayampols,
    This is starting to look like a refresh issue much like running an ant script in your project that changes the state of the project won’t be noticed until you refresh the project. Can you do this, change a chart and save it to cause the jasper file to be created, then check in the webapp dir ot make sure it WAS NOT updated, then change to your Navigator view in Eclipse and refresh the project, then check the file again in the web app, was it updated?

    AFAIK the problem stems from the fact that the deployer’s hot deploy detects changes to files via an Eclipse notification mechanism, and for some reason it is being made aware of the other changes files, but not the jasper file, so it has no idea that it should deploy it.

    #211071 Reply

    Riyad Kalla
    Member

    ayampols,
    More information about this from one of our devs:

    The deployer works off the workbench resource change modification so if it’s
    not being refreshed, we’re not getting notified.

    The “correct” solution for this is for any tool that adds files to the
    workspace to either use the workspace IResource API’s to do it or force a
    refresh of the new artifact when it’s created.

    So if refreshing works, this may be an issue with the JasperAssistant team to verify that they are using this approach.

    #211072 Reply

    Riyad,

    I created a new app from scratch and found that I could not reproduce the problem — the .jasper files were getting deployed! I went back to my old project and added some new report templates, and found that some of these did and some did not get deployed. Really strange. I removed the entire resource package, sources and all, and redeployed, and then I recreated the whole resource directory from scratch, and now the anomolies seem to have disappeared. I think you are right, there must have been something strange in my project setup wherein the notification mechanism didn’t see the changes. I will look for a recurrence of the problem, and if it happens again I will try to find a way to reproduce it. Thank you for all your help and time, sorry it turned out to be so ephemeral…

    #211073 Reply

    Riyad Kalla
    Member

    Hmm very strange! I appreciate you going through so much troubleshooting to get to the bottom of it though and I think this thread is still good information for other users facing similar problems. Don’t hesitate to ask if you run into anything else.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Hot Deployment of Modified Resources [Closed]

You must be logged in to post in the forum log in