<?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>Dushyanth Jyothi &#187; Java</title>
	<atom:link href="http://dushi.co.uk/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://dushi.co.uk</link>
	<description>Me, My Life and the Binary</description>
	<lastBuildDate>Thu, 22 Jul 2010 21:14:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Error: Path for project must have only one segment</title>
		<link>http://dushi.co.uk/09/07/2009/error-path-for-project-must-have-only-one-segment/</link>
		<comments>http://dushi.co.uk/09/07/2009/error-path-for-project-must-have-only-one-segment/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 17:58:32 +0000</pubDate>
		<dc:creator>Dushyanth Jyothi</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://dushi.co.uk/?p=34</guid>
		<description><![CDATA[Error: Path for project must have only one segmentEven Though google shows 995,000 pages containg the text &#8220;Path for project must have only one segment&#8221; &#8211; None of them really explains what this error mean &#8211; Except if you look at the source code of WorkspaceRoot class, particularly &#8216;getProject&#8217; method:This problem usually occurs when you [...]]]></description>
			<content:encoded><![CDATA[Error: Path for project must have only one segment<br /><br />Even Though google shows 995,000 pages containg the text &#8220;Path for project must have only one segment&#8221; &#8211; None of them really explains what this error mean &#8211; Except if you look at the source code of WorkspaceRoot class, particularly &#8216;getProject&#8217; method:<br /><br />This problem usually occurs when you try to access a project  name/path,etc, when it is not avialable or you might have forget to instantiate the IProject object or try to  instantiate the IProject with different name.<br /><br />Solution: Have a look at your code where you are calling <pre>getProject. </pre>Check names, paths are called correctly.<br /><br /><pre class="devcodeblock" title="Progress"><table class="devcodetools"><tbody><tr><td>&nbsp;Progress&nbsp;|&nbsp;</td><td style="background-image:url('http://dushi.co.uk/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard2" src="http://dushi.co.uk/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=2&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">01</td><td class="devcodelinesarea"><pre class="devcode devcodeline">public IProject getProject<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff; font-weight: <span style="color: #006600;">bold</span>;">STRING</span> JavaDoc <span style="color: #0000ff;">NAME</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">02</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">      <span style="color: #66cc66;">//</span><span style="color: #0000ff; font-weight: <span style="color: #006600;">bold</span>;">FIRST</span> check our project <span style="color: #0000ff;">CACHE</span></pre></td></tr><tr><td class="devcodelines" width="1%">03</td><td class="devcodelinesarea"><pre class="devcode devcodeline"> Project result <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span>Project<span style="color: #66cc66;">&#41;</span> projectTable<span style="color: #66cc66;">.</span>get<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">NAME</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">04</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">       <span style="color: #0000ff; font-weight: <span style="color: #006600;">bold</span>;">IF</span> <span style="color: #66cc66;">&#40;</span>result <span style="color: #66cc66;">==</span> null<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></pre></td></tr><tr><td class="devcodelines" width="1%">05</td><td class="devcodelinesarea"><pre class="devcode devcodeline">            IPath projectPath <span style="color: #66cc66;">=</span> <span style="color: #993333;">NEW</span> Path<span style="color: #66cc66;">&#40;</span>null<span style="color: #66cc66;">,</span> <span style="color: #0000ff;">NAME</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">.</span>makeAbsolute<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">06</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">          <span style="color: #0000ff; font-weight: <span style="color: #006600;">bold</span>;">STRING</span> JavaDoc <span style="color: #0000ff; font-weight: <span style="color: #006600;">bold</span>;">MESSAGE</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;Path for project must have only one segment.&quot;</span><span style="color: #66cc66;">;</span> <span style="color: #66cc66;">//$</span>NON<span style="color: #66cc66;">-</span>NLS<span style="color: #66cc66;">-</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">$</span></pre></td></tr><tr><td class="devcodelines" width="1%">07</td><td class="devcodelinesarea"><pre class="devcode devcodeline"> Assert<span style="color: #66cc66;">.</span>isLegal<span style="color: #66cc66;">&#40;</span>projectPath<span style="color: #66cc66;">.</span>segmentCount<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">==</span> ICoreConstants<span style="color: #66cc66;">.</span>PROJECT_SEGMENT_LENGTH<span style="color: #66cc66;">,</span> <span style="color: #0000ff; font-weight: <span style="color: #006600;">bold</span>;">MESSAGE</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">08</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">            <span style="color: #66cc66;">//</span>try <span style="color: #0000ff; font-weight: <span style="color: #006600;">bold</span>;">TO</span> <span style="color: #0000ff; font-weight: <span style="color: #006600;">bold</span>;">GET</span> the project <span style="color: #0000ff; font-weight: <span style="color: #006600;">bold</span>;">USING</span> a canonical <span style="color: #0000ff;">NAME</span></pre></td></tr><tr><td class="devcodelines" width="1%">09</td><td class="devcodelinesarea"><pre class="devcode devcodeline"> <span style="color: #0000ff; font-weight: <span style="color: #006600;">bold</span>;">STRING</span> JavaDoc canonicalName <span style="color: #66cc66;">=</span> projectPath<span style="color: #66cc66;">.</span>lastSegment<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">10</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">            result <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span>Project<span style="color: #66cc66;">&#41;</span> projectTable<span style="color: #66cc66;">.</span>get<span style="color: #66cc66;">&#40;</span>canonicalName<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></td></tr><tr><td class="devcodelines" width="1%">11</td><td class="devcodelinesarea"><pre class="devcode devcodeline">             <span style="color: #0000ff; font-weight: <span style="color: #006600;">bold</span>;">IF</span> <span style="color: #66cc66;">&#40;</span>result <span style="color: #66cc66;">!=</span> null<span style="color: #66cc66;">&#41;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">12</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">                 <span style="color: #993333;">RETURN</span> result<span style="color: #66cc66;">;</span></pre></td></tr><tr><td class="devcodelines" width="1%">13</td><td class="devcodelinesarea"><pre class="devcode devcodeline">            result <span style="color: #66cc66;">=</span> <span style="color: #993333;">NEW</span> Project<span style="color: #66cc66;">&#40;</span>projectPath<span style="color: #66cc66;">,</span> workspace<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">14</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">            projectTable<span style="color: #66cc66;">.</span>put<span style="color: #66cc66;">&#40;</span>canonicalName<span style="color: #66cc66;">,</span> result<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span></pre></td></tr><tr><td class="devcodelines" width="1%">15</td><td class="devcodelinesarea"><pre class="devcode devcodeline">       <span style="color: #66cc66;">&#125;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">16</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">         <span style="color: #993333;">RETURN</span> result<span style="color: #66cc66;">;</span></pre></td></tr><tr><td class="devcodelines" width="1%">17</td><td class="devcodelinesarea"><pre class="devcode devcodeline">     <span style="color: #66cc66;">&#125;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">18</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">&nbsp;</pre></td></tr><tr><td class="devcodelines" width="1%">19</td><td class="devcodelinesarea"><pre class="devcode devcodeline">&nbsp;</pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">20</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"></pre></td></tr></table></div></pre><div id="TixyyLink" style="border: medium none; overflow: hidden; color: #000000; background-color: transparent; text-align: left; text-decoration: none;">Read more: "Java > Open Source Codes > org > eclipse > core > internal > resources > WorkspaceRoot _ Java API By Example, From Geeks To Geeks." - <a href="http://kickjava.com/src/org/eclipse/core/internal/resources/WorkspaceRoot.java.htm#ixzz0H1TWbu8u&#038;A">http://kickjava.com/src/org/eclipse/core/internal/resources/WorkspaceRoot.java.htm#ixzz0H1TWbu8u&#038;A</a></div>]]></content:encoded>
			<wfw:commentRss>http://dushi.co.uk/09/07/2009/error-path-for-project-must-have-only-one-segment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
