1 / 46

Coeus & Interactive Debugging

Coeus & Interactive Debugging. David B. Harrison Brown University. Crash Course. “The problem with most crash courses is that they crash.” - Berel Wein. Presenter. David B. Harrison Sr. Programmer / Analyst Brown University 9 months experience with Coeus

stan
Download Presentation

Coeus & Interactive Debugging

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Coeus & Interactive Debugging David B. Harrison Brown University

  2. Crash Course “The problem with most crash courses is that they crash.” - BerelWein

  3. Presenter David B. Harrison Sr. Programmer / Analyst Brown University • 9 months experience with Coeus • BS and MS in Computer Science • 20 years of Software Engineering

  4. Crash Course in Interactively Debugging Coeus • Why? • Background • Requirements • Setting up • Real-world examples

  5. Why would you want to do that? • Understanding the architecture • Greater speed in solving problems • Quickly test changes, fixes, or enhancements! • Assist in making Institution-specific changes

  6. Brown & Coeus Background • Originally, Brown had a homemade system • Coeus @ Brown since version 4.0 • Ben DiMolfetta assisted in original implementation • Main Coeus developer/support for Brown left 11 months ago • David Harrison joined Brown 9 months ago. • Started learning Coeus at that time.

  7. Inspiration • Frustrated with lack of documentation • Needed to understand the architecture • Builds were preformed on remote servers. It took at least 15-20 minutes, just to see if a change compiled. This is a distraction. • Using the right tools and local builds, should make the process much faster… • Goal: Stay in the “Zone”

  8. Recent Experience • Brown University recently completed major upgrade from Coeus 4.3.7 to 4.4.3 • Migrated 4.3.x customizations to 4.4.x • Stored procedures • Blort-loads of XML / XSL templates • The FOP Engine upgrade affected rendering of custom reports • Customized Email notifications

  9. Approach Preferred • “See One” • “Do One” • “Teach One” Actual • Jump in • Repeat • Drink coffee • Learn some • Do Some“Do or do not. There is no Try.” (Jedi Master Yoda) • Deploy • Huge sigh of relief! • “Teach One!”

  10. Getting to know you • What is your primary role? • Most people said “Developer” or “Support” • Do you use revision control for Coeus? • Approximately 3 out of 12 attendees use a revision control system. • Do you use a change management or deployment system? • None.

  11. Other Questions • Planning to move to Coeus 4.4.4 or KC soon? • Formal process in place for Upgrades & QA?

  12. Required Software • Java • Ant • Apache Tomcat • Eclipse • Helios edition recommended • A Database! • Oracle is recommended • SQL / Schema explorer tool

  13. Setting up! • Environment • Tomcat • Eclipse

  14. Pre-conditions • Install the required software! • Retrieve Coeus source • Setup Tomcat • Setup & test database connection • Update the Coeusbuild.properties file • We’re not going to cover this part. • Ant build • Build from the command-line, first!

  15. Environment Variables JAVA_OPTS = -verbose:class CoeusLite / Server Debugging JPDA_ADDRESS = 11555 JPDA_TRANSPORT = dt_socket Coeus Premium debugging JAVAWS_TRACE_NATIVE = 1 JAVAWS_VM_ARGS = -Xdebug -Xnoagent-Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8989,server=y,suspend=n

  16. Apache Tomcat Setup • Define the data source • Configure Tomcat Java options • Copy libraries into Tomcat’s common lib folder

  17. Apache Tomcat – Data Source In the Tomcat conf directory • Add a Data Source Resource to the Context.xml file, • There are other areas where you could define the data source. <Resource name="jdbc/coeus" type="javax.sql.DataSource“ driverClassName="oracle.jdbc.driver.OracleDriver“ maxIdle="2" maxWait="5000" validationQuery="select sysdate from dual" maxActive="4" url="jdbc:oracle:oci:@DBServer.YourInsititution.edu:YourPort:YourOracleSID" username=“SchemaName" password=“PrettySecret"

  18. Tomcat Java Options • Load the Apache Tomcat “Configure Tomcat” program. • Go to the Java tab • Add the “Java Options” -Xdebug-Xrunjdwp:transport=dt_socket,address=11555,server=y,suspend=n-verbose:class

  19. Tomcat Libraries • Libraries copied into Tomcat’s common lib Tomcat-5.5\common\lib • ojdbc14.jar (If you’re using Oracle) • log4j-1.2.16.jar • coeusmail.jar

  20. Eclipse Setup • Now for some fun stuff! • You do have Eclipse, right?

  21. Setting up the Eclipse Project • Import the Coeus project into Eclipse. We’ll use the Ant build script. • Import the Coeus as a new Java Project • File -> New -> Project

  22. Setting up the Eclipse Project • New Project -> • Pick “Java Project from Existing Ant Buildfile”

  23. Setting up the Eclipse Project • Browse to find and select the Ant build file build.xml

  24. Setting up the Eclipse Project • It worked! Now there is a project called “Coeus4”

  25. Select the project Right click & Select Properties

  26. Setting up the Eclipse Project • Properties for Coeus4 • Java Build Path • Libraries • Add two external jars. (in the java JDK) • Jce.jar • Jsse.jar • Ok!

  27. Setting up the Eclipse Project • Hopefully… you’ve got a Coeus4 project, with no build errors. • What does that mean? • How can I tell if there are no errors?

  28. Like sources of build errors • If you get compile errors about classes not being found…Import the source into the project…

  29. Eclipse Debug Configurations • We’ll setup to Debug Configurations • CoeusLite (AKA “Server”) • Coeus Premium

  30. CoeusLite (Server) Debug Config • Run -> Debug Configurations

  31. Coeus4 Server Debug Config • Find “Remote Java Application” • Click on the “New” button to create a configuration

  32. Coeus4 Server Debug Config • Name: Coeus4-Server • Connection Props • Host: localhost • Port to 11555

  33. Coeus4 Server Debug Config • On the Source Tab… • Make sure that the source is selected

  34. Coeus Premium Debug Config • Similar to Lite/server • Just use port 8989

  35. Coeus.jnlp modification • For debugging only, comment out the J2SE line, in Coeus.jnlp, • Left in, it prevents the environment variables from being passed to the JVM. We need those! <resources> <!-- <j2se version="1.5* 1.4.2*" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="100M" max-heap-size="200M"/> -->

  36. Starting the Environment • Start CoeusLite • Run Tomcat, with the Coeus WAR deployed • The Default Coeus WAR is fine • Start the Coeus Premium • Use ‘javaws’ to point at the local JNLP file. This will start it, and it will have the debugger enabled, listening on port 8989 • Javawshttp://localhost:8080/coeus/coeus.jnlp

  37. Starting the Environment (2) • Eclipse • Start Eclipse • Attach debugger for Coeus Premium • Attach debugger for CoeusLite

  38. Debugging Techniques • Break points and Tracing • “Andy, could you duplicate the issue you reported on my development system?” • “Sure…” • “Aha!!!” • Stepping through code and looking at the call-stack • Change a variable, during run time!

  39. Debugging Techniques (2) • Make a change to the source code and see how it affects the functionality, immediately. • XML and XSL • Capture XML and XSL • Fix and Tweak XSL templates outside of Coeus • Logs • Use the log to help find the right Class and line of code to investigate • Add more logging information to Coeus

  40. Real World Examples • Searching for a schedule, based on ‘*’ wild-card only fails with error message. • CoeusSearch.xml

  41. Real World Examples (2) • “Email Link not working” • BIT00175 • Link to Coeus not working in Email body in 4.4.3

  42. What’s next? • Coeus 4.4.4 • Coeus 4.5 • KualiCoeus

  43. Thanks! • Brown University • Elaine Saklad • David Boylan • Chris Moore • Jennifer Quinn • Emily Derby • Andy Krajewski • WinMill Software • Ben DiMolfetta (Introduction & collaboration) • Rob Yetter • Sabarinath Nair • The whole Coeus Consortium

  44. Links for Required Software • Coeus • Java JDK • Eclipse IDE for Java EE Developers • Apache Tomcat • Ant

  45. Optional Software • Toad Extension for Eclipse • Quest Toad • AltovaXML Spy

More Related