<?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>WireLust &#187; java</title>
	<atom:link href="http://www.wirelust.com/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wirelust.com</link>
	<description>Technology and stuff, you know.</description>
	<lastBuildDate>Thu, 27 May 2010 05:37:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Java keystore cert import on OSX Leopard</title>
		<link>http://www.wirelust.com/2010/03/17/java-keystore-cert-import-on-osx-leopard/</link>
		<comments>http://www.wirelust.com/2010/03/17/java-keystore-cert-import-on-osx-leopard/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 15:27:29 +0000</pubDate>
		<dc:creator>Tea</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.wirelust.com/?p=460</guid>
		<description><![CDATA[This morning I needed to connect IDE (IntelliJ Idea) to a FishEye/Jira server that had a self signed security certificate. Since IntelliJ (or at least the Atlassian plugin) uses Java to connect to https, it fails because of the JVM&#8217;s strict security checking. Normally when this happens, it is just a matter of installing the [...]]]></description>
			<content:encoded><![CDATA[<p>This morning I needed to connect IDE (IntelliJ Idea) to a FishEye/Jira server that had a self signed security certificate.  Since IntelliJ (or at least the Atlassian plugin) uses Java to connect to https, it fails because of the JVM&#8217;s strict security checking.</p>
<p>Normally when this happens, it is just a matter of installing the certificate into the JVM keystore.  There is an article and code that does this for you <a href="http://blogs.sun.com/andreas/entry/no_more_unable_to_find" target="_blank">here</a>.  <a href="http://louise.hu/poet/?p=3069" target="_blank">This blog post</a> even has a nice bash wrapper  that will download and compile this code for you on OSX.</p>
<p>When I tried to do this today, I got this error every time I tried to run this tool:<br />
<pre class="php">java.security.UnrecoverableKeyException: Password verification failed</pre></p>
<p>After a lot of digging on google.  I finally found the problem.  </p>
<p>On Java for OSX 10.6 u1 and 10.5 u6, Apple changed the default keystore password from <b>&#8216;changeit&#8217;</b> to <b>&#8216;changeme&#8217;</b>.</p>
<p>Such a trivial change, but annoying because changeit had been the Sun default forever.  There is <a href="http://lists.apple.com/archives/java-dev/2009/Dec/msg00105.html" target="_blank">a funny post</a> on the Apple Java mailing list where an engineer at Apple apologized and just sort of said they didn&#8217;t think it would be a big deal for anyone.  </p>
<p><a href="http://mattfleming.com/node/310" target="_blank">This post</a> from Matt Fleming, has some more info as well as how to change the keystore password if you decide you don&#8217;t like this change:<br />
<pre class="bash">sudo keytool -storepasswd -new changeit -keystore /Library/Java/Home/lib/security/cacerts -storepass changeme</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirelust.com/2010/03/17/java-keystore-cert-import-on-osx-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monty Widenius is trying to regain control of MySQL and why this is bad for OSS</title>
		<link>http://www.wirelust.com/2010/01/02/monty-widenius-spreading-fud-again/</link>
		<comments>http://www.wirelust.com/2010/01/02/monty-widenius-spreading-fud-again/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 21:33:52 +0000</pubDate>
		<dc:creator>Tea</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://www.wirelust.com/?p=344</guid>
		<description><![CDATA[One of the most widely discussed topics to go around the tech industry last year was the Oracle acquisition of Sun and what this meant for the MySQL database. This topic held up the merger with the US DOJ and currently has it stalled in the EU commission. One of the primary forces behind these [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most widely discussed topics to go around the tech industry last year was the Oracle acquisition of Sun and what this meant for the MySQL database.  This topic held up the merger with the US DOJ and currently has it stalled in the EU commission.  </p>
<p>One of the primary forces behind these hold ups is a series of FUD articles written by Monty Widenius, the most recent just <a href="http://monty-says.blogspot.com/2009/12/help-keep-internet-free.html" target="_blank">a few days ago</a>.  Monty has a huge following so whenever he writes up one of these articles it gets huge circulation and riles up the Slashdot and LAMP crowds.</p>
<p>I think that the open source community should be very skeptical about anything written by Monty on this topic, and should start looking at the big picture of what this merger means for themselves and the various players involved.</p>
<p>I don&#8217;t know why I haven&#8217;t been seeing many serious rebuttals to Michael&#8217;s posts.  I can only guess that is because everyone working at Sun and Oracle are prohibited from speaking up on the matter.</p>
<h3>Here is what I think everyone should consider:</h3>
<p><strong>1. Sun is the largest contributor to Open Source in the world</strong></p>
<p><strong>2. Java, which sun is responsible for, one of the largest ecosystem of open source software in the world.</strong></p>
<p class="indent">IBM, RedHat, the Apache Foundation, Oracle, Google, and hundreds of other companies have based themselves on Java.  Java is by far the most used platform out there today.  Out of this wide adoption has sprung a massive open source ecosystem that can only be rivaled by Linux.  I don&#8217;t have any studies but I wouldn&#8217;t be surprised if there was much more open source Java code out there than C.</p>
<p class="indent">The Java community in my experience, by and large, is very reluctant to touch anything that is not open source.  In the past 10 years the community has moved from expensive application servers and IDEs to free alternatives.  Projects like JBoss, Glassfish, Tomcat, Eclipse, and Netbeans are the dominant players in the space and have been driving the mindset that to be a player in this market you have to be free.
</p>
<p><strong>3. Sun is in trouble and risks going out of business if no-one buys it.  Talks with IBM broke down, and there aren&#8217;t many other companies that can make a purchase.</strong></p>
<p class="indent">Not much else to say here.  Oracle has been having some rough years.  Hardware sales are down and they&#8217;ve been spending too much on R&#038;D.  Sun needs someone to buy them and buy them quickly.  They have been actively been doing layoffs that affect all of their open source efforts (including MySQL) while this drags out.  <strong>Further delays, or the blocking of this merger will only further harm the OSS Community.</strong></p>
<p><strong>4. Oracle already owns Berkely DB and InnoDB, which current versions of MySQL rely on.</strong></p>
<p class="indent">This same sort of noise and FUD was made years ago when Oracle bought these two products.  Oracle has continued to maintain these and has been a more stable steward of the projects than when they were independent.</p>
<p><strong>5. It doesn&#8217;t make business sense for Oracle to try to kill MySQL.</strong></p>
<p class="indent">First off &#8211; MySQL does not compete with Oracle Database.  Anyone who thinks it does does not understand what Oracle Database is.  People that use Oracle tend to buy the whole oracle package (DB, App Server, IDE, Middleware, etc..).  There are free alternatives to everything in this stack, including many products owned by Oracle but companies that want Oracle are companies that want the piece of mind that support for the stack brings.</p>
<p class="indent">There are no CTOs out there hemming and hawing about wether to use MySQL or Oracle.  It would be like sitting around and trying to decide if you were going to buy a Ford Focus or an M1 Abrams Tank.  I&#8217;m not using this analogy to point out that Oracle has many more features (it does) or that it is better than MySQL, only that it is different.  You would never buy the tank to commute to work or for most of your driving needs.  The same is true with MySQL, it is perfect for most projects and Oracle tends to be a little too heavyweight.</p>
<p class="indent">Furthermore, for companies that do insist on purchasing the Oracle stack but want to use MySQL would now be able to buy the support stack with MySQL in it.  Oracle can now sell the complete support package and their customers can feel good about getting everything from one vendor.  Companies that buy Oracle are most likely the companies that would be paying for MySQL support as well.  If a customer comes to oracle, what do they care which database the customer wants to use when they own both.</p>
<p class="indent">The last thing Oracle would want to do is alienate a large developer community.  Changing anything about MySQL would hugely upset not just the LAMP and Java communities but just about everyone on the planet.  This is just bad business.</p>
<p><strong>6. All Oracle will own is a trademark and some engineers.</strong></p>
<p class="indent">The source code for MySQL is already free. Anyone can fork it off and start another project and attempt to gain community support around their new project.  The only thing they can&#8217;t do is call it MySQL.  Monty has already started one such fork called MariaDB.</p>
<p class="indent">Open source projects are about the community rallying around ideas, not around companies.  Monty argues that a forked product could never compete with MySQL without the name recognition.  This isn&#8217;t true.  If the community feels that Oracle is doing a bad job as a maintainer, but someone else is releasing new features on some other project, people will switch very quickly.  We see this all the time in the Linux world with the community switching from one fork to another of a large project.</p>
<p class="indent">Monty says that forks can never happen because they would need funding and resources.  What this argument ignores is that large companies with a lot invested in MySQL could step up if the project is faltering.  If Oracle were to stop releasing updates, do you think Google is going to sit around and do nothing?  The community would jump ship to GoogSQL or whatever if it came to that and was seen as a better product.</p>
<p><strong>6. Monty Widenius has the most to gain from Oracle divesting in MySQL.</strong></p>
<p class="indent">Like everything else in the world, when there is an argument, you need to step back and ask yourself who has the most to gain.  Widenius sold MySQL for a hefty personal gain and is now trying to wrestle back control by spreading fear throughout the MySQL community.</p>
<p class="indent">Monty has been making noise since September 2008 (before the announced Oracle-Sun merger) and complaining about the direction of the project.  He didn&#8217;t feel Sun was doing a good job and started immediately calling for forks and and a change of direction.  The community heard Widenius out but didn&#8217;t build up a ton of support for his ideas, because by and large, most people are satisfied with the job Sun is doing.</p>
<p class="indent">Right before the Sun ownership, MySQL was in the process of rolling out a non-free enterprise edition and telling people that they would have to pay for new features.  The company I was working for at the time had MySQL sales reps and consultants flat out tell us that we would need to purchase a support agreement if we wanted to use the Falcon Engine or clustering past v5.5.  Sun put a stop to this.</p>
<h3>In Summary</h3>
<p class="indent">I am not under any illusions that an Oracle-Sun merger would be all sunshine and roses.  I think that Sun has developed a culture and business model around everything being open and free and Oracle has not.  Oracle will need to make some big changes about how it does business in order for the merger to work.</p>
<p class="indent">I would prefer if Sun could remain an independent company but we have to face facts, Sun is in trouble and there aren&#8217;t many other companies that can bail them out.  If Sun is allowed to continue it&#8217;s downward spiral then we are facing a great loss to the open source community.</p>
<p class="indent">I am not worried about the Oracle stewardship of any of Sun&#8217;s open source products precisely because of the community support.  Oracle can&#8217;t afford to make huge changes and alienate hundreds of thousands of developers who have some say in how much money their companies give to Oracle.  Doing something like killing or even changing GlassFish, VirtualBox, ZFS, or any other OSS project could lead to less sales in it&#8217;s existing stack of software.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirelust.com/2010/01/02/monty-widenius-spreading-fud-again/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moving from Tomcat 6 to Jboss AS5 &#8211; notes</title>
		<link>http://www.wirelust.com/2009/05/18/moving-from-tomcat-6-to-jboss-as5-notes/</link>
		<comments>http://www.wirelust.com/2009/05/18/moving-from-tomcat-6-to-jboss-as5-notes/#comments</comments>
		<pubDate>Mon, 18 May 2009 06:31:57 +0000</pubDate>
		<dc:creator>Tea</dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.wirelust.com/?p=179</guid>
		<description><![CDATA[I&#8217;m moving a bunch of single WAR sites from Tomcat 6 to Jboss AS5. Here are the configuration steps that need to be taken. Assuming this is your tomcat config file: %TOMCAT_HOME%/conf/server.xml: &#60;Host appBase=&#34;/home/wirelust/wirelust.com&#34; autoDeploy=&#34;false&#34; debug=&#34;0&#34; deployXML=&#34;true&#34; liveDeploy=&#34;true&#34; name=&#34;domainname.com&#34; unpackWARs=&#34;true&#34;&#62; &#60;Alias&#62;www.wirelust.com&#60;/Alias&#62; &#160; &#60;Context cachingAllowed=&#34;true&#34; cookies=&#34;true&#34; crossContext=&#34;true&#34; debug=&#34;0&#34; displayName=&#34;wirelust&#34; docBase=&#34;.&#34; path=&#34;&#34; privileged=&#34;false&#34; reloadable=&#34;true&#34; swallowOutput=&#34;false&#34; useNaming=&#34;true&#34;&#62; &#60;Resource [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m moving a bunch of single WAR sites from Tomcat 6 to Jboss AS5.  Here are the configuration steps that need to be taken.</p>
<p>Assuming this is your tomcat config file:<br />
%TOMCAT_HOME%/conf/server.xml:<br />
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Host</span> <span style="color: #000066;">appBase</span>=<span style="color: #ff0000;">&quot;/home/wirelust/wirelust.com&quot;</span> <span style="color: #000066;">autoDeploy</span>=<span style="color: #ff0000;">&quot;false&quot;</span>
     <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">deployXML</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">liveDeploy</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
     <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;domainname.com&quot;</span>
     <span style="color: #000066;">unpackWARs</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
 
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Alias<span style="font-weight: bold; color: black;">&gt;</span></span></span>www.wirelust.com<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Alias<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
     <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Context</span> <span style="color: #000066;">cachingAllowed</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">cookies</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">crossContext</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;0&quot;</span>
             <span style="color: #000066;">displayName</span>=<span style="color: #ff0000;">&quot;wirelust&quot;</span> <span style="color: #000066;">docBase</span>=<span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">privileged</span>=<span style="color: #ff0000;">&quot;false&quot;</span>
             <span style="color: #000066;">reloadable</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">swallowOutput</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">useNaming</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
             <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Resource</span> <span style="color: #000066;">auth</span>=<span style="color: #ff0000;">&quot;SERVLET&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wirelustDatasource&quot;</span> <span style="color: #000066;">scope</span>=<span style="color: #ff0000;">&quot;Shareable&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;javax.sql.DataSource&quot;</span>
                     <span style="color: #000066;">username</span>=<span style="color: #ff0000;">&quot;username&quot;</span>
                     <span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;password&quot;</span>
                     <span style="color: #000066;">driverClassName</span>=<span style="color: #ff0000;">&quot;net.sourceforge.jtds.jdbc.Driver&quot;</span>
                     <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;jdbc:jtds:sqlserver://sql.wirelust.com/database&quot;</span>
                     <span style="color: #000066;">removeAbandoned</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
                     <span style="color: #000066;">removeAbandonedTimeout</span>=<span style="color: #ff0000;">&quot;30&quot;</span>
                     <span style="color: #000066;">logAbandoned</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
             <span style="font-weight: bold; color: black;">/&gt;</span></span>
     <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Context<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Host<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></p>
<p>Becomes the embedded tomcat config file:<br />
%JBOSS_HOME%/server/default/deploy/jbossweb.sar/server.xml<br />
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Host</span> <span style="color: #000066;">appBase</span>=<span style="color: #ff0000;">&quot;/home/wirelust/deploy/wirelust.com.war&quot;</span> <span style="color: #000066;">autoDeploy</span>=<span style="color: #ff0000;">&quot;false&quot;</span>
     <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">deployXML</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">liveDeploy</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
     <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;domainname.com&quot;</span>
     <span style="color: #000066;">unpackWARs</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
 
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Alias<span style="font-weight: bold; color: black;">&gt;</span></span></span>www.wirelust.com<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Alias<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Host<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></p>
<p>Notice that the appBase is now in a folder called &#8220;deploy&#8221;.  You have to add this deploy folder to the config file:<br />
%JBOSS_HOME%/server/default/conf/bootstrap/profile.xml<br />
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;bean</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;BootstrapProfileFactory&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.jboss.system.server.profileservice.repository.StaticProfileFactory&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;bootstrapURI&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>${jboss.server.home.url}conf/jboss-service.xml<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/property<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;deployersURI&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>${jboss.server.home.url}deployers<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/property<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;applicationURIs&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;list</span> <span style="color: #000066;">elementClass</span>=<span style="color: #ff0000;">&quot;java.net.URI&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value<span style="font-weight: bold; color: black;">&gt;</span></span></span>${jboss.server.home.url}deploy<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/value<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;value<span style="font-weight: bold; color: black;">&gt;</span></span></span>file:/home/wirelust/deploy<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/value<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/list<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/property<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;attachmentStoreRoot&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>${jboss.server.data.dir}/attachments<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/property<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;profileFactory&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;inject</span> <span style="color: #000066;">bean</span>=<span style="color: #ff0000;">&quot;ProfileFactory&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/property<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/bean<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></p>
<p>Make sure your exploded directory ends in .war or jboss won&#8217;t see it.</p>
<p>Then in that new deploy directory, create a datasource file, in this case called &#8220;wirelust-ds.xml&#8221; with these contents:<br />
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
&nbsp;
<span style="color: #00bbdd;">&lt;!DOCTYPE datasources
    PUBLIC &quot;-//JBoss//DTD JBOSS JCA Config 1.5//EN&quot;
    &quot;http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;datasources<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;local</span>-tx-datasource<span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;jndi</span>-name<span style="font-weight: bold; color: black;">&gt;</span></span>wirelustDatasource<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/jndi</span>-name<span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;connection</span>-url<span style="font-weight: bold; color: black;">&gt;</span></span>jdbc:jtds:sqlserver://sql.wirelust.com/wirelust<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/connection</span>-url<span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;use</span>-java-context<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/use</span>-java-context<span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;driver</span>-class<span style="font-weight: bold; color: black;">&gt;</span></span>net.sourceforge.jtds.jdbc.Driver<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/driver</span>-class<span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;user</span>-name<span style="font-weight: bold; color: black;">&gt;</span></span>username<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/user</span>-name<span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;password<span style="font-weight: bold; color: black;">&gt;</span></span></span>password<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/password<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Pool</span>.LogAbandoned<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Pool</span>.LogAbandoned<span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Pool</span>.RemoveAbandoned<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Pool</span>.RemoveAbandoned<span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Pool</span>.RemoveAbandonedTimeout<span style="font-weight: bold; color: black;">&gt;</span></span>50000<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Pool</span>.RemoveAbandonedTimeout<span style="font-weight: bold; color: black;">&gt;</span></span>
   <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/local</span>-tx-datasource<span style="font-weight: bold; color: black;">&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/datasources<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></p>
<p>In order to bind to the correct virtual host, you have to create a new file in your exploded WEB-INF directory called jboss-web.xml with these contents:<br />
<pre class="xml"><span style="color: #00bbdd;">&lt;!DOCTYPE jboss-web PUBLIC
    &quot;-//JBoss//DTD Web Application 4.2//EN&quot;
    &quot;http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd&quot;&gt;</span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;jboss</span>-web<span style="font-weight: bold; color: black;">&gt;</span></span>  
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;context</span>-root<span style="font-weight: bold; color: black;">&gt;</span></span>/<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/context</span>-root<span style="font-weight: bold; color: black;">&gt;</span></span>  
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;virtual</span>-host<span style="font-weight: bold; color: black;">&gt;</span></span>wirelust.com<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/virtual</span>-host<span style="font-weight: bold; color: black;">&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/jboss</span>-web<span style="font-weight: bold; color: black;">&gt;</span></span></pre> </p>
<p>Then the last change you have to make is how you are looking up your datasource in the application.<br />
If you have code like this in your tomcat application it will fail because your jndi is not bound to java:comp/env:<br />
<pre class="java"><a href="http://www.google.com/search?q=allinurl%3AContext+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Context</span></a> ctx = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AInitialContext+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">InitialContext</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<a href="http://www.google.com/search?q=allinurl%3AContext+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Context</span></a> envCtx = <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AContext+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Context</span></a><span style="color: #66cc66;">&#41;</span> ctx.<span style="color: #006600;">lookup</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;java:comp/env&quot;</span><span style="color: #66cc66;">&#41;</span>;
DataSource ds = <span style="color: #66cc66;">&#40;</span>DataSource<span style="color: #66cc66;">&#41;</span>envCtx.<span style="color: #006600;">lookup</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;wirelustDatasource&quot;</span><span style="color: #66cc66;">&#41;</span>;
con = ds.<span style="color: #006600;">getConnection</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></p>
<p>This of course can be fixed with some further configuration and resource-ref settings but I couldn&#8217;t get that to work so I just changed the code to work either way:<br />
<pre class="java"><a href="http://www.google.com/search?q=allinurl%3AContext+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Context</span></a> ctx = <span style="color: #000000; font-weight: bold;">null</span>;
<a href="http://www.google.com/search?q=allinurl%3AContext+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Context</span></a> envCtx = <span style="color: #000000; font-weight: bold;">null</span>;
DataSource ds = <span style="color: #000000; font-weight: bold;">null</span>;
<a href="http://www.google.com/search?q=allinurl%3AConnection+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Connection</span></a> con = <span style="color: #000000; font-weight: bold;">null</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>
	ctx = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AInitialContext+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">InitialContext</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ANamingException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">NamingException</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	e.<span style="color: #006600;">printStackTrace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>ctx != <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">// look for the datasource in the tomcat location</span>
		envCtx = <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AContext+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Context</span></a><span style="color: #66cc66;">&#41;</span> ctx.<span style="color: #006600;">lookup</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;java:comp/env&quot;</span><span style="color: #66cc66;">&#41;</span>;
		ds = <span style="color: #66cc66;">&#40;</span>DataSource<span style="color: #66cc66;">&#41;</span>envCtx.<span style="color: #006600;">lookup</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;wirelustDatasource&quot;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span>javax.<span style="color: #006600;">naming</span>.<a href="http://www.google.com/search?q=allinurl%3ANameNotFoundException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">NameNotFoundException</span></a> nnfe<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// look for it in the jboss location</span>
			ds = <span style="color: #66cc66;">&#40;</span>DataSource<span style="color: #66cc66;">&#41;</span>ctx.<span style="color: #006600;">lookup</span><span style="color: #66cc66;">&#40;</span>wirelustDatasource<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Exception</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			e.<span style="color: #006600;">printStackTrace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Exception</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		e.<span style="color: #006600;">printStackTrace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">// open the connection</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>ds != <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>
		con = ds.<span style="color: #006600;">getConnection</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Exception</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		e.<span style="color: #006600;">printStackTrace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirelust.com/2009/05/18/moving-from-tomcat-6-to-jboss-as5-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting binary to signed decimal in Actionscript</title>
		<link>http://www.wirelust.com/2009/04/08/converting-binary-to-signed-decimal-in-actionscript/</link>
		<comments>http://www.wirelust.com/2009/04/08/converting-binary-to-signed-decimal-in-actionscript/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 21:44:00 +0000</pubDate>
		<dc:creator>Tea</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[bitwise]]></category>

		<guid isPermaLink="false">http://www.wirelust.com/?p=157</guid>
		<description><![CDATA[If you&#8217;re like me, you may have been living these past few years taking advantage of the luxury of new sleek programming languages that rarely require you to do low level operations. One of the old skills I seem to always let get rusty enough is bitwise operation. Most code written with the help of [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me, you may have been living these past few years taking advantage of the luxury of new sleek programming languages that rarely require you to do low level operations.  One of the old skills I seem to always let get rusty enough is bitwise operation.  Most code written with the help of frameworks doesn&#8217;t require this type of code and most programmers probably don&#8217;t even bother to learn it anymore.</p>
<p>I came into an instance yesterday where I needed to do some bitwise work in actionscript.  The code was reading a bytestream from a binary file and converting to an array of numbers.  Since this project was ported from Java (by someone else), a simple operation was overlooked.  It was taking the binary number and converting it to a signed short.  Since actionscript doesn&#8217;t have the same casting mechanisms conversion isn&#8217;t as straight forward in java.</p>
<p>In java the operation looked like this:<br />
<pre class="java"><span style="color: #808080; font-style: italic;">//  binary: 1111 1111 1111 0001</span>
<span style="color: #993333;">int</span> hexValue = 0xFFF1;
&nbsp;
<span style="color: #993333;">short</span> value = <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">short</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>hexValue<span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// value = -15 </span></pre></p>
<p>Since short in java is always stored with a signed bit, the cast appropriately set the value at -15.</p>
<p>The way this was translated into Actionscript looked liked this:<br />
<pre class="actionscript"><span style="color: #808080; font-style: italic;">//  binary: 1111 1111 1111 0001</span>
<span style="color: #000000; font-weight: bold;">var</span> hexValue:<span style="color: #0066CC;">int</span> = 0xFFF1;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> value:<span style="color: #0066CC;">int</span> = <span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>hexValue<span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// value = 65521  // Wrong! </span></pre></p>
<p>Actionscript has no concept of casting for primitives so the int(hexValue) doesn&#8217;t do anything at all.</p>
<p>Here is the workaround I came up with, I suspect there is a shorter way to get the same result but I can&#8217;t think of one right now.</p>
<p><pre class="actionscript"><span style="color: #808080; font-style: italic;">//  binary: 1111 1111 1111 0001</span>
<span style="color: #000000; font-weight: bold;">var</span> hexValue:<span style="color: #0066CC;">int</span> = 0xFFF1;
&nbsp;
<span style="color: #808080; font-style: italic;">// get everything except the signed bit &quot;111 1111 1111 0001&quot;</span>
<span style="color: #000000; font-weight: bold;">var</span> unsignedValue:<span style="color: #0066CC;">Number</span> = <span style="color: #66cc66;">&#40;</span>hexValue &amp; 0x7FFF<span style="color: #66cc66;">&#41;</span>;  
<span style="color: #808080; font-style: italic;">// unsignedValue now equals 32,753</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> signedValue:<span style="color: #0066CC;">Number</span> = unsignedValue;
&nbsp;
<span style="color: #808080; font-style: italic;">// if the signed flag is set, flip the value</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>hexValue &gt;&gt; <span style="color: #cc66cc;">15</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    signedValue = unsignedValue - 0x8000;   <span style="color: #808080; font-style: italic;">// 0x800 =  32,768 (maximum 15 bit number)</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// signedValue = -15 </span></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirelust.com/2009/04/08/converting-binary-to-signed-decimal-in-actionscript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Picture Pump</title>
		<link>http://www.wirelust.com/2009/04/06/picture-pump/</link>
		<comments>http://www.wirelust.com/2009/04/06/picture-pump/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 10:21:01 +0000</pubDate>
		<dc:creator>Tea</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[jnlp]]></category>

		<guid isPermaLink="false">http://www.wirelust.com/?p=145</guid>
		<description><![CDATA[About five years ago Ben Sisto had an idea for an application that I thought would be useful. The idea being that if you want to download images from Google image search &#8212; it takes forever to go through the results, wait for them to load, and save the images that aren&#8217;t 404. The application [...]]]></description>
			<content:encoded><![CDATA[<p>About five years ago <a href="http://www.51570.org/" target="_blank">Ben Sisto</a> had an idea for an application that I thought would be useful.  The idea being that if you want to download images from Google image search &#8212; it takes forever to go through the results, wait for them to load, and save the images that aren&#8217;t 404.   The application Ben envisioned, would simply download every result and ignore the ones that were 404 or took too long to load.  Once you have all the results on your hard drive it is a lot easier to sift through them.</p>
<p>I quickly banged out a release that was workable in a few days and never really looked at it again.</p>
<p>This week I had an exact need for this application again.  When I fired it up, it seems Google changed their site so it wasn&#8217;t working anymore.   I spent some time tonight to fix it up and got it working much better than the original.</p>
<p>So here it is. v1.0 (i guess) release of Picture Pump (named after the site Ben ran at the time &#8211; HoneyPump):</p>
<p><img src="/img/entries/PicturePump_screenshot.png"/></p>
<p>Click launch to start/install the application.  OSX users should be all set, windows users you might have to <a href="http://www.java.com">get java</a> first.</p>
<p><a href="/apps/PicturePump/launch.jnlp"><img src="/img/webstart_button.gif" border="0" /></a></p>
<p>also, hey look. <a href="/apps/PicturePump/picturepump.zip">source code</a></p>
<p>Email me with any suggestions or patches.</p>
<p><b>UPDATE: 10/24/2009</b><br />
- fixed my mime settings so that launch button works again (sorry moved servers and forgot to set it)<br />
- fixed a few bugs<br />
- added support for safe search<br />
- added filtering by image type and license<br />
- source code is now under the <a href="http://en.wikipedia.org/wiki/Apache_License" target="_blank">Apache Public 2.0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirelust.com/2009/04/06/picture-pump/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Howto set the cookie policy with Apache http client 4.0</title>
		<link>http://www.wirelust.com/2009/03/29/howto-set-the-cookie-policy-with-apache-http-client-40/</link>
		<comments>http://www.wirelust.com/2009/03/29/howto-set-the-cookie-policy-with-apache-http-client-40/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 00:59:04 +0000</pubDate>
		<dc:creator>Tea</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[httpcomponents java]]></category>

		<guid isPermaLink="false">http://www.wirelust.com/?p=139</guid>
		<description><![CDATA[The Apache Http Components client changed quite a bit from 3.0 to 4.0 beta. It wasn&#8217;t entirely clear to me from the documentation how to set request headers and cookie policies with the new client. After a lot of fishing around I was able to figure it out, here is the code for anyone trying [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://hc.apache.org">Apache Http Components client</a> changed quite a bit from 3.0 to 4.0 beta.  It wasn&#8217;t entirely clear to me from the documentation how to set request headers and cookie policies with the new client.  After a lot of fishing around I was able to figure it out, here is the code for anyone trying to do the same thing.</p>
<p>Downloading a page with the 3.0 client:<br />
<pre class="java">HttpClient httpClient = <span style="color: #000000; font-weight: bold;">new</span> HttpClient<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
GetMethod get = <span style="color: #000000; font-weight: bold;">new</span> GetMethod<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://www.twitter.com/teacurran&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// set a faux User-agent</span>
get.<span style="color: #006600;">setRequestHeader</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;User-Agent&quot;</span>, <span style="color: #ff0000;">&quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// set the cookie policy</span>
get.<span style="color: #006600;">getParams</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setCookiePolicy</span><span style="color: #66cc66;">&#40;</span>CookiePolicy.<span style="color: #006600;">RFC_2109</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333;">int</span> responseCode = httpClient.<span style="color: #006600;">executeMethod</span><span style="color: #66cc66;">&#40;</span>get<span style="color: #66cc66;">&#41;</span>;
<a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>get.<span style="color: #006600;">getResponseBody</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
get.<span style="color: #006600;">releaseConnection</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></p>
<p>here is the same thing with the 4.0 client:<br />
<pre class="java">DefaultHttpClient httpClient = <span style="color: #000000; font-weight: bold;">new</span> DefaultHttpClient<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
HttpGet get = <span style="color: #000000; font-weight: bold;">new</span> HttpGet<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://www.twitter.com/teacurran&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// set a faux User-agent</span>
get.<span style="color: #006600;">addHeader</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;User-Agent&quot;</span>, <span style="color: #ff0000;">&quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// set the cookie policy</span>
get.<span style="color: #006600;">getParams</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setParameter</span><span style="color: #66cc66;">&#40;</span>ClientPNames.<span style="color: #006600;">COOKIE_POLICY</span>, CookiePolicy.<span style="color: #006600;">RFC_2965</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
HttpResponse response = httpClient.<span style="color: #006600;">execute</span><span style="color: #66cc66;">&#40;</span>get<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333;">int</span> responseCode = <span style="color: #993333;">int</span> code = response.<span style="color: #006600;">getStatusLine</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getStatusCode</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
HttpEntity entity = response.<span style="color: #006600;">getEntity</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>EntityUtils.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span>entity<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirelust.com/2009/03/29/howto-set-the-cookie-policy-with-apache-http-client-40/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating an iText pdf with embedded JFreeChart</title>
		<link>http://www.wirelust.com/2008/03/17/creating-an-itext-pdf-with-embedded-jfreechart/</link>
		<comments>http://www.wirelust.com/2008/03/17/creating-an-itext-pdf-with-embedded-jfreechart/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 15:36:53 +0000</pubDate>
		<dc:creator>Tea</dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.wirelust.com/2008/03/17/creating-an-itext-pdf-with-embedded-jfreechart/</guid>
		<description><![CDATA[Charts are simple to make with JFreeChart and there are tons of examples on the web about how to generate them and save them as .jpg or .gif files. I ran into an issue however, where I needed to embed a chart into a pdf file. My first thoughts were to generate the charts as [...]]]></description>
			<content:encoded><![CDATA[<p>Charts are simple to make with <a href="http://www.jfree.org/jfreechart/" target="_blank">JFreeChart</a> and there are tons of examples on the web about how to generate them and save them as .jpg or .gif files.  I ran into an issue however, where I needed to embed a chart into a pdf file.  My first thoughts were to generate the charts as a .jpg file and embed them, but the pdfs looked a little choppy and didn&#8217;t print well.</p>
<p>To solve the problem you need to have the chart rendered as vector graphics and inserted into the pdf.  The code required to do this ended up being simple, but I wasn&#8217;t able to find any good complete examples on the web.  This is a simple working example I made for anyone else who finds themselves in this position.</p>
<p>Downloads:</p>
<ul>
<li><a href="/examples/jfreechartpdf.zip">Full source / binary / libs</a></li>
<li><a href="/examples/GenerateJfreePdf.java">Java source</a></li>
<li><a href="/examples/jfreechartpdf.pdf">Generated pdf</a></li>
<p><font style="position: absolute;overflow: hidden;height: 0;width: 0"><a href="http://kvantservice.com/">компютри</a></font>
</ul>
<p>To do an ant build, all you need to do is set j2ee.lib.dir in the build.properties file to a directory that contains the j2ee.jar (in your jdk or app server) and you are good to go.  The war file should easily deploy on any app server.</p>
<p>Here is the meat of the code required:<br />
<pre class="java">docWriter = PdfWriter.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span>doc, baosPDF<span style="color: #66cc66;">&#41;</span>;
&nbsp;
doc.<span style="color: #006600;">addProducer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
doc.<span style="color: #006600;">addCreator</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">getClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getName</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
doc.<span style="color: #006600;">addTitle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;jfreechart pdf&quot;</span><span style="color: #66cc66;">&#41;</span>;
doc.<span style="color: #006600;">setPageSize</span><span style="color: #66cc66;">&#40;</span>PageSize.<span style="color: #006600;">LETTER</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
doc.<span style="color: #006600;">open</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// add some text to the document</span>
doc.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Phrase<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// build up the dataset for the char</span>
XYSeriesCollection dataset = <span style="color: #000000; font-weight: bold;">new</span> XYSeriesCollection<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
XYSeries series = <span style="color: #000000; font-weight: bold;">new</span> XYSeries<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;XYGraph&quot;</span><span style="color: #66cc66;">&#41;</span>;
series.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
series.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>;
series.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span>, <span style="color: #cc66cc;">9</span><span style="color: #66cc66;">&#41;</span>;
series.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span>, <span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
dataset.<span style="color: #006600;">addSeries</span><span style="color: #66cc66;">&#40;</span>series<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// set up the chart</span>
JFreeChart chart = ChartFactory.<span style="color: #006600;">createXYLineChart</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;XY Chart Sample, non default font&quot;</span>, <span style="color: #808080; font-style: italic;">// chart title</span>
        <span style="color: #ff0000;">&quot;x-axis&quot;</span>,   <span style="color: #808080; font-style: italic;">// domain axis label</span>
        <span style="color: #ff0000;">&quot;y-axis&quot;</span>,   <span style="color: #808080; font-style: italic;">// range axis label</span>
        dataset,    <span style="color: #808080; font-style: italic;">// data</span>
        PlotOrientation.<span style="color: #006600;">VERTICAL</span>,   <span style="color: #808080; font-style: italic;">// orientation</span>
        <span style="color: #000000; font-weight: bold;">true</span>,   <span style="color: #808080; font-style: italic;">// include legend</span>
        <span style="color: #000000; font-weight: bold;">true</span>,   <span style="color: #808080; font-style: italic;">// tooltips</span>
        <span style="color: #000000; font-weight: bold;">false</span>   <span style="color: #808080; font-style: italic;">// urls</span>
    <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// trick to change the default font of the chart</span>
chart.<span style="color: #006600;">setTitle</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> TextTitle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;XY Chart Sample, non default font&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006600;">awt</span>.<a href="http://www.google.com/search?q=allinurl%3AFont+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Font</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Serif&quot;</span>, <a href="http://www.google.com/search?q=allinurl%3AFont+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Font</span></a>.<span style="color: #006600;">BOLD</span>, <span style="color: #cc66cc;">12</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
chart.<span style="color: #006600;">setBackgroundPaint</span><span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Color</span></a>.<span style="color: #006600;">white</span><span style="color: #66cc66;">&#41;</span>;
chart.<span style="color: #006600;">setBorderPaint</span><span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AColor+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Color</span></a>.<span style="color: #006600;">black</span><span style="color: #66cc66;">&#41;</span>;
chart.<span style="color: #006600;">setBorderStroke</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3ABasicStroke+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">BasicStroke</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
chart.<span style="color: #006600;">setBorderVisible</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333;">int</span> width = <span style="color: #cc66cc;">260</span>;
<span style="color: #993333;">int</span> height = <span style="color: #cc66cc;">250</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// get the direct pdf content</span>
PdfContentByte dc = docWriter.<span style="color: #006600;">getDirectContent</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// get a pdf template from the direct content</span>
PdfTemplate tp = dc.<span style="color: #006600;">createTemplate</span><span style="color: #66cc66;">&#40;</span>width, height<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// create an AWT renderer from the pdf template</span>
<a href="http://www.google.com/search?q=allinurl%3AGraphics2D+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Graphics2D</span></a> g2 = tp.<span style="color: #006600;">createGraphics</span><span style="color: #66cc66;">&#40;</span>width, height, <span style="color: #000000; font-weight: bold;">new</span> DefaultFontMapper<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
<a href="http://www.google.com/search?q=allinurl%3ARectangle2D+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Rectangle2D</span></a> r2D = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3ARectangle2D+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Rectangle2D</span></a>.<a href="http://www.google.com/search?q=allinurl%3ADouble+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Double</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>, width,height<span style="color: #66cc66;">&#41;</span>;
chart.<span style="color: #006600;">draw</span><span style="color: #66cc66;">&#40;</span>g2,r2D,<span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>;
g2.<span style="color: #006600;">dispose</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// add the rendered pdf template to the direct content</span>
<span style="color: #808080; font-style: italic;">// you will have to play around with this because the chart is absolutely positioned.</span>
<span style="color: #808080; font-style: italic;">// 38 is just a typical left margin</span>
<span style="color: #808080; font-style: italic;">// docWriter.getVerticalPosition(true) will approximate the position that the content above the chart ended</span>
dc.<span style="color: #006600;">addTemplate</span><span style="color: #66cc66;">&#40;</span>tp, <span style="color: #cc66cc;">38</span>, docWriter.<span style="color: #006600;">getVerticalPosition</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>-height<span style="color: #66cc66;">&#41;</span>;</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirelust.com/2008/03/17/creating-an-itext-pdf-with-embedded-jfreechart/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sun Spots are now Open Source</title>
		<link>http://www.wirelust.com/2008/01/30/sun-spots-are-now-open-source/</link>
		<comments>http://www.wirelust.com/2008/01/30/sun-spots-are-now-open-source/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 18:09:29 +0000</pubDate>
		<dc:creator>Tea</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.wirelust.com/2008/01/30/sun-spots-are-now-open-source/</guid>
		<description><![CDATA[Sun has announced that the Sun Spots are now fully open source. This means that the API as well as the Squawk VM are now fully open. The Squak VM itself is an interesting project. I will be curious to see how it compares against google&#8217;s Dalvik VM on small devices (that is whenever google [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.wirelust.com/blog/wp-content/uploads/2008/01/sunspot.jpg' alt='sunspot.jpg' align="right" style="border: solid 1px black; margin:10px;"/>Sun has <a href="http://www.sun.com/aboutsun/pr/2008-01/sunflash.20080129.3.xml" target="_blank">announced</a> that the Sun Spots are now fully open source.  This means that the <a href="https://spots-libraries.dev.java.net/" target="_blank">API</a> as well as the <a href="https://squawk.dev.java.net/" target="_blank">Squawk VM</a> are now fully open.  The Squak VM itself is an interesting project.  I will be curious to see how it compares against google&#8217;s Dalvik VM on small devices (that is whenever google releases or tells us more about Dalvik).</p>
<p>The <a href="http://www.sun.com/aboutsun/pr/2008-01/sunflash.20080129.3.xml" target="_blank">press release</a> seems to imply that the Sun Spot hardware will also be open source:</p>
<blockquote><p>
The open source release of the versatile Java technology-based Sun SPOT platform will include hardware, software and the Squawk Virtual Machine.
</p></blockquote>
<p>but this is the only mention I see of hardware in the press release and on the <a href="https://www.sunspotworld.com/" target="_blank">several</a> <a href="https://spots.dev.java.net/" target="_blank">sites</a> dedicated to Sun Spot.  I really hope they expand on this and show the world everything that is included in the OSS releases.</p>
<p>If the hardware is Open Source that could make way for some third parties to make their own implementations, similar to the different implementaitons of <a href="http://www.arduino.cc/" target="_blank">Arduino</a>.  This would be especially welcome given the crazy high cost of a Sun Spot device ($250 or so per device compared with $20-150 depending on configuration for Arduino).  Yea, Yea, I know Sun Spot is way awesomer than Arduino, but if I am going to make a little device to attach to the top of a rocket or the under carriage of my skateboard, you better believe I am going to be looking for the cheapest hardware I can find.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirelust.com/2008/01/30/sun-spots-are-now-open-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Chandler Server</title>
		<link>http://www.wirelust.com/2007/12/13/building-chandler-server/</link>
		<comments>http://www.wirelust.com/2007/12/13/building-chandler-server/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 22:19:07 +0000</pubDate>
		<dc:creator>Tea</dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.wirelust.com/2007/12/13/building-chandler-server/</guid>
		<description><![CDATA[I&#8217;ve been using Chandler for a few weeks now to try to organize my life. I tried building Chandler Server from source today. Following the instructions on their site give&#8217;s me a build error because it can&#8217;t find a copy of Apache Abdera Some of the error: /mnt/drive2/chandler/cosmo/cosmo/src/main/java/org/osaf/cosmo/atom/provider/UserTarget.java:&#91;20,46&#93; cannot find symbol symbol : class AbstractTarget [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://chandlerproject.org/" target="_blank">Chandler</a> for a few weeks now to try to organize my life.</p>
<p>I tried building Chandler Server from source today.  Following the <a href="http://chandlerproject.org/Developers/ChandlerServerSource" target="_blank">instructions</a> on their site give&#8217;s me a build error because it can&#8217;t find a copy of <a href="http://incubator.apache.org/abdera/" target="_blank">Apache Abdera</a></p>
<p>Some of the error:<br />
<pre class="php">/mnt/drive2/chandler/cosmo/cosmo/src/main/java/org/osaf/cosmo/atom/provider/UserTarget.java:<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">20</span>,<span style="color: #cc66cc;">46</span><span style="color: #66cc66;">&#93;</span> cannot find symbol
symbol  : <span style="color: #000000; font-weight: bold;">class</span> AbstractTarget
location: package org.apache.abdera.protocol.server.impl
&nbsp;
/mnt/drive2/chandler/cosmo/cosmo/src/main/java/org/osaf/cosmo/atom/provider/UserTarget.java:<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">29</span>,<span style="color: #cc66cc;">32</span><span style="color: #66cc66;">&#93;</span> cannot find symbol
symbol: <span style="color: #000000; font-weight: bold;">class</span> AbstractTarget
public <span style="color: #000000; font-weight: bold;">class</span> UserTarget extends AbstractTarget <span style="color: #66cc66;">&#123;</span>
&nbsp;
/mnt/drive2/chandler/cosmo/cosmo/src/main/java/org/osaf/cosmo/atom/provider/BaseItemTarget.java:<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">22</span>,<span style="color: #cc66cc;">46</span><span style="color: #66cc66;">&#93;</span> cannot find symbol
symbol  : <span style="color: #000000; font-weight: bold;">class</span> AbstractTarget
location: package org.apache.abdera.protocol.server.impl
&nbsp;
/mnt/drive2/chandler/cosmo/cosmo/src/main/java/org/osaf/cosmo/atom/provider/BaseItemTarget.java:<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">25</span>,<span style="color: #cc66cc;">45</span><span style="color: #66cc66;">&#93;</span> cannot find symbol
symbol: <span style="color: #000000; font-weight: bold;">class</span> AbstractTarget
public abstract <span style="color: #000000; font-weight: bold;">class</span> BaseItemTarget extends AbstractTarget</pre></p>
<p>After much fiddeling around, and even trying to install Abdera from source, I was able to get it to build by checking out everything related to cosmo and building that.</p>
<ul>
<li>svn co http://svn.osafoundation.org/server/cosmo/trunk</li>
<li>cd trunk/cosmo</li>
<li>mvn package</li>
</ul>
<p>ta-da.  </p>
<p>I still get some errors with the unit tests, but I don&#8217;t know if those are serious or not yet.</p>
<p>Now let&#8217;s see if it run&#8217;s with Tomcat 6.0</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirelust.com/2007/12/13/building-chandler-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix + Javamail = disagreement</title>
		<link>http://www.wirelust.com/2007/12/09/postfix-javamail-disagreement/</link>
		<comments>http://www.wirelust.com/2007/12/09/postfix-javamail-disagreement/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 06:30:54 +0000</pubDate>
		<dc:creator>Tea</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.wirelust.com/2007/12/09/postfix-javamail-disagreement/</guid>
		<description><![CDATA[I had a server die on me last week and I needed to reinstall it as quickly as possible. It was running Fedora Core 4. I only had install media for Fedora core 6. I knew it would be a bit of a pain to update all of the config files for everything running on [...]]]></description>
			<content:encoded><![CDATA[<p>I had a server die on me last week and I needed to reinstall it as quickly as possible.  It was running Fedora Core 4.  I only had install media for Fedora core 6.  I knew it would be a bit of a pain to update all of the config files for everything running on the server, but I figured now is as good a time as any.  I would have updated to 7 or 8, but I didn&#8217;t have time to download those on CDs (I have 8 on dvd but the server doesn&#8217;t have a dvd drive).</p>
<p>Anyway.  I updated everything and it all seemed to run swimmingly.  I didn&#8217;t even have to configure anything too drastically different.   I switched from Courier IMAP to Dovecot, but that is another story.</p>
<p>The issue that got me pulling my hair out last night was that my tomcat log kept showing odd smtp related error messages in the stack trace:</p>
<p><pre class="php">javax.<a href="http://www.php.net/mail"><span style="color: #000066;">mail</span></a>.SendFailedException: Sending failed;
  nested exception is:
        <span style="color: #000000; font-weight: bold;">class</span> javax.<a href="http://www.php.net/mail"><span style="color: #000066;">mail</span></a>.MessagingException: <span style="color: #cc66cc;">501</span> <span style="color: #cc66cc;">5.5</span><span style="color: #cc66cc;">.4</span> Bad RET parameter syntax
        at javax.<a href="http://www.php.net/mail"><span style="color: #000066;">mail</span></a>.Transport.send0<span style="color: #66cc66;">&#40;</span>Transport.java:<span style="color: #cc66cc;">218</span><span style="color: #66cc66;">&#41;</span>
        at javax.<a href="http://www.php.net/mail"><span style="color: #000066;">mail</span></a>.Transport.send<span style="color: #66cc66;">&#40;</span>Transport.java:<span style="color: #cc66cc;">80</span><span style="color: #66cc66;">&#41;</span>
        at com.approachingpi.store.order.Notification.sendMail<span style="color: #66cc66;">&#40;</span>Notification.java:<span style="color: #cc66cc;">116</span><span style="color: #66cc66;">&#41;</span>
        at com.approachingpi.store.order.Notification.run<span style="color: #66cc66;">&#40;</span>Notification.java:<span style="color: #cc66cc;">56</span><span style="color: #66cc66;">&#41;</span>
        at java.lang.Thread.run<span style="color: #66cc66;">&#40;</span>Thread.java:<span style="color: #cc66cc;">595</span><span style="color: #66cc66;">&#41;</span></pre></p>
<p>After a lot of digging, it seems that javamail sends the RET parameter as described in <a href="http://www.ietf.org/rfc/rfc1891.txt" target="_blank">RFC-1891</a>, even if it is not set up in the config file.   Since this is an optional parameter, you would think that leaving it out of your properties file would make javamail not send it to the mail server.   It seems it sends &#8220;RET=&#8221; rather than leaving it out.</p>
<p>It also seems that postfix v2.2.2 ignores &#8220;RET=&#8221;, but v2.3.3 is a little more strict and expects your parameter to have a value.</p>
<p>I don&#8217;t know what application is behaving improperly here.  My guess is that postfix is doing the right thing, and that javamail should probably not send the RET parameter, but I guess they could argue that I just need to always configure it in my settings to make sure I&#8217;m compliant.  (I am using javamail 1.3.0 btw, so it may have changed in newer versions)</p>
<p>to fix the problem, all I had to do was add these two lines to my javamail config properties file:<br />
mail.smtp.dsn.ret=HDRS<br />
mail.smtp.dsn.notify=NEVER</p>
<p>I found I also had to set the mail.smtp.dns.notify value too, because if I don&#8217;t I get this error:<br />
<pre class="php">javax.<a href="http://www.php.net/mail"><span style="color: #000066;">mail</span></a>.SendFailedException: Sending failed;
  nested exception is:
        <span style="color: #000000; font-weight: bold;">class</span> javax.<a href="http://www.php.net/mail"><span style="color: #000066;">mail</span></a>.SendFailedException: Invalid Addresses;
  nested exception is:
        <span style="color: #000000; font-weight: bold;">class</span> javax.<a href="http://www.php.net/mail"><span style="color: #000066;">mail</span></a>.SendFailedException: <span style="color: #cc66cc;">501</span> <span style="color: #cc66cc;">5.5</span><span style="color: #cc66cc;">.4</span> Error: Bad NOTIFY parameter syntax;
  nested exception is:
        <span style="color: #000000; font-weight: bold;">class</span> javax.<a href="http://www.php.net/mail"><span style="color: #000066;">mail</span></a>.SendFailedException: <span style="color: #cc66cc;">501</span> <span style="color: #cc66cc;">5.5</span><span style="color: #cc66cc;">.4</span> Error: Bad NOTIFY parameter syntax
        at javax.<a href="http://www.php.net/mail"><span style="color: #000066;">mail</span></a>.Transport.send0<span style="color: #66cc66;">&#40;</span>Transport.java:<span style="color: #cc66cc;">218</span><span style="color: #66cc66;">&#41;</span>
        at javax.<a href="http://www.php.net/mail"><span style="color: #000066;">mail</span></a>.Transport.send<span style="color: #66cc66;">&#40;</span>Transport.java:<span style="color: #cc66cc;">80</span><span style="color: #66cc66;">&#41;</span>
        at com.approachingpi.store.order.Notification.sendMail<span style="color: #66cc66;">&#40;</span>Notification.java:<span style="color: #cc66cc;">116</span><span style="color: #66cc66;">&#41;</span>
        at com.approachingpi.store.order.Notification.run<span style="color: #66cc66;">&#40;</span>Notification.java:<span style="color: #cc66cc;">56</span><span style="color: #66cc66;">&#41;</span>
        at java.lang.Thread.run<span style="color: #66cc66;">&#40;</span>Thread.java:<span style="color: #cc66cc;">595</span><span style="color: #66cc66;">&#41;</span></pre></p>
<p>It looks like javamail sends that along as blank as well.  weird.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wirelust.com/2007/12/09/postfix-javamail-disagreement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
