Generalized Steps for configuring imported jsf project's libraries in eclipse - eclipse

i have checked similar posts and have googled but could not find an eligible answer to this. When ever i import a jsf project from some other system (where its working fine) OR delete the tomcat server in eclipse and add new server back again...there are lots of tag libs and imports that go "unresolved". Such applications are often not created by me and i dont exactly know which libraries are to be added to configure and fix project in eclipse.
I want to ask, is there any general way to find out all the required libraries for any imported jsf project and then add them.
Thanks in advance.

Download the javax.faces.jar file and drop it in project's /WEB-INF/lib folder.
That's all.

Related

Vaadin on Netbeans -- which jar?

i'm looking to use Vaadin on Netbeans 8.
I installed the Vaadin plug-in on Netbeans.
Followed the instructions on https://vaadin.com/wiki/-/wiki/Main/Getting+Started+on+NetBeans.
The jar i'm using is vaadin-all-7.3.8.
I assigned Tomcat to the project.
However - com.vaadin isn't recognized for all what it has in the environment-- com.vaadin.ui and com.vaadin.Application aren't seen.
I'm getting checked errors to
import com.vaadin.Application;
and
import com.vaadin.ui.*;
, but not to
import com.vaadin.*;
What more do i need for Vaadin on Netbeans??
TIA.
//=======================
EDIT:
Pls note: Saw Using Vaadin on NetBeans WITHOUT Maven along with some other discussions.
Also note: We're looking to avoid Vaadin-on-Maven. have already had issues with that one as well.
Be sure to read the readme in the zip file that tells you which jar files you need to include in your project:
Copy all vaadin-* files except vaadin-client and vaadin-client-compiler to WEB-INF/lib in your project
Copy lib/*.jar to WEB-INF/lib in your project
Copy vaadin-client and vaadin-client-compiler to a lib folder which is on your classpath but will not be deployed. These files are only needed when compiling a module (widget set) to Javascript.
What issues did you have with maven? Typically I would recommend using a dependency management tool to make upgrades easier in the future.

rdf using apache jena on net beans

I want to create a simple RDF graph and then try simple querying using SPARQL. Since I'm familiar with java and net beans, I want to use Apache Jena on NetBeans. I downloaded the related files from http://www.apache.org/dist/jena/ .
What should I do next to write RDF codes on net beans? i.e Should I install something or add lib files/jar files somewhere?
(Too long for a comment on Ian's reply)
Maven is easy on netbeans, and a good way to get started with everything you need (as Ian says). Here's a quick guide to start a jena project:
File -> New Project. Choose Maven then Java Application.
Pick project name, location, etc., then Finish.
Netbeans will create a new maven project and open it.
Right click on Dependencies, choose Add Dependency....
Use org.apache.jena as the Group ID, jena-core (or jena-arq if you want SPARQL) as the Artifact ID, and 2.10.1 as the Version.
Open the Dependencies folder. It ought to have a number jars present -- these are jena and its required jars. You might need to right-click on Dependencies again and choose Download Declared Dependencies to ensure jena is ready for use.
Under Source Packages you'll find App.java. Try some of the simple jena api tutorials and try running them.
You need to put the .jar files from the Jena distribution where Netbeans will find them. I don't know Netbeans, but in Eclipse I might have a lib directory in my project top-level directory, and then set the Eclipse's project classpath to include each of those .jar files. Netbeans I'm sure has something similar.
Actually what I do in Eclipse is not use downloaded jars at all, but I would use Maven to manage the dependencies for me. So I would create a pom.xml file in my project folder that stated that, among other things, my project depends on Jena, and then Maven takes care of downloading the dependencies for me. Eclipse and Maven work well together; I'd hope the same would be true of Netbeans. Setting up Maven to use Jena is described on the Jena site. However, learning Maven can be a bit of a steep curve, so if you're not ready to take that on just yet then downloading the .jar files to a project lib directory is the way to go.

How do you import a Java Class Library into a Java Web project (using NetBeans)?

I've already tried the options "Add folder...", "Add Library...", and "Add JAR/Folder...", but it's not working this time -- I've done this several times before without any problems.
I've also tried to add the folder / JAR file (.war-file) manually to the projects properties in every thinkable way, but still no success.
And so far, Google hasn't helped either..
Any help would really be appreciated.
(This is for a Java Web project with JavaServer Faces, using NetBeans 7.1)
Solved: I never found out what caused the problem. I ended up re-installing entire NetBeans, and re-created (a thousand times) the project I was trying to import. And in the end, I got it working.
Put the JAR file in the WEB-INF/lib directory of your web project. All JARs in the WEB-INF/lib and all packages in WEB-INF/classes are automatically in the CLASSPATH.
Can you make "Hello, servlet" work? If not, why bother with JSF? Do a simple web app successfully and build up from there.
I had this problem with netbeans, but it seems like all the answers I found are for Eclipse (I guess am wrong) as I dont see any WEB-INF/lib directoryin NetBeans, though I have a WEB-INF directory.
so here what I did.
I remove the tomcat server on NetBeans, go to C:\apache-tomcat-7.0.30\lib , put the jstl-1.2.jar file their, restart NetBeans and add a new (Tomcat) server, create a new web app, and their, I could find the jstl-1.2.jar file in the Libraries > Apache tomcat.
and for unknown reason, it worked.!

Hibernate Setup in eclipse helios

How I can setup Hibernate for a Dynamic Web application by using Eclipse Helios? I am a newbe so please let me know if there is any example.
I tried for Java application and included all JARS and it worked fine. But don't understand how I can do it for Web application and test it.
I will use Struts2 so I will appreciate if I can get appropriate example or guidance.
Drop the jars in WEB-INF/lib. Those jars are automatically added by Eclipse to the project build path, and constitute (with the WEB-INF/classes directory and the container classpath) the classpath of the webapp.
http://hardik4u.wordpress.com/2008/09/02/struts-2-hibernate-3-integrationcomplete-using-eclipse/
https://stackoverflow.com/questions/4364923/struts2-and-hibernate-framework-create-in-eclipse
First, download Struts2, and import example WAR file into Eclipse. You can find it from the source folder: struts-2.3.1-all\struts-2.3.1\apps\struts2-blank.war
Second, you should install Eclipse Hibernate Plugin. Goto Window > Preferences > Install/Update > Available Software Sites and add following link and name it JBossTools or something.
http://download.jboss.org/jbosstools/updates/helios/
Depending on your needs you can install Hibernate Plugins for many project types. In this case, select web application plugin.
And after, you should include Hibernate Core libraries into your classpath. I would recomment Hibernate 3.6 and greater. Because it does not depend on asm (asm-3.3.jar, asm-commons-3.3.jar ...) anymore. If you use earlier versions you might encounter some problems, since Struts2 also depend on asm libraries.
Then create your database, and use following link to configure and generate model bean classes.
http://casteyo.wordpress.com/2007/06/06/conf_hibernate/
Now you don't need to write mapping files by yourselves. And with DAO factory pattern you have your way to finish your project.
Hope this helps, and Goodluck

Importing a existing Web Application , into Eclipse

I need to import a existing Web Application , into Eclipse .
Please see the Structure of my Web Application as shown in the below figure .
http://imageshack.us/f/220/structurek.jpg/
From Eclipse IDE , while using import What option i need to select that is should i use
Existing projects into Eclipse
Archive File
File System
please see this image
http://imageshack.us/f/850/eclipseo.jpg/
Import existing projects into Eclipse works only for projects that were created in Eclipse.
And you're definitely not dealing with an Archive File here.
Import from the File System just copies the resources but does not actually create an Eclipse project for you.
What I would advise you, is to create a new Dynamic Web Project, configuring all the required facets, and then just copy all the contents of your existing app to the WebContent folder, either by drag'n'dropping it into the Project Explorer or by using Import from the File System, overwriting all the contents.
So far, there seems to be no other way to do it in Eclipse. However you may check out the similar post. The user #RC recommends using ant task for this process, but I'm more than sure that it won't configure all the required facets for you. It may work for some simple Java projects, but surely not enough for Java EE projects.