facebook

problem with redeployment

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

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

    slin
    Member

    Hi,

    I’m new and trying to get familiar with myEclipse using struts feature. There some problems I’m experience:
    1) redeployment: every time I make changes and redeploy to the server (JRun), I got the following message:
    file struts.jar unable to be deleted. If a file is locked, you can wait until the lock times out to redeploy, or stop the server and redeploy

    It seems there some libary files(.jar) under WEB-INF/lib always causing share violation. I know I can stop the server to redeploy, but just it’s time-consuming and not necessary. Just wonder if there is a more effecient way? something like change setting? etc

    2)I’m trying to use debug feature with struts: so far it works if I set break point at some action.java files, but it didn’t stop at jsp pages. I wonder why?Also, step over cause error like “cannot find source file of struts.jar”. How can I fix it?

    3)If I want to debug, do I have to use exploded file to deploy or .war file is ok?

    Thank you very much for your help!

    #206706

    Riyad Kalla
    Member

    1) redeployment: every time I make changes and redeploy to the server (JRun), I got the following message:
    file struts.jar unable to be deleted. If a file is locked, you can wait until the lock times out to redeploy, or stop the server and redeploy

    It seems there some libary files(.jar) under WEB-INF/lib always causing share violation. I know I can stop the server to redeploy, but just it’s time-consuming and not necessary. Just wonder if there is a more effecient way? something like change setting? etc

    This problem is actually a Windows issues. The way the file system works is that if there are any files with an open file handle against a file (reader) then the file cannot be removed. In this case JRun has probably read the JAR file and loaded classes from it, so it cannot be deleted while JRun is running.

    On Unix/Linux (maybe Solaris) you don’t have this problem as file ops can take place at any time, and after all file handles are closed, the file op (say delete) is performed. We are going to try and help getting around this problem in future releases by provided context-specific controls that would allow a redeploy to do something like “Stop Context, Redeploy Project, Start Context” to hopefully have the file locks removed.

    You can try using exploded deployment as this supports hot-deploy of changes as you make them, and will generally lessen your conflicts by about 90% than doing manual deploys every time.

    2)I’m trying to use debug feature with struts: so far it works if I set break point at some action.java files, but it didn’t stop at jsp pages. I wonder why?Also, step over cause error like “cannot find source file of struts.jar”. How can I fix it?

    We support JSP-level debugging if you are using an application server that supports JSR-45 spec. Unfortunately per our FAQ, JRun4 does not support the debugging spec, so there is no supported debugging using this container: http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-29.html

    As far as struts source, you need to download the struts source code from Jakarta, and then unzip it someplace. Load up your project in MyEclipse, select the struts.jar and right click, go down to Properties. Now from this screen you should be able to ‘Attach source’ for the JAR file, make sure to point to the top-level source directory for the struts source once you unzip it, its something like: “<unzipped location of struts source>/src/src/share”.

    3)If I want to debug, do I have to use exploded file to deploy or .war file is ok?

    Both should work, but developing with an exploded format is a bit easier, please see my reasons from the end of answer #1.

    #206707

    slin
    Member

    @support-rkalla wrote:

    1) redeployment: every time I make changes and redeploy to the server (JRun), I got the following message:
    file struts.jar unable to be deleted. If a file is locked, you can wait until the lock times out to redeploy, or stop the server and redeploy

    It seems there some libary files(.jar) under WEB-INF/lib always causing share violation. I know I can stop the server to redeploy, but just it’s time-consuming and not necessary. Just wonder if there is a more effecient way? something like change setting? etc

    This problem is actually a Windows issues. The way the file system works is that if there are any files with an open file handle against a file (reader) then the file cannot be removed. In this case JRun has probably read the JAR file and loaded classes from it, so it cannot be deleted while JRun is running.

    On Unix/Linux (maybe Solaris) you don’t have this problem as file ops can take place at any time, and after all file handles are closed, the file op (say delete) is performed. We are going to try and help getting around this problem in future releases by provided context-specific controls that would allow a redeploy to do something like “Stop Context, Redeploy Project, Start Context” to hopefully have the file locks removed.

    You can try using exploded deployment as this supports hot-deploy of changes as you make them, and will generally lessen your conflicts by about 90% than doing manual deploys every time.

    2)I’m trying to use debug feature with struts: so far it works if I set break point at some action.java files, but it didn’t stop at jsp pages. I wonder why?Also, step over cause error like “cannot find source file of struts.jar”. How can I fix it?

    We support JSP-level debugging if you are using an application server that supports JSR-45 spec. Unfortunately per our FAQ, JRun4 does not support the debugging spec, so there is no supported debugging using this container: http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-29.html

    As far as struts source, you need to download the struts source code from Jakarta, and then unzip it someplace. Load up your project in MyEclipse, select the struts.jar and right click, go down to Properties. Now from this screen you should be able to ‘Attach source’ for the JAR file, make sure to point to the top-level source directory for the struts source once you unzip it, its something like: “<unzipped location of struts source>/src/src/share”.

    3)If I want to debug, do I have to use exploded file to deploy or .war file is ok?

    Both should work, but developing with an exploded format is a bit easier, please see my reasons from the end of answer #1.

    Thank you very much for your quick response. For the first question, I wonder where I can locate the lock file. I think if I can manually remove this file, it may solve the problem. As debugging issue, I wonder if I have to get all source files in order to use debug step over, step return (btw, does step return mean to go to next break point? if it’s not, which one is)? It seems it can debug to jsp page when I create HelloWorld, but after adding struts feature (I followed exactly like in the struts tutorial demo), it never worked again. Just curious why simple app worked?

    Can you explain a little bit more why it reflects the changes I make when using exploded file deployment, but not .war file. In that case, do I need to redeploy again? Also, why didn’t I see the “external preview” penal? I’m using eclipse 2.1.3.

    Thank you again for your help.

    #206708

    Riyad Kalla
    Member

    Thank you very much for your quick response. For the first question, I wonder where I can locate the lock file. I think if I can manually remove this file, it may solve the problem.

    Ahh sorry, I should clarify: Its not a lock file, its a “locked” file… in Windows terms this means “You can’t delete this file, someone is reading it right now!”. It would be like taking a book out of your friends hand while he’s reading it, and setting it on fire. Its socially unacceptable; same rule applies to OS’s 😀

    I wonder if I have to get all source files in order to use debug step over, step return (btw, does step return mean to go to next break point? if it’s not, which one is)?

    You can step without source code and break without source code, you just see an empty editor window that says “NO SOURCE AVAILABLE”, which makes it useless.

    Also Step Return means to step to the next point where the method you are in returns. So if you stepped into a method, say “getLength()” of a String object, and you go “Ohh this is stupid, I wanted the next line in the calling class, not this one” you can do a Step Return, to finishing executing all the code in getLength(), do the return THEN stop at the next line after the getLength() call comes back. You can click the “Play” looking button to hit the next breakpoint if you want to jump ahead.

    It seems it can debug to jsp page when I create HelloWorld, but after adding struts feature (I followed exactly like in the struts tutorial demo), it never worked again. Just curious why simple app worked?

    The issue with JSR45 compliance isn’t a white/black thing. Even if an app server doesn’t support it, you MIGHT still be able to debug certain files (like you are seeing) but not others. Supporting JSR 45 gives you the garuntee that you can debug all files. So you are probably running into a case where the App server and debugger are playing nice until you add Struts stuff.

    Can you explain a little bit more why it reflects the changes I make when using exploded file deployment, but not .war file. In that case, do I need to redeploy again?

    Sure, when using exploded deployment AND you have the “Perform build automatically on resource modification” turned on in Eclipse (Workbench preferences), it allows MyEclipse to detect and immediately deploy individually changed files directly to the app server in the appropriate location. With packaged deployment, this would mean actually recreating an entire WAR file every time you modified a file. With a tiny 4-page application this probably wouldn’t be too bad, but you get any sized serious app and you are looking at the potential for minutes between file modifications JUST to create the WAR file, then copy it over.

    One thing I like to do is develop with exploded, and right before a new release goes out, I do a packaged deployment and then move that WAR file onto the server and deploy it.

    Also, why didn’t I see the “external preview” penal? I’m using eclipse 2.1.3.

    Very popular question, its covered here: http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-30.html#132

    #206721

    slin
    Member

    Could you let me know what application servers that support JSR-45 spec? Could you recommend a free one which is easy config? I’m using window 2000 platform. Thanks

    #206723

    Riyad Kalla
    Member

    Could you recommend a free one which is easy config? I’m using window 2000 platform. Thanks

    Tomcat 5 is an excellent choice. If you need an EJB container, you can use the beta versions of JBoss that are not using Tomcat 5, or if you just need a servlet container, I’d suggest just Tomcat 5 standalone.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: problem with redeployment

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