facebook

JARs in deployment directory [Closed]

💡
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 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #219479 Reply

    Paul Baker
    Member

    Hi, I’m a newbee…

    Problem: I don’t want the following system files copied to the:
    app/WEB-INF/lib directory.

    dom.jar
    jaxen-full.jar
    jaxp-api.jar
    jdbc2_0-stdext.jar
    jstl.jar
    mail.jar
    sax.jar
    saxpath.jar
    standard.jar
    xalan.jar
    xercesImpl.jar

    Steps I’ve taken to prevent these files from being copied…

    I have copied the following files to the Tomcat/Shared/Lib directory:

    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-logging.jar
    dom.jar
    jaxen-full.jar
    jaxp-api.jar
    jdbc2_0-stdext.jar
    jsf-api.jar
    jsf-impl.jar
    jstl.jar
    mail.jar
    mysql-connector-java-3.0.9-stable-bin.jar
    sax.jar
    saxpath.jar
    standard.jar
    xalan.jar
    xercesImpl.jar

    I created a Library called APACHE_SHARED (with the jars above) and included that in my Java Build Path.

    I have also selected the MyEclipse-Web Option:
    Ignore External Libraries During Deployment (I will manage them).

    But the files listed above are still copied. Why? Because this occurs I cannot do a hot deployment. Will someone point me in the right direction (doco link etc). I only want MY app classes in the app/WEB-INF/lib directory.

    Thanks in advance!! Paul

    #219481

    Paul Baker
    Member

    I was able to find the source of the files that I had questions about…
    Preferences | MyEclipse | J2EE Project | Library Sets | J2EE 1.4

    I was able to remove all files except:
    javax.servlet.jar & javax.servlet.jsp.jar

    But is this the correct way?

    My original problem was the I could not hot deploy because the JVM (tomcat) was locking the files in my app/WEB-INF/lib directory. Now I can hot deploy but am concerned that I have approached this problem the wrong way. Putting the system jar files in shared has the problem that all apps must work with the same version of JSF, etc. How do others handle this… ??

    Paul

    #219495

    Riyad Kalla
    Member

    Paul,
    Are you aware that your application’s class files are suppose to go into the WEB-INF/classes dir and your application’s libraries are suppose to go into WEB-INF/lib? I’m asking because it sounds like you are going through a JARing process to put your class files in your WEB-INF/lib dir which is not necessary (unless you are working on a 3rd party library that your app uses).

    You should have left the JARs your app needs in your WEB-INF/lib dir, and use an exploded deployment, then MyEclipse will only hot deploy the files that change to Tomcat, that means that it won’t try and deploy jstl.jar, xalan.jar, etc… and the other JARs that are not changing, only the ones that are changing.

    Working around the Tomcat locking problem is a PIA, lukily Tomcat 5 has made strides to avoid file locks completely, so you could try that if you have JDK 5.0 installed.

    #219521

    Paul Baker
    Member

    Thanks, rkalla. Yes, I am trying to get around the hot deploy problem.. Everytime I make a change, I must stop, redeploy, and then restart Tomcat. When I copy all of the system jar files into the TomCat shared dir as I wrote above I can hot deploy. My app classes do go into the /classes dir… I incorrectly said that there were going into the /lib file..

    The error that I was getting w/in Eclipse was:

    QUOTE
    Undeployment failure on Tomcat 5. File C:\Apache\Tomcat 5.5\webapp\Contacts\WEB-INF\lib\jsf-impl.jar unable to be deleted. If a file is locked, you can wait until the lock times out to redeploy, or stop…
    UNQUOTE

    I don’t get these errors now… But, I would apprecaite it if someone could tell me how I can hot deploy w/out going through the gyrations that I am..

    Thanks! Paul

    #219523

    Riyad Kalla
    Member

    Paul,
    “Hot deploy” is transparent to the user, its part of the build loop assuming you have Automatic Project building turned on AND are using Exploded deployment… every time you save a file, the changed resource is deployed out to the running application server… you don’t need to go back to the deployment menu and hit the “redeploy” button again, which does a delete/deploy operation, which is giving you those exceptions (understandably so as Tomcat has them open to load the classes).

    #219524

    Paul Baker
    Member

    Thanks for the information. The Hot Deploy processing is working just fine – as you suggested… I made a change and then checked the Server app directory and my changed file was there. I’m not sure why TomCat is not reloading the app automatically but when I enter:

    http://localhost:8080/manager/reload?path=/Security

    Everything works perfect… Sorry for all the trouble..

    #219530

    Riyad Kalla
    Member

    No problem, I’m glad its working now. You can check with the Tomcat docs to see if you have the server setup to reload changes (usual timeout period is about 15 seconds)

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: JARs in deployment directory [Closed]

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