facebook

help integrating MyEclipse with pre-existing Eclipse project

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

    grimholtz
    Member

    Hi,
    I have an existing Eclipse project I used with WebSphere 5. I’m trying to integrate MyEclipse to work with it, but am having difficulty.

    I’ve configured and enabled WebSphere 5 in MyEclipse’s Preferences. Then I added a “project deployment” as an Exploded Archive, and was filled in correctly.

    However, when redeploy the project thru MyEclipse, only the JSPs are copied over… not my classes or jars (although the WEB-INF and META-INF folders are created with the right subfolders).

    I also have my own web.xml that I need deployed, not something that MyEclipse would generate… it is part of the project.

    Any suggestions?

    Thank you,
    Eric Jung

    #203607 Reply

    Riyad Kalla
    Member

    Eric,
    First I would say that our websphere support is a work in progress but I believe this basic kind of deployment should work. ME expects a project in an exploded WAR format, more specifically something like:

    webroot
    /WEB-INF
    + web.xml
    /lib
    /classes

    A deployment will then copy everything from your /webroot (recursively) into your app server. Are the libs in your /lib dir actual JAR files, or sym links over to the real files somewhere else? MyEclipse currently doesn’t honor links in the file system and won’t follow them; but the 2.8 release will have a much enhanced deployment tool that will take care of linked resources.

    At any rate your web.xml file should be copied over with the deployment. Can you explain your project setup to us? What is the name of your webroot dir, are you using any sym links in the project, etc?

    #203609 Reply

    grimholtz
    Member

    Hi Riyad,

    No sym links since I’m on a Windows PC. Here is the directory structure of my project:

    \bin
    \conf
    \doc
    \images
    \lib
    \src
    \WEB-INF\classes (.class files get built here by Eclipse)

    The webroot is “\” — i.e., there are jsps and html files at the same level as the above directories.

    I am willing to re-arrange the project any way you suggest in order to make this work.

    Thank you!

    #203610 Reply

    Riyad Kalla
    Member

    Ahhh ok that’s the problem, we don’t currently allow the root project directory to be the webroot. There was a loud outcry for this so we decided to add it but I’m not sure if it will be in 2.7 GA or 2.8. We appologize for the inconvenience this causes you.

    Thank you for being so flexible with willing to arrange the project, actually rearranging the project would probably be a good idea since an exploded WAR format will be compatible with just about anyplace you decide to put it.

    Currently you have quite a bit of directories in the webroot of your project that probably shouldn’t be where they are. For example, you have a ‘bin’ dir, but for web projects, the ‘bin’ dir is really the WEB-INF/classes directory. Also you have the ‘lib’ dir in your webroot, which means people will be able to access your libs AND your web project won’t have access to them… so these should go in /WEB-INF/lib (UNLESS these are libs for something else, in which case I’ll suggest another location for you). Also your ‘src’ dir is in your webroot, again a problem because that means people will actually have access to your source if you were to deploy your app this way. I’m not sure if your /doc dir is necessary for your website, or if its your internal ‘docs’ dir for things like licenses and so forth, I’ll pretend its for license files and so forth and give a suggestion based on that. Also your conf dir I’m assuming is a custom conf dir for some of the libs you are using, so I’ll suggest you hide that in WEB-INF so its not publically accessible.
    A good organization is something like this:

    
    /<project root>
      +/src <-- Java source code for web project (servlets, actions, forms, beans, etc.)
      +/docs <-- license files, readme's, etc
        +/api <-- Target for your Javadoc source generation
      +/lib <-- extra libs that the web app doesn't need while running
      +/webroot <-- this is the base of the webroot, this will be the root when deployed to Tomcat, etc.
        +index.jsp <-- example jsp file in root
        +/images <-- images for the website
        +/WEB-INF <-- very important :)
          +/classes <-- build output directory
          +/lib <-- libs required for your webapp to run (i.e. struts.jar, etc.)
          +/conf <-- your custom conf files that you need for your app
          +/tld <-- taglibs (just a FYI, it didn't seem you had any)
    

    Please let me know if you have any questions or want ot ask why I posted something I did.

    #203718 Reply

    grimholtz
    Member

    Hello Riyad,

    Thank you for the advice. I’ve made the directory changes you suggested and things are a lot cleaner now. However, I still don’t have MyEclipse working (although it’s close).

    When I do MyEclipse/Add Project Deployment and select WebSphere 4 as the server (deploy type: exploded archive), the deploy location is specified as C:\WebSphere\AppServer\installedApps\generator.war

    But this isn’t accurate. It should be C:\WebSphere\AppServer\installedApps\generator.ear

    Then the exploded war is supposed to go in a directory under generator.ear called generator.war. You can see an example of this with the Samples that come with WebSphere 4 and also the petstore and admin applications. Here is the path of how a fully exploded EAR for an application called foo is supposed to look for Websphere 4:

    
    C:\WebSphere\AppServer\installedApps\foo.ear\foo.war\index.jsp
    C:\WebSphere\AppServer\installedApps\foo.ear\foo.war\images
    C:\WebSphere\AppServer\installedApps\foo.ear\foo.war\other web files and dirs
    C:\WebSphere\AppServer\installedApps\foo.ear\foo.war\WEB-INF\classes
    C:\WebSphere\AppServer\installedApps\foo.ear\foo.war\WEB-INF\lib
    C:\WebSphere\AppServer\installedApps\foo.ear\foo.war\WEB-INF\tld
    
    C:\WebSphere\AppServer\installedApps\foo.ear\META-INF\application.xml
    C:\WebSphere\AppServer\installedApps\foo.ear\META-INF\ibm-application-bnd.xmi
    C:\WebSphere\AppServer\installedApps\foo.ear\META-INF\ibm-application-ext.xmi
    C:\WebSphere\AppServer\installedApps\foo.ear\META-INF\MANIFEST.MF
    

    I’d like to be able to modify the directory MyEclipse uses for the exploded ear, but it’s greyed out. What do you suggest I do now?

    Thank you for your help,
    Eric Jung

    #203719 Reply

    Riyad Kalla
    Member

    Eric,
    I’m not farmiliar with Websphere at all, but it sounds like it wants an ear file. In that case you probably need to create a new Enterprise Application project, and as you are creating it, setup your current Web Module Project as a dependency. Then when you configure deployments for the Enterprise Application, I believe it will deploy correctly as you mentioned above.

    As far as the deployment directory not being editable, this is intentional. The Application Server connectors are hard coded for deployment locations, but for 2.8 we are looking at opening up a lot of custimizability (this is included) for users to modify.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: help integrating MyEclipse with pre-existing Eclipse project

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