User: gropi Date: 01/05/22 10:36:07 Modified: src/docs howtojbuilderdebug.xml Log: Updated integration guide for JBuilder 4 and JBoss 2.2.1 Done by John P. Coffey, thanks. Revision Changes Path 1.3 +291 -169 manual/src/docs/howtojbuilderdebug.xml Index: howtojbuilderdebug.xml =================================================================== RCS file: /cvsroot/jboss/manual/src/docs/howtojbuilderdebug.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- howtojbuilderdebug.xml 2001/03/21 08:30:20 1.2 +++ howtojbuilderdebug.xml 2001/05/22 17:36:07 1.3 @@ -1,171 +1,293 @@ <?xml version = "1.0" encoding = "UTF-8"?> <section> - <title>How to Run JBoss in JBuilder's Debugger</title> - <section> - <title>JBuilder Foundation 3.5</title> - <para>With each of these, replace <![CDATA[<JBOSS-HOME> with the location of your JBoss directory, for example, C:\jboss.]]></para> - <orderedlist> - - <listitem> - <para>Launch JBuilder.</para> - </listitem> - - <listitem> - <para>Go to Project|Properties, click the Paths tab, and make sure you're using JDK 1.3 as your JDK. To have 1.3 available, you - may need to add it or change your default JDK. First install JDK 1.3 (from Sun) on your PC, then point JBuilder to it by - clicking "new" or "edit" in the Select a JDK dialog.</para> - </listitem> - - <listitem> - <para>On the Paths tab, go to the Required Libraries tab, click "add" and then "new" to create a new one, and call it "JBoss Server" - (or something similar). Add the following .jar file: - - <![CDATA[<JBOSS-HOME>\bin\run.jar ]]></para> - </listitem> - - - - <listitem> - <para>Click OK on the Edit library dialog, then OK on the Select one or more libraries dialog, which should add the new library to - your project. The library will now be available to other projects as well.</para> - </listitem> - - - <listitem> - <para>Go to the Run tab of the Project Properties dialog. On the Application tab, set the main class to org.jboss.Main. Note that this - is project-specific and will need to be done for each project running JBoss. </para> - </listitem> - - - <listitem> - <para>On the Run tab, under "VM Parameters", add the following (again, for each project): - - -Duser.dir=<![CDATA[<JBOSS-HOME> ]]></para> - </listitem> - - - <listitem> - <para>Click OK and close JBuilder.</para> - </listitem> - - <listitem> - <para>Create a copy of your JBuilder shortcut (in Win98, it should be in C:\WINDOWS\Start Menu\Programs\JBuilder 3.5). Rename - the copy to something appropriate, such as "JBuilder with JBoss working directory". </para> - </listitem> - - - <listitem> - <para>Edit the shortcut's properties by right-clicking and choosing properties. Change the "Start in" folder to - <![CDATA[<JBOSS-HOME>\bin\. Click OK. ]]></para> - </listitem> - - - <listitem> - <para>To run or debug JBoss within JBuilder, first use the modified shortcut to launch JBuilder, then open your project as normal and - select Run|Run Project or Run|Debug Project. </para> - </listitem> - - - <listitem> - <para>To debug EJBs within this setup, first build and deploy them in <![CDATA[ <JBOSS-HOME>\deploy as you would normally. Then set - breakpoints in your EJB code and debug the project using org.jboss.Main as the main class using the instructions above. ]]></para> - </listitem> - - - </orderedlist> - <para>NOTE: When running JBoss within JBuilder, it will launch an empty console window with "java" as the title. I'm not sure why this is, -but it appears to have some relation to Hypersonic SQL. You will probably need to close this window manually after stopping JBoss.</para> - </section> - <section> - <title>JBuilder 4</title> - <para>Author: Peter Henderson</para> - <orderedlist> - <listitem> - <para>Project Properties. (Project properties/paths) - Set the working directory to the JBoss bin dir. For example: - - C:/jboss_tomcat/jboss-2.0-FINAL/bin</para> - </listitem> - <listitem> - <para>Set VM parameters. (Project properties/run) - - -classic -Dtomcat.home=C:\jboss_tomcat\tomcat-3.2-b7 -Duser.dir=C:\jboss_tomcat\jboss-2.0-FINAL/bin </para> - </listitem> - <listitem> - <para>Set Main class - Set main class to org.jboss.Main </para> - </listitem> - <listitem> - <para>Create a JBoss Server Library. (Project properties/required libs) </para> - <para>Add: </para> - <programlisting> /jboss_tomcat/jboss-2.0-FINAL/bin/run.jar - /jboss_tomcat/jboss-2.0-FINAL/bin - /jboss_tomcat/jboss-2.0-FINAL/conf - /jboss_tomcat/jboss-2.0-FINAL/lib/jaas.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/jboss-jaas.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/jdbc2_0-stdext.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/jmxri.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/xml.jar - /jboss_tomcat/tomcat-3.2-b7/lib/servlet.jar - /jboss_tomcat/tomcat-3.2-b7/lib/jaxp.jar - /jboss_tomcat/tomcat-3.2-b7/lib/webserver.jar - /jboss_tomcat/tomcat-3.2-b7/lib/parser.jar - /jboss_tomcat/tomcat-3.2-b7/lib/jasper.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/activation.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/awt.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/dynaserver.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/ejb.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/ejxeditor.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/ejxejb.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/ejxjaws.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/ejxjboss.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/hsql.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/idb.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/jboss.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/jetty-service.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/jms.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/jmxtools.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/jndi.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/jnpserver.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/jpl-util-0_5b.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/jta-spec1_0_1.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/mail.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/spydermq.jar - /jboss_tomcat/jboss-2.0-FINAL/lib/ext/tomcat-service.jar - /jboss_tomcat/jboss-2.0-FINAL/db - /jboss_tomcat/jboss-2.0-FINAL/log - /jboss_tomcat/jboss-2.0-FINAL/conf/tomcat - - </programlisting> - - - <para> Also the source dir for jboss sources should be set to: - - /jboss_tomcat/jboss-2.0-FINAL/src - - </para> - </listitem> - - - <listitem> - <para>Add JBoss Server Library to your project. </para> - </listitem> - - - <listitem> - <para>Rebuild all. </para> - </listitem> - - - <listitem> - <para>Deploy your application. - Copy your jar to the jboss/deploy dir </para> - </listitem> - - </orderedlist> - <para>If all is well, you should be able to set break points etc and single step your code. </para> - <para>Notes - -Do NOT include the Sun J2EE SDK jars in your project. </para> - </section> -</section> \ No newline at end of file +<title>Integrating JBuilder 4.0 Foundation with JBoss +for source level debugging</title> + <para>Author:<author> + <firstname>John</firstname> + <surname>Coffey</surname> + </author> + </para> +<section> +<title>Install the JBoss Server</title> + +<para> +For the purpose of this howto, I installed the JBossTomcat release version +2.2.1 into d:\JBoss-2.2.1_Tomcat-3.2.1. Download it from +http://www.jboss.org and select the binary link from the page. Don't worry +about downloading a binary package, when all you want is the source code; +the binary package also contains the source code used for building. +</para> +</section> +<section> +<title>Create a JBuilder 4.0 Project</title> + +<para>While setting up an EJB project the typical entry level screen +Project/Properties should look like: +</para> +<mediaobject><imageobject> +<imagedata fileref = "images/jbuilder-prop-path.png"/> +</imageobject></mediaobject> + +</section> +<section> +<title>Create a JBoss-Server library</title> + +<para> +This is the most difficult aspect of the setup to get correct, however once +completed it does not need to be changed so you can setup multiple ejb +projects and reuse this library thanks to the folks at Borland. +</para> +<para> +To do this launch the Project/ProjectProperties/RequiredLibraries/Add... +dialog +</para> +<para> +Add the following library entries to the JBoss-Server classpath (the order +is crucual here). Pay specific attention to the log and tmp folders, +faulure to put these in the Library class path will cause the classloader to +spit out error messages, the most confusing of which is that /log.properties +or /tmp.properties files could not be located. This is because the folders +containing these files need to be in the classpath and the class loader +complains. +</para> +<para> +<programlisting> +/$JBOSS_TOMCAT_HOME/jboss/lib/crimson.jar +/$JBOSS_TOMCAT_HOME/jboss/bin/run.jar +/$JBOSS_TOMCAT_HOME/jboss/bin +/$JBOSS_TOMCAT_HOME/jboss/conf +/$JBOSS_TOMCAT_HOME/jboss/lib/jaas.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/jboss-jaas.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/jdbc2_0-stdext.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/jmxri.jar +/$JBOSS_TOMCAT_HOME/tomcat/lib/parser.jar +/$JBOSS_TOMCAT_HOME/tomcat/lib/servlet.jar +/$JBOSS_TOMCAT_HOME/tomcat/lib/jaxp.jar +/$JBOSS_TOMCAT_HOME/tomcat/lib/webserver.jar +/$JBOSS_TOMCAT_HOME/tomcat/lib/jasper.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/activation.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/awt.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/dynaserver.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/ejb.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/ejxeditor.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/ejxejb.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/ejxjaws.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/ejxjboss.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/hsql.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/idb.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jboss.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jetty-service.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jms.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jmxtools.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jndi.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jnpserver.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jpl-util-0_5b.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jta-spec1_0_1.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/mail.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/tomcat-service.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jbossmq.jar +/$JBOSS_TOMCAT_HOME/jboss/db +/$JBOSS_TOMCAT_HOME/jboss/conf/default +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/log4j.jar +/$JBOSS_TOMCAT_HOME/jboss/log +/$JBOSS_TOMCAT_HOME/jboss/tmp +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jbosssx.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jbosscx-0.2.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/connector.jar +/$JBOSS_TOMCAT_HOME/jboss/lib/ext/minerva-1_0b3.jar +</programlisting> +</para> +<para> +In the source tab for the JBoss-Server library point to +/$JBOSS_TOMCAT_HOME/jboss/src. This is how JBuilder resolves where to find +the source for stepping through the code. Without this step typically you +will be able to step through the code but the Main.java will appear as +Main.class. +</para> +<para> +As per the diagram figure below, set the main class entry point to +'org.jboss.Main'. This is where the JBoss server code starts up. Make sure +that you set the working directory is set to $JBOSS_TOMCAT_HOME/jboss/bin in +the paths tab. +</para> +<mediaobject><imageobject> +<imagedata fileref = "images/jbuilder-prop-run.png"/> +</imageobject></mediaobject> +<para> +Cut and paste the following line and place it into the 'vm parameters' entry +field (Project/Properties/Run) +</para> +<para><programlisting> +-classic -Dtomcat.home=D:\$JBOSS_TOMCAT_HOME\tomcat -Duser.dir=D:\$JBOSS_TOMCAT_HOME\jboss\bin +-Djavax.xml.parsers.SAXParserFactory=org.apache.crimson.jaxp.SAXParserFactoryImpl +-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.crimson.jaxp.DocumentBuilderFactoryImpl +</programlisting></para> +<para> +The starup argument should be left blank with the above setting. If you +want to run with the integrated tomcat you can put tomcat as the argument, +however beware that you MAY need to replace the +/$JBOSS_TOMCAT_HOME/jboss/conf/default with +/$JBOSS_TOMCAT_HOME/jboss/conf/tomcat +</para> + +<para> +If the above steps have been done correctly, open up JBoss-Server.library, +this is located in the folder you specified when creating the library. +Typically this is C:\Documents and Settings\<![CDATA[<nt_username>]]>\.jbuilder4 or home +directory on Linux. Do NOT edit this file, I found several problems +manually editing this file and I am unsure why but I got several instances +of resource not found exceptions afterwards. If in doubt don't touch it! +</para> +<para> +<programlisting><![CDATA[ +<?xml version="1.0" encoding="UTF-8"?> +<library> + <!--JBuilder Library Definition File--> + <fullname>JBoss-Server</fullname> + <class> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/crimson.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/bin/run.jar]</path> + <path>/$JBOSS_TOMCAT_HOME/jboss/bin</path> + <path>/$JBOSS_TOMCAT_HOME/jboss/conf</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/jaas.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/jboss-jaas.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/jdbc2_0-stdext.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/jmxri.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/tomcat/lib/parser.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/tomcat/lib/servlet.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/tomcat/lib/jaxp.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/tomcat/lib/webserver.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/tomcat/lib/jasper.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/activation.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/awt.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/dynaserver.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/ejb.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/ejxeditor.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/ejxejb.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/ejxjaws.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/ejxjboss.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/hsql.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/idb.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jboss.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jetty-service.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jms.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jmxtools.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jndi.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jnpserver.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jpl-util-0_5b.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jta-spec1_0_1.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/mail.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/tomcat-service.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jbossmq.jar]</path> + <path>/$JBOSS_TOMCAT_HOME/jboss/db</path> + <path>/$JBOSS_TOMCAT_HOME/jboss/conf/default</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/log4j.jar]</path> + <path>/$JBOSS_TOMCAT_HOME/jboss/log</path> + <path>/$JBOSS_TOMCAT_HOME/jboss/tmp</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jbosssx.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/jbosscx-0.2.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/connector.jar]</path> + <path>[/$JBOSS_TOMCAT_HOME/jboss/lib/ext/minerva-1_0b3.jar]</path> + </class> + <source> + <path>/$JBOSS_TOMCAT_HOME/jboss/src</path> + </source> +</library> +]]></programlisting></para> +<para> +A note about the initial file directory specifier. I have seen this a +couple of ways, if you have multiple hard drives with the home on C and the +JBoss on D for example you will see 'D%|/' in place of / or alternatively +you may see a relative directory such as ../../JBoss-2.2.1.... +</para> +</section> +<section> +<title>Bypass the hanging InstantDB embedded database</title> +<para> +I found that loading instant DB within its minnerva pool manager +occasionally causes the debugger to hang (on different setups), to work +around this, I made the following modifications to config/tomcat and also +config/default (it depends on the model you wish to start up JBoss in) +</para> +<para><programlisting><![CDATA[ +<!-- JDBC @JC org.enhydra.instantdb.jdbc.idbDriver removed from list of drivers --> +<mbean code="org.jboss.jdbc.JdbcProvider" +name="DefaultDomain:service=JdbcProvider"> + <!-- <attribute name="Drivers">org.hsql.jdbcDriver, + org.enhydra.instantdb.jdbc.idbDriver</attribute> HANGS DRIVER --> + <attribute name="Drivers">org.hsql.jdbcDriver</attribute> +</mbean> +]]></programlisting></para> +<para> +and comment out the minnerva pool definitions associated with InstantDB +</para> +<para><programlisting><![CDATA[ +<!-- + <mbean code="org.jboss.jdbc.XADataSourceLoader" + name="DefaultDomain:service=XADataSource,name=InstantDB"> + <attribute name="PoolName">InstantDB</attribute> + <attribute name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute> + <attribute name="Properties"></attribute> + <attribute name="URL">jdbc:idb:../conf/default/instantdb.properties</attribute> + <attribute name="GCMinIdleTime">1200000</attribute> + <attribute name="JDBCUser" /> + <attribute name="MaxSize">10</attribute> + <attribute name="Password" /> + <attribute name="GCEnabled">false</attribute> + <attribute name="InvalidateOnError">false</attribute> + <attribute name="TimestampUsed">false</attribute> + <attribute name="Blocking">true</attribute> + <attribute name="GCInterval">120000</attribute> + <attribute name="IdleTimeout">1800000</attribute> + <attribute name="IdleTimeoutEnabled">false</attribute> + <attribute name="LoggingEnabled">false</attribute> + <attribute name="MaxIdleTimeoutPercent">1.0</attribute> + <attribute name="MinSize">0</attribute> + </mbean> +--> +]]></programlisting></para> +</section> +<section> +<title>Sprinkle breakpoints throughout your EJB and or Client Code</title> +<para> +Firstly it is necessary to put breakpoints in your ejb's. As outlined +previously project settings should point to the source of your beans. Open +up a typical bean implementation and place breakpoints whereever desired. +</para> +</section> +<section> +<title>Start the JBoss server</title> +<para> +Using the IDE, select run / start debugger (shift + f9). If you want to see +your beans being instantiated by the deployer, place breakpoints on the bean +constructors (if you specified them) You will not need to have a client +running to exercise this functionality. +</para> +</section> +<section> +<title>Deploy the Beans</title> +<para> +copy of drag/drop (for windoze fans) the ejb jar file containing the +ejb-jar.xml and jboss.xml (optional) to the deploy folder. If you have set +breakpoints in stateless session ejb's these should cause the debugger to +stop in your code! Hurrah! +</para> +</section> +<section> +<title>Start a client test application as a separate JBuilder application instance</title> +<para> +If you include a client test code in your project you can debug this also +(even though the project's main execution class is specified as +'org.jboss.Main'. To do this, launch a 2nd instance of JBuilder in another +window, then select the client class containing the Main() entry with the +right mouse button and select the debug popup context menu option. (nice one +again JBuilder). You should be aware though that this will be running from +the JBOSS_TOMCAST_HOME/jboss/bin directory as that is where we set the +project to execute from. If all goes well you should have your other +JBuilder instance stop in the breakpoints you set. +</para> +<para> +If anyone spots some ommissions in this how-to please let me know. +</para> +</section> +</section> _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
