suki2.jpg

10/03/2010

Client webservice timeout on CXF webservice on Jboss

Category CXF JBOSS webservices timeout
What a riveting blog title, but this one is mainly for people to find for a solution via google.

Problem: you have a JBoss server with a webservice CLIENT talking to a webservice somewhere else, and you keep getting timeouts, most likely with the following error

org.apache.cxf.phase.PhaseInterceptorChain doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:226)

If this happens after 60 second (the CXF default timeout), then it is most likely not the target server refusing you, but your client timing out (if your luckily you can get to the target server logs and confirm). Sooo lets extend the client timeout period, personally i like doing this via server configs and indeed that was my first port of call (do a google search for CXF.xml for more details), however even after i figured out what to call the file (cxf.xml, jbossws-cxf.xml, or jboss-cxf.xml) and got it in the right place (inside the WEB-INF of the project for access via POJO's) the darn thing just ignored me, incidentally the following is the "meat" of the file which should change the timeout (in fact the "*.http-conduit" changes the timeouts on all webservice clients on that app.

<http-conf:conduit name="*.http-conduit">
<http-conf:client ConnectionTimeout="120000" />
</http-conf:conduit>

After a prolonged swear, and discovery that i was not the only person who had had this problem on JBoss for CFX clients, I binned that and went into the code, now if your getting this problem then your all ready making a web service client call so you will already have a line like this

Service client = service.yourwebservice();

if you cant find one, and make all you "client stubs" with something like WSDL2Java or via your IDE, do a search for "extends Service", you are now looking for a line like this

public class myfunkyservice_Service extends Service {

when you find it, it will tell you what you should go back and look for ie

funkyservice = new myfunkyservice_Service(URL);
myfunkyservice_Service client = funkyservice.yourwebservice();

well something like that anyway, now bung the following code in after it (changing 'myfunkyservice_Service' to what ever you client service is called, and not forgetting that the timeout is in milliseconds)


Client cl = ClientProxy.getClient(myfunkyservice_Service);
HTTPConduit http = (HTTPConduit) cl.getConduit();

HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(120000);
http.setClient(httpClientPolicy);

oh, don't forget your imports!!

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;

that's the code done, it should all work swimmingly, one exception to this is if you get the error

java.lang.ClassCastException: com.sun.xml.ws.client.sei.SEIStub
at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)

What this bundle of joy means is that sun's library is loading with a higher priority that the CFX lib, if this is on a server its time to get dirty with your config, if this is on your IDE then, go to your projects properties --> Java build path --> Order and export, and bump the CXF lib up (try it at the top)

there you go, now wasn't that fun

Bookmark and Share

05/03/2010

making any ISO

Category UNIX Linux OsX
While building a new win7 VM, I discovered that some of my software was still on DVD/CD only (the horror), I figured that there must be a easy linux way of making an iso image, and diddle me so there is, its called dd The ultimate frenzy guide to how to use this amazing command can be found at How To Do Everything With DD but for me it boiled down to

dd if=/dev/scd0 of=DVDBACKUP.iso

you just need to know where your dvd drive is mounted

$ mount

/dev/sda1 on / type ext3 (rw,noatime,errors=remount-ro)
/dev/sda3 on /home type ext3 (rw,noatime)
/dev/sda1 on /media/SecondHDD type ext3 (rw)
/dev/scd0 on /media/cdrom0 type udf (ro,nosuid,nodev,user=myers)
<-- This One looks Right

Sooo

myers@EX-L1:~$ sudo dd if=/dev/scd0 of=DVDBACKUP.iso

7816384+0 records in
7816384+0 records out
4001988608 bytes (4.0 GB) copied, 312.694 s, 12.8 MB/s

Cooooor, instant .iso or any order disk copy you might like (its built into all good OS's, and by that i mean all with a Unix core { yes yes the turtle neck fruit boys can even be included on this one})

Bookmark and Share

04/03/2010

Fitness Week 1 AGAIN

QuickImage Category Fitness
Back at it again, this time I'm dragging a fellow member of LDC with me, Mr green and i are having a double competition, each with a prize (a slap up meal):

First person to win 250 squash games
Kieran: 0 Games
Mark: 3 Games

First person to loose 2 stone
Kieran ( Initially 15 Stone, 8 pounds) : 15 8"
Mark ( Initially 16 Stone, 8 pounds) : 16' 8"

MAY THE BATTLE BEGIN!!!
Bookmark and Share

28/02/2010

Sticky Footers in domino

QuickImage Category HTML CSS

Any of you who have tried to do sticky footers with domino, may have ground your teeth in frustration as the best CSS only solutions don't seem to work, how ever this one does!!! http://www.cssstickyfooter.com/, well initially it does not, but in the best tradition of RTFM, all you have to do is look at the tiny foot note at the bottom of the instructions which is aimed at .Net developers

"When coding sites for ASP.net where each page is inside a <form> tag, be sure to add the form tag to the height:100% statement, else it will break the sticky footer. Like this;
html, body, form, #wrap {height: 100%;}"

Ohhhhh domino does those as well, and one line of css later, it all works
Bookmark and Share

07/02/2010

Developers guide for commissioning creative types

QuickImage Category Tips creative
Having commissioned quite a lot of art and designs from the creatives of this world i thought i might share some tips.

General rules (you know them already and like to be treated this way, but just to remind you)

1) Dont pester, if they don't reply, wait 24 hours before trying again, remember lack of planning on your side does not mean a crisis on their side, if its a rush job tell them up front so they can price (and plan) accordingly.

2) Agree how many edits you can make at the different stages, before paying the deposit, a single page agreement is fine.

Specific to creatives

1) Let them create, give a rough outline and then some very specific details (the important ones), you will find that they fill in the gaps better than you do, but if they ask for more details give them simply and clearly and for goodness sake never say something like "your the artist isn't that your job", if they are asking questions then they are trying to do a good job, help them help you

2) Portfolio is everything, good creatives will love their job, and will 'create' in the same way geeks 'fiddle', if they don't have a good portfolio don't employ them, it does not have to be client based, but it does have to exist

3) The best time to get hold of a creative, is when they have just finished their education (or if they have none, straight after their first decent paying job), its when they are eager and full of fresh ideas but know how to behave and deal with clients (yes i know that's a nasty way of looking at it but its true)

Money and Rights

For DECENT work, $100 is your ball park for single detailed images ( for example of a realistic looking person ), or $250 for an original design (say for a company site), better artist cost more, poorer artist less, your judgment ($10 for anything artistic is a normally a waste, don't be tempted), its is normal to pay 50% up front, then the final 50% upon sign off of the final images, you will then receive the master images, DO NOT accept compressed image formats as masters you want PNG/PSD/etc files with their layers intact.

Rights are a funny thing, and worth being firm up-front with, you have purchased this art, it is now yours!, an artist should of course be allowed to use their images in their portfolio, and should receive full credit where suitable, but you can change the final image if you want and the rights do not revert to them at any time in the future, always be honest on what the FULL extent of the use of the image or design could be up front (so again they can charge suitably). Rights are the only thing i have found that its no good discussing, if they want unacceptable rights (say a yearly rental of the work with a financial review annually {yes i have met that}), thank them kindly and state that "that is unacceptable for my business model", and move on to the next artist/company

Hope these help
***Update**** As requested, the biggest place to go to get artists/designers at this point in time is http://www.deviantart.com, the best way i find is to put a post in the "work advertised forum" at http://forum.deviantart.com/jobs/offers/, then while you are waiting go and browse the categories you are looking for, most artist state if they are open for commissions, if in doubt just send them a 'note'.
Bookmark and Share

29/01/2010

multiple JBoss instances step by step

Category Multiple JBoss Linux

So you have got JBoss working on your linux box, if you did it manually then it was a long hard fight involving start up scripts and file permission's, but its not enough, you want more, maybe you want to try out clustering, maybe you want a dev and a live instance but only have one box, who knows, who cares, you just want it, so step by step here it is:

"JBoss" = is the both the name of the existing instance and the user its installed under (as per JBoss defaults)
"jbossXXX" =  the name of the new instance and user
"Jboss-4.0.5.GA" = the JBoss install directory


0) I'm assuming you have already added your multiple IP addresses if not go here if you are doing it with only 1 IP address and different ports then go away as i don't like you anymore, also you should be running in text only mode for efficiency, if your running a gui then shame on you, and finally you should be logged on as root or have equivalent rights

1)
useradd jbossXXX
(this will create your user and their home directory)

2) passwd jbossXXX
(then enter the new password at the prompt, if you don't do this the user wont be activated)

2) passwd jbossXXX
(then enter the new password at the prompt, if you don't do this the user wont be activated)

3) mkdir /home/jbossXXX/jboss-4.0.5.GA
(time to make some where for JBoss to live)

4) cp -r /home/jboss/jboss-4.0.5.GA/* /home/jbossXXX/jboss-4.0.5.GA
(clone the current one to a new home)

5) sudo chown -R jbossXXX:root /home/jbossXXX/jboss-4.0.5.GA
(we cloned the file rights as well so lets reset the owner to the user we just created)

6) cp /etc/rc.d/init.d/jboss /etc/rc.d/init.d/jbossXXX
(make a copy of the existing startup script for the new instance of the server)

7) vi /etc/rc.d/init.d/jbossXXX
(edit it so we change make some changes)

8) press "I" to enter interactive mode
(bloody VI does not start in edit mode)

9) find the following lines and amend with the new server location/user

JBOSS_HOME=${JBOSS_HOME:-"/home/jbossXXX/jboss-4.0.5.GA"}
JBOSS_USER=${JBOSS_USER:-"jbossXXX"}


10) put the new notes ip address in this line

JBOSS_HOST=${JBOSS_HOST:-"192.168.0.10"}


11) Press "escape" to edit interactive mode

12) press 'shift'+zz to save and exit

13) now normally if you have only one JBoss server, its bound to all available IP address i.e. the same JBoss server responds to all the IP address you have on the server, but you cant have that any more so you will have to go into the "/etc/rc.d/init.d/jboss" and change the line

JBOSS_HOST=${JBOSS_HOST:-"0.0.0.0"}

to be the servers original IP address.

14) run the following

ln -s /etc/rc.d/init.d/jbossXXX /etc/rc3.d/S84jbossXX

ln -s /etc/rc.d/init.d/jbossXXX /etc/rc4.d/S84jbossXXX

ln -s /etc/rc.d/init.d/jbossXXX /etc/rc5.d/S84jbossXXX

ln -s /etc/rc.d/init.d/jbossXXX /etc/rc6.d/K15jbossXXX

ln -s /etc/rc.d/init.d/jbossXXX /etc/rc0.d/K15jbossXXX

ln -s /etc/rc.d/init.d/jbossXX /etc/rc1.d/K15jbossXX


(this makes links from your startup script to all the different ways that you can start a server up (you really only need mode 3 (multi user text) and mode 6 (multi user gui), but I'm trying to be neat here.

15) bounce the box (yes yes i know you don't have to do that, but i like to prove that servers can cope after a power outage)  
reboot

and that should be your lot

*** Update ***
Now it has come to light that old versions of JBoss (seems to be below version 4.2), have a slight bug in that startup and shut down script that still putts "localhost" as a parameter, even if you have specified an alternative IP address, as we no longer have one server on the localhost IP address this obviously breaks things, so while you can start up JBoss with

/etc/init.d/jbossXXX start

to shut it down (individually), you need to use something like

/home/jbossXXX/jboss-4.0.5.GA/bin/shutdown.sh -s jnp://192.168.0.10:1099

*** End Update ***

Bookmark and Share

27/01/2010

new book from Steve Crug

QuickImage Category Site Testing Book Review
As a designer I am well aware that I suck, I am one of the people responsible for Scott Good's quote of "The worst applications that people use are the ones they use at work" (from his Lotusphere session "BP202-There's no fixing ugly How to make a great first impression with your applications" an amazing session which left me ashamed of my sub standard design work but determined to do better).

My bible to this end is Steve Crugs book "Don't make me think" or as I like to call it "Amazon got it right", a truly fabulous book (my one is dog-eared having been passed round colleges and even family), this morning much to my excitement i discovered he has published a new book called
RocketSurgeryCover100w.jpg
"Rocket Surgery Made Easy:The Do-It-Yourself Guide to Finding and Fixing Usability Problems",
I purchased a pdf version and plowed into it.

This one has the same easy feel and readability of his first book, but for me has a slightly different target audience, its one of those books that you place meaningfully on a project managers desk, or read your self, but not to actually use just to have the tools to hand to fight the good fight and guide your wayward manager/user base when they skimp on testing, it also shows you what to do with any test results you might get (chapter 10 "debriefing 101" is a particular gem which I intend to print out and take to the next meeting in which we "address functional issues" / "listen to the users bitching"), with plenty of pertinent FAQ's, it can flicked through for a quick fix, or read cover to cover with out falling asleep (rare for any IT based book), very much recommended.


Bookmark and Share

25/01/2010

lotusphere, between the lines for web developers

QuickImage Category Lotusphere review
Back from Lotusphere and this is what i brought back

1) If your sticking with Notes for dev then learn xpages (best place is with Matt White at http://xpages101.net/ or at the http://xpagesblog.com/).
2) Mobile device support Android/iphone/blackberry, do not leave them out of ANY apps.
3) Flex is the RIA of choice.
4) Learn how to use Amazon s3 storage*.
5) Give lip service to dojo but use Jquery really.
6) Learn how to hack xml raw code (for Xpages/Websphere/Flex).
7) Ugly is out Out OUT**.
8) Tweak what ever your doing to sound like REST services.
9) Platform wise: for the client, Windows beats Mac, but Mac beats Linux (Eclipse is the future in all cases), server side: Redhat is the way to go.
10) Oldy but goldy: if your not learning Java, hurry up!!.


*Well cloud computing really, but so far the only bit that is really cloud seems to be the storage, processor renting has not changed, however there is a bit more integration with other services.

**and Web 2.0 is in In IN (well thank you for that IBM)


There is other stuff like "we have gone API crazy, please integrate everything with everything", but i recon that is the main points

Bookmark and Share

19/01/2010

LotuSphere 2010 notes pt1

QuickImage Category no Proper LotusSphere Content
*** LotuSphere Disclaimer: I have no intention of giving you any serious or useful information this lotusphere (well while not while im actually here at least, as there are too many people doing that already, go to planetlotus to find them ***

Now sharing a room with someone is a fab way of cutting the old LS costs down but after 2 days of sharing a room with the wretch, the cracks are showing,

what has he done you ask, well i tell you, he is tidy and reasonable, which is as far as im concerned is a crime against all that's conference!!, i present exhibit A:

sharingaroom1.jpg
look at this bed!!, it has been slept in by a drunk person!!, where is the vomit, where is the ripped sheet and pillows on the floor, it a travasty, but there is worse to come:

sharingaroom2.jpg
he folds and lays out T-shirts before passing out, its wrong i tell you, tomorrow night i would not be surprised if he started hoovering, now THIS is how a hotel room should look

sharingaroom3.jpg
somewhere between a nest and a pit, with the sheets on the floor, socks should craw around the fetid air, growling gently.



P.S. I also attended a very good session Mr Tim Davis on blackberry and IPhone apps, but i turns out that i committed a number of terrible faux pas, that include asking question during the session and sliding out once i had got all the info i wanted, (i feel shamed)
Bookmark and Share

11/01/2010

UKLug Virtual views Flex download

QuickImage Category Virtual notes Views FLEX
This is terribly late, but I needed to just blog it before lotusphere. Earlier this year the Poole and myself presented at UKlug, my part of the presentation was a way of doing a few thing that we take for granted in the notes client but done on the web with flex, this included Formula validation, design information and private views

The only complex part was the private/virtual views, which while not hugely fast still gave us private views back in a easy way (it builds documents that flex then renders back as views), and permits full use of formulas, variable columns, column titles and does not require view or full text indexes

You can see it in action here (for some reason the source server it on is being REALLY REALLY slow at the moment and as the demo app was designed to be pre-loaded for a demo its load time sucks anyway, just wait till you see the "$$viewField" appear in the dropdown). there are already 2 prebuilt views.

uklugfreebe.png

However this is more of a 'take it apart and see how it works' thing so the flex source code is here and the whole app is here also Mr Poole's code can be found here

You may wonder why the column and view selection formula is built so clumsily, well partly it is to give an excuse to show the formula validation, but mainly its because a perfect formula builder already exists, by Jake Howlett which can be found here

Oh. Next week I will be skulking at stand 622 at Lotusphere, where i will be fighting a hangover and writing an air app so you can have Elguji's 'Jam' products on your desktop (well actually i was supposed to have already written it, however I'm a work shy sod, but bruce has forgiven me out of the kindness of his soul), so drop by and if you feel like a bit of free flex/air/webservices how-to.
Bookmark and Share

Hire Me

Directly:

Curriculum Vitae

As a member of:
ldc_badge.gif

LDC Tshirts

Contact My Grubby Hide

Skype Linkin Main Me Twitter

Common sense for the recession

keep_calmblog.jpg