HTTPService get with parameters

I was trying to put together a simple HTTPService Get service and most of the tutorials online did not work for me, as most of them are get calls without parameters and I needed to pass 2 to 3 arguments with my get call. Below is sample code for my get call.

[cc lang=”actionscript3″]

private function getListings():void
{
var params:Object = new Object;
params[“Input”] = txtInput.text;
params[“Index”] = new String(cmbSample.selectedIndex);
GetMyListing.send(params);
}
[/cc]
How does this work
When the HTTPService executes it will convert the above call to

http://localhost/rs/client/listing?Input=sometxt&Index=sometxt

This way am not having to do a post call just to send two parameters.

The ResourceConfig instance does not contain any root resource classes

I have finished building a web service several times start up tomcat and get the above error even though my classes have @path annotations and my web.xml is properly setup for web services.

Here is a solution I found out, make sure to do a manual project build from Eclipse when you are done working on it. For some unknown reason even though the project is on auto build, the resource configurator did not pick up my new restful project until I did a manual build. The manual build is only required the first time you need to add the restful service to your resources, the servlet entry below is all you need to add to your web.xml to enable restful services to be configured by resource locator.

[cc lang=”xml”]
rest

com.sun.jersey.server.impl.container.servlet.ServletAdaptor

1


rest
/rs/*
[/cc]

My First 10k run

Today I ran my first ever official 10k and it was something else, I have run the same distance several times myself while just jogging but it was different while doing it for competition, and the course was not forgiving at all which I had heard from a few people who had participated at the us10k classic before. I was happy with my results though coming in at 500 0f  2998 timed racers, I was able to set a personal best time of 50 min my earlier record was 1h2min for the same distance and my race number is here just so I can always remember. After the race I got to learn that the lady who was first in women had parked her car at the finish line jogged to the start line started with everyone and finished fourth overall in a time of 35min, it felt impossible for me to comprehend this especially since I felt as if my body was about to fall apart and I had only ran half the distance she ran this morning.

Next am looking forward to my first half marathon.

p7zip Command Line

In CentOS to use p7zip  from command line the cmd is 7za and not p7zip or 7z, I wasted some time on this as most manuals online tell you to use p7zip [options] filename.

To extract a file you would do:

7za x filename.7z

You can substitute the .7z extension with whatever archive extension you are trying to xtract e.g tar,gz,zip etc as long as its an extension that can be handled by 7zip which should be most of the common formats.

Going Raw

After reading several articles on this topic I decided to try it, so I went to the local grocery store and bought some sprouts, started up my blender to make my smoothie as usual but this time I added raw sprouts into the mix. To tell you the truth the first few days do take some getting used to. The raw sprouts have a distinct flavor and smell which can take some adjusting to. Right now am on my second week and I can drink it without a problem. I have come to love sandwiches from mellow mushroom as they add sprouts to their veggie sandwiches.

Black screen FreeNX/NX

I have been running my FreeNX for several years with no problem then all of a sudden I tried to log in today and I received a black screen. After several searches I found out that it’s a problem with the window manager temporary files being corrupt. Just to test I changed the settings on my nx client to use another window manager “KDE” in the system and it worked. To resolve the issue I SSHed into the box and deleted all gconfd, orbit and mapping tmp folders/files for the affected user. Tried to reconnect again and it worked.

Great Linux CMDs

In this post I will be making a list of great Linux cmd’s that I find all over the net one great place to stop by is commandlinefu.com they have a great deal of important linux cmd’s.

First cmd is mtr, it combines your ping and netstat cmd’s. In CentOS you have to su- to run this cmd:

mtr google.com

The following cmd I just started using recently and it has been a life saver I don’t know how I went all that time without it. The cmd is screen it works like your VNC or NX but for the terminal, it is especially handy if you SSH into your box but you don’t want to leave the terminal running waiting for a task to finish, you just start a screen run your cmd and detach from the screen. Now even if your connection gets disconnected or you disconnect yourself all you have to do when you connect again is run “screen -dR” and you are connected back to your earlier session and you can check on the progress of your task. To list screen instances “screen -ls”.

screen

Ctrl+a   ->pressing this twice moves to the next screen

Ctrl+a+c  ->adds a new screen to you screen instance

Ctrl+a+d ->detach from screen session

Ctrl+d  ->exit a screen

screen -dR   ->connect to/start a screen session

Mount a drive world writeable

mount -t ntfs-3g -o umask=000 /dev/drive /mnt/mountpoint

mount -t cifs -o umask=000,username=username,password=password //ipaddress/folder /mnt/mountpoint

by adding the option umask=000 any user can write to the mounted folder, this comes in handy when you want to write to a mounted drive as a regular user.  I have had a problem with some slack based distro’s not accepting this option in the current format and might need to play around with the mask cmd placement to see what works.

Update vs Clean Install

I just upgraded to CentOS 5.5 and while talking to a friend of mine we got into talking about updating vs clean install. After my update I had to restore to an image before the update as my mail system was not working, checked all packages contained in the update and zeroed the cause to a sendmail update. Which was disabling my current MTA “postfix”. I fixed that and another issue with my open office and I was ready to go. While my friend prefers to just do a clean install.

To me it just comes down to preference, if you have a heavily customized system it’s time saving to just do an upgrade, but if you are running a generic system with few modifications a clean install might be the best way for you.