Why do you look up your BasicCalculator twice? In my believe the line: "BasicCalculatorHome home=(BasicCalculatorHome)ctx.lookup("WSsamples/BasicCalculator");" will not work since the home is not put in JNDI as a Home Interface, so you cannot cast it. I think your code should look like this: