facebook

JSF deployment to WAR file…missing JARs?

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

    Curt King
    Participant

    I’ve created a standard Web Project and used the “MyEclipse…Add JSF Capabilities” menu option to add JSF functionality. I’ve built a little two-page app to test JSF. It works fine when I deploy it as an Exploded Archive to my local Tomcat server. But when I deploy it as a Packaged Archive, the app will not run. (Tomcat can’t find the Faces Servlet.)

    Looking at the WAR file, none of the JSF JARs are included. The WAR file contains my JSPs and classes, but not the jsf-api.jar, jsf-impl.jar, or jstl-1.2 jar files.

    If I add these JARs manually to the deployed web app, the web app runs fine.

    In another thread, Nipun says:

    The J2EE/Java EE libraries are never deployed and should never be deployed, they are provided by the application server at runtime and some application servers will even refuse to load your web-app if it detects copies of core classes like that.

    (Sorry if I’m taking that quote out of context.)

    Here’s a link to that thread:
    https://www.genuitec.com/forums/topic/java-ee-libraries-not-getting-deployed-and-icefaces-missing/&highlight=jsf+war&sid=0a90b6ab48eff6498f60c2ab189ed5e9

    So I’m confused — should these three JARs be in the /Tomcat/lib directory or should they be exported in the WAR file with the rest of my web app?

    Thanks,
    Curt

    #298584 Reply

    Loyal Water
    Member

    So I’m confused — should these three JARs be in the /Tomcat/lib directory or should they be exported in the WAR file with the rest of my web app?

    The confusion comes from the fact that with Java EE 5 and beyond, JSF 1.2 is part of the spec — so any Java EE 5 compliant server (JBoss, Glassfish, Sun App Server, WebLogic, etc. etc.) will provide their own JSF jars for JSF application in the server’s lib directory — they *have* to.

    The problem is that Tomcat and Jetty are both super-popular servers that are NOT completely Java EE 5 compliant servers — they provide a lot of support for Servlets, JSP and the other basics, but they don’t ship their own support for EJB containers or JSF libs I guess– so in THOSE cases, you have to deploy the libs to those servers.

    This is managed by way of the library-filtering feature we have in MyEclipse… if you go to Window > Prefs > Project Caps > JSF and expand out any of the libraries, there should be a filter node called “Server Deployments” and from there you can tell MyEclipse which servers which libraries should get deployed and which shouldn’t.

    The odd thing is that with JSF, in packaged mode, to Tomcat, MyEclipse should be deploying those. Can you double check those settings.

    #298606 Reply

    Curt King
    Participant

    I’m looking at the Preferences tab that you referred to (Project Capabilities > JavaServer Faces) and under both “jsf-api.jar” and “jsf-impl.jar”, I see “Server deployment excludes: (None).”

    Here’s an interesting wrinkle:

    When I deploy as a WAR file to the “MyEclipse Tomcat” server or the “Tomcat 6.x” server, the JARs are included. When I deploy to “<Externally Launched>” (in my case, a network drive that maps to a /Tomcat/webapps directory), the JARs are not included.

    If you need any other details, such as configuration info, please let me know.

    Curt

    #298635 Reply

    support-joy
    Member

    Curt,

    For a workaround, you can add these jar files as ‘Add External Jar files’ to the project build path.

    #298639 Reply

    Curt King
    Participant

    Great workaround, Joy. Much better than deploying the JARs into the Tomcat/lib directory, which was my first inclination.

    This isn’t a huge issue for me, and I know you guys are swamped with 7.5 and other stuff, so whenever you can get to it, it’s OK.

    Thanks,
    Curt

    #298690 Reply

    support-joy
    Member

    Thanks Curt. Yes, it would help if you can share your installation details with us. You can get it from MyEclipse > Installation Summary > Installation Details. Also do you have any third party plugins installed with ME? If yes, can you also list them out? You can get them from Help > Software Updates > Add/Remove Software.

    #298715 Reply

    Curt King
    Participant

    Here are my installation details:

    *** Date: 
    Tuesday, May 26, 2009 8:16:22 AM CDT
    
    ** System properties:
    OS=WindowsXP
    OS version=5.1.0
    Java version=1.5.0_11
    
    
    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 7.1.1
    Build id: 7.1.1-20090310
    
    
    *** Eclipse details:
    MyEclipse Enterprise Workbench
    
    Version: 7.1.1
    Build id: 7.1.1-20090310
    
    
    
    
    Eclipse Platform
    
    Version: 3.4.1.r341_v20080731-9I96EiDElYevwz-p1bP5z-NlAaP7vtX6Utotqsu
    Build id: M20080911-1700
    
    
    Eclipse Java Development Tools
    
    Version: 3.4.1.r341_v20080709-0800-7o7tEAfEF_U5qyUgrb2HAp539P97
    Build id: M20080709-0800
    
    
    Eclipse Graphical Editing Framework GEF
    
    Version: 3.4.1.v20080806-67718083A56B4H2A3213573
    Build id: 200809101400
    
    
    Eclipse RCP
    
    Version: 3.4.100.r341_v20080814-989JESIEdAciFYfkZZsBfSwQ2341
    Build id: M20080703-0800
    
    
    Eclipse Plug-in Development Environment
    
    Version: 3.4.1.r341_v20080731-7T7U0E9mlRIuGUYviF_VP
    Build id: M20080703-0800
    
    
    
    
    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -showsplash
    -launcher
    C:\Program Files\Genuitec\MyEclipse 7.0\myeclipse.exe
    -name
    Myeclipse
    --launcher.library
    C:\Program Files\Genuitec\MyEclipse 7.0\../Common\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\eclipse_1115.dll
    -startup
    C:\Program Files\Genuitec\MyEclipse 7.0\../Common\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
    -clean
    -configuration
    C:\Program Files\Genuitec\MyEclipse 7.0\configuration
    -vm
    C:\Program Files\Genuitec\Common\binary\com.sun.java.jre.win32.x86_1.5.0.011\bin\client\jvm.dll
    

    I do have several third-party plugins installed:

    Groovy
    FindBugs
    Checkstyle
    TPTP

    Curt

    #298746 Reply

    support-joy
    Member

    Thank you Curt.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: JSF deployment to WAR file…missing JARs?

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