Skip to main content

Posts

How to debug SOAP on Mac with tcpdump

I’ve been using several tools to debug SOAP on Mac and Windows. I would like to share my experience in using some of the tools and show some examples. So far I found four major categories of tools that are useful in debugging SOAP: Interface listeners such as tcpdump and others Proxy tools such as TCPMonitor Servlet filters Application server logging. For example, Weblogic has a special logging option that dumps SOAP requests and responses to the sever log. All of these tools have their own advantages and disadvantages. In this article, I will describe the first type - an interface listener tool called tcpdump. I am planning to describe other three categories in the future posts. The tcpdump is a tool that sniffs IP traffic and dumps it to a file or a standard output stream. It was originally developed by Van Jacobson, Craig Leres and Steven McCanne from the Lawrence Berkeley National Laboratory, University of California, Berkeley, CA. It is open source. The tcpdump documentation...

Deploying BlazeDS to Weblogic 10.0

The BlazeDS is a free and open source J2EE application that provides data services to Adobe Flex and AIR applications. I’ve deployed it to Weblogic 10.0 server. I thought somebody else would be interested to do the same. Here is how. In case you need to install Weblogic 10.0, the developers copy is available for free at http://commerce.bea.com/products/weblogicplatform/weblogic_prod_fam.jsp . I have it installed on my Windows XP at D:\bea10 folder. I have created a new domain for my BlazeDS applications. It is easy to do, see http://edocs.bea.com/common/docs100/confgwiz/index.html for details. In my case, the domain name is blazeds and it is located in D:\bea10\user_projects\domains\blazeds folder on my computer. The domain name and the folders names can be difference, I just mentioned them so it is easier to follow the examples.. Once the Weblogic server is installed and a domain is ready, the BlazeDS applications can be deployed. A copy of BlazeDS is available...

MySQL macport install on Mac OS X Tiger

I have installed mysql5 macport on the MacBookPro laptop running OS X Tiger 10.4. There are a few steps that needs to be done once the port is installed. These steps are not documented (see Ticket #12694 on macports.org). So, after reading a few blogs and analyzing mysql startup error messages, I figured out what needs to be done in order to get it running. That info might be useful to others, so I’ve decided to publish the solution here. First of all, we need to create the initial database database $ sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql Here is the output of the command: $ sudo ./mysql_install_db --user=mysql Installing MySQL system tables... 071118 0:06:29 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql5/ is case insensitive OK Filling help tables... 071118 0:06:29 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql5/ is case insensitive OK To start mysqld at boot time you hav...

How To Run Java EE 5 Tutorial Examples On Mac

I spent some time configuring Java environment on Mac. Here are a few tips on how to get it going. The Max OS X comes with Java 5 installed. So, here are main steps: * Download Java EE 5 Tutorial package from http://java.sun.com/javaee/5/docs/tutorial/information/download.html * Download Sun Java System Application Server 9.1 from http://java.sun.com/javaee/downloads/ . I downloaded Java EE 5 SDK Update 3 that comes with the application server. * Use instructions posted here on how to install it http://java.sun.com/javaee/sdk/javaee5sdk_install.jsp Also use Application Server Installation Tips posted here: http://java.sun.com/javaee/5/docs/tutorial/doc/gexaj.html Once the application server is installed, change permissions on the SDK/javadb, so the folder permissions allow creating a database. Here is an example on how to do that: cd SDK sudo chown –R your_name javadb In general, I believe it is a good idea to change permissions to other files in SDK to some less privileged user than r...

Java Unboxing and Null

While playing with boxing/unboxing in Java 5, I found an interesting case. If my collection has a null value, the unboxing fails with a NullPointerException at runtime. Here is an example Set s = new HashSet (); for (int i=0; i < 10; i++) { s.add(i); } s.add(null); System.out.println("s: " + s); // this is a problem. The unboxing does not handle null for (int sx : s) { System.out.println("sx: " + sx); } The output of the progam is here: s: [2, 4, null, 9, 8, 6, 1, 3, 7, 5, 0] sx: 2 sx: 4 Exception in thread "main" java.lang.NullPointerException at com.mykola.TestSets.main(TestSets.java:21) So, unboxing is fine, unless a collection has a null element.

Macrodef makes Ant stronger

I found new macrodef feature in ant extremely useful in my code development. It allows me to reuse lots of code and save time. Here is a quick example on how to use macrodef and why it is cool Let’s say I have several web applications that I need to deploy on the same web server. If I use a regular Ant task, I would have to replicate these lines of code for every application: <wldeploy action="deploy" verbose="${verbose}" debug="${debug}" name="myApp" source="${output.dir}/myApp.war" user="${admin.username}" password="${admin.password}" adminurl="${adminurl}" targets="myWebSiteDomain" /> I know it does not look that bad, but this is just a short sample. In a real world case, I also need to compile the application, generate a WAR file, deploy it, generate a client stub, etc. So, the Ant build.xml tends to grow very fast. In one o...

Some Perforce Tips

Here is a small one line command that I created to find all local files, i.e. the files that still need to be added to the repository: find . -type f -print | xargs p4 filelog -m 1 | grep "not on client" I like to work with svn more. The "svn status" makes the same thing much more easier.