1

I'm going rephrase my previous question. We have a website on our server that was developed by our parent company (across the globe in Taiwan) using NetBeans. Nothing on the server is from NetBeans, no references, build files, project files, or anything. Just the necessary files the server needs to run the website. I've been given the responsibility of maintaining this website because they no longer support us. So, I copied/pasted the entire website, from the domain folder, over to my local computer and imported it into my NetBeans. As I go into the source code, I get a whole bunch of errors. Basically 95% of the import statements are erroring out because it can't find the specified "symbol", or the package simply "doesn't exist".

I've tried working with the Project properties -> Libraries and adding libraries and/or JAR/Folder that I believe the source code is trying to reference..but it doesn't seem to do the trick, or I'm not doing it right. I just need to get these darn references working.. here is a small list of the import statements from the file in question (RecordAdd.java):

package asp.easp;

import asp.SessionBean1;
import com.icesoft.faces.component.ext.HtmlCommandButton;
import com.icesoft.faces.component.ext.HtmlCommandLink;
import com.icesoft.faces.component.ext.HtmlDataTable;
import com.icesoft.faces.component.ext.HtmlInputText;
import com.icesoft.faces.component.ext.HtmlInputTextarea;
import com.icesoft.faces.component.ext.HtmlMessage;
import com.icesoft.faces.component.ext.HtmlOutputText;
import com.icesoft.faces.component.ext.HtmlPanelGrid;
import com.icesoft.faces.component.ext.HtmlSelectOneMenu;
import com.icesoft.faces.component.jsfcl.data.DefaultSelectedData;
import com.icesoft.faces.component.jsfcl.data.DefaultSelectionItems;
import com.icesoft.faces.component.jsfcl.data.DefaultTableDataModel;
import com.icesoft.faces.component.jsfcl.data.SelectInputDateBean;
import com.icesoft.faces.component.panelpopup.PanelPopup;
import com.icesoft.faces.component.paneltabset.PanelTab;
import com.icesoft.faces.component.paneltabset.PanelTabSet;
import com.icesoft.faces.component.selectinputdate.SelectInputDate;
import com.icesoft.faces.component.selectinputtext.SelectInputText;
import com.sun.rave.faces.data.DefaultSelectItemsArray;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import java.util.ArrayList;
import java.util.Collection;
import javax.faces.FacesException;
import javax.faces.convert.DateTimeConverter;
import javax.faces.model.ListDataModel;
import util.RecordDetailInfoBean;
import asp.ApplicationBean1;
import asp.RequestBean1;
import com.coretronic.util.DateConvert;
import com.icesoft.faces.component.ext.HtmlSelectOneRadio;
import com.icesoft.faces.component.jsfcl.data.CachedRowSetWrapperDataModel;
import com.icesoft.faces.context.effects.Appear;
import com.icesoft.faces.context.effects.Effect;
import com.sun.data.provider.impl.CachedRowSetDataProvider;
import com.sun.jsfcl.data.CachedRowSetDataModel;
import com.sun.sql.rowset.CachedRowSetXImpl;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Calendar;

You can see a picture of the file hierarchy of the website in the link above to my previous question. Can somebody please help me get these references working in my project? I have very little experience in JavaEE, so please assume I don't know anything, because I don't. The stuff I do know that I've mentioned is what I've come to find after working on this for a week now. I can provide any additional information you need about the project. Thank you very much in advance.

Community
  • 1
  • 1
Nick Rolando
  • 25,879
  • 13
  • 79
  • 119
  • I just created an empty Java EE project on NetBeans and I must say it's much more complicated than what I'm used to (Java SE). It actually generates 3 different projects: EnterpriseApplication1, EnterpriseApplication1-ejb and EnterpriseApplication1-war. I can understand that things are messed up if they bundled up those 3 projects as a set of files for deployment. I also noticed that you can create a Java EE project with "Existing Sources"; I could not try it but it might be useful to you. – toto2 Jun 18 '11 at 01:04
  • In the end, you might have to fully understand how everything works before making any progress. You might want to create tiny Java EE apps to see what NetBeans does. – toto2 Jun 18 '11 at 01:04
  • @toto: Looking at the folder structure in the screen in the previous question, it's just a WAR project, not an EAR project. I don't do Netbeans, but Eclipse offers the possibility to create a simple WAR project (1 project map) or an EAR project (3 project maps). – BalusC Jun 18 '11 at 02:51
  • @BalusC - NetBeans also is capable of creating a simple Web Application (WAR) project, and a full Enterprise Application. – Rogach Jun 18 '11 at 05:54

1 Answers1

4

You should always first figure which application server the webapp is currently running in. You should namely have a copy of the very same server in your local development environment. That can be Tomcat 6/7, Glassfish 2/3, JBoss AS 5/6 or something. "Java EE" is an abstract API and the application server is a concrete implementation which contains the real libraries, such as the javax.* ones. I don't do Netbeans (I am an Eclipse user), so I can't go in detail, but you should at least integrate the application server in your IDE and import the project as a Java EE project and associate it with the application server in there. This way the javax.* imports should work. At least, if the IDE is a bit smart.

According the com.sun.rave.* imports, which is part of the (fortunately) for long dead Woodstock component library for JSF, I guess that the webapp was originally developed in Netbeans 6.x (max 6.7) and that target application server is Glassfish v2. That IDE shipped with a so-called Visual JSF Editor which allowed you to drag'n'drop web UI components together (and generated hard-to-maintain code). I'd suggest to get a copy of Netbeans 6.7 which was the latest which shipped with Glassfish 2.1 and Woodstock. You can download it here. Pick the one of the 2nd column, saying "Java" (not "Java SE"!). It's 238MB.

The com.icesoft.faces.* imports are from the IceFaces JSF component library. Seeing this in combination with the Woodstock imports, I guess that the project was ever migrated from Woodstock to IceFaces after Woodstock died. The IceFaces libraries (and all other webapp-specific libraries) should be available in the /WEB-INF/lib folder. When the project is on a proper manner imported, the IDE should already have taken all JARs in the /WEB-INF/lib folder in the build path. Again, I'm not sure about Netbeans, but at least Eclipse (for Java EE) does that automagically.

Good luck with maintaining the project. This is definitely not going to be easy if you haven't ever touched Java EE. If you want a bit more background info about Woodstock, check my answer on this question: Where is Visual Web Editor for JavaServer Faces on Netbeans Last but not least, I strongly recommend to take a pause of about half a year or longer and play around with simple Java EE tutorials/examples/projects first so that you get better overall idea. Going from nothing to JSF is a pretty steep and long traject. I'd suggest to get yourself through Java EE web development, where do I start and what skills do I need?

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Awesome, thank you very much. I'm out over the weekend, so when I get back on Monday I'll check all this out. Definitely very useful information. Yes, I'm sure the libs are in /WEB-INF/lib folder, and the weird thing is I added all those files in the project properties library references and nothing.. Well, even tho it was done in netbeans, if it still won't work, I'll try it with eclipse, I have a lot more exp with that too. Thank you again for your response and I'll let you know how it goes on monday :) – Nick Rolando Jun 18 '11 at 17:44
  • @Nicklamort I might be wrong. When imported the project, are you sure you imported application folder and not the domain folder? I am just curious because the rootfolder in your picture is domain2. – Bhesh Gurung Jun 18 '11 at 18:12
  • /BGurung I was able to get the actual netbeans project from taiwan and netbeans recognized it :) None of the saved libraries were found, but I removed them and readded the .jars in the lib folders and it worked!!! I specified the target server and that got rid of the javax.* import errors too :) thanks a bunch! – Nick Rolando Jun 20 '11 at 20:43