The following step by step directions may help you to get the sample applications provided with the distributions up and running and to get started with Empire-db.
- Run the Empire-db sample application DBSample
- Run the Empire-Struts2-Extensions sample application DBWebSample
Run the Empire-db sample application DBSample from Eclipse
The following steps describe how to run and debug the Empire-db sample application provided with the Emprie-db distribution package:
- Download and unzip the Empire-db distribution package.
- In Eclipse choose File / Import and select Existing projects into workspace. When prompted for a root directory select the folder ".../empire-db-2.0.0/examples/DBSample".
- Open the file DBSampleApp.java and set a breakpoint on the first line of the main method.
- From the Run menu select Debug as / Java Application. When prompted for a Java application class select SampleApp – de.esteam.sample.db.
The sample should now run and stop at the breakpoint in the main method. You may then step through the code and play around with it. For further information please read the tutorial.
In order to manually configure the project the following jar files need to be added to your classpath:
Run the Empire-Struts2-Extensions sample application DBWebSample from Eclipse
The following steps describe how to run the Empire-Struts2-Extensions sample application from Eclipse using Apache Tomcat 5.5 application server. Apache Tomcat 5.5. should be already installed on your system – otherwise it may be downloaded here.
- Download and unzip the Empire-Struts2-Extensions distribution package.
- In Eclipse choose File / Import and select Existing projects into workspace. When prompted for a root directory select the folder ".../empire-struts2-ext-1.x.x\examples\DBWebSample".
- If you are reported an error that the type
javax.servlet.http.HttpSessioncannot be resolved please do one of the following:
- In the Eclipse preferences panel, select Server / Installed Runtimes and add Apache Tomcat to the list of runtimes. Then open the project properties panel and check whether Apache Tomcat is listed on the Library tab. If not, choose Add Library / Server Runtime and select Apache Tomcat. Finally rebuild the project.
- Alternatively you may add the required JARs directly. Choose Add External JARs and add the file servlet-api.jar from the Tomcat-5.5.x/common/lib folder.
- In order to run the sample you can do either of the following (depending on your environment):
- From the Run menu select Debug as / Debug on Server. When prompted for a server choose Apache Tomcat application class select Apache Tomcat v5.5. Server at localhost.
- If you prefer to use the Sysdeo Eclipse Tomcat Launcher plugin right click on the DBWebSample project. From the context menu select Tomcat project / Add context in Tomcat. Please make sure, that the plugin’s DevLoader class has been copied to TOMCAT_HOME/server/classes (see also readmeDevLoader.html in /plugins/com.sysdeo.eclipse.tomcat_3.2.x). Now click on the Tomcat symbol in the toolbar in order to run tomcat.
- Open your browser and enter
http://localhost:8080/DBWebSamplein the URL field. The Empire Struts2 sample application should now prompt you with its login screen.
Note: When running the sample you will be prompted for a username and password. This is just a fake login screen. Any non empty username will be accepted. The password field may even be left empty. On the search form leave all fields empty and simple press the search button in order to get all results.
Further we recommend to set breakpoints at the following locations:
- on the
- on the
- on the