Here's a short and hacky guide on how to set up jforum for development using NetBeans.
It's quite messy and can definitely do with improvements, but i'm posting it here regardless so that java EE n00bs like me have a starting point.
As I find improvements I'll make changes. Please suggest changes too
By the way, thanks to Andowson Chang and Rafael Steil for their heroic efforts. I'm so glad that I can have a forum written in java and not ugly php.
Setting up jforum in Netbeans. Works in netbeans 7.0.1.
This is meant to complement Andowson's excellent guide for eclipse:
http://jforum.andowson.com/posts/list/3.page
1. Download netbeans for Java EE (enterprise edition) from
http://netbeans.org/downloads/
Install.
Note that you can use the servlet container 'GlassFish' that comes with netbeans instead of tomcat. If you are ok using glassfish, skip the next two steps.
2. Download xampp for your operating system from
http://www.apachefriends.org/en/xampp.html
Install.
3. Register Tomcat (bundled with xampp) as a server in NetBeans.
In NetBeans, find the Menu: Tools -> Servers.
Select 'Add server'
Select 'Apache Tomcat' then click Next
In the 'Server location', click browse and find the tomcat directory in the xampp directory. For example: C:\JavaFiles\xampp-win32-1.7.7-VC9\xampp\tomcat
Type a username and password, making sure that they are the same as those used when installing xampp.
etc.
4. Download the latest jforum code from the repository using subversion.
In NetBeans, Team -> Subversion -> checkout
In the repository URL type:
https://jforum2.googlecode.com/svn
Then click Next.
Half-way down the next dialog, in the 'Specify local folder to checkout folders into', choose a folder to save the files to.
Click Finish.
Netbeans will download all of the source files and you can see the progress in the bottom right 'checking out...' status of the netbeans window.
5. Create a new project in netbeans.
File -> new project
For category choose 'Java Web'and for project choose 'Web Application'.
Give the project any name, let's use 'myjforumproject'.
For server, choose Apache Tomcat.
Then click Finish.
6. Insert data into the project.
Find the folders downloaded by subversion using your file browser (WindowsExplorer).
Go to trunk/src/main/java and copy the 'net' folder.
Paste it into myjforumproject/src/java.
Go to trunk/src/main/webapp and copy all files and folders. There should be 6 folders and 3 files.
Paste it into myjforumproject/web. Overwrite and replace all existing files and folders.
Go to trunk/src/main/resources and copy the 'templates' folder.
Paste it into myjforumproject/web.
Go to trunk/src/main and copy the 'config' folder.
Paste it into myjforumproject/web/WEB-INF
6. Add the dependancy jar files.
Download jforum-2.3.3.war from
http://code.google.com/p/jforum2/downloads/list
Unzip the war file using winzip or 7zip.
Go to jforum-2.3.3/WEB-INF/lib and copy all files except for jforum-2.3.3.jar. We don;t need that one since that's what we're actually building from the source code (.java files).
Create a new directory in your project folder, such as myjforumproject/dependancyLibs.
Paste the jar files into this folder.
In the NetBeans window, on the left hand side in the 'Projects' or 'Files' tab,
right click 'myjforumproject' and click 'Properties'.
In 'categories', select 'Libararies'.
In the right hand side of the dialog, select add jar/folder. Navigate to myjforumproject/dependancyLibs and select all of the jar files then click OK.
7. Now we're nearly there. For some reason the net.jforum.context.web.WebRequestContext.java file is missing a method, so add the following code to that file.
/**
* Returns an <code>Enumeration</code> of <code>String</code> objects containing the names
* of the parameters contained in this request. If the request has no parameters, the method
* returns an empty <code>Enumeration</code>.
*
* @return an <code>Enumeration</code> of <code>String</code> objects, each
* <code>String</code> containing the name of a request parameter; or an empty
* <code>Enumeration</code> if the request has no parameters
*/
public Enumeration getParameterNames() {
final WebRequestContext wrc = this;
return new Enumeration() {
Iterator<?> names = wrc.getRequest().getParameterMap().keySet().iterator();
public boolean hasMoreElements() {
return names.hasNext();
}
public Object nextElement() {
return names.next();
}
};
}
8. Final steps
Clean and build the project.
Then Run the project.
Your browser should take you to the installation page if everything is working.
If it isn't working, check that Tomcat (or Glassfish) is working by browsing to 'localhost:8080'. If that shows nothing then tomcat is not working or is not registed with netbeans properly.
If the NetEBans output window says: Starting of Tomcat failed, the server port 8080 is already in use., that is probably because you started tomcat in xampp's control panel, so make sure you stop tomcat in xampp then try again starting it in netbeans.
Note that you can stop the Tomcat server in NetBeans by selecting Window -> Services then expand the Servers node, then right click Apache Tomcat and select stop.
9. Final deployment
To deploy the application locally, navigate to myjforumproject/dist and unzip the myjforumproject.war file. Copy the unzipped war file directory 'myjforumproject' and paste it into the directory .../xampp/tomcat/webapps.
Then start up the xampp control panel (C:\JavaFiles\xampp-win32-1.7.7-VC9\xampp\xampp-control-3-beta.exe), and start tomcat.
Then browse to the address:
http://localhost:8080/myjforumproject and hopefully the installation page shows.