impossible add Icefaces 3 facet in Eclipse 3.7? - eclipse

I am trying add Icefaces 3 facet but it is not work correctly, I have created a maven project (WTP=2.0) by maven command, the I have add JSF2,Java 1.6 and Javascript by Eclipse project facet, but when I try to add ICefaces 3 facet then Eclipse not working.
I add .XHTML extension in JSP editor and it work fine if I create a ICefaces project.
I don´t upload images, sorry, this is a link: http://www.flickr.com/photos/75492946#N02/6785053594/
In the image above, I press OK button and nothing happens, Icefaces 3 faces doesn´t add.
Otherwise, I download M2Eclipse and I have created a maven project, I followed the same steps above, and everything is fine until I try to add ICefaces 3 facet, with the same result for me.
I can write tag ui autocomplete bacause JSF2 nature add correctly, but I dont write autocomplete tags ace/ice
Finally, I could create a Icefaces project but this is not desired by me, because I need a Maven project within Icefaces 3 nature.
any suggestions?
Kinds regards.
==================================================================================
Finally!! I have resolved this problem. It is a very easy solution but I had overlooked. When You need to add Dynamic Web Module facet you must set Content directory: /src/main/webapp/
In this way the project preserver standard maven structure y then you could add JSF2 and Icefaces3 facet without problem.
Now, You can create *.xhtml file and autocomplete Icefaces,JSF2 and facelets tags.
Edit: The real conflict is the web.xml, it must be version=3.0, only in this way you can do the above steps.
ICefaces 3 releases note say: This release includes the Mojarra JSF 2.1.4 runtime libraries. Mojarra 2.1.4 introduces a hard depedency on Servlet 3.0 APIs, as a result, it cannot be used on older JEE5 application servers. Mojarra 2.1.3, or Apache MyFaces 2.1.6 should be used in on older JEE5 servers instead.
In my case I use Mojarra 2.1.3 and the web.mxl is version=2.5, but it conflict because ICefaces 3 eclipse facet somehow related Mojarra 2.14 and web.xml version=3.0
The final solution addition to the above is to user web.xml version=3.0 and libraries provided by Icefaces3 plugin.

If you start your project as an ICEFaces project, you can convert it to be a Maven project also after it is created.
Right click the project in your explorer
Select Configure > Convert to Maven project
This has worked for me in the past when I have needed a project to use Maven and other plugins at the same time.

Related

When downloading Mojarra libraries for JSF it is showing error "zip file is empty" in Eclipse

I'm working on JSF project, I'm trying to set up project facets in Eclipse, When I'm downloading Mojarra libraries for JSF2.2 it is giving error message. I'm using Eclipse Neon 2.
See the below image for more information.
Update: Updated.
Adding Mojarra Manually When Eclipse Luna/NEON/Oxygen JSF Download Library Is Empty...
When I was setting up a fresh install of JavaEE on my laptop today, the JSF Download Library would not return any results to download. Some searching suggested that I had to change my proxy settings but since I was not behind a proxy,
Actually some sorts are saying temporarily / Website is offline that's why its not downloadable ...
it would not help me. Lucky enough, JSF are just another bunch of jars that can be added to a user library.
You can download the JSF Scroll down here for newest versions of JSF jars...
Download JSF API JAR JSF API jar file
Download JSF IMPL JAR JSF IMPl jar file
Then simply; click the “Manage Libraries” icon on the JSF capabilities page click “New” and name your library
click “Add external jars” and browse to the jars you downloaded
Finally you are fully featured to the JSF Mojjara Library
Thanks...
I have downloaded javax.faces.jar file from maven repository. Added that jar file to classpath, now it is working fine.
javax.faces.jar
I found other sotution, when you start a new dynamic Web proyect pick "New runtime", then Oracle>Glassfish, install it and restart eclipse, JSF library is probided by Glassfish so in JSF Capabilities panel (when the new proyect is created) , glassfish is assigned by default (the System library). it works for me :)

Maven Eclipse Integration

I have recently started out on Maven. I am trying to integrate Maven+eclipse(Juno)+tomcat7.
I have downloaded m2e-wtp plugin for eclipse and created a Maven project whose structure follows a standard Maven project structure. It is also configured a dynamic web project.
It is a multi module project with two modules of flex(f1 AND f2) and one module of webapp(w).I have configured all the plugins correctly and there is no problem with configuration of POMs.
What I want to achieve is :
When I clean and Build project in Eclipse using Project-->Clean,Eclipse does not build the war in target folder of my web application project (w). I also does not copy any of the flex resources to target folder. However,
When I run the project as maven build by right-clicking the web application project and running it as a "maven install" it creates everything as expected.
My question is that if it is possible to achieve what I mentioned in point (1)? Or the only correct way to do this is the way mentioned in point (2).
I am also not able to deploy the generted files in step 2 automatically in tomcat.
Do I need to use another maven plugin for this?
Please note that this i my first experience with Maven + eclispe. I have followed certain tutorials. So, Please be lenient while voting negatively.
From what I know it is not possible to force Eclipse to use Maven directly (I would gladly be proven wrong).
Eclipse does not use Maven to build (1). Using the m2e plugin, it is possible to run maven to perform the build as you discovered (2).
If you are looking for that kind of tight integration you can look at NetBeans or IntelliJ who are using Maven natively.
EDIT:
About (3) there is a Tomcat-Maven-Plugin that can deploy the WAR file created on a running tomcat instance. Check the Usage page for more details.

Adding JSF 2.2 results in "Found multiple versions of the required class javax.faces.FactoryFinder"

I'm wondering how I can use JSF 2.2 (instead of the 2.0.2) in Eclipse?
It seems like there is no official release (only majorra 2.0 and myfaces 2.0.2 are available)
and when I add jsf 2.2 impl and api manually (Project Facets), it tells me: "Found multiple versions of the required class javax.faces.FactoryFinder.".
When i remove the old (myfaces 2.0.2) tomcat fails...
is there a way to make JSF 2.2 run in eclipse as default?
You can both, add the library to your classpath or configure it in jsf preferences, if you've the facet enabled. In the first way you're not telling Eclipse you're using JSF and second way you tell it and you can choose between configuring the classpath yourself or make Eclipse choose which JSF jars you want to use to let it include them.
First of all you need to download the jars from Mojarra's or MyFaces'es site. MyFaces doesn't have 2.2 version implemented as of today.
To just add the library to your classpath, right click on the project and go to Properties, Java build path. Then click on Add JAR or Add External JARs, depending where you have the jar and add the jsf-api and jsf-impl jars.
Otherwise, if you have the project configured as a JSF project, firstly you have to enable the JSF facet, check Project Facets. Then Eclipse will create a submenu inside Project Facets, letting you configure JSF. You can choose disable library configuration and do it the previous way or select User Library:
Then click on the books icon and you can add a new user library. Once added you only need to add required jars. Keep in mind that you need both jsf-api and jsf-impl jars to have it working, as Tomcat is a plain servlet container and doesn't include any JSF implementation out of the box.
Alternatively, you can also place the jsf-impl directly in your Tomcat shared libraries folder. You should drop it in $CATALINA_HOME/lib and every single application you deploy will use the same implementation. In that way you can just reference the jsf-api from your projects and code against it, having the implementation itself into the server's classpath.

what are the minimal JSF jars needed to deploy a JSF app with Tomcat

I know that a minimal API is 4 jars, I remember facelets*.jar.
What are the minimal JSF jars needed to deploy a JSF app with Tomcat?
Just use the JAR files which are provided/required by the JSF implementation you choose to use. Just download the implementation and read their own installation/users guide if you don't actually need more JAR files (as dependencies).
As of now there are only two major JSF implementations: Mojarra and MyFaces. The number of JAR files may vary per implementation and even version. Ultimately you need to make sure that you have both the JSF API and JSF implementation (which may exist of 2 or even 1 JAR file, depending on impl/version). MyFaces requires more commons-*.jar dependencies while Mojarra doesn't require any additional dependencies.
Since JSF 2.0, Facelets is bundled with the JSF implementation and has replaced JSP as default view technology.
See also:
Our JSF wiki page
These two are enough to start a simple web app using JSF 2.1 with tomcat 7.
javax.faces-2.1.14.jar
and
jstl-1.1.0.jar
You can run a JSF application with tomcat by either including Mojarra libraries or by including jars.
1. To include Mojarra libraries,
While creating an JSF application, it asks for JSF implementation library. Select option 'User library' and then click on 'Download library' option as shown in the below image.
It will then search for the libraries and show an option like below,
Select the mojarra library and then accept the "Terms and conditions" and click on "Finish".
2. Include below jars
Download JSF-API Jar http://central.maven.org/maven2/com/sun/faces/jsf-api/
Download JSF-IMPL Jar http://central.maven.org/maven2/com/sun/faces/jsf-impl/

NetBeans + GWT 2.2.0 + Maven compile problem

I'm trying to create a Maven Web Application project with Google Web Toolkit in NetBeans 6.9. I've followed the steps shown on this video: http://www.youtube.com/watch?v=M-iVZ5TJ21w
After creating the project and adding GWT to the frameworks my project compiles and deploys to Tomcat nicely. Now i like to change the default GWT version from 2.0.3 to 2.2.0. As i edit the gwt.version property in the POM and save the file, NetBeans fetches the new gwt-user-2.2.0.jar file and the javadoc. However if i try to compile the project i get this Maven error in the console:
Downloading: http://repo1.maven.org/maven2/com/google/gwt/gwt-dev/2.2.0/gwt-dev-2.2.0-linux.jar
Unable to find resource 'com.google.gwt:gwt-dev:jar:linux:2.2.0' in repository central (http://repo1.maven.org/maven2)
If i point my browser to the URL http://repo1.maven.org/maven2/com/google/gwt/gwt-dev/2.2.0/ i can see that there's truly no gwt-dev-2.2.0-linux.jar present. However i can see there a gwt-dev-2.2.0.jar which i think will be the correct one to use.
What should i do to fix this error?
You're probably using old version of gwt-maven-plugin. Switch to 2.2.0 or remove version declaration and it'll fetch newest version.
It's also possible that you have some old-format dependency for GWT in your pom. There used to be tag required for old GWT versions. If you have one you can remove tag and it will fetch system independent version without -linux suffix.