JAX WS 2.1 based Web Service on Tomcat 5.5.*

•April 5, 2009 • Leave a Comment

I have implemented JAX WS 2.1 based Web Service on Tomcat 5.5.27. This has been done in Eclipse using Apache Ivy for dependency management. I am only publishing the ivy.xml here because dependency resolution was a big headache for me, as artifacts in maven repository are out of sync.

Ivy Descriptor:


<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="2.0">
	<info organisation="com.learning" module="testWebProject" status="integration">
	</info>
	<configurations>
		<conf name="runtime" />
	</configurations>
	<dependencies>
		<dependency org="com.sun.xml.ws" name="jaxws-rt" rev="2.1.5"
			conf="runtime->default" />
		<dependency org="com.sun.xml.ws" name="jaxws-tools" rev="2.1.5"
			conf="runtime->default" />
		<dependency org="com.sun.xml.bind" name="jaxb-impl" rev="2.1.9"
			conf="runtime->default" />
		<dependency org="com.sun.xml.bind" name="jaxb-xjc" rev="2.1.9"
			conf="runtime->default" />
		<dependency org="javax.xml.ws" name="jaxws-api" rev="2.1"
			conf="runtime->default" />
		<dependency org="com.sun.xml.stream.buffer" name="streambuffer"
			rev="0.9" conf="runtime->default" />
		<dependency org="com.sun.xml.stream" name="sjsxp" rev="1.0"
			conf="runtime->default" />
		<dependency org="org.jvnet.staxex" name="stax-ex" rev="1.0"
			conf="runtime->default" />
		<dependency org="javax.jws" name="jsr181-api" rev="1.0-MR1"
			conf="runtime->default" />
		<dependency org="javax.xml.soap" name="saaj-api" rev="1.3"
			conf="runtime->default" />
		<dependency org="com/sun/xml/ws" name="webservices-rt" rev="1.4"
			conf="runtime->default" />
		<dependency org="javax.annotation" name="jsr250-api" rev="1.0"
			conf="runtime->default" />
	</dependencies>
</ivy-module>

Ivy Settings:


<ivysettings>

	<property name="ivy.default-resolver" value="development-chain"
		override="false" />

	<include url="${ivy.default.settings.dir}/ivysettings-public.xml" />
	<include url="${ivy.default.settings.dir}/ivysettings-shared.xml" />
	<include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
	<include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml" />
	<include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml" />

	<settings defaultResolver="${ivy.default-resolver}" />

	<resolvers>
		<ibiblio name="java.net.1" root="http://download.java.net/maven/1/"
			pattern="[organization]/jars/[module]-[revision].[ext]" />
		<ibiblio name="java.net.2" root="http://download.java.net/maven/2/"
			pattern="[organization]/[module]/[revision]/[module]-[revision].[ext]" />
		<chain name="development-chain" returnFirst="true">
			<resolver ref="local" />
			<resolver ref="java.net.1" />
			<resolver ref="java.net.2" />
			<resolver ref="main" />
		</chain>
	</resolvers>
</ivysettings>

Add to: Facebook | Digg | Del.icio.us | Stumbleupon | Reddit | Blinklist | Twitter | Technorati | Furl | Newsvine

Almost clocked 25k on my bike

•March 21, 2009 • Leave a Comment

I reached home and I was hoping that u would have completed silver jubilee riding my bike. That was not the case. Here is the reading.

reading

Google Video and Chat on iphone treats iphone as Power PC Mac

•March 21, 2009 • Leave a Comment

Gmail Video & Chat treated my Iphone as Power PC. For once I am happy. I really want to own a Mac.

Junit ignore test cases, classes using @ignore

•December 16, 2008 • Leave a Comment

I am a huge fan of Junit 4.5. It is very simple in its approach and test cases are simpler than ever before. I liek the idea of embedding unit test cases within the same class. With junit 4.5 there needs to be a single @Test annotation before the method and thats what is required to run it as a junit test case. I use ant’s junit task to execute my tests. 

Recently i ran into a small issue which was related to interfaces, abstract classes and classes with no junit tests present in the source directory. I had an option to include only test classes in a fileset but i preferred using batchtest, both are ant resource collections.

Ant will always return an error in these cases. I found a way around by using @ignore for all classes which ant junit should ignore. Anyone having a better way ?


package com.vivek.design.patterns;

import org.junit.Ignore;

@Ignore("interface")

public interface FlyBehaviour {

void fly();

}

Class above is from Head First Design Patterns

Accessing Oracle without Oracle Client Setup using Instant Client (Windows)

•October 9, 2008 • 2 Comments

Oracle Client Installation is required on machines from which access to Oracle Server is required. My work machine has only 1Gb of RAM and i run few more memory intensive applications on it. Currently i am using Oracle Instant Client instead of Oracle Client to access Oracle Database. Setup is minimal and if done in order works fine.

Read more on Instant Client from Oracle’s Website.

Now coming to setup.

Download Instant Client (10.2.0.4) from the link on website above. You will need to register for download if not already registered which i did not like. After download unzip folder in say C:\ and create a folder named oracle. Inside C:\oracle create a folder bin. Move all unzipped files inside bin folder.

Create a folder name network in C:\oracle. Inside C:\oracle\network create a folder named admin.

Create a new file called tnsnames.ora inside C:\oracle\network\admin.

Now there are 3 environment variables which need to be set:

Path=C:\oracle\bin (Add anywhere in Path)
SQL_PATH=C:\oracle
TNS_ADMIN=C:\oracle\network\admin

Fire up TOAD or Oracle SQL Developer and you should be able to connect to all schemas mentioned in tnsnames.ora

Instant Client is avalible for lot of platforms. I have written this post when using InstantClient on Windows XP.

Add to: Facebook | Digg | Del.icio.us | Stumbleupon | Reddit | Blinklist | Twitter | Technorati | Furl | Newsvine