<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Ijaz ahmed's Weblog</title>
	<atom:link href="http://ijaxahmed.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ijaxahmed.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Fri, 30 Dec 2011 09:35:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ijaxahmed.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Ijaz ahmed's Weblog</title>
		<link>http://ijaxahmed.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ijaxahmed.wordpress.com/osd.xml" title="Ijaz ahmed&#039;s Weblog" />
	<atom:link rel='hub' href='http://ijaxahmed.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Log4j Comprehensive tutorial</title>
		<link>http://ijaxahmed.wordpress.com/2011/03/01/log4j-comprehensive-tutorial/</link>
		<comments>http://ijaxahmed.wordpress.com/2011/03/01/log4j-comprehensive-tutorial/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 12:10:37 +0000</pubDate>
		<dc:creator>Ijaz Ahmed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[java log]]></category>
		<category><![CDATA[java logging]]></category>
		<category><![CDATA[Log4j]]></category>

		<guid isPermaLink="false">http://ijaxahmed.wordpress.com/?p=40</guid>
		<description><![CDATA[As logging required in every project.  Log4j provided by Apache to add logging to your system in best way.  I also required logging to my application and decided to use Log4j but could find any comprehensive tutorial about logging as somewhere basic were forund and advance use on other site. the way you want to add logging [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=40&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As logging required in every project.  Log4j provided by Apache to add logging to your system in best way.  I also required logging to my application and decided to use Log4j but could find any comprehensive tutorial about logging as somewhere basic were forund and advance use on other site. the way you want to add logging into your application is also vary to normal system sometime. thats why i had to read many tutorial to implement loggin as my requirements. here i will cover applying logging in different and hope it will cover your requirement of logging. here goes my comprehensive tutorial for Log4j.</p>
<p>I will cover following thing in this Post/tutorial</p>
<p>-Simple logging tutorial</p>
<p>- Logging on console and File</p>
<p>- How to manage logging in different files and size</p>
<p>- How to do logging on different file for different package or for different functional functionality withing the application.</p>
<p><strong>let me first introduce you LOG4J</strong></p>
<p>Log4j is a Reliable, Fast and Flexible Logging Framework (APIs) written in Java which is distributed under the Apache Software License.</p>
<p>Log4j has been ported to the C, C++, C#, Perl, Python, Ruby, and Eiffel languages.</p>
<p>Log4j is highly configurable through external configuration files at runtime. It views the logging process in terms of levels of priorities and offers mechanisms to direct logging information to a great variety of destinations, such as a database, file, console, UNIX Syslog etc.</p>
<p>Log4j has three main components:</p>
<ul>
<li><strong>loggers:</strong> Responsible for capturing logging information.</li>
<li><strong>appenders :</strong> Responsible for publishing logging information to various preferred destinations.</li>
<li><strong>layouts:</strong>Responsible to format logging information in different styles.<strong>LOGER :</strong>
<p><a id="LOG4J-Basics-Logger">The logger is the core component of the logging process. In log4j, there are 5 normal levels Levels of logger available (not including custom Levels), the following is borrowed from the log4j API (</a><a href="http://jakarta.apache.org/log4j/docs/api/index.html" target="_top">http://jakarta.apache.org/log4j/docs/api/index.html</a>):</p>
<div>
<ul type="disc">
<li>static Level DEBUGThe DEBUG Level designates fine-grained informational events that are most useful to debug an application.</li>
<li>static Level INFOThe INFO level designates informational messages that highlight the progress of the application at coarse-grained level.</li>
<li>static Level WARNThe WARN level designates potentially harmful situations.</li>
<li>static Level ERRORThe ERROR level designates error events that might still allow the application to continue running.</li>
<li>static Level FATALThe FATAL level designates very severe error events that will presumably lead the application to abort.</li>
</ul>
</div>
<p>In addition, there are two special levels of logging available: (descriptions borrowed from the log4j API <a href="http://jakarta.apache.org/log4j/docs/api/index.html" target="_top">http://jakarta.apache.org/log4j/docs/api/index.html</a>):</p>
<div>
<ul type="disc">
<li>static Level ALLThe ALL Level has the lowest possible rank and is intended to turn on all logging.</li>
<li>static Level OFFThe OFF Level has the highest possible rank and is intended to turn off logging.</li>
</ul>
</div>
<p>The behaviour of loggers is hierarchical. The following table illustrates this:</p>
<p><img src="https://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/log4j/files/images/loggerlevels.png" alt="Logger Output Hierarchy" /></p>
<p><a id="d0e188">There are a number of ways to create a logger, one can retrieve the root logger:</a></p>
<table width="90%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>Logger logger = Logger.getRootLogger();</pre>
</td>
</tr>
</tbody>
</table>
<p><a id="d0e188">One can create a new logger:</a></p>
<table width="90%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>Logger logger = Logger.getLogger("MyLogger");</pre>
</td>
</tr>
</tbody>
</table>
<p><a id="d0e188">More usually, one instantiates a static logger globally, based on the name of the class:</a></p>
<table width="90%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>static Logger logger = Logger.getLogger(test.class);</pre>
</td>
</tr>
</tbody>
</table>
<p><a id="d0e188">All these create a logger called &#8220;logger&#8221;, one can set the level with:</a></p>
<table width="90%" border="0" bgcolor="#E0E0E0">
<tbody>
<tr>
<td>
<pre>logger.setLevel((Level)Level.WARN);</pre>
</td>
</tr>
</tbody>
</table>
<p><a id="d0e188">You can use any of 7 levels; Level.DEBUG, Level.INFO, Level.WARN, Level.ERROR, Level.FATAL, Level.ALL and Level.OFF.</a></p>
<p><a id="d0e188"><br />
</a></p>
<h3><a id="LOG4J-Basics-Appender">APPENDER:</a></h3>
<p><a id="LOG4J-Basics-Appender">The Appender controls how the logging is output. The Appenders available are (descriptions borrowed from the log4j API </a><a href="http://jakarta.apache.org/log4j/docs/api/index.html" target="_top">http://jakarta.apache.org/log4j/docs/api/index.html</a>):</p>
<div>
<ol type="1">
<li>ConsoleAppender: appends log events to System.out or System.err using a layout specified by the user. The default target is System.out.</li>
<li>DailyRollingFileAppender extends FileAppender so that the underlying file is rolled over at a user chosen frequency.</li>
<li>FileAppender appends log events to a file.</li>
<li>RollingFileAppender extends FileAppender to backup the log files when they reach a certain size.</li>
<li>WriterAppender appends log events to a Writer or an OutputStream depending on the user&#8217;s choice.</li>
<li>SMTPAppender sends an e-mail when a specific logging event occurs, typically on errors or fatal errors.</li>
<li>SocketAppender sends LoggingEvent objects to a remote a log server, usually a SocketNode.</li>
<li>SocketHubAppender sends LoggingEvent objects to a set of remote log servers, usually a SocketNodes</li>
<li>SyslogAppendersends messages to a remote syslog daemon.</li>
<li>TelnetAppender is a log4j appender that specializes in writing to a read-only socket.</li>
</ol>
</div>
<p>One may also implement the <em>Appender</em> interface to create ones own ways of outputting log statements.</p>
<h3><a id="LOG4J-Basics-Layout">LAYOUT:</a></h3>
<p><a id="LOG4J-Basics-Layout">The Appender must have have an associated Layout so it knows how to format the output. There are three types of Layout available:</a></p>
<div>
<ol type="1">
<li><a id="LOG4J-Basics-Layout">HTMLLayout formats the output as a HTML table.</a></li>
<li><a id="LOG4J-Basics-Layout">PatternLayout formats the output based on a <em>conversion pattern</em> specified, or if none is specified, the default conversion pattern.</a></li>
<li><a id="LOG4J-Basics-Layout">SimpleLayout formats the output in a very simple manner, it prints the Level, then a dash &#8216;-&#8217; and then the log message.</a><a id="LOG4J-Basics-Layout"><br />
</a></p>
<p><strong>1. Basic Log4j Basic Example:</strong></p>
<p>To implement the log4j in your application, following you have to do.</p>
<p>- Create Properties file for log4j in your plication at root : log4j.properties</p>
<p>what you to define in the properties file. this is example of properties for logging on console</p>
<p>log4j.rootLogger = stdout // the root logger that is applied to whole aplication, if you dont wanted to apply this &#8220;stdou&#8221; logger at whole application then see below how to change to required use</p>
<p>log4j.appender.stdout=org.apache.log4j.ConsoleAppender // define appender, here is console</p>
<p>log4j.appender.stdout.Target=System.out</p>
<p>log4j.appender.stdout.layout=org.apache.log4j.PatternLayout</p>
<p>log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L &#8211; %m%n // layour of log, how it should be printed</p>
<p>-Initialize logger in your application, as many ways are written above how to initialize.</p>
<p>the basic ways is(write this initialization code at starting of the class) :</p>
<p>static Logger log = Logger.getLogger(Myclass.class.getName());</p>
<p>- User logger object (initialized in your class) to perform logging. write log statment anywhere in the class like this.</p>
<p>log.debug(&#8220;this is first log&#8221;)</p>
<p>log.info(&#8220;this is first log&#8221;)</p>
<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p>log.fatal(&#8220;this is first log&#8221;)</li>
</ol>
</div>
<p><a id="d0e188">SO! thi is the basic one and its SIMPLE !!! not much complexity</a></p>
<p><a id="d0e188"><strong>2. FILE Logging</strong> </a></p>
<p><a id="d0e188">Now if you also wanted to perform logging in the file. now you only need to Chang your properties file. following will be achieved in this example,</a></p>
<p>- Logging in file</p>
<p>-Plus logging on console</p>
<p>- Manage logging file size</p>
<p>-Backup logging files</p>
<p><em>Properties file:</em></p>
<p>log4j.rootLogger = stdout ,FILE // Console and File logging</p>
<p>log4j.appender.stdout=org.apache.log4j.ConsoleAppender // Console logging</p>
<p>log4j.appender.stdout.Target=System.out</p>
<p>log4j.appender.stdout.layout=org.apache.log4j.PatternLayout</p>
<p>log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L &#8211; %m%n</p>
<p># Define the file appender</p>
<p>log4j.appender.FILE=org.apache.log4j.RollingFileAppender //file logging</p>
<p>log4j.appender.FILE.File=first.log //log file name</p>
<p>log4j.appender.FILE.MaxFileSize=2MB //log file size, if size increase to this then new file will be created</p>
<p>log4j.appender.FILE.MaxBackupIndex=2 //backup will be persist until two files<br />
# Define the layout for file appender</p>
<p>log4j.appender.FILE.layout=org.apache.log4j.PatternLayout</p>
<p>log4j.appender.FILE.layout.conversionPattern=%m%n</p>
<p><a id="d0e188"><br />
</a></p>
<p><a id="d0e188">Now if you wanted to have different file for different packages or different functionality in application, here is the solution.</a></p>
<p><strong>3. File logging (with multipal files)</strong></li>
</ul>
<p>what you will achieve here</p>
<p>- Console loggign</p>
<p>- File logging</p>
<p>- define multiple log files within application</p>
<p>you can do it by two way.</p>
<p><span style="color:#800000;"><strong> 3.1 -Define multipal log files</strong></span></p>
<p>- for each log file  define package of the application(mean &#8220;first.log&#8221;  is for  &#8221;com.mypackage1 and come.mypakage2&#8243;  etc)</p>
<p>to implement this functionality yoz need to change log4j propertiues files and in the code intilization of the logger.</p>
<p>log4j.properties file:</p>
<p># Define the root logger with appender file<br />
log4j.rootLogger =<span style="color:#ff0000;"> stdout ,FILE, EXPORT</span></p>
<p>log4j.appender.stdout=org.apache.log4j.ConsoleAppender // Console logging</p>
<p>log4j.appender.stdout.Target=System.out</p>
<p>log4j.appender.stdout.layout=org.apache.log4j.PatternLayout</p>
<p>log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L &#8211; %m%n</p>
<p># Define the file appender</p>
<p>log4j.appender.FILE=org.apache.log4j.RollingFileAppender //file logging</p>
<p>log4j.appender.FILE.File=<span style="color:#ff0000;">first.log //log file name</span></p>
<p>log4j.appender.FILE.MaxFileSize=2MB //log file size, if size increase to this then new file will be created</p>
<p>log4j.appender.FILE.MaxBackupIndex=2 //backup will be persist until two files<br />
# Define the layout for file appender</p>
<p>log4j.appender.FILE.layout=org.apache.log4j.PatternLayout</p>
<p>log4j.appender.FILE.layout.conversionPattern=%m%n</p>
<p><span style="color:#ff0000;">log4j.logger.com.mypackage1=info, EXPORT</span></p>
<p><span style="color:#ff0000;">log4j.logger.com.mypackage2=info, EXPORT </span></p>
<p><span style="color:#ff0000;">log4j.logger.com.mypackage1=info, EXPORT</span><br />
# Define the file appender</p>
<p>log4j.appender.EXPORT=org.apache.log4j.RollingFileAppender</p>
<p>log4j.appender.EXPORT.Threshold=fatal</p>
<p>log4j.appender.EXPORT.File=<span style="color:#ff0000;">second.log // second log file</span></p>
<p>log4j.appender.EXPORT.MaxFileSize=2MB</p>
<p>log4j.appender.EXPORT.MaxBackupIndex=2<br />
# Define the layout for file appender</p>
<p>log4j.appender.EXPORT.layout=org.apache.log4j.PatternLayoutlog4j.appender.EXPORT.layout.conversionPattern=%m%n</p>
<p>to implement logging to specific to package  is marked as RED .</p>
<p>now initialize the logger like this.</p>
<p>static Logger log =Logger.getLogger(&#8220;FILE&#8221;); for  first log file , use this intialization in the code where you wanted to perform logging in first file</p>
<p>static Logger log =Logger.getLogger(&#8220;EXPORT&#8221;); for  second log file , use this intialization in the code where you wanted to perform logging in second file</p>
<p>logging statements in the code you dont need to change(except you change the logging level)</p>
<p><span style="color:#800000;"><strong> 3.2- Define different debug level for different files.</strong></span></p>
<p>- for first.log  define &#8220;fatal&#8221; logging level like this &#8220;log4j.appender.FIRST.Threshold=fatal&#8221;</p>
<p>- for second.log  define &#8220;info&#8221; logging level like this &#8220;log4j.appender.SECOND.Threshold=debug&#8221;</p>
<p>how it helps, where you wnated to write limited log or related to some functionality use first logger becouse its lowses loggign level so its only print the</p>
<p>log.fatal(&#8230;..)  statements log in the file.</p>
<p>for the rest of the application used second logger because its logging level is debug and its cover almost all logging level, therefor its write all log statement of application in log file.</p>
<p>log.debug(&#8230;..)</p>
<p>log.info(&#8230;..) etc you can check in above colorfull table how much logging level debug covers.</p>
<p>how you can implement in your application.  for this you have to Chane your log4j. properties file, logging initialization and log statement in the code</p>
<p>log4j.properties :</p>
<p># Define the root logger with appender file<br />
log4j.rootLogger = <span style="color:#ff0000;">stdout ,FILE, EXPORT</span></p>
<p>log4j.appender.stdout=org.apache.log4j.ConsoleAppender // Console logging</p>
<p>log4j.appender.stdout.Target=System.out</p>
<p>log4j.appender.stdout.layout=org.apache.log4j.PatternLayout</p>
<p>log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L &#8211; %m%n</p>
<p># Define the file appender</p>
<p>log4j.appender.FILE=org.apache.log4j.RollingFileAppender //file logging</p>
<p>log4j.appender.FILE.File=<span style="color:#ff0000;">first.log </span>//log file name</p>
<p>log4j.appender.FILE.MaxFileSize=2MB //log file size, if size increase to this then new file will be created</p>
<p>log4j.appender.FILE.MaxBackupIndex=2 //backup will be persist until two files<br />
# Define the layout for file appender</p>
<p>log4j.appender.FILE.layout=org.apache.log4j.PatternLayout</p>
<p>log4j.appender.FILE.layout.conversionPattern=%m%n<br />
# Define the file appender</p>
<p>log4j.appender.EXPORT=org.apache.log4j.RollingFileAppender</p>
<p>log4j.appender.EXPORT.Threshold=fatal</p>
<p>log4j.appender.EXPORT.File=<span style="color:#ff0000;">second.log // second log file</span></p>
<p>log4j.appender.EXPORT.MaxFileSize=2MB</p>
<p>log4j.appender.EXPORT.MaxBackupIndex=2<br />
# Define the layout for file appender</p>
<p>log4j.appender.EXPORT.layout=org.apache.log4j.PatternLayoutlog4j.appender.EXPORT.layout.conversionPattern=%m%n</p>
<p>here you can see two log file.</p>
<p>what you have to change to intialize loggign in code. see below</p>
<p>static Logger log =Logger.getLogger(<span style="color:#ff0000;">&#8220;FILE</span>&#8220;); for  first log file , use this intialization in the code where you wanted to perform logging in first file</p>
<p>static Logger log =Logger.getLogger(&#8220;<span style="color:#ff0000;">EXPORT</span>&#8220;); for  second log file , use this intialization in the code where you wanted to perform logging in second file</p>
<p>becouse the second file we have define logging leve is <strong>FATAL, </strong> functionality in second filespecificthis line to perform logging for some write</p>
<p>log.fatal(&#8220;&#8230;&#8230;&#8230;&#8221;);</p>
<p>for the fist logging you can use any statement like log.debug, log.info because first logging level is debug which covers all.</p>
<p>Hope it helps you!!! if you like this post please comment and share with other.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ijaxahmed.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ijaxahmed.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ijaxahmed.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ijaxahmed.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ijaxahmed.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ijaxahmed.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ijaxahmed.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ijaxahmed.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ijaxahmed.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ijaxahmed.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ijaxahmed.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ijaxahmed.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ijaxahmed.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ijaxahmed.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=40&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ijaxahmed.wordpress.com/2011/03/01/log4j-comprehensive-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/21f105e095863a9637636d6c07eea276?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ijaxahmed</media:title>
		</media:content>

		<media:content url="https://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/log4j/files/images/loggerlevels.png" medium="image">
			<media:title type="html">Logger Output Hierarchy</media:title>
		</media:content>
	</item>
		<item>
		<title>Relationship b/w Axis, CXF and JAX-WS &#8211; WebService Toolkit</title>
		<link>http://ijaxahmed.wordpress.com/2010/11/18/relationship-bw-axis-cxf-and-jax-ws-webservice-toolkit/</link>
		<comments>http://ijaxahmed.wordpress.com/2010/11/18/relationship-bw-axis-cxf-and-jax-ws-webservice-toolkit/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 12:37:11 +0000</pubDate>
		<dc:creator>Ijaz Ahmed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AXIS]]></category>
		<category><![CDATA[CXF]]></category>
		<category><![CDATA[JAX-RPC]]></category>
		<category><![CDATA[JAX-WS]]></category>
		<category><![CDATA[SAAJ]]></category>
		<category><![CDATA[webservice Toolkit]]></category>

		<guid isPermaLink="false">http://ijaxahmed.wordpress.com/?p=35</guid>
		<description><![CDATA[I am working on web service from last couple of years  before i was only know about Axis1/Axis2 and later i get to know more webservice API and framworks for JAVA(some of them given by Apache and SUN). Therefore first thing to know is whats the difference between all these APIs and framworsk. here is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=35&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am working on web service from last couple of years  before i was only know about Axis1/Axis2 and later i get to know more webservice API and framworks for JAVA(some of them given by Apache and SUN). Therefore first thing to know is whats the difference between all these APIs and framworsk. here is my try to make it simple to cleare confusion b/w ways to make webservices.  here is littel defination part;</p>
<p>- Apache SOAP,JAX-RPC, Axis1 and Axis2.</p>
<p>Soap, JAX-RPC  and Axis1 is obsolete now. JAX-RPC is a pecification/API for java developer to develop SOAP based interoperatable webservices . This API is now obsolete and may be dropped from  next J2EE version. same is the case with Axis1 because Axis1 is a web service framework and based on JAX_RPC ansd SAAJ and this turned out not be good approach because JAX-RPC constrained the internal design of the Axis code and contributed to both performance and flexibility issues. therefor Axis1 is also now obsolete now. Axis2 replace the JAX-RPC with  JAX-WS and  also support SAAJ. so Axis2 was designed to be flexible enough to  implement support for the replacement web service standard on top of base framwork one of the reason is based on completely new architecture and has been written from scratch. Recent version of the Axis2 have implemented support for both the JAXB 2.x java XML data binding standard and JAX-WS 2.x java web service standard that replace java JAX-RPC.</p>
<p>- SAAJ  is another API/specification for using SOAP envelops with or without attachment. It operates on lower level then JAX-RPC or JAX-WS, both of which will use SOAP envelopes based on SAAJ if needed.</p>
<p>- CXF is an open source service framwork . It comes up from a fusion of XFire and Ionas Celtix project. CXF was developed with the intention to integrate it into other systems. This is reflected in the CXF API and the use of the Spring framework. Therefore it is simple to integrate CXF into existing systems. CXF helps you to develop and build services using frontend programming APIs, like JAX-WS and JAX-RS. these  services can speak veriety of protocols such as SOAP, XML/HTTP, RestFul Http, CORBA and work over veritey of transports such  as Http, JMS or JBI. CSF implemnts  the JAX-Ws APIs. CXF  JAX-WS  support includes some extension to the standard that make it significantly easy to use, compared to the reference implementation: it will automatically generate code for request and response bean classes  and dose not requires WSDL in the simple case. It also include &#8220;simple front-end &#8221; which allow creation of client and endpoint without annotation. It support both Generating WSDL from Java classes and generating Java classes from WSDL.</p>
<p>- JAX-WS The Java API for XML based Web Services is the successor of the JAX-RPC specification. JAX-WS respectively its predecessor is message based and supports asynchronous communication. The Configuration is managed by annotations therefore Java 5 or higher is required. JAX-WS isn&#8217;t downwardly compatible to its predecessor JAX-RPC. With JAX-WS it is pretty easy to write and consume Web Services. The default values of numerous parameters are comfortable for the programmer, so that simple Pojos declared with a @WebService annotation can be used as a Service</p>
<p>- More recent SOAP offerings from Apache―the competing <em>Apache Axis2 </em>and <em>Apache CXF</em> projects―both implement JAX-WS. So far as I can tell, neither of them implements the older JAX-RPC API. The CXF User Guide recommends JAX-WS as a primary programming framework. Axis2 advocates its own APIs, and at the time of writing the JAX-WS interface was sparsely documented. But it does exist.</p>
<p>The <em>JAX-WS Reference Implementation</em> (JAX-WS-RI) is developed within the <em>GlassFish Community</em>. It is another Open Source implementation of JAX-WS. So these three leading candidates for “modern” Java SOAP implementations all implement JAX-WS, and none of them implements JAX-RPC. If the implementers are right, JAX-WS seems to be the way of the future.</p>
<p>A snapshot</p>
<p>JAX-WS is a Specification (provided by Sun, now Oracle) to defining Web Services by use of Annotations.</p>
<p>Apache CXF is a framework that implements JAX-WS to generate Web Services Definitions and Java Proxy (from a Web Service Definitions)</p>
<p>Apache Axis 2 is also a framework that now supports JAX-WS (up to JAX-WS 2). It&#8217;s an improvement from Apache Axis. CXF supports up to JAX-WS 1.2.</p>
<p>Hope this Artical help you to understand the difference /relationship between webservice API and frameworks.</p>
<p>P.S if you have question ask under this blog and if you like this then support me to write more by showing your likeness.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ijaxahmed.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ijaxahmed.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ijaxahmed.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ijaxahmed.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ijaxahmed.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ijaxahmed.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ijaxahmed.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ijaxahmed.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ijaxahmed.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ijaxahmed.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ijaxahmed.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ijaxahmed.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ijaxahmed.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ijaxahmed.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=35&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ijaxahmed.wordpress.com/2010/11/18/relationship-bw-axis-cxf-and-jax-ws-webservice-toolkit/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/21f105e095863a9637636d6c07eea276?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ijaxahmed</media:title>
		</media:content>
	</item>
		<item>
		<title>MySql Security Setting issue &#8211; Error 1045</title>
		<link>http://ijaxahmed.wordpress.com/2010/10/28/mysql-security-setting-issue-error-1045/</link>
		<comments>http://ijaxahmed.wordpress.com/2010/10/28/mysql-security-setting-issue-error-1045/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 13:47:46 +0000</pubDate>
		<dc:creator>Ijaz Ahmed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ijaxahmed.wordpress.com/?p=31</guid>
		<description><![CDATA[When you installed mysql first time all goes well but if due to some reason you need to uninstall then install mysql agian follwoing problem always occure at configuring it Processing configuration&#8230; &#160; / Prepare configuration / Write configuration file (c:\Program &#8230; \my.ini) / Start service x Apply Security settings &#160; the last step (Apply [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=31&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When you installed mysql first time all goes well but if due to some reason you need to uninstall then install mysql agian follwoing problem always occure at configuring it</p>
<p>Processing configuration&#8230;</p>
<p>&nbsp;</p>
<p>/ Prepare configuration</p>
<p>/ Write configuration file (c:\Program &#8230; \my.ini)</p>
<p>/ Start service</p>
<p>x Apply Security settings</p>
<p>&nbsp;</p>
<p>the last step (Apply security setting) always get fail. I also had the same problem  and it took so much time to me to solve the issue. on the internet you found lots of solution</p>
<p>related to properly uninstalling mysql like</p>
<p>&nbsp;</p>
<p>-Unintsall by Add/Remove program(In windows XP)</p>
<p>- delete Mysql folder in program Files(c:progme Files etc) directory</p>
<p>-remove entry from registry(regedit)</p>
<p>- remove entry from system configration (msconfig)</p>
<p>- check by (Alt+ctr+del), that my sql service is runnign uder proccess, if it is then stop it.</p>
<p>- better to restar your system(optional)</p>
<p>- Now reisntall  and configure it agian.</p>
<p>&nbsp;</p>
<p>If this solution works then its greate, otherwise i have another solution for your problem</p>
<p>&nbsp;</p>
<p>for the 2nd solution you have to dlelete  some enrty from mysql tables to congfiure mysql easily.</p>
<p>so follow it as following</p>
<p>&nbsp;</p>
<p>1 -stop if mysql service running(offcourse its running after installation), use (Alt+ctr+del) to stop form procsess</p>
<p>or use it http://dev.mysql.com/doc/refman/5.1/en/windows-start-service.html</p>
<p>&nbsp;</p>
<p>2 -Open command promt (in windows Menu&gt;Start&gt;Run&gt;CMD )</p>
<p>&#8220;C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld.exe&#8221; &#8211;skip-grant-tables</p>
<p>3 &#8211; Let this window open , open another command promt</p>
<p>Menu&gt;Start&gt;Run&gt;CMD</p>
<p>&#8220;C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql.exe&#8221; -u root</p>
<p>4 -Set new password for root user (or your user that given it another name)</p>
<p>&nbsp;</p>
<p>You&#8217;re now connect to MySQL, you have to modified the root account in the date of MySQL</p>
<p>&nbsp;</p>
<p>mysql&gt; use mysql;</p>
<p>mysql&gt; UPDATE user SET password=PASSWORD(&#8216;motdepasse&#8217;) WHERE user=&#8221;root&#8221;;</p>
<p>mysql&gt; flush privileges;</p>
<p>mysql&gt; exit;</p>
<p>&nbsp;</p>
<p>5- Restart with MySQL Commant Line Client (mean restart the mysql service).</p>
<p>&nbsp;</p>
<p>Thats all you have to do!!!</p>
<p>&nbsp;</p>
<p>Leave your comments, if this solution works for you (offcourse it will work, as it work in my case) <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ijaxahmed.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ijaxahmed.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ijaxahmed.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ijaxahmed.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ijaxahmed.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ijaxahmed.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ijaxahmed.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ijaxahmed.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ijaxahmed.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ijaxahmed.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ijaxahmed.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ijaxahmed.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ijaxahmed.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ijaxahmed.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=31&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ijaxahmed.wordpress.com/2010/10/28/mysql-security-setting-issue-error-1045/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/21f105e095863a9637636d6c07eea276?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ijaxahmed</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding Axis1.* to running project</title>
		<link>http://ijaxahmed.wordpress.com/2009/04/27/adding-axis1-to-running-project/</link>
		<comments>http://ijaxahmed.wordpress.com/2009/04/27/adding-axis1-to-running-project/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 14:07:25 +0000</pubDate>
		<dc:creator>Ijaz Ahmed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ijaxahmed.wordpress.com/?p=27</guid>
		<description><![CDATA[I had gone through lost of taturial about how to configure axis1 or axis2 then add your projetcs to Axisp.but there is no taturial that tells about &#8220;how to add Axis1 into running projetc&#8221; instead of adding projetc to Axis..so i have made this short taturial for it..its v simple Simply follow these smal steps.. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=27&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had gone through lost of taturial about how to configure axis1 or axis2 then add your projetcs to Axisp.but there is no taturial that tells about &#8220;how to add Axis1 into running projetc&#8221; instead of adding projetc to Axis..so i have made this short taturial for it..its v simple</p>
<p>Simply follow these smal steps..</p>
<p>1-Downlaod Axis1.*  and put somewhere in your computer.</p>
<p>2-copy all jar files from Axis lib folder  to your application lib folder(fir example in my case its HOMEPATH/axis-1_4\lib, the real Path is     D:\axis-1_4\lib)</p>
<p>3-copy All servcila mappings from web.xml of Axis1.4(D:\axis-1_4\webapps\axis\WEB-INF\web.xl) to your projetc web.xml</p>
<p>4-set Folwing path in your seysetn Enviorment Veriables.</p>
<p>AXIS_HOME=D:\axis-1_4</p>
<p>AXIS_LIB=%AXIS_HOME%\lib</p>
<p>AXISCLASSPATH=%AXIS_LIB%\axis.jar;%AXIS_LIB%\commons-discovery-0.2.jar;%AXIS_LIB%\commons-logging-1.0.4.jar;%AXIS_LIB%\jaxrpc.jar;%AXIS_LIB%\saaj.jar;%AXIS_LIB%\log4j-1.2.8.jar;%AXIS_LIB%\xml-apis.jar;%AXIS_LIB%\xercesImpl.jar</p>
<p>5-Then Simple open command prompt and us any of follwing command to depoly the web servcie</p>
<p> </p>
<p>java -cp %AXISCLASSPATH% org.apache.axis.client.AdminClient -1http://localhost:8081/HyperCupSample/servlet/AxisServlet deploy.wsdd</p>
<p>or</p>
<p>D:\axis-1_4\lib&gt;java -cp activation.jar:axis-ant.jar:axis.jar:axis-schema.jar:commons-discovery-0.2.jar:commons-logging-1.0.4.jar:jaxrpc.jar:log4j-1.2.8.jar:saaj.jar:wsdl4j-1.5.1.jar:. org.apache.axis.client.AdminClient -1http://localhost:8080/HyperCupSample/servlet/AxisServlet deploy.wsdd</p>
<p> </p>
<p>Enjoyyyyyyyyyyyyyy!!!!</p>
<p>if you find some problem then simply email me and if your like this short taturail then please comment something.thanks</p>
<div></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ijaxahmed.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ijaxahmed.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ijaxahmed.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ijaxahmed.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ijaxahmed.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ijaxahmed.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ijaxahmed.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ijaxahmed.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ijaxahmed.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ijaxahmed.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ijaxahmed.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ijaxahmed.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ijaxahmed.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ijaxahmed.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=27&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ijaxahmed.wordpress.com/2009/04/27/adding-axis1-to-running-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/21f105e095863a9637636d6c07eea276?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ijaxahmed</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript calendar</title>
		<link>http://ijaxahmed.wordpress.com/2008/09/17/javascript-calendar/</link>
		<comments>http://ijaxahmed.wordpress.com/2008/09/17/javascript-calendar/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 07:43:10 +0000</pubDate>
		<dc:creator>Ijaz Ahmed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ijaxahmed.wordpress.com/?p=23</guid>
		<description><![CDATA[i have used this javascript calendare on my web pag..its good check this link to follow http://ui.jquery.com/repository/latest/demos/functional/#ui.datepicker http://docs.jquery.com/UI/Datepicker<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=23&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>i have used this javascript calendare on my web pag..its good</p>
<p>check this link to follow</p>
<p>http://ui.jquery.com/repository/latest/demos/functional/#ui.datepicker</p>
<p>http://docs.jquery.com/UI/Datepicker</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ijaxahmed.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ijaxahmed.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ijaxahmed.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ijaxahmed.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ijaxahmed.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ijaxahmed.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ijaxahmed.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ijaxahmed.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ijaxahmed.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ijaxahmed.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ijaxahmed.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ijaxahmed.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ijaxahmed.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ijaxahmed.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ijaxahmed.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ijaxahmed.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=23&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ijaxahmed.wordpress.com/2008/09/17/javascript-calendar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/21f105e095863a9637636d6c07eea276?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ijaxahmed</media:title>
		</media:content>
	</item>
		<item>
		<title>Get Path Where A Class Is Located -java</title>
		<link>http://ijaxahmed.wordpress.com/2008/09/02/get-path-where-a-class-is-located-java/</link>
		<comments>http://ijaxahmed.wordpress.com/2008/09/02/get-path-where-a-class-is-located-java/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 10:35:13 +0000</pubDate>
		<dc:creator>Ijaz Ahmed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ijaxahmed.wordpress.com/?p=19</guid>
		<description><![CDATA[if you want to get path where calss is located ..here is code URL url =getClass().getProtectionDomain().getCodeSource().getLocation(); hop its helpfull write here if you feel its helpful cherrrrrrrrrrzzzzzzzzzzzzz<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=19&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>if you want to get path where calss is located ..here is code</p>
<p>URL url =getClass().getProtectionDomain().getCodeSource().getLocation();</p>
<p>hop its helpfull</p>
<p>write here if you feel its helpful</p>
<p>cherrrrrrrrrrzzzzzzzzzzzzz</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ijaxahmed.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ijaxahmed.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ijaxahmed.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ijaxahmed.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ijaxahmed.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ijaxahmed.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ijaxahmed.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ijaxahmed.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ijaxahmed.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ijaxahmed.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ijaxahmed.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ijaxahmed.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ijaxahmed.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ijaxahmed.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ijaxahmed.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ijaxahmed.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=19&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ijaxahmed.wordpress.com/2008/09/02/get-path-where-a-class-is-located-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/21f105e095863a9637636d6c07eea276?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ijaxahmed</media:title>
		</media:content>
	</item>
		<item>
		<title>Add Env variable in web application using web.xml</title>
		<link>http://ijaxahmed.wordpress.com/2008/09/02/add-env-variable-in-web-application-using-webxml/</link>
		<comments>http://ijaxahmed.wordpress.com/2008/09/02/add-env-variable-in-web-application-using-webxml/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 10:33:04 +0000</pubDate>
		<dc:creator>Ijaz Ahmed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ijaxahmed.wordpress.com/?p=17</guid>
		<description><![CDATA[How to add veriable/enviorment variabls in web application.these are the variable you can access anywhere in project here is solution addfollwing tag to web xm&#8230;and given values of your own choics &#60;env-entry&#62; &#60;env-entry-name&#62;webmasterEmail&#60;/env-entry-name&#62; &#60;env-entry-value&#62;admin@domain.com&#60;/env-entry-value&#62; &#60;env-entry-type&#62;java.lang.String&#60;/env-entry-type&#62; &#60;/env-entry&#62; you can access in a code by this // Get a handle to the JNDI environment naming context Context env = (Context)new InitialContext().lookup("java:comp/env"); // Get a single value String webmasterEmail = (String)env.lookup("webmasterEmail"); thats It ...enjoyyyyyyyy here is the helping [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=17&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How to add veriable/enviorment variabls in web application.these are the variable you can access anywhere in project</p>
<p>here is solution</p>
<p>addfollwing tag to web xm&#8230;and given values of your own choics</p>
<pre>&lt;env-entry&gt;
    &lt;env-entry-name&gt;webmasterEmail&lt;/env-entry-name&gt;
    &lt;env-entry-value&gt;admin@domain.com&lt;/env-entry-value&gt;
    &lt;env-entry-type&gt;java.lang.String&lt;/env-entry-type&gt;
&lt;/env-entry&gt;

you can access in a code by this
<code>
<span style="color:#3f7f5f;">// Get a handle to the JNDI environment naming context</span>
<span style="color:#000000;">Context env = </span><span style="color:#000000;">(</span><span style="color:#000000;">Context</span><span style="color:#000000;">)</span><span style="color:#7f0055;"><strong>new </strong></span><span style="color:#000000;">InitialContext</span><span style="color:#000000;">()</span><span style="color:#000000;">.lookup</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"java:comp/env"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span>
<span style="color:#3f7f5f;">// Get a single value</span>
<span style="color:#000000;">String webmasterEmail = </span><span style="color:#000000;">(</span><span style="color:#000000;">String</span><span style="color:#000000;">)</span><span style="color:#000000;">env.lookup</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"webmasterEmail"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span></code>

thats It ...enjoyyyyyyyy

here is the helping uRL

http://wiki.metawerx.net/wiki/Web.xml.EnvEntry

comment here if it is useful for you <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ijaxahmed.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ijaxahmed.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ijaxahmed.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ijaxahmed.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ijaxahmed.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ijaxahmed.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ijaxahmed.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ijaxahmed.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ijaxahmed.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ijaxahmed.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ijaxahmed.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ijaxahmed.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ijaxahmed.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ijaxahmed.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ijaxahmed.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ijaxahmed.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=17&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ijaxahmed.wordpress.com/2008/09/02/add-env-variable-in-web-application-using-webxml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/21f105e095863a9637636d6c07eea276?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ijaxahmed</media:title>
		</media:content>
	</item>
		<item>
		<title>get Server Context Path</title>
		<link>http://ijaxahmed.wordpress.com/2008/09/01/get-server-context-path/</link>
		<comments>http://ijaxahmed.wordpress.com/2008/09/01/get-server-context-path/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 13:05:03 +0000</pubDate>
		<dc:creator>Ijaz Ahmed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ijaxahmed.wordpress.com/?p=15</guid>
		<description><![CDATA[Q:how take server(tomcat, Jboss)context path for any work e:g file upload. A:here is the solution make a class of any name and implements ServletContextListener(its servlet calss) write body of contextInitialized(ServletContextEvent event) method like this public void contextInitialized(ServletContextEvent event) { yourUtilitiesClass.FILES_PATH = event.getServletContext().getRealPath(”&#8221;) + File.separator + “files” + File.separator; yourUtilitiesClass.IMAGES_FILES_PATH = event.getServletContext().getRealPath(”&#8221;) + File.separator + “images” [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=15&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Q:how take server(tomcat, Jboss)context  path for any work e:g file upload.</p>
<p>A:here is the solution<br />
make a class of any name and implements ServletContextListener(its servlet calss)</p>
<p>write body of contextInitialized(ServletContextEvent event)  method</p>
<p>like this</p>
<p>public void contextInitialized(ServletContextEvent event) {</p>
<p>yourUtilitiesClass.FILES_PATH = event.getServletContext().getRealPath(”&#8221;) + File.separator + “files” + File.separator;<br />
yourUtilitiesClass.IMAGES_FILES_PATH = event.getServletContext().getRealPath(”&#8221;) + File.separator + “images” + File.separator;<br />
yourUtilitiesClass.MY_RATES_XML_PATH = event.getServletContext().getRealPath(”&#8221;) + File.separator + “flash” + File.separator;<br />
}</p>
<p>add follwing tag in the web.xml of you web application and give your class name in the listener-class tag (that you write above)</p>
<p>&lt;listener&gt;<br />
&lt;listener-class&gt;com.myproject.portal.utilities.ContextListener&lt;/listener-class&gt;<br />
&lt;/listener&gt;</p>
<p>now what happend<br />
on every event on your web application server.xml call the listen and set the paths in your static(calss level) variable so you can use any where in the project.</p>
<p>this is the sample calss</p>
<p>import java.io.File;<br />
import javax.servlet.ServletContextEvent;<br />
import javax.servlet.ServletContextListener;</p>
<p>public class ContextListener implements ServletContextListener {</p>
<p>public ContextListener() {<br />
super();<br />
}</p>
<p>public void contextInitialized(ServletContextEvent event) {<br />
yourUtilities.FILES_PATH = event.getServletContext().getRealPath(&#8220;&#8221;) + File.separator + &#8220;files&#8221; + File.separator;<br />
yourUtilities.IMAGES_FILES_PATH = event.getServletContext().getRealPath(&#8220;&#8221;) + File.separator + &#8220;images&#8221; + File.separator;<br />
yourUtilities.VOPIUM_RATES_XML_PATH = event.getServletContext().getRealPath(&#8220;&#8221;) + File.separator + &#8220;flash&#8221; + File.separator;<br />
}</p>
<p>public void contextDestroyed(ServletContextEvent event) {</p>
<p>}</p>
<p>}</p>
<p>cheeerrrrrrrrs!!!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ijaxahmed.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ijaxahmed.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ijaxahmed.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ijaxahmed.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ijaxahmed.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ijaxahmed.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ijaxahmed.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ijaxahmed.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ijaxahmed.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ijaxahmed.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ijaxahmed.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ijaxahmed.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ijaxahmed.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ijaxahmed.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ijaxahmed.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ijaxahmed.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=15&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ijaxahmed.wordpress.com/2008/09/01/get-server-context-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/21f105e095863a9637636d6c07eea276?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ijaxahmed</media:title>
		</media:content>
	</item>
		<item>
		<title>DBCp connection!</title>
		<link>http://ijaxahmed.wordpress.com/2008/08/13/dbcp-connection/</link>
		<comments>http://ijaxahmed.wordpress.com/2008/08/13/dbcp-connection/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 10:43:15 +0000</pubDate>
		<dc:creator>Ijaz Ahmed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ijaxahmed.wordpress.com/?p=11</guid>
		<description><![CDATA[1.create your own context.xml file and put in Yourapp/META-INF/ location its contents should be &#60;Context docBase=&#8221;Tracker&#8221; path=&#8221;/Tracker&#8221;&#62; &#60;Resource name=&#8221;jdbc/tracker&#8221; scope=&#8221;Shareable&#8221; type=&#8221;javax.sql.DataSource&#8221; factory=&#8221;org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory&#8221; url=&#8221;jdbc:mysql://localhost:3306/tracker?autoReconnect=true&#8221; driverClassName=&#8221;com.mysql.jdbc.Driver&#8221; username=&#8221;root&#8221; password=&#8221;admin&#8221; maxIdle=&#8221;5&#8243; maxActive=&#8221;50&#8243; /&#62; 2.Then make entry in web.xml &#60;resource-ref&#62; &#60;description&#62;DB Connection&#60;/description&#62; &#60;res-ref-name&#62;jdbc/tracker&#60;/res-ref-name&#62; &#60;res-type&#62;javax.sql.DataSource&#60;/res-type&#62; &#60;res-auth&#62;Container&#60;/res-auth&#62; &#60;/resource-ref&#62; 3.Then place mysql-connector-java-3.1.13.jar in TOMCAT_HOME/common/lib folder 4.place jstl.jar.standar,jar in TOMCAT_HOME/common/lib folder/ or in you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=11&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1.create your own context.xml file and put in Yourapp/META-INF/  location</p>
<p>its contents should be<br />
&lt;Context  docBase=&#8221;Tracker&#8221; path=&#8221;/Tracker&#8221;&gt;</p>
<p>&lt;Resource name=&#8221;jdbc/tracker&#8221; scope=&#8221;Shareable&#8221; type=&#8221;javax.sql.DataSource&#8221;<br />
factory=&#8221;org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory&#8221;<br />
url=&#8221;jdbc:mysql://localhost:3306/tracker?autoReconnect=true&#8221;<br />
driverClassName=&#8221;com.mysql.jdbc.Driver&#8221;<br />
username=&#8221;root&#8221;<br />
password=&#8221;admin&#8221;<br />
maxIdle=&#8221;5&#8243;<br />
maxActive=&#8221;50&#8243;</p>
<p>/&gt;<br />
2.Then make entry in web.xml<br />
&lt;resource-ref&gt;<br />
&lt;description&gt;DB Connection&lt;/description&gt;<br />
&lt;res-ref-name&gt;jdbc/tracker&lt;/res-ref-name&gt;<br />
&lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;<br />
&lt;res-auth&gt;Container&lt;/res-auth&gt;<br />
&lt;/resource-ref&gt;</p>
<p>3.Then  place mysql-connector-java-3.1.13.jar in  TOMCAT_HOME/common/lib folder<br />
4.place jstl.jar.standar,jar in TOMCAT_HOME/common/lib folder/</p>
<p>or</p>
<p>in you webInf/lib folder(this is optional stepp if u using jstl)</p>
<p>5. use any where with code<br />
Context ctx = new InitialContext();<br />
DataSource ds = (DataSource)ctx.lookup(&#8220;java:comp/env/jdbc/tracker&#8221;);<br />
connection = ds.getConnection();</p>
<p>Note:</p>
<p>-download <a href="http://www.mysql.com/products/connector-j">Connector/J</a> 3.0.11-stable (the official JDBC Driver)</p>
<p>-Downlaod jstl lib(standard.jar, jstl.jar agian this is optional)</p>
<p>you can email me for jdbc connector and JStl lib at aijaza.b@gmail.com</p>
<p>for refrence also check that link</p>
<p>http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ijaxahmed.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ijaxahmed.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ijaxahmed.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ijaxahmed.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ijaxahmed.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ijaxahmed.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ijaxahmed.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ijaxahmed.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ijaxahmed.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ijaxahmed.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ijaxahmed.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ijaxahmed.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ijaxahmed.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ijaxahmed.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ijaxahmed.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ijaxahmed.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=11&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ijaxahmed.wordpress.com/2008/08/13/dbcp-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/21f105e095863a9637636d6c07eea276?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ijaxahmed</media:title>
		</media:content>
	</item>
		<item>
		<title>send configration sms on mobile</title>
		<link>http://ijaxahmed.wordpress.com/2008/08/07/send-configration-sms-on-mobile/</link>
		<comments>http://ijaxahmed.wordpress.com/2008/08/07/send-configration-sms-on-mobile/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 12:42:00 +0000</pubDate>
		<dc:creator>Ijaz Ahmed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[configration sms]]></category>
		<category><![CDATA[OMA]]></category>
		<category><![CDATA[OTA]]></category>
		<category><![CDATA[sync]]></category>

		<guid isPermaLink="false">http://ijaxahmed.wordpress.com/?p=7</guid>
		<description><![CDATA[Q.how to send an configration SMS(like mobile operators send GPRS setting, its an configration SMS) A.configration SMS is not a simple text sms.you have to send your message using  Over The Air(OTA) or Open Mobile Alaince (OMA). you can download OTA spacification document from there but first you have to make a login to nokia [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=7&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Q.how to send an configration SMS(like mobile operators send GPRS setting, its an configration SMS)</p>
<p>A.configration SMS is not a simple text sms.you have to send your message using  Over The Air(OTA) or Open Mobile Alaince (OMA).</p>
<p>you can download OTA spacification document from there but first you have to make a login to nokia forum.open the link make you registration the download the pdf file</p>
<p>http://www.forum.nokia.com/info/sw.nokia.com/id/3377eb33-cb1d-490e-a1cb-8735d785e1d3/OTA_settings_general_7_0.pdf.html</p>
<p>you can also download OMA specification</p>
<p>http://www.forum.nokia.com/info/sw.nokia.com/id/8d85ad81-5a9b-40fe-bf2a-d567dfd755ec/Series_40_DP_2_0_OMA_Client_Provisioning_v1_3_en.pdf.html</p>
<p>-i wanna send configration sms for synch settings . for that i read the these above spacification(parameters required).<br />
-then i create an xml according to OMA/OTA spacification.<br />
-and concert this xml to wbxml</p>
<p>how convert xml to wbxml<br />
there is two solution for that, you can find two APIs on the internet<br />
-wbxml this is c++ library<br />
can be downlaoded for here http://libwbxml.aymerick.com/<br />
-kxml this is java library<br />
can be donwlaod from here http://kxmlrpc.objectweb.org/software/downloads/</p>
<p>i converted my xml to wbxml using kxml api.here is code</p>
<p>package test.kxml;</p>
<p>import java.io.ByteArrayInputStream;<br />
import java.io.ByteArrayOutputStream;<br />
import java.io.File;<br />
import java.io.FileInputStream;<br />
import java.io.FileOutputStream;<br />
import java.io.InputStream;<br />
import java.io.InputStreamReader;</p>
<p>import org.kxml.io.AbstractXmlWriter;<br />
import org.kxml.kdom.Document;<br />
import org.kxml.parser.XmlParser;<br />
import org.kxml.wap.WbxmlWriter;</p>
<p>public class Converter {</p>
<p>public static void main(String args[]){</p>
<p>byte[] bytes=null;</p>
<p>try {<br />
File file = new File(&#8220;D:\\xml\\OMA2.xml&#8221;);</p>
<p>InputStream is = new FileInputStream(file);</p>
<p>// Get the size of the file<br />
long length = file.length();</p>
<p>// You cannot create an array using a long type.<br />
// It needs to be an int type.<br />
// Before converting to an int type, check<br />
// to ensure that file is not larger than Integer.MAX_VALUE.<br />
if (length &gt; Integer.MAX_VALUE) {<br />
// File is too large<br />
}</p>
<p>// Create the byte array to hold the data<br />
bytes = new byte[(int)length];</p>
<p>// Read in the bytes<br />
int offset = 0;<br />
int numRead = 0;<br />
while (offset &lt; bytes.length<br />
&amp;&amp; (numRead=is.read(bytes, offset, bytes.length-offset)) &gt;= 0) {<br />
offset += numRead;<br />
}</p>
<p>} catch (Exception e) {<br />
// TODO: handle exception<br />
}</p>
<p>try {<br />
FileOutputStream fOutStream = new FileOutputStream(&#8220;D:\\xml\\OMA2.wbxml&#8221;);<br />
// Construct an InputStreamReader on ByterArrayInputStream.<br />
InputStreamReader in = new InputStreamReader(new ByteArrayInputStream(bytes));</p>
<p>// Make parser using this Reader.<br />
XmlParser parser = new XmlParser(in);</p>
<p>// Construct a DOM Document to parse XML.<br />
Document document = new Document ();<br />
document.parse(parser);<br />
in.close();</p>
<p>// Make an OutputStream on which WbxmlWriter can write.<br />
ByteArrayOutputStream out = new ByteArrayOutputStream();<br />
//AbstractXmlWriter writer = new WbxmlWriter(out);</p>
<p>AbstractXmlWriter writer = new WbxmlWriter(fOutStream);<br />
document.write(writer);<br />
writer.close();</p>
<p>System.out.println(&#8220;&#8212;&#8212;&#8212;&#8212;-&#8221;+out.toString());<br />
//out.writeTo(fOutStream);<br />
// Get WBXML from this stream.<br />
bytes = out.toString().getBytes();</p>
<p>out.close();</p>
<p>}//try<br />
catch (Exception e) { e.printStackTrace(); }</p>
<p>}//End of MAin</p>
<p>}</p>
<p>i also have the exe file of wbxml lib(complied and convert to exe). you can run it on command promt.<br />
place the xml file and related dll in a folder the open the command promt and point to that folder and the write that command<br />
xml2wbxml.exe<br />
then write this command<br />
xml2wbxml -o output.wbxml input.xml<br />
xml2wbxml -k -n -v 1.1 -o output.wbxml input.xml</p>
<p>then your file convertd to wbxml. for wbxml exe file you can email me at aijaz.a.b@gmail.com</p>
<p>wbxml is short form of xml mean all xml data converted to binary so file size get commpressed. when you convert the xml to wbxml you will see all tags are converted into binary form but the text will remain the same.<br />
then convert it to Hexadecimal form and send it to your mobile.</p>
<p>downlaod hex-editor form that link http://www.brothersoft.com/free-hex-editor-download-40299.html, it will convert wbxml to hex.</p>
<p>how to send to the mobile you have to read your gate spacificatio. i am using unwire gateway so for that i set the &#8220;type&#8221; varibale to &#8220;raw&#8221; in the url and set the header.i didnt able to get sms on mobile therefor i contacted to my gateway provider but these all step really help to send the configration SMS.</p>
<p>the sms you will send it will have two parts<br />
first is UDH head<br />
what is UDH head read this link</p>
<p>http://dev.mobi/article/binary-sms-sending-rich-content-devices-using-sms</p>
<p>the samlple i send like this<br />
(UDH header)Header1: 0B0504C34FC0020003B90201<br />
(hexdecimal form of wbxml)Body1: 010604039481EA00010045C60601871245018713110331302E392E382E37000187146101872111032B333637303730303039323700018722700187231103766F6461776170000187241103766F646177617000018728730187296C0101C606018712410187131103323232000187146001871A11032B33363730393939363530<br />
Header2: 0B0504C34FC0020003B90202</p>
<p>hope this all will help</p>
<p>also read this link .might be it will be helpful</p>
<p>http://dev.mobi/article/email-configuration-sms</p>
<p>this is the example that i tryied with some gatway</p>
<p>i used this url of my gateway provider to send sms on mobile</p>
<p><!--[if gte mso 9]&gt;  Normal 0     false false false  EN-US X-NONE X-NONE              MicrosoftInternetExplorer4              &lt;![endif]--><!--[if gte mso 9]&gt;                                                                                                                                            &lt;![endif]--><!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman";} a:link, span.MsoHyperlink 	{mso-style-priority:99; 	color:blue; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{mso-style-noshow:yes; 	mso-style-priority:99; 	color:purple; 	mso-themecolor:followedhyperlink; 	text-decoration:underline; 	text-underline:single;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]&gt; &lt;!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} --> <!--[endif]--></p>
<p class="MsoNormal"><span style="color:#1f497d;"><a href="http://mobile.unwire.dk/java/servlet/smspush?user=jmobile&amp;password=SczX17o&amp;to=923224414591&amp;smsc=dk.tdc&amp;udh=0605040B840000&amp;text=02056A0045C60C037777772E6465762E6D6F62692F69735F66756E2E68746D6C0011033635333200070103446576446F744D6F62692069732046756E2021000101&amp;phoneno=923224414591&amp;mediacode=Vopium&amp;appnr=321&amp;from=Vopium&amp;type=raw&amp;">http://mobile.unwire.dk/java/servlet/smspush?user=test&amp;password=</a></span><a href="http://mobile.unwire.dk/java/servlet/smspush?user=jmobile&amp;password=SczX17o&amp;to=923224414591&amp;smsc=dk.tdc&amp;udh=0605040B840000&amp;text=02056A0045C60C037777772E6465762E6D6F62692F69735F66756E2E68746D6C0011033635333200070103446576446F744D6F62692069732046756E2021000101&amp;phoneno=923224414591&amp;mediacode=Vopium&amp;appnr=321&amp;from=Vopium&amp;type=raw&amp;">test</a><span style="color:#1f497d;"><a href="http://mobile.unwire.dk/java/servlet/smspush?user=jmobile&amp;password=SczX17o&amp;to=923224414591&amp;smsc=dk.tdc&amp;udh=0605040B840000&amp;text=02056A0045C60C037777772E6465762E6D6F62692F69735F66756E2E68746D6C0011033635333200070103446576446F744D6F62692069732046756E2021000101&amp;phoneno=923224414591&amp;mediacode=Vopium&amp;appnr=321&amp;from=Vopium&amp;type=raw&amp;">&amp;to=92322111111&amp;smsc=dk.tdc&amp;udh=0605040B840000&amp;text=02056A0045C60C037777772E6465762E6D6F62692F69735F66756E2E68746D6C0011033635333200070103446576446F744D6F62692069732046756E2021000101&amp;phoneno=92322111111&amp;mediacode=ijazcompnay&amp;appnr=321&amp;from=ijax&amp;type=raw&amp;</a></span></p>
<p class="MsoNormal">
<p class="MsoNormal">see type variable</p>
<p class="MsoNormal">
<p class="MsoNormal">
<p>cheeeeeeeeeeeeeeerz</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ijaxahmed.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ijaxahmed.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ijaxahmed.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ijaxahmed.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ijaxahmed.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ijaxahmed.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ijaxahmed.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ijaxahmed.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ijaxahmed.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ijaxahmed.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ijaxahmed.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ijaxahmed.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ijaxahmed.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ijaxahmed.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ijaxahmed.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ijaxahmed.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ijaxahmed.wordpress.com&amp;blog=4198829&amp;post=7&amp;subd=ijaxahmed&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ijaxahmed.wordpress.com/2008/08/07/send-configration-sms-on-mobile/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/21f105e095863a9637636d6c07eea276?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ijaxahmed</media:title>
		</media:content>
	</item>
	</channel>
</rss>
