facebook

Changes not being picked up using the ME WebLogic plugin

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

    Pipeline
    Participant

    Eclipse version 3.0.0, build 200406251208
    MyEclipse version 3.7.200, build: 200407091200-3.8-Beta2
    WebLogic Server 8.1 SP3, JDK 1.4.1_02

    All session beans are deployed in the Weblogic 8 application server plug-in that is provided by MyEclipse.
    The Web Application project is deployed via the MyEclipse deployment manager as an exploded archive, and the
    EJB project is deployed as a packaged archived.

    I have a JSP page that gets a reference to a stateless session bean and calls a particular method in the session bean.
    In the past any changes that I made to the Session Bean after MyEclipse started WebLogic were immediately “picked” up
    by the WebLogic server, however this is no longer the case. Note: these changes are not changes that modify any method signatures.

    Removing the project deployments, and then re-deploying them does not take care of this problem.

    So far the only way to resolve this is to restart the WebLogic application server.

    What am I doing wrong here? Until recently I have used the WebLogic plugin for Eclipse and using that with a JDK 1.4+ I
    was able to change session bean code on the fly without having to restart anything. Also, since I have seen this work with my own
    eyes with MyEclipse, I know that there must be something that we can do to have this work properly again.

    Thanks,

    Cor

    #212021 Reply

    Riyad Kalla
    Member

    Cor,

    If you make a change in MyEclipse and then restart WebLogic and SEE the change, but you only see if it if you restart WebLogic, then you likely flipped an option somewhere where WebLogic will poll its web applications for changes and reload any changes it finds.

    If you make a change in MyEclipse and no matter if you restart WebLogic or not, you ONLY see the change if you redeploy, then the problem is with MyEclipse and you likely need to erase the deployment and recreate an exploded deployment (after deploying a packaged deployment using WebLogic’s console IIRC).

    #212024 Reply

    Pipeline
    Participant

    Riyad,

    I don’t think it is a setting within WebLogic, because I just ran a test where I created a new Enterprise Application Project with MyEclipse, deployed it just as I did with the other project, and the changes that I make to the Session Bean are immediately picked up without having to perform a redeploy or restart.

    What could cause this behaviour with the other project? Is there a setting within the MyEclipse application server configuration that could cause this to happen?

    Thanks,

    Cor

    #212025 Reply

    Riyad Kalla
    Member

    Cor,
    Did you try completely removing the deployment for this project from WebLogic and removing the project from WebLogic as well, then redeploy and resetting it up with a new exploded deployment to see that fixed it?

    No there is no setting… its just “automatic” if you use exploded.

    #212029 Reply

    Pipeline
    Participant

    Riyad,

    Yes, I completely removed the EJB and Web deployments from WebLogic, using the WebLogic console interface as well as the MyEclipse Deployment Manager. I then restarted the WebLogic server using MyEclipse and any subsequent changes to my session bean are NOT picked up.

    If I create a whole new EAP project using the same code, it works, but for the project in question it refuses to pick up the changes that are made subsequent to deployment.

    Please help because this is a major roadblock to our successful implementation of MyEclipse as the IDE for our multinational development team.

    Thank you very much,

    Cor

    #212033 Reply

    Riyad Kalla
    Member

    Cor,
    When you set the deployment back up you made sure to use an exploded deployment correct? ALso are there any errors in your log file? (workspace dir\.metadata\.log)

    #212034 Reply

    Pipeline
    Participant

    Riyad,

    The deployment is deployed correctly and there are no errors in my log file.

    I did find something that seems to be the trigger for the described erroneous behavior. The session bean by default implements the SessionBean interface, and my session bean implements another interface called GenericService that is utilized to ensure that a particular method is available in the implementing class. The only method in the GenericService class a method called “execute”. Here is the strange thing: If I remove the fact that my session bean implements GenericService, all works fine, but when I put the implementation of GenericService back in, subsequent changes to the code fail to be picked up again.

    This would appear to be a problem with the interaction of MyEclipse with the “embedded” WebLogic application server because we have done this type of coding with the WebLogic plugin for Eclipse from WebLogic for quite a while now.

    Your input is very much appreciated.

    Thanks,

    Cor

    #212035 Reply

    Riyad Kalla
    Member

    Ok atleast we are nailing down some things now…

    Do me a favor and open up the directory where the class file is deployed to WebLogic so you can see the time stamp on the file, let a few minutes pass (atleast 1) and then go into MyEclipse and change the file and save it, now alt-tab back to the deployment directory and refresh the dir listing, is the timestamp different on the file?

    #212036 Reply

    Pipeline
    Participant

    Riyad,

    Remember that I am deploying the EJB application as a packaged archive, not an exploded archive. In light of this I am not quite sure where I would check whether the file has been updated. In fact I would not expect any changes because I am not performing a redeploy action; all I am doing is changing the code of the one method.

    I have done some additional testing and have found another strange behavior. Here are the steps that I use to duplicate the behavior:
    1. Interface GenericService has one method called “execute”.
    2. Session bean EmailService implements SessionBean and GenericService.
    3. EJB project is deployed as packaged archive, Web project is deployed as exploded archive.
    4. JSP page gets reference to EmailService session bean and calls “execute” method.
    5. I make a change in MyEclipse to the “execute” method.
    6. Same JSP page calls the “execute” method, and the changes in the “execute” method are not reflected.
    7. OK, so that is where we were before… Lets continue.
    8. I remove all the deployed projects from WebLogic, and restart the WebLogic server via MyEclipse.
    9. I copy the code from the “execute” method to a new method called “executeTwo” in the EmailService session bean.
    10. I re-generate the interfaces using XDoclet.
    11. I deploy both the EJB and Web projects using MyEclipse.
    12. My JSP now calls the “executeTwo” method.
    13. Subsequent changes to the “executeTwo” method are picked up automatically.

    So it appears that the system seems to have a problem picking up code changes for methods that are obtained from implementing additional interfaces beyond the standard SessionBean interface methods.

    I hope that all makes sense…

    Cor

    #212038 Reply

    Riyad Kalla
    Member

    Cor, I’ve asked someone else to take a look at this… hang tight.

    #212044 Reply

    Scott Anderson
    Participant

    Cor & Riyad,

    Changes to the internals of individual methods are handled by the JDK 1.4 debugger support within Eclipse itself. The new code is updated in the remote JVM, after compilation in the workbench, with save and recompile within the workspace. Of course, all this is dependent on auto-build being turned on, and that the change does not affect the “shape” of the class which goes beyond what the JPDA spec can support. A more detailed explaination of that is available here: http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-439-highlight-debugger+shape+class.html
    The next thing to remember is that after you’ve used the hot update mechanism, those changes will not be present the next time you start weblogic, when you’re using packaged deployment, because those changes were inserted while the prior JVM was running. You’ll get a warning icon on your deployment in the Deployment Manager dialog and you’ll need to manually redeploy it the next time to pick up changes. Such is not the case with exploded deployment as your code is always kept in sync.

    Different versions of the JDK are better / worse at taking changes than others, mainly based on the presense or absense of bugs rather than enhancements. JDK 1.4.1_02 is actually quite reliable, in my personal experience.

    If you’re still experiencing behavior you don’t understand after reviewing the above, please be sure you’re browser isn’t caching the page (you can use the internal browser we supply as it doesn’t have a cache just for this reason), that you have Window > Preferences > Java > Debug > “Show error when hot code replace fails” checked, that auto build is turned on, and that you’re running your applications in Debug mode, not Run mode.

    #212117 Reply

    Pipeline
    Participant

    Scott,

    Thanks for the detailed information.

    We have the auto-build function turned on for all the projects in question. The changes that we are making are not changing the “shape” of the class; all we are doing is changing a System.out.println line to output different information for the purpose of this test.

    I understand what you are saying about these changes not being present the next time that WebLogic is started, unless we perform a re-deployment; however this does not apply to the issue at hand since we are not seeing our changes in the first place.

    Also, browser caching does not apply here since the test is actually performed in the Session Bean where we change the output of a System.out.println statement.

    The auto build flag is turned on, and the application is running in Debug mode.
    I did not have the Window > Preferences > Java > Debug > “Show error when hot code replace fails” checked, but have it checked now.

    I know you are going to think that you are dealing with a crazy user after you read this, but please bear with me.
    When I initially deployed the EJB project as a packaged archive, any changes I made to the body of my test method caused an error dialog to pop up informing me that the
    hot code deploy failed due to some code hierarchy problem. I changed the method of deployment of the EJB project from packaged to exploded, updated the MANIFEST.MF file
    of the Web project, restarted the WebLogic server and deployed the EJB and Web projects as exploded archives. This took care of the “hot code deploy” error that I was
    running into earlier, but the changes in the session bean test method still do not reflect after I make changes. Here is the crazy part: I changed everything back so that
    I am deploying the EJB project as a packaged archive, but now I do not receive any errors about regarding hot code deployment. I also still do not see the changes that I
    am making in the System.out.println statement.

    I decided to see if this problem can be reproduced by classes in the Web project and I basically created two interfaces called InterfaceOne and InterfaceTwo. I also created
    a class called TestClass and had it implement the InterfaceOne and InterfaceTwo interfaces. InterfaceOne has one method called testOne, and interfaceTwo has one method
    called testTwo. The TestClass class has these two methods, and the body of these methods is basically this: System.out.println(“testOne: A”); for method testOne,
    and System.out.println(“testTwo: A”); for method testTwo. When I call the testOne and testTwo methods from my test JSP page any changes that I make to the System.out.println
    is immediately realized. This confused me because I was expecting the same problem as with the methods in the EJB project.

    So to clarify, here is the problem scenario for my EJB project:
    1. Interface called “GenericService” with a single method called “execute”.
    2. Stateless session bean called “EmailServiceBean” with a public method called “execute” and “executeTest”.
    3. The “execute” and “executeMe” methods contain a System.out.println and are identical except for the text in the System.out.println statement.
    4. The test JSP page in the Web project calls the “execute” and the “executeMe” methods on the session bean.
    5. I make a change to the output of the System.out.println lines in both methods of the session bean.
    6. The change I made in the “execute” method is not reflected.
    7. The change I made in the “executeMe” method is immediately reflected.

    So why does this work in my Web project, and for methods that are not implemented from an interface in my EJB project?

    I really look forward to your response.

    Cor

    #212121 Reply

    Scott Anderson
    Participant

    Cor,

    This sounds like some of the issues we see from time to time that have to do with a bug or incompatibility between Eclipse’s JPDA implementation and the JVM’s. Would you double check the JDK you’re using to launch Eclipse? You can specify it explicitly with -vm <path-to-javaw.exe> on the commandline. I’d suggest using the latest 1.4.2 (_05 I believe) for both Eclipse 3 and WebLogic. I’d also set that same JDK to be the default for the platform in the Installed JRE’s preference. Then, with the same JDK specified in all three places I’d try to replicate your findings.

    #212147 Reply

    Pipeline
    Participant

    Scott,

    Thanks for the response.

    I updated the JDK from 1.4.1_02 to 1.4.2_05, and made sure that it is the JDK used when bringing up Eclipse. I also made sure that it is now the default for the platform as well as the referenced JDK by WebLogic.

    The problem is still the same as with 1.4.1_02; changes to the “execute” method are not reflected, however the changes to the “executeMe” method are immediately reflected.

    What do we do now?

    Thanks,

    Cor

    #212149 Reply

    Riyad Kalla
    Member

    What do we do now?

    Update to 3.8 GA that was released an hour ago and see if that helps?

Viewing 15 posts - 1 through 15 (of 17 total)
Reply To: Changes not being picked up using the ME WebLogic plugin

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