facebook

How to import an existing EAR/JSF project into MyEclipse

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

    nbhatia
    Member

    I am evaluating MyEclipse 5.0.1 for my development environment. My current project uses Maven 2 and contains sub-projects for EJBs, JSF front-end etc. I also have .project and .classpath files for editing my Java files in Eclipse. How can I configure MyEclipse to allow editing of this project? I would like to be able to edit my JSF files through MyEclipse and also build/deploy my project on to JBoss.

    P.S. So far the docs/tutorial I have seen show me how to build a MyEclipse project from scratch. I have not come across any way to “import” existing projects.

    Thanks.

    #258503

    Jeremy Stein
    Member

    You have to add the approriate capabilities to the project. I wrote a simple JSF/Spring project for another member of this forum. I explained how to import it into MyEclipse. You may find that helpful: http://stein.everybody.org/brain/simple-jsf-spring-example/

    MyEclipse does seem to be better tested with new projects. You have to fight the “Add JSF Capabilities” feature a little bit because it tries to re-add the required web.xml changes. That would be a good feature request for MyEclipse: to provide smoother support for adding capabilities to existing projects. However, it does work — just not as smoothly as it could.

    The best feature of MyEclipse (in my opinion) is the auto-hot-deployment of code changes to the web server. To take advantage of that, you have to have the output directory set to WEB-INF/classes in your source tree. (MyEclipse sets this for you when you “Add WebProject Capabilities”.) This goes against best practices with source control tools and with Maven, but in practice I’ve found it to be reasonable, as long as you didn’t have a classes directory already created. You’ll just have to be aware that there is generated output in that one directory. The beauty of this is that you then have an exploded war right in your source. MyEclipse will keep it synchronized with your web server.

    #258509

    Jeremy Stein
    Member
    #258583

    nbhatia
    Member

    Jeremy,

    Thanks for the pointers – very useful. I guess the only thing that is bothering me is the not so clean seperation between source and output locations – especially in the web project. Maven seems to want only source in src\main\webapp, whereas MyEclipse insists on making the WebRoot directory as a place to build the exploded war – mixing source and output. While I love the hot-deployment feature of MyEclipse, do you know of a way to keep the source and target seperate? I am even willing to create a MyEclipse project from scratch if it can coexist peacefully with Maven. Also I don’t like checking in jars into my CVS, so it would be nice if MyEclipse can pull them in from the maven local repository before doing the build out.

    Thanks.
    Naresh

    #258603

    Jeremy Stein
    Member

    @nbhatia wrote:

    While I love the hot-deployment feature of MyEclipse, do you know of a way to keep the source and target seperate?

    You can’t have both. But, while you’re in MyEclipse, the WEB-INF\classes directory is not shown as source. And you can always delete it when you exit.

    @nbhatia wrote:

    Also I don’t like checking in jars into my CVS, so it would be nice if MyEclipse can pull them in from the maven local repository before doing the build out.

    You shouldn’t check in your jars. MyEclipse does pull them from the repository. This command

    mvn eclipse:eclipse

    puts the maven jars in your Eclipse project’s classpath. (But it also messes up the output directory, so you’ve got to fix that. See my post again for details.)

    #258604

    nbhatia
    Member

    Ok, I think your comments are now registering in my brain :-). I will give it a shot and let you know how it goes.

    Thanks for all the help.
    Naresh

    #258642

    nbhatia
    Member

    Jermey,

    Your blog post was extremely helpful in importing my project into MyEclipse. Since my project is an ear, I had to fight a bit more with MyEclipse to layout the ear just like Maven is doing. I am almost there except that I am having a classloader issue with JBoss – I am getting the following error:

    WARN [EJBDeployer] Verify failed; continuing
    java.lang.NoClassDefFoundError: org/springframework/ejb/support/AbstractStatelessSessionBean

    My EJB uses spring. I have packaged spring-1.2.7.jar at the ear level (not in the EJB jar) and the MANIFEST.MF in the EJB jar includes spring.1.2.7 in the classpath. When Maven produces this exact layout, JBoss has no problems with it, but when MyEclipse does it, I am getting the above error. I have checked other files such as application.xml and jboss-app.xml and they are exacly the same between the two deployments. Any idea what this could be?

    Thanks.
    Naresh

    #258643

    Jeremy Stein
    Member

    Sorry; I’ve had no experience with that. In that sort of situation, I would generally grab one copy of the Maven version and one copy of MyEclipse’s version and WinMerge them. Something has got to be different!

    If you need further help, you may want to start a new thread. The MyEclipse support team seems pretty good at following up on threads without any other replies, but this one may be forgotten.

    #258645

    nbhatia
    Member

    Yes, I have begun to use WinMerge and already found that a dependent jar project has nothing in it. I have started a new thread on it.

    Thanks.

    #258670

    Riyad Kalla
    Member

    Naresh,
    The trick of converting an EAR to MYEclipse is to figure out all the “modules” and map those to projects in MyEclipse. With respect to your EAR/Spring library, you put it in exactly the right place, in the top level of your EAR. Did you try and regenerate the MANIFEST files to see if any of them ended up empty (Which can signify a build path issue).?

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: How to import an existing EAR/JSF project into MyEclipse

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