<?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/"
	>

<channel>
	<title>tmro &#187; java</title>
	<atom:link href="http://www.tmro.net/category/software/languages/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tmro.net</link>
	<description>Mobilise your business</description>
	<lastBuildDate>Sun, 21 Aug 2011 01:38:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mac OS and Java Me SDK 3.0</title>
		<link>http://www.tmro.net/2009/11/mac-os-and-java-me-sdk-3-0/</link>
		<comments>http://www.tmro.net/2009/11/mac-os-and-java-me-sdk-3-0/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 01:38:21 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[javame]]></category>

		<guid isPermaLink="false">http://www.tmro.net/?p=213</guid>
		<description><![CDATA[Sun have released not too long ago a Java ME SDK 3.0 that finally brings an official Wireless Toolkit Emulator to the Mac platform. I have been dealing with SUN software for a while now and I was not expecting &#8230; <a href="http://www.tmro.net/2009/11/mac-os-and-java-me-sdk-3-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sun have released not too long ago a Java ME SDK 3.0 that finally brings an official Wireless Toolkit Emulator to the Mac platform.</p>
<p>I have been dealing with SUN software for a while now and I was not expecting this to be a smooth ride. Those who&#8217;d dealt with the WTK on Windows/Linux platform are well aware of the limitations of these emulators. What I was not prepared for was to get so much clutter that would just not work more than a couple of times.</p>
<p>First impression: this wtk looks like the most polished emulator ever released by Sun.</p>
<p>Sadly, after using the thing for a few days I discovered that the old habits had not changed:</p>
<ul>
<li>there is no menu entry to run an existing jad/jar pair. You have to right click on an emulator instance and then run it&#8230;</li>
<li>you cannot set-up a project starting from a jad/jar pair. There used to be an option to do this back in wtk 2.2&#8230;</li>
<li>after running a couple of apps the whole thing crashes an burns</li>
<li>when closing down the wtk a process is left lingering. Run this in a terminal:  <em>ps aux | grep device-manager.app</em></li>
<li>switching the verbose mode when launching the emulator kills the whole thing dead!</li>
<li>they bundled ant 1.7.1 with the distro although ant is built in Mac OS</li>
<li>Permgen errors are thrown if you try to launch the app too often. LOL</li>
</ul>
<p>Here&#8217;s what happened when I created a new project and tried to run it:</p>
<p><span style="color: #ff0000;">*** Error ***</span></p>
<p><span style="color: #ff0000;">Failed to connect to device 0!</span></p>
<p><span style="color: #ff0000;">Reason:</span></p>
<p><span style="color: #ff0000;">Emulator 0 terminated while waiting for it to register!</span></p>
<p>The same thing happens with Emulator 1 and 2 and 3 and 4 and 5 and 6 and &#8230; you get the picture.</p>
<p>Googling did return lots of forum posts, but hardly any answers&#8230;</p>
<p>So after wasting more than 2 hours on this issue I did the unthinkable: rebooted my mac! To my surprise the miracle happened during the reboot: I was finally able to run the project again.</p>
<p>Needless to say I am very disappointed but not surprised by the quality of this, early access, Java ME SDK.</p>
<p>Cheers&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tmro.net/2009/11/mac-os-and-java-me-sdk-3-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Jersey and Websphere 6.1</title>
		<link>http://www.tmro.net/2009/08/jersey-and-websphere-6-1/</link>
		<comments>http://www.tmro.net/2009/08/jersey-and-websphere-6-1/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 23:37:34 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.tmro.net/?p=158</guid>
		<description><![CDATA[If you landed on this page it probably means that you&#8217;ve attempted to deploy a Jersey RESTful web service in IBM&#8217;s Websphere app server. First of all: what were you thinking?!? Secondly: it probably wasn&#8217;t your decision and you just &#8230; <a href="http://www.tmro.net/2009/08/jersey-and-websphere-6-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you landed on this page it probably means that you&#8217;ve attempted to deploy a Jersey RESTful web service in IBM&#8217;s Websphere app server.<br />
First of all: what were you thinking?!?</p>
<p>Secondly: it probably wasn&#8217;t your decision and you just need to make it work and move on. That was our case anyway&#8230;</p>
<p>So rather than bore you to death with how we ended up debugging the JVM and discovering that a <strong>java.lang.TypeNotPresentException</strong> is thrown when calling <strong>class.isAnnotationPresent</strong> from within the cores (com.ibm.oti.reflect.AnnotationHelper.getAnnotation) of the IBM J9 JVM rather than a plain true / false, I will just give you a bullet list of the things that need to happen to keep Websphere happy.</p>
<ul>
<li>Get your versions right! Jersey 1.0.3 and Websphere AS 6.1.0.25 (including 6.1.0.25 Fix Pack for Web Services) (Getting here is a blog post in itself and I will not do it here)</li>
<li>Make sure that the enterprise app that contains your Jersey resources uses &#8220;Classes loaded with parent class loader first&#8221; and &#8220;Single class loader for application&#8221; (That is in your application&#8217;s &#8220;Class loading and update detection&#8221; section.)</li>
<li>In your web xml configure the Jersey servlet to search for resources using ClassNames rather than packages. Basically make sure your web.xml looks similar to what I have below.</li>
</ul>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Jersey Web Application<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.sun.jersey.spi.container.servlet.ServletContainer<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.sun.jersey.config.property.resourceConfigClass<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.sun.jersey.api.core.ClassNamesResourceConfig<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.sun.jersey.config.property.classnames<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				net.tmro.MyRESTfulResource
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;load-on-startup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>10<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/load-on-startup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Jersey Web Application<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/json/*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<ul>
<li>Okay, some clarification: the reason ClassNamesResourceConfig is used rather than PackagesResourceConfig is that when the packages are browsed for the actual @Path annotated classes an actual jar browsing is done which throws and swallows a nasty SecurityException&#8230; I invite you (more like dare you) to try using ClasspathResourceConfig and let me know if it works.</li>
</ul>
<p>Now go ahead and give this a try&#8230; don&#8217;t forget to let me know if it worked or failed for you&#8230; Good luck!</p>
<p>Cheers&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tmro.net/2009/08/jersey-and-websphere-6-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JATA &#8211; Java Application Terminal Alignment</title>
		<link>http://www.tmro.net/2009/06/jata-java-application-terminal-alignment/</link>
		<comments>http://www.tmro.net/2009/06/jata-java-application-terminal-alignment/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 03:03:00 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[javame]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://www.blog.tmro.net/?p=107</guid>
		<description><![CDATA[The Sun JavaOne conference is now in progress and one of the interesting things that have been announced so far is the JATA. Together with France Telecom and Orange, Motorola, Nokia, Sony Ericsson and Vodafone, Sun announced the Java Application &#8230; <a href="http://www.tmro.net/2009/06/jata-java-application-terminal-alignment/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span><span style="font-size:11pt"><span style="font-family: verdana, sans-serif;">The Sun JavaOne conference is now in progress and one of the interesting things that have been announced so far is the JATA.</span></span></span></p>
<p><span><span style="font-family: verdana, sans-serif;"> </span><span style="font-family: verdana, sans-serif;"> </span> <span style="font-family: verdana, sans-serif;"><em>Together with France Telecom and Orange, Motorola, Nokia, Sony Ericsson and Vodafone, Sun announced the Java Application Terminal Alignment (JATA), which they promised would reduce the number of tests application developers would need to go through to ensure their applications run on different networks and handsets.</em></span></p>
<p><span style="font-family: verdana, sans-serif;"><em> </em></span></span></p>
<p><span><em> </em></span><span style="font-size:11pt"><span><span style="font-family: verdana, sans-serif;"><em>Also promised are a publisher ID digital certificate to authenticate a person and application, and R&amp;D signing for developers to test their applications.</em><br />
</span> </span><span><span style="font-family: verdana, sans-serif;"><br />
I am looking forward to learning more about it&#8230; in the mean time there is always j2mepolish <img src='http://www.tmro.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span></span></span></p>
<div><span style="font-size: medium;"><span style="font-size: 15px;"><span style="font-family: verdana, sans-serif;"><br />
</span></span></span></div>
<div><span style="font-size: medium;"><span style="font-size: 15px;"><span style="font-family: verdana, sans-serif;">Cheers&#8230;</span></span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.tmro.net/2009/06/jata-java-application-terminal-alignment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

