<?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>wakka.net</title>
	<atom:link href="http://wakka.net/feed" rel="self" type="application/rss+xml" />
	<link>http://wakka.net</link>
	<description>stuff google didn't know about java and unix</description>
	<lastBuildDate>Sat, 10 Jan 2009 19:10:23 +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>easily add files to META-INF in NetBeans</title>
		<link>http://wakka.net/archives/36</link>
		<comments>http://wakka.net/archives/36#comments</comments>
		<pubDate>Sat, 10 Jan 2009 19:07:51 +0000</pubDate>
		<dc:creator>kcartmell</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://wakka.net/?p=36</guid>
		<description><![CDATA[These days when you find me working in Java, you&#8217;ll find me working in NetBeans. If I wanted to spend my time manually editing ant scripts, you&#8217;d probably find me working in vi instead. I needed to add a file to META-INF in my application jar a few days ago. NetBeans provides a META-INF folder [...]]]></description>
			<content:encoded><![CDATA[<p>These days when you find me working in Java, you&#8217;ll find me working in NetBeans. If I <em>wanted</em> to spend my time manually editing ant scripts, you&#8217;d probably find me working in vi instead.<br/><br/></p>
<p>I needed to add a file to META-INF in my application jar a few days ago. NetBeans provides a META-INF folder in the project window for web applications, but not for standalone java applications. There is a lot of documentation for this specific problem that will help you edit your build script to get this done but for something so basic I prefer a simpler solution.<br/><br/></p>
<p>After some experimentation I found an alternative:</p>
<ol>
<li>open the project window</li>
<li>right-click on &#8220;Source Package&#8221;, click &#8220;New&#8221;, and choose &#8220;Folder&#8221; under the &#8220;Other&#8221; category</li>
<li>name the new folder &#8220;META-INF&#8221;</li>
<li>add files (.mailcap in my case) to this folder</li>
<li>build as usual</li>
<li>open your jar, browse to META-INF, and note that your files are now where they belong</li>
</ol>
<p><br/></p>
<p>Please note that I&#8217;m using NetBeans 6.5, and that this method could suddenly stop working in some future version of NetBeans if the build process changes dramatically.<br/><br/></p>
<p>If you have an alternative to this process that does not require build script modification, I would very much like to hear from you!</p>
]]></content:encoded>
			<wfw:commentRss>http://wakka.net/archives/36/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Logged exception missing stack trace in Log4j?</title>
		<link>http://wakka.net/archives/34</link>
		<comments>http://wakka.net/archives/34#comments</comments>
		<pubDate>Sat, 10 Jan 2009 18:39:41 +0000</pubDate>
		<dc:creator>kcartmell</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://wakka.net/?p=34</guid>
		<description><![CDATA[Invoking error(exception); will not log the stack trace from exception. Invoking error(&#8220;message&#8221;,exception); will log the stack trace. If you&#8217;re only using error(), info(), warn(), and debug() to perform logging you&#8217;re missing out on a lot of valuable tools; take a moment to browse the Log4j API documentation for Category for details. Here&#8217;s a simple application [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>Invoking <strong>error</strong>(exception); <em>will not</em> log the stack trace from exception.</li>
<li>Invoking <strong>error</strong>(&#8220;message&#8221;,exception); <strong>will</strong> log the stack trace.</li>
</ul>
<p>If you&#8217;re only using error(), info(), warn(), and debug() to perform logging you&#8217;re missing out on a lot of valuable tools; take a moment to browse the <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Category.html" target="_blank">Log4j API documentation for Category</a> for details.</p>
<p>Here&#8217;s a simple application that illustrates this point&#8230;</p>
<div class="java" style="font-family:monospace;"><br />
<span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">net.wakka</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.log4j.Logger</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Log4jTest<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> Logger log <span style="color: #339933;">=</span> Logger.<span style="color: #006633;">getLogger</span><span style="color: #009900;">&#40;</span>Log4jTest.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;just a string&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> toString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;wakka&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> x <span style="color: #339933;">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;yellow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Anumberformatexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">NumberFormatException</span></a> e<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; log.<span style="color: #006633;">error</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; log.<span style="color: #006633;">error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;caught a number format exception&quot;</span>,e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #009900;">&#125;</span></div>
<p>Console output follows&#8230;</p>
<pre style="background-color:'gainsboro'">
[INFO] just a string
[INFO] wakka
[ERROR] java.lang.NumberFormatException: For input string: "yellow"
[ERROR] caught a number format exception
java.lang.NumberFormatException: For input string: "yellow"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
        at java.lang.Integer.parseInt(Integer.java:447)
        at java.lang.Integer.parseInt(Integer.java:497)
        at net.wakka.Log4jTest.main(Log4jTest.java:23)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://wakka.net/archives/34/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetBeans 6.5 &#8211; failed to create task or type copyfiles</title>
		<link>http://wakka.net/archives/29</link>
		<comments>http://wakka.net/archives/29#comments</comments>
		<pubDate>Mon, 24 Nov 2008 23:41:59 +0000</pubDate>
		<dc:creator>kcartmell</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://wakka.net/?p=29</guid>
		<description><![CDATA[Just upgraded to NetBeans 6.5 and encountered the following error when I tried to build my project: &#8220;Problem: failed to create task or type copyfiles&#8221;. Not much detail in that message, and I hate having to delve into the generated ant scripts. Turns out that I was missing &#8220;org-netbeans-modules-java-j2seproject-copylibtask.jar&#8221; from my ./lib/CopyLibs folder. Tossed it [...]]]></description>
			<content:encoded><![CDATA[<p>Just upgraded to NetBeans 6.5 and encountered the following error when I tried to build my project: &#8220;Problem: failed to create task or type copyfiles&#8221;. Not much detail in that message, and I hate having to delve into the generated ant scripts. Turns out that I was missing &#8220;org-netbeans-modules-java-j2seproject-copylibtask.jar&#8221; from my ./lib/CopyLibs folder. Tossed it back in there from a new project and I was back in business!</p>
]]></content:encoded>
			<wfw:commentRss>http://wakka.net/archives/29/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ErrorCodeIOException 525</title>
		<link>http://wakka.net/archives/12</link>
		<comments>http://wakka.net/archives/12#comments</comments>
		<pubDate>Sun, 23 Nov 2008 18:55:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OpenOffice]]></category>

		<guid isPermaLink="false">http://wakka.net/?p=12</guid>
		<description><![CDATA[OpenOffice error code 525 is undocumented. (There&#8217;s a calc err 525, but this is different.) I grabbed errcode.hxx from the OpenOffice 3.0 source code in which these error codes are defined, and did the following math&#8230; 525 decimal = 00000010 00001101 binary #define ERRCODE_AREA_SHIFT 13 #define ERRCODE_CLASS_SHIFT 8 so: 525 = 00000010 00001101 aaaccccc eeeeeeee [...]]]></description>
			<content:encoded><![CDATA[<p>OpenOffice error code 525 is undocumented. (There&#8217;s a calc err 525, but this is different.) I grabbed <a href="http://wakka.net/public_files/errcode.hxx">errcode.hxx</a> from the OpenOffice 3.0 source code in which these error codes are defined, and did the following math&#8230;<br />
<br/></p>
<pre>525 decimal = 00000010 00001101 binary

#define ERRCODE_AREA_SHIFT      13
#define ERRCODE_CLASS_SHIFT     8

so: 525 = 00000010 00001101
          aaaccccc eeeeeeee
    area = 0
    class = 2
    error = 13

#define ERRCODE_AREA_IO 	ERRCODE_AREA_TOOLS
#define ERRCODE_AREA_TOOLS	( 0UL &lt;&lt; ERRCODE_AREA_SHIFT )

#define ERRCODE_CLASS_GENERAL (2UL &lt;&lt; ERRCODE_CLASS_SHIFT)

#define ERRCODE_IO_GENERAL (13UL|ERRCODE_CLASS_GENERAL|ERRCODE_AREA_IO)</pre>
<p><br/><br />
&#8230;and there you have it. Error 525 is an error in the IO area of class GENERAL, specifically an IO_GENERAL error. The first time I encountered this error our instance of OpenOffice 3.0 was borked and had to be reinstalled. The second time I encountered this error the permissions were bad on a file that was the target of a loadComponentFromURL invocation. I doubt this helps anyone very much, but at least you don&#8217;t have to dig the silly thing out of the source code now, right? Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://wakka.net/archives/12/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Filters in OpenOffice 3.0</title>
		<link>http://wakka.net/archives/7</link>
		<comments>http://wakka.net/archives/7#comments</comments>
		<pubDate>Sun, 23 Nov 2008 18:08:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OpenOffice]]></category>

		<guid isPermaLink="false">http://wakka.net/?p=7</guid>
		<description><![CDATA[The OpenOffice developer&#8217;s wiki contains a listing of filters in version 2.3, but nothing for 3.0. This is rather annoying since one of the major features of 3.0 is support for Microsoft Office 2007 XML formats through several new filters. I wrote a quick Java UNO app that enumerated these filters and dumped them to [...]]]></description>
			<content:encoded><![CDATA[<p>The OpenOffice developer&#8217;s wiki contains a listing of filters in version 2.3, but nothing for 3.0. This is rather annoying since one of the major features of 3.0 is support for Microsoft Office 2007 XML formats through several new filters. I wrote a quick Java UNO app that enumerated these filters and dumped them to stdout, and that list is available to you below.</p>
<p><br/></p>
<p>Fun Fact: &#8220;vorlage&#8221; is German for &#8220;template&#8221;.</p>
<p><br/></p>
<pre>StarOffice XML (Writer)
PSD - Adobe Photoshop
calc_HTML_WebQuery
draw_png_Export
StarWriter 4.0
calc_StarOffice_XML_Calc_Template
StarOffice XML (Calc)
draw_jpg_Export
writer_globaldocument_StarOffice_XML_Writer_GlobalDocument
HTML (StarWriter)
Calc MS Excel 2007 XML Template
StarWriter 3.0 Vorlage/Template
StarWriter 4.0 Vorlage/Template
StarWriter 5.0 Vorlage/Template
WMF - MS Windows Metafile
Text (encoded) (StarWriter/GlobalDocument)
writer_web_HTML_help
DIF
HTML
draw_ppm_Export
StarDraw 3.0 Vorlage (StarImpress)
StarDraw 5.0 Vorlage (StarImpress)
MS Word 95 Vorlage
MS Word 97 Vorlage
MS PowerPoint 97 Vorlage
draw8
MS Excel 97 Vorlage/Template
RAS - Sun Rasterfile
HTML (StarCalc)
writer_StarOffice_XML_Writer_Template
chart8
draw_wmf_Export
StarMath 3.0
XPM
SGV - StarDraw 2.0
StarChart 4.0
writer8
draw_pgm_Export
MS Word 2003 XML
UOF presentation
StarMath 5.0
EMF - MS Windows Metafile
draw_tif_Export
MS Excel 5.0/95
draw_pbm_Export
MS Excel 95 (StarWriter)
UOF spreadsheet
StarWriter 3.0 (StarWriter/Web)
StarWriter 4.0 (StarWriter/Web)
StarWriter 5.0 (StarWriter/Web)
MS Excel 95
StarCalc 4.0
MS Excel 97
draw_emf_Export
Lotus 1-2-3 1.0 (WIN) (StarWriter)
SVM - StarView Metafile
impress_StarOffice_XML_Impress_Template
StarImpress 5.0
Lotus 1-2-3 1.0 (DOS) (StarWriter)
SGF - StarOffice Writer SGF
StarWriter 3.0 (StarWriter/GlobalDocument)
StarWriter 4.0 (StarWriter/GlobalDocument)
StarWriter 5.0 (StarWriter/GlobalDocument)
StarOffice XML (Math)
WordPerfect
JPG - JPEG
PocketWord File
StarWriter/Web 4.0 Vorlage/Template
draw_xpm_Export
draw8_template
MS Excel 4.0 Vorlage/Template
StarWriter/Web 5.0 Vorlage/Template
writerglobal8_HTML
Text (StarWriter/Web)
calc8_template
draw_bmp_Export
draw_PCD_Photo_CD_Base4
calc8
draw_flash_Export
Text - txt - csv (StarCalc)
MathType 3.x
PPM - Portable Pixelmap
StarImpress 5.0 (packed)
writerglobal8
Rich Text Format
StarDraw 5.0 (StarImpress)
StarOffice XML (Base)
StarWriter 1.0
writer_pdf_Export
Rich Text Format (StarCalc)
MS Word 2007 XML Template
impress8
impress_xpm_Export
impress_wmf_Export
impress_tif_Export
impress_svm_Export
impress_svg_Export
impress_ras_Export
impress_ppm_Export
impress_png_Export
impress_bmp_Export
impress_emf_Export
impress_eps_Export
impress_gif_Export
impress_jpg_Export
impress_met_Export
impress_pbm_Export
impress_pct_Export
impress_pdf_Export
impress_pgm_Export
DXF - AutoCAD Interchange
StarCalc 3.0 Vorlage/Template
StarCalc 4.0 Vorlage/Template
StarCalc 5.0 Vorlage/Template
StarWriter 3.0
writer8_template
Impress MS PowerPoint 2007 XML Template
impress8_draw
AportisDoc Palm DB
BibTeX_Writer
placeware_Export
MediaWiki_Web
StarOffice XML (Draw)
impress_StarOffice_XML_Draw
StarWriter 5.0
MS WinWord 6.0
Pocket Excel
StarWriter DOS
Text (encoded)
UOF text
writerglobal8_writer
MS Word 95
MS Word 97
Impress MS PowerPoint 2007 XML
TIF - Tag Image File
draw_pdf_Export
MS Excel 95 Vorlage/Template
writer_MIZI_Hwp_97
LaTeX_Writer
MS Excel 5.0 (StarWriter)
XHTML Impress File
PCX - Zsoft Paintbrush
impress_flash_Export
draw_gif_Export
dBase
draw_ras_Export
BMP - MS Windows
MS Excel 2003 XML
StarMath 2.0
StarChart 3.0
StarWriter 4.0/GlobalDocument
StarWriter 5.0/GlobalDocument
EPS - Encapsulated PostScript
StarMath 4.0
Calc MS Excel 2007 XML
StarOffice XML (Chart)
XHTML Writer File
Text
Calc MS Excel 2007 Binary
XHTML Calc File
CGM - Computer Graphics Metafile
StarChart 5.0
math_pdf_Export
MS PowerPoint 97
XBM - X-Consortium
StarDraw 3.0 Vorlage
StarDraw 5.0 Vorlage
draw_html_Export
StarCalc 1.0
MS Excel 5.0/95 Vorlage/Template
draw_PCD_Photo_CD_Base16
draw_PCD_Photo_CD_Base
writer_web_pdf_Export
writer_web_StarOffice_XML_Writer_Web_Template
StarCalc 3.0
MathML XML (Math)
StarImpress 4.0
Quattro Pro 6.0
StarDraw 3.0
StarCalc 5.0
MS Word 2007 XML
draw_pct_Export
PCT - Mac Pict
draw_met_Export
MS Excel 4.0
writerweb8_writer
T602Document
StarDraw 5.0
XHTML Draw File
writer_globaldocument_pdf_Export
MediaWiki
impress8_template
Lotus
MS Excel 4.0 (StarWriter)
TGA - Truevision TARGA
DocBook File
writerweb8_writer_template
GIF - Graphics Interchange
StarOffice XML (Base) Report Chart
draw_eps_Export
Text (encoded) (StarWriter/Web)
writer_web_StarOffice_XML_Writer
calc_pdf_Export
MS WinWord 5
PGM - Portable Graymap
draw_svg_Export
StarImpress 4.0 Vorlage
StarImpress 5.0 Vorlage
SYLK
StarOffice XML (Base) Report
MET - OS/2 Metafile
PNG - Portable Network Graphic
draw_StarOffice_XML_Draw_Template
StarOffice XML (Impress)
StarDraw 3.0 (StarImpress)
writer_globaldocument_StarOffice_XML_Writer
math8
PBM - Portable Bitmap
draw_svm_Export
StarWriter 2.0
impress_html_Export</pre>
]]></content:encoded>
			<wfw:commentRss>http://wakka.net/archives/7/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wakka, wakka, wakka!</title>
		<link>http://wakka.net/archives/1</link>
		<comments>http://wakka.net/archives/1#comments</comments>
		<pubDate>Sun, 23 Nov 2008 17:09:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wakka.net]]></category>

		<guid isPermaLink="false">http://wakka.net/?p=1</guid>
		<description><![CDATA[I&#8217;ve been stalking this domain since 2000. I&#8217;ve been meaning to start posting solutions to the various evil problems that I get paid to solve on a daily basis so that others may benefit and when I forget what happened and the same problem comes up three days later I can just refer back to [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>I&#8217;ve been stalking this domain since 2000.</li>
<li>I&#8217;ve been meaning to start posting solutions to the various evil problems that I get paid to solve on a daily basis so that others may benefit and when I forget what happened and the same problem comes up three days later I can just refer back to my notes.</li>
<li>Thank you, Mr. Mott, for infecting our minds with wakka. Oh, and all that technical training was neat too.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://wakka.net/archives/1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

