facebook

jar files on web deployment

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #247688 Reply

    Hi,
    I have a web application dependent on many jar files. I have them configured in my eclipse as dependent in java build path. But when I publish, it is deploying the dependent libraries also. Is there any way I can instruct myeclipse to deploy only restricted jar file not all.

    Thanks,

    env: tomcat 5.5,myeclipse 4.0

    #247734 Reply

    Riyad Kalla
    Member

    MyEclipse User,
    You can adjust the deployment rules under your Project Properties > MyEclipse-Web > Deployment. Note that you may need to adjust what *kind* of libraries your JARs are if you want some deploying and other’s not. For example, turn on deployment of User Libraries, but turn off External JAR Deployment, then change all your restricted JARs to External JARs.

    #247751 Reply

    Hi Riyad,
    Thanks for the suggestion on jar file configuration. In my development environment on building the project the myeclipse generates the class files in WebProject\class directory.

    On deployment, it copies the files to tomcat webapps directory (due to that 2 copies of the same file exist in the system). Is there any way I can configure myeclipse to remember the deployment for debugging and don’t do deploy any files?

    I tried to configure the debugging without deployment config(with tomcat context file point to webproject\ directory). But myeclipse could not recognize the jsp files when multiple files with same name exist in different subdirectories during debugging with break point.
    Eg:
    \jsp\dir1\success.jsp
    \jsp\dir2\success.jsp

    If I put a break point in jsp file, it could not find the right file and at the break point it stops but it says “source file could not be found”. But it works with after adding deployment .

    Could you provide some suggestion?
    Thanks

    #247781 Reply

    Riyad Kalla
    Member

    On deployment, it copies the files to tomcat webapps directory (due to that 2 copies of the same file exist in the system). Is there any way I can configure myeclipse to remember the deployment for debugging and don’t do deploy any files?

    I tried to configure the debugging without deployment config(with tomcat context file point to webproject\ directory). But myeclipse could not recognize the jsp files when multiple files with same name exist in different subdirectories during debugging with break point.

    Oh I see, yes just do not create a deployment. We don’t normally suggest people point Tomcat at your project directory like that, but if you want to, there is no need to create a deployment. Just run your app server and start setting break points.

    Eg:
    \jsp\dir1\success.jsp
    \jsp\dir2\success.jsp

    If I put a break point in jsp file, it could not find the right file and at the break point it stops but it says “source file could not be found”. But it works with after adding deployment .

    Very strange, if you point Tomcat back at your /webapps dir and DO create a deployment externally from your project, does it debug correctly? I think the problem above might be like you said, the duplication of files.

    #252030 Reply

    majecek
    Member

    Hi support-rkalla,
    in your first post you suggest “turn off External JAR Deployment”
    I cann’t find that. Can you give me advice where it is?

    Problem overview:
    I have some jar files in dependent project, which I don’t want to be deployed, because there are already in jboss default lib folder. (actually I need them there) (If they are deployed it screem about duplication files
    I think I have the same problem as myeclipseuser1 had. right?
    I need to forbid 2 jar files but allow the rest to be deployed.
    Can you help me with that?

    Thanks in advance

    #252073 Reply

    Riyad Kalla
    Member

    in your first post you suggest “turn off External JAR Deployment”

    I cann’t find that. Can you give me advice where it is?

    Open your project properties, go to MyEclipse-Web then the Deployment tab.

    I have some jar files in dependent project, which I don’t want to be deployed, because there are already in jboss default lib folder. (actually I need them there) (If they are deployed it screem about duplication files

    I think I have the same problem as myeclipseuser1 had. right?

    I need to forbid 2 jar files but allow the rest to be deployed.

    Can you help me with that?

    The issue here is that MyEclipse doesn’t support explicit filtering of deployed resources yet so you need to sort of fudge this. What we do support is turning on/off the deployment of different kinds of JARs depending on where they are from: Your build path, User library, External JAR and so on. What I would suggest is removing the JARs that are already in JBoss from your project, then adding them to your project by using the “External JAR” functionality on your Java Build Path setup, and then go to the MyEclipse Deployment settings and be sure to turn off deployment of external JARs.

    #252085 Reply

    majecek
    Member

    I got still problem.

    I have found just half way solution for my problem (in a meantime you write your answer 🙂

    My problem is more trickier than I thought.
    I have 3 projects:
    1. projectLib (where are my jar which I use in project)
    2. projectWeb (Struts,…) and depend on projectLib
    3. projectLogic (EJB,…) and depend on projectLib

    When I have done deploy for projectWeb the projectLib was deployed as well with all its jars. And i needed 2 jars not to be deployed.

    Solution:
    Create user library in projectLIb and put there those 2 jar files the rest jar files will be along (not in user library).
    For projectWeb:
    1. Properties of project (ALT + ENTER)
    2. MyEclipse-Web -> Deployment
    3. uncheck ‘Use workbench default settings’ and also uncheck the last option ‘User library jars exported by dependent Java project’
    4. do deploy and the libraries in user-library will not be deployed.

    My Problem:
    How can I do the same for EJB project? Firstly there is not such a option so it always deploy all jar files.
    Can you help me out from this?

    Thanks

    #252086 Reply

    majecek
    Member

    support-rkalla
    In your last post i understand everything except the last line
    ‘and then go to the MyEclipse Deployment settings and be sure to turn off deployment of external JARs.’
    Where I turn off deployment of external JARs ?

    Mine MyEclipse doployment options looks same as this picture (taken from myeclipse doc.)

    http://myeclipseide.com/enterpriseworkbench/help/topic/com.genuitec.myeclipse.doc/html/quickstarts/webprojects/images/prefs_webproject_deployment_annot.gif

    #252095 Reply

    Riyad Kalla
    Member

    My appologies, I referred to the setting by the wrong name. The setting I was referring to was the first one, the “Jars on the web project build path”. Uncheck that.

    #252126 Reply

    majecek
    Member

    Sorry to bother you again.
    But can you look at my pre-previouse post 🙂

    Is there way to do it also for EJB projekt?

    Thanks

    #252134 Reply

    Riyad Kalla
    Member

    You are corect EJB projects do not support this level of deployment control yet.

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: jar files on web deployment

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