facebook

Lazy guide to SEAM in MyEclipse

  1. MyEclipse Archived
  2.  > 
  3. Documentation
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #264228 Reply

    Tony Herstell
    Participant

    This was also posted in JBoss Seam Forums.

    The examples in other posts are ant-build-deploy based… including how to connect to a running server “somewhere ourside the IDE” – e.g. a Live/Pre Production Server.

    For developement you probably don’t want to do that! If you have a Good IDE why not use it?

    I generally work alone on projects so time is king!

    So, call me very sad but I could not stand the time taked to ant build/redeploy each time I made a tiny change !!! so I bothered to set up a J2EE project in MYEclipse comprising of three parts:
    xxxx.ear
    xxxx.jar
    xxxx.war

    I then ripped apart a war created for the booking example (from Ant) and kept fiddling until I finally got the right Jars/Code in the right areas (ear, jar and war) that matched the WAR. (I can supply this!)

    I then told MyEclipse to “deploy as exploded” to my JBoss server; which creates a directory in the JBoss Deploy area called xxx.ear and puts your “real” code in there… unarchived! NEAT!

    I then just run the JBoss server from INSIDE MyEclipse with one button click and generally when I change code/xhtml I don’t even have to redeploy/restart the server; it just works… and I can also set breakpoints etc. (might have to close the browser to clear the browsers cache of .css and .xhtml though!)

    All your output from the server, including your logging statements, is in the MyEclipse console and you just set breakpoints in your code and it works! none of this fiddling with Jboss config etc.

    Set your log statements to info to see them in the console (the easy option as JBoss logs by default to info I guess) or else do some fiddling in the Jboss Logger Config XML file (cant remember the name) to either:
    1. change the default outputter to log at the level of debug (you get a lot of debug info from everywhere including the JBoss server itself! some of it quite interesting and amusing!)
    OR (the geek solution)
    2. add a outputter for your project that outputs your applications packages logging (xxx.xxxx.xxxx.xxx) at the debug level. – See a Geek for how to do this or RTFM from JBoss as it should be in there!

    Now, if you change the code too much (i.e. change an interface) then you get MyEclipse reporting (on behalf of JBoss) that it can’t manage the change and you are offered the option to terminate the server; which I generally do; and then re-start it (again one-click from inside MyEclipse).

    Finally, when I have to, I write an ant script for other people ! (Not actually done one yet and been working this project for weeks!!!)

    NOTE: MyEclipse is SUPPOSED to deploy as an WAR archive as well as exploded but I never get a valid war !!! as the application.xml gets munged…(e.g. <web-uri>risingstars.war.war</web-uri>). This is a shame as then I would only have to writer an Ant script at the VERY VERY end to get rid of some Jars I dont need deployed (the test ones) but I think I may be able to fiddle around more and have “dependent” projects in MyEclipse to get round this e.g. xxxx._testing.ear. (NOte to self – RTFM in MyEclipse as I can’t ‘NOT’ deploy a jar file from my project to the exploded or archived project).

    Not bad for a tool that really doesn’t even support SEAM/EJB3.

    If you go this route make sure you do this:
    Under xxxx.ear go into properties
    Under EAR check the option for
    “Do No Modify ‘application.xml’ (I will manually manage it)”
    as it gets it wrong!

    SEAM + IceFaces Related stuff:

    I seem to have ended up with the same jars in some/all parts of the project! seems to still work ok though.

    You seem to have to add your icefaces jars to the application.xml

    
    <application>
        <display-name>risingstars</display-name>
    
        <module>
            <web>
                <web-uri>risingstars.war</web-uri>
                <context-root>/risingstars</context-root>
            </web>
        </module>
        <module>
            <ejb>risingstars.jar</ejb>
        </module>
        <module>
            <java>jboss-seam.jar</java>
        </module>
        <module>
            <java>icefaces.jar</java>
        </module>
        <module>
            <java>icefaces-comps.jar</java>
        </module>
    </application>
    

    And if you have to use IceFaces table etc. then dont forget to open this file:
    C:\Program Files\jboss-4.0.5.GA\server\default\deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml and alter this line:
    <attribute name=”UseJBossWebLoader”>true</attribute>
    and no, I don’t know why.

    MyEclipse are looking to add in EJB3 support and possibly Seam support but that depends on the support from JBoss Seam Team I guess and they may not want to take this “inside the IDE approach”. I can only hope the MyEclipse Devs talk to Gavin or Michael.

    Hope this helps.

    #264349 Reply

    Riyad Kalla
    Member

    First let me thank you for this, fantastic guide and a lot of users are going to appreciate this. I’m moving this ot the Documentation forum so folks can find it.

    Now to address a few things you mentioned:

    NOTE: MyEclipse is SUPPOSED to deploy as an WAR archive as well as exploded but I never get a valid war !!! as the application.xml gets munged…(e.g. <web-uri>risingstars.war.war</web-uri>).

    Is your project named with a dot in the name? That would be screwing up the deployment…

    (NOte to self – RTFM in MyEclipse as I can’t ‘NOT’ deploy a jar file from my project to the exploded or archived project).

    Deployment filtering is comming soon, I promise! 🙂

    #264386 Reply

    Tony Herstell
    Participant

    Thanks.
    I hope it helps someone.

    Is your project named with a dot in the name? That would be screwing up the deployment..

    Nope… I can give you access to the code repository and you can load the project yourself to help debug it. pm me as its still not working right!

    Deployment filtering is comming soon, I promise! 🙂

    😀 😀 😀 😀 😀 😀 😀 😀 😀

    #264446 Reply

    Tony Herstell
    Participant

    Update

    Don’t have a . (dot) in your MyEclipse projects:
    xxxx.ear
    xxxx.jar
    xxxx.war

    should be
    xxxx
    xxxx_jar
    xxxx_war

    and then you can deploy a .ear file directly to your server from MyEclipse (thanks MyEclipse guys).

    making your xxx
    META-INF
    application.xml

    
    <application>
        <display-name>xxxx</display-name>
    
        <module>
            <web>
                <web-uri>xxxx_war.war</web-uri>
                <context-root>/xxxx</context-root>
            </web>
        </module>
        <module>
            <ejb>xxxx_jar.jar</ejb>
        </module>
        <module>
            <java>jboss-seam.jar</java>
        </module>
        <module>
            <java>icefaces.jar</java>
        </module>
        <module>
            <java>icefaces-comps.jar</java>
        </module>
    </application>
    
    #264568 Reply

    Tony Herstell
    Participant

    Have a feeling that having the . in my project also caused the problems with being able to copy, move, rename class files as I dont seem to having the problems at the moment.

    Which sort of implies that MyEclipse is pretty acceptable as a Tool for programming SEAM.

    Would be nice if it was more supportive, but thats up to you devs.

    #264578 Reply

    What about this :
    ear project: xxxxx.ear
    ejb project: xxxxx.jar
    web project: xxxxx (war extention added by ME on deployment)

    regards
    Jean-Michel

    #265260 Reply

    eirirlar
    Member

    @JMPARG wrote:

    What about this :
    ear project: xxxxx.ear
    ejb project: xxxxx.jar
    web project: xxxxx (war extention added by ME on deployment)

    regards
    Jean-Michel

    This will cause you trouble when you try to refactor something: https://bugs.eclipse.org/bugs/show_bug.cgi?id=171937

    Regards, Eirik

    #265261 Reply

    eirirlar
    Member

    @balanceofpower wrote:

    should be
    xxxx
    xxxx_jar
    xxxx_war

    Is this really working for you? I’m having the trouble described here: http://www.myeclipseide.com/modules.php?op=modload&name=PNphpBB2&file=viewtopic&t=15896#72157

    In short: changes made to java files EJB project is not reflected on the deployed application (try for yourself). If I use “xxxx.jar” as the EJB project name, changes are reflected, but I get the refactoring trouble mentioned above.

    If you have solutions I’d be more than happy to hear them as I’m about to scratch my head all the way through my cranium.

    Regards, Eirik

    #265263 Reply

    Tony Herstell
    Participant

    I swear it’s working fine for me now.
    EAR=risingstars
    JAR=risingstars_jar
    WAR=risingstars_war

    Getting rid of the dots means my project re-factors (thank heavens)!

    DON’T forget to set the ear (via properties) to NOT update the application.xml as it gets it wrong for Seam (the radio button you click is : Do not modify ‘application.xml’ (I will manually manage it)).

    Sorry been away so long from the computer and I hope this helps.

    #265274 Reply

    eirirlar
    Member

    Hi again and thanks for the answer.

    I don’t know why, but after creating another workspace using the myprojectEJB naming and doing a clean install of jboss appserver, hot code replacement is working. Strange. Would be interresting to hear if anyone else have encountered similar problems.

    Regards, Eirik

    #265276 Reply

    eirirlar, balanceofpower:
    I was not aware of that bug: thanks for the info !

    Jean-Michel

    #265889 Reply

    Tony Herstell
    Participant

    Ok, MyEclipse guys.
    With the huge growth of Seam/Icefaces can we please have any indication of when the support for Seam (EJB3) and IceFaces will appear.
    IceFaces already do a MYEcdlipse plugin but I have not seen it arrive in any update.
    Seam guys do some eclipse tools but I think they use NetBeans out of preference (for some reason).

    I am building Seam apps very successfully with MyEclipse but I feel that more could be done…

    #265912 Reply

    Riyad Kalla
    Member

    I don’t have any official commitment from the management team. I’ve made them very aware of the demand for it but first thing is going to be JEE 5 support before we do anything specific like SEAM. As far as bundling the ICEFaces plugin, that depends on the licensing and isn’t something that I have personally evaluated yet, but we surely do appreciate them putting one together.

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: Lazy guide to SEAM in MyEclipse

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