Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Deploying iTrust v11 (Spring 2011) at Home on Mac OSX By, Team 5 Downloads: Eclipse IDE for Java EE Developers (Mac OS X Cocoa) - either 32bit or 64bit http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/heliossr2 JDK is not needed for Mac OS X because Apple uses a company specific version of the Java JDK that should be preinstalled in your system. Apache Tomcat 5.5.x (http://tomcat.apache.org/download-55.cgi) - Download the core zip. Also download the MySQL JDBC Driver and place the .jar file into the following directory: <your tomcat folder>/common/lib/ MySQL 5.5.x for Mac OS X - easiest to download the DMG ex:(mysql-5.5.11-osx10.5x86_64.dmg) http://dev.mysql.com/downloads/mysql/ In this installer, we will talk about downloading the MySQLWorkbench, a GUI tool to help manage your database. You can download it here: http://dev.mysql.com/downloads/workbench/. However, there is a better Mac only tool on the to manage your MySQL database called Sequel Pro. You can download it for free from http://www.sequelpro.com/. NOTE: we will ONLY be discussing how to set up the MySQLWorkbench. iTrust Source Download the zip to desired location. Do not extract. Apache Tomcat: Once you unzip Tomcat into a directory on your machine (don't forget the MySQL driver!), you will need to set up the Web Tools environment to deploy projects. To do this, complete the following steps in Rational Team Concert or Eclipse: ● Go to Window > Show View > Other… Select Server > Servers… In the Servers view, right click and select “New > Server” Select Apache > Tomcat 5.5. Hit next. Select the folder where you previously unzipped Tomcat (your version number might not match the screenshot - that's okay as long as it's 5.5). Before hitting the finish button, click on the server runtime environment add link. In the Installation directory, select the folder which you extracted your tomcat server. Then hit finish, the hit finish again. Starting the Server: In the servers view, you should see your new runtime below. Click on the “Play” button to start the server. If you see the text Server startup in xxxxx ms in the Console view, and the Servers view shows that your status is “Synchronized”, then your server is properly configured. If the Console view isn't open, go to Window > Show View… > Console MySQL: Double click on the DMG file to mount the volume. Then open the .pkg file that is named after the .dmg file. Then run through the install windows. Once the installer has finished, exit out and install the MySQLStartupitem.pkg. Which is also found in the DMG mount. This installer will automatically start MySQL once your computer is turned on. If you do not want this feature, please do not install it! • To set up your MySQL database server please follow the steps here http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html • Or check here for Leopard (If you are comfortable with the command line) http://hivelogic.com/articles/installing-mysql-on-mac-os-x/ • Or here for Snow Leopard (If you are comfortable with the command line) http://hivelogic.com/articles/compiling-mysql-on-snow-leopard/ Download the MySQL workbench from http://dev.mysql.com/downloads/workbench/ for Mac OSX, be sure to download the .dmg file. Once downloaded, mount the image and a window should automatically pop up instructing you to drag the MySQLWorkBench Icon to your Application folder. Doing so will install the new app on your Mac. Then open up the application from the applications folder or search via spotlight in the top right hand corner. Once workbench is running, click on new connection. Which will give you a setup new connection window. In connection name, give specific name. Then for Connection method select, Standard (TCP/IP). Hostname: 127.0.0.1 Port: 3306 Username: root set the password to nothing unless you had set up your sql root password previously to have a password. Then click Test Connection to make sure all parameters are correct and that the workbench can connect to your database. Troubleshooting MySQL Installation: If you are having problems with your MySQL installation. Try downloading a fresh copy from the MySQL site and reinstalling. Configuring Project: The source files will need to be imported as an Eclipse project, and deployed as a Tomcat application. To do this, follow these steps: • Download the source (see link at the top) and save it to a location you can remember. • From within Eclipse, switch to the Java perspective. (use Window > Open Perspective…, or use the icons in the upper-right corner) • To import the project files, go to File → Import … and select Existing Projects Into Workspace. Click Next. • Check the radio button Select Archive File and select Browse. • Select the archive of your source code. • Make sure that iTrust is checked in the projects selector and click Finish. The files are now in your workspace. The Package Explorer should look like this: • Now you need to deploy the project to your Tomcat server. In the Servers view, right-click on your Tomcat installation and select Add and Remove Projects… • iTrust should show up on the list, move it over to the “Configured Projects” pane, hit Finish • If you click on the plus sign in your server configuration, you should see “iTrust” deployed (published) there. • Now that iTrust is set up to be deployed on Tomcat, you need to set the database parameters. In the Package Explorer, Open up iTrust > WebRoot > META-INF > context.xml • If the file is opened in “Design” mode, switch to the “Source” mode at the bottom of the editor. • Follow the comments in the context.xml file to properly set up your database parameters. If you have a username, password, and URL for a database provided by the instructor or TA, or if you have a local database, please use those parameters. • For example, if you are using a local database, your parameters might look like the following: • username=“root” password=“” url=“jdbc:mysql://localhost/iTrust” • To test your parameters, go to iTrust > unittests> edu.ncsu.csc.itrust. Right-click on DBBuilder.java, select Run as… > Java Application • (to view your packages easier, click on the triangle in the package explorer view, Package Presentation > “Hierarchical”) • The console view should show many lines beginning with Executing: , then end with Operation Completed • To populate your database with test data, go to unittests, and in the datagenerators package, run the TestDataGenerator.java program. You should also get a lot of Executing: , followed by an Operation Completed. Running the Application: Start the Tomcat Server in the Servers view as before. Open your internet browser and surf to http://localhost:8080/iTrust/. You should be able to log in and use the application as normal. Miscellaneous Tips: If you already have a flavor of Eclipse installed that isn’t the Java EE version. You can install it through your current Eclipse install. To do this go to Help > Install New Software… Then in your dropdown menu that says Work With: Select the option that says http://download.eclipse.org/releases/xxxxx - xxxxx being your eclipse version such as helios or galileo. Once you add the site. It will list all the available packages in the scroll window below. Check the box that says Web, XML and Java EE Development. This will install all the neccessary files to have the Java EE view in your eclipse. Click on next to finish installing files. And then click finish once all the files have finished installing. Localhost not found: If while running iTrust you get a localhost not found error. Check to see if your server is first added under servers in Eclipse. Then check to see if it is running and synchronized. If it still fails, right click on your Tomcat server and select Clean Tomcat Work Directory...Then try to also clean your SVN team repository by right clicking on your project and going to Team > Cleanup. Then go to Project menu option and selecting Clean and check the box next to iTrust. Once eclipse finishes cleaning. Manually restart your server and make sure it says Started and synchronized.