This is the tutorial on how to set up a development environment for 3 tier web application development. This post is just a collection of step by step instructions until now.
Nevertheless, I hope you can draw something useful from these step by step instructions until then.
- Installed JDK (1.7.x)
- Windows 7
- You’ve read the previous post about Angular JS Web Development
- MongoDB 2.6.x
- EclipseLink 2.5
- Go to http://www.mongodb.org/downloads -> Download Windows 64bit (32bit)msi installer
- Run the installer -> Next -> check License Agreement -> Next -> Custom -> Choose your favorite install location -> Next -> Install -> Finish
- Go to your installation directory and create the folder structure “/data/db”.
- Go to your installation directory and create a folder named “log”.
- In the installation directory create a file named “mongod.cfg” -> open file -> type the mongod.cfg snippet (see below)
- In the installation directory create a file named “mongoStart.bat” -> open file (e.g. with notepad) -> type “C:\path\to\mongo\bin\mongod.exe –config C:\path\to\mongo\mongod.cfg”
- DB Startup: doubleclick mongoStart.bat
- DB Shutdown: in command prompt type CTRL+C -> J -> Enter
- All log files are created in the log directory and can be read with notepad or a text editor
- (optional) If you are running Windows7 AND you are getting Errorcode 33 while running MongoDB -> Installhttp://support.microsoft.com/kb/2731284
- Install MonjaDB Plugin
- Help -> Eclipse Marketplace -> type “MonjaDB” -> Install -> Confirm -> I accept the terms of the license agreement -> Finish (Installs Monja DB for easier DB development)
- Window -> Perspectives -> Other -> MonjaDB (opens the perspective for Monja DB. One can switch back to the normal perspective by clicking on “JavaEE” in the right top corner of Eclipse)
- To connect to a running MongoDB click on the leftmost icon of the “DB Tree” view -> ConnectionType=Normal / No SSH Configuration / Host=127.0.0.1 / Port=27017 / Database=test -> OK
- Setup MongoDB and EclipseLink
- R-Click project -> Maven -> Add Dependency -> org.eclipse.persistence.jpa / org.eclipse.persistence.nosql / mongo-java-driver / org.apache.tomcat servlet api / javax javaee-api
- R-Click on “src” folder -> New -> Other -> General -> Folder -> Name it “META-INF”
- R-Click on “META-INF” folder -> New -> Other -> File -> Name it “persistence.xml” (This is where you are configuring )
- insert persistence.xml snippet (see below)