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

<channel>
	<title>OSGi + Spring + iBatis blog</title>
	<atom:link href="http://osgiknowledge.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://osgiknowledge.wordpress.com</link>
	<description>Let's see how far we can push it</description>
	<lastBuildDate>Wed, 23 Jul 2008 07:21:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='osgiknowledge.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>OSGi + Spring + iBatis blog</title>
		<link>http://osgiknowledge.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://osgiknowledge.wordpress.com/osd.xml" title="OSGi + Spring + iBatis blog" />
	<atom:link rel='hub' href='http://osgiknowledge.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Eclipse Problem Figured Out</title>
		<link>http://osgiknowledge.wordpress.com/2008/07/23/eclipse-problem-figured-out/</link>
		<comments>http://osgiknowledge.wordpress.com/2008/07/23/eclipse-problem-figured-out/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 06:09:55 +0000</pubDate>
		<dc:creator>alexaggregate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://osgiknowledge.wordpress.com/?p=13</guid>
		<description><![CDATA[I&#8217;ve been able to find why Eclipse doesn&#8217;t update the classes for OSGi in some cases. To find when is starts going wrong. I got the hint here at Apache Felix FAQ. I was using cross-references. My bundles: DAOLayer was using com.ak.domain.WebSite and exporting com.ak.dao.WebSiteDAO MainLayer was using com.ak.dao.WebSiteDAO and exporting com.ak.domain.WebSite So when I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=osgiknowledge.wordpress.com&amp;blog=4292722&amp;post=13&amp;subd=osgiknowledge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been able to find why Eclipse doesn&#8217;t update the classes for OSGi in some cases. To find <em>when</em> is starts going wrong. I got the hint <a href="http://felix.apache.org/site/apache-felix-osgi-faq.html" target="_blank">here</a> at Apache Felix FAQ.</p>
<p>I was using cross-references. My bundles:</p>
<p>DAOLayer was using com.ak.domain.WebSite and exporting com.ak.dao.WebSiteDAO</p>
<p>MainLayer was using com.ak.dao.WebSiteDAO and exporting com.ak.domain.WebSite</p>
<p>So when I remove this cross-reference, it starts updating classes. This, however, doesn&#8217;t happen in all cases. Seems like it stops working only when the classes in cross-referenced packages also reference each other.</p>
<p>Over all, here are the conclusions:</p>
<p>1. Don&#8217;t cross-reference packages that rely on each other. Maybe it&#8217;s OSGi problem.</p>
<p>2. If bundle A has package package1 and bundle B has package with the same name (package1), then bundle B can not export this package for bundle A to use.</p>
<p>3. !!IMPORTANT!! Let&#8217;s say we&#8217;ve got BundleA and BundleB. If BundleB uses SomeClass in a method that is called by BundleA (even if BundleA has no idea of SomeClass), you need to explicitly export package of SomeClass in BundleB.</p>
<p>Again,</p>
<p>IF (</p>
<p>BundleB / package com.Big / BigClass has method:</p>
<p>public void printSmth () { new com.small.SomeClass(); }</p>
<p>AND BundleA imports com.Big in order to call com.Big.BigClass.printSmth(),</p>
<p>) THEN {</p>
<p>BundleB has to export com.small package</p>
<p>}</p>
<p>&#8212; doesn&#8217;t make too much sense, but this is how it works for me.</p>
<p>To fix all the problems, I moved Website class to DAOLayer. I know its better place is in MainLayer, but it won&#8217;t work this way. They (WebSite and WebSiteDAO) are too tightly coupled and therefore don&#8217;t work if they&#8217;re in different bundles.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/osgiknowledge.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/osgiknowledge.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/osgiknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/osgiknowledge.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/osgiknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/osgiknowledge.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/osgiknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/osgiknowledge.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/osgiknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/osgiknowledge.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/osgiknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/osgiknowledge.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/osgiknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/osgiknowledge.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/osgiknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/osgiknowledge.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=osgiknowledge.wordpress.com&amp;blog=4292722&amp;post=13&amp;subd=osgiknowledge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://osgiknowledge.wordpress.com/2008/07/23/eclipse-problem-figured-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e3db7e494f08fcabd2925957473e973?s=96&#38;d=identicon" medium="image">
			<media:title type="html">alexaggregate</media:title>
		</media:content>
	</item>
		<item>
		<title>Current Problems</title>
		<link>http://osgiknowledge.wordpress.com/2008/07/22/current-problems/</link>
		<comments>http://osgiknowledge.wordpress.com/2008/07/22/current-problems/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 14:11:42 +0000</pubDate>
		<dc:creator>alexaggregate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://osgiknowledge.wordpress.com/?p=9</guid>
		<description><![CDATA[First off, I&#8217;m getting &#8216;com.ibatis.sqlmap.client.SqlMapException: There is no statement named getWebsite in this SqlMap.&#8217; &#8211; even though there is one. Even if I try to call it with namespace, like WebSite.getWebSite. I also tried &#8216;allWebsites&#8217; to get a java.util.List. Second thing, somehow I can&#8217;t update the files in Eclipse. When I change my WebSiteDAOImpl with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=osgiknowledge.wordpress.com&amp;blog=4292722&amp;post=9&amp;subd=osgiknowledge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>First off, I&#8217;m getting &#8216;com.ibatis.sqlmap.client.SqlMapException: There is no statement named getWebsite in this SqlMap.&#8217; &#8211; even though there is one. Even if I try to call it with namespace, like WebSite.getWebSite. I also tried &#8216;allWebsites&#8217; to get a java.util.List.</p>
<p>Second thing, somehow I can&#8217;t update the files in Eclipse. When I change my WebSiteDAOImpl with iBatis connection, and Run the project, I keep hearing same old &#8216;com.ibatis.sqlmap.client.SqlMapException: There is no statement named getWebsite in this SqlMap.&#8217; Even when I comment all of the lines. So it&#8217;s obvious that the class just doesn&#8217;t get reloaded (I tried OSGi command &#8216;shutdown&#8217;, stopping the execution, reopening Eclipse, restarting Linux).</p>
<p>Then I tried deleting &#8216;bin&#8217; folder, so that it sees I don&#8217;t have classes and just remakes them. What it says is &#8216;i don&#8217;t see your classes&#8217;.</p>
<p>________________________________________________________</p>
<p>Short note about Eclipse.</p>
<p>1. Sometimes it just &#8216;loses&#8217; your classes and says it doesn&#8217;t see them, when in reality they&#8217;re in place.</p>
<p>2. Sometimes its MANIFEST editor won&#8217;t save any changes. What helps is reopening Eclipse</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/osgiknowledge.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/osgiknowledge.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/osgiknowledge.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/osgiknowledge.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/osgiknowledge.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/osgiknowledge.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/osgiknowledge.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/osgiknowledge.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/osgiknowledge.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/osgiknowledge.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/osgiknowledge.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/osgiknowledge.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/osgiknowledge.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/osgiknowledge.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/osgiknowledge.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/osgiknowledge.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=osgiknowledge.wordpress.com&amp;blog=4292722&amp;post=9&amp;subd=osgiknowledge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://osgiknowledge.wordpress.com/2008/07/22/current-problems/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e3db7e494f08fcabd2925957473e973?s=96&#38;d=identicon" medium="image">
			<media:title type="html">alexaggregate</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding iBatis to OSGi application</title>
		<link>http://osgiknowledge.wordpress.com/2008/07/22/adding-ibatis-to-osgi-application/</link>
		<comments>http://osgiknowledge.wordpress.com/2008/07/22/adding-ibatis-to-osgi-application/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 14:07:16 +0000</pubDate>
		<dc:creator>alexaggregate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://osgiknowledge.wordpress.com/?p=7</guid>
		<description><![CDATA[Last blog post leaves us with working JDBC/Spring/OSGi. Now we want to sweet it with iBatis. 1. I used the same way as with &#8216;mysql-connector&#8217; to add iBatis library jar (it&#8217;s the only one we need). So, again, I added it to JARs folder, then to bundle&#8217;s classpath and exported add com.ibatis packages. 2. Then [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=osgiknowledge.wordpress.com&amp;blog=4292722&amp;post=7&amp;subd=osgiknowledge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last blog post leaves us with working JDBC/Spring/OSGi. Now we want to sweet it with iBatis.</p>
<p>1. I used the same way as with &#8216;mysql-connector&#8217; to add iBatis library jar (it&#8217;s the only one we need). So, again, I added it to JARs folder, then to bundle&#8217;s classpath and exported add com.ibatis packages.</p>
<p>2. Then what goes inside of iBatis folder:</p>
<p>File 1. Configuration file: ibatisconfig.xml:</p>
<p><em>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;!DOCTYPE sqlMapConfig<br />
PUBLIC &#8220;-//ibatis.apache.org//DTD SQL Map Config 2.0//EN&#8221;<br />
&#8220;http://ibatis.apache.org/dtd/sql-map-config-2.dtd&#8221;&gt;</p>
<p>&lt;sqlMapConfig&gt;</p>
<p>&lt;settings useStatementNamespaces=&#8221;true&#8221;/&gt;</p>
<p>&lt;transactionManager type=&#8221;JDBC&#8221;&gt;<br />
&lt;dataSource type=&#8221;SIMPLE&#8221;&gt;<br />
&lt;property name=&#8221;JDBC.Driver&#8221; value=&#8221;com.mysql.jdbc.Driver&#8221;/&gt;<br />
&lt;property name=&#8221;JDBC.ConnectionURL&#8221;<br />
value=&#8221;jdbc:mysql://localhost/RELATE&#8221;/&gt;<br />
&lt;property name=&#8221;JDBC.Username&#8221; value=&#8221;root&#8221;/&gt;<br />
&lt;property name=&#8221;JDBC.Password&#8221; value=&#8221;123&#8243;/&gt;<br />
&lt;/dataSource&gt;<br />
&lt;/transactionManager&gt;</p>
<p>&lt;sqlMap url=&#8221;file:///home/ayarmula/projects/osgi/DAOLayer/ibatis/mapping/WebSite.xml&#8221;/&gt;</p>
<p>&lt;/sqlMapConfig&gt;<br />
</em></p>
<p>File 2. Mapping: WebSite.xml</p>
<p><em>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243; ?&gt;<br />
&lt;!DOCTYPE sqlMap<br />
PUBLIC &#8220;-//ibatis.apache.org//DTD SQL Map 2.0//EN&#8221;<br />
&#8220;http://ibatis.apache.org/dtd/sql-map-2.dtd&#8221;&gt;<br />
&lt;sqlMap namespace=&#8221;WebSite&#8221;&gt;</p>
<p>&lt;resultMap class=&#8221;com.ak.domain.WebSite&#8221; id=&#8221;webSiteResultMap&#8221;&gt;<br />
&lt;result property=&#8221;id&#8221; column=&#8221;ID&#8221;<br />
javaType=&#8221;java.lang.Long&#8221; /&gt;<br />
&lt;result property=&#8221;displayName&#8221; column=&#8221;DISPLAY_NAME&#8221;<br />
javaType=&#8221;java.lang.String&#8221; /&gt;</p>
<p>&lt;/resultMap&gt;</p>
<p>&lt;select id=&#8221;getWebsite&#8221; resultClass=&#8221;com.ak.domain.WebSite&#8221; resultMap=&#8221;webSiteResultMap&#8221;&gt;<br />
select ID as ID,<br />
DISPLAY_NAME as displayName<br />
from WEBSITE<br />
where ID = #value#<br />
&lt;/select&gt;<br />
&lt;/sqlMap&gt;</em></p>
<p>3. So having this set there&#8217;s one thing left, use it from the application.</p>
<p>First of all, for Eclipse under Linux, resource &#8216;.&#8217; folder is home/user. So include that in paths.</p>
<p>In SomeDAOImpl I tried using</p>
<p>Reader reader = Resources.getResourceAsReader(&#8220;projects/osgi/DAOLayer/ibatis/ibatisconfig.xml&#8221;);<br />
SqlMapClient sqlMapper =<br />
SqlMapClientBuilder.buildSqlMapClient(reader);<br />
reader.close();<br />
Object ws =<br />
sqlMapper.queryForObject(&#8220;WebSite.getWebsite&#8221;, new Integer(108));</p>
<p>but it kept telling that the resource was incorrect. I could get it working by:</p>
<p>Reader reader = new BufferedReader(new FileReader(new File(&#8220;projects/osgi/DAOLayer/ibatis/ibatisconfig.xml&#8221;)));</p>
<p>Also, there&#8217;s a trick in path to mapping file. As you can see about in ibatisconfig.xml, it only worked for me as &lt;sqlMap url=&#8221;file:///home/ayarmula/projects/osgi/DAOLayer/ibatis/mapping/WebSite.xml&#8221;/&gt;.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/osgiknowledge.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/osgiknowledge.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/osgiknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/osgiknowledge.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/osgiknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/osgiknowledge.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/osgiknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/osgiknowledge.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/osgiknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/osgiknowledge.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/osgiknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/osgiknowledge.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/osgiknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/osgiknowledge.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/osgiknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/osgiknowledge.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=osgiknowledge.wordpress.com&amp;blog=4292722&amp;post=7&amp;subd=osgiknowledge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://osgiknowledge.wordpress.com/2008/07/22/adding-ibatis-to-osgi-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e3db7e494f08fcabd2925957473e973?s=96&#38;d=identicon" medium="image">
			<media:title type="html">alexaggregate</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick Start OSGi/Spring/JDBC</title>
		<link>http://osgiknowledge.wordpress.com/2008/07/22/quick-start-osgispringjdbc/</link>
		<comments>http://osgiknowledge.wordpress.com/2008/07/22/quick-start-osgispringjdbc/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 13:59:14 +0000</pubDate>
		<dc:creator>alexaggregate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://osgiknowledge.wordpress.com/?p=5</guid>
		<description><![CDATA[Ok, so here&#8217;s what we basically do to start OSGi/Spring/JDBC: 1. Create 2 OSGi bundles, Main and DAO. 2. In DAO, create com.you.dao.SomeDAO interface and com.you.dao.impl.SomeDAOImpl. DAO will have DataSource param and some JDBC stuff that it does. 3. In META-INF/MANIFEST.mf add com.you.dao to export packages. 4. In META-INF/spring (create it) create 2 xml files, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=osgiknowledge.wordpress.com&amp;blog=4292722&amp;post=5&amp;subd=osgiknowledge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ok, so here&#8217;s what we basically do to start OSGi/Spring/JDBC:</p>
<p>1. Create 2 OSGi bundles, Main and DAO.</p>
<p>2. In DAO, create com.you.dao.SomeDAO interface and com.you.dao.impl.SomeDAOImpl. DAO will have DataSource param and some JDBC stuff that it does.</p>
<p>3. In META-INF/MANIFEST.mf add com.you.dao to export packages.</p>
<p>4. In META-INF/spring (create it) create 2 xml files, one will create SomeDAOImpl (named &#8216;someDAO&#8217;) and map DataSource to it (it includes DataSource bean definition as well, to be quick), second one will expose SomeDAOImpl under its interface SomeDAO to OSGi. Like:</p>
<p><em> &lt;osgi:service id=&#8221;someDAOOSGiService&#8221; ref=&#8221;someDAO&#8221;<br />
interface=&#8221;com.you.dao.SomeDAO&#8221;&gt;<br />
&lt;/osgi:service&gt;</em></p>
<p>5. In Main, create some class (MainClass) and a parameter for SomeDAO. We&#8217;ll use it later</p>
<p>6. In Main, make sure META-INF/MANIFEST.mf imports com.you.dao package. Also, META-INF/spring of this bundle needs to &#8216;catch&#8217; SomeDAO:</p>
<p><em>&lt;osgi:reference id=&#8221;someDAOService&#8221; interface=&#8221;com.you.dao.SomeDAO&#8221;/&gt;</em></p>
<p>Also, we need to link this bean to HelloClass like this:</p>
<p><em>&lt;bean name=&#8221;helloClass&#8221; class=&#8221;&#8230;HelloClass&#8221; init-method=&#8221;start&#8221;&gt;<br />
</em></p>
<p><em>&lt;property name=&#8221;webSiteDAO&#8221; ref=&#8221;webSiteDAOService&#8221;/&gt;<br />
</em></p>
<p><em>&lt;/bean&gt;</em></p>
<p>7. Now in helloClass we can create &#8220;public void start()&#8221; method and use SomeDAO.</p>
<p>8. Dependencies. Just like it&#8217;s written <a href="http://www.javaworld.com/javaworld/jw-04-2008/jw-04-osgi2.html?page=2" target="_blank">here</a>, but including my comment in previous post. Don&#8217;t forget to create New Project &#8211; Plug-in Development &#8211; Plug-in From existing JAR archive and include commons-logging.jar there.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/osgiknowledge.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/osgiknowledge.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/osgiknowledge.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/osgiknowledge.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/osgiknowledge.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/osgiknowledge.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/osgiknowledge.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/osgiknowledge.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/osgiknowledge.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/osgiknowledge.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/osgiknowledge.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/osgiknowledge.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/osgiknowledge.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/osgiknowledge.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/osgiknowledge.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/osgiknowledge.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=osgiknowledge.wordpress.com&amp;blog=4292722&amp;post=5&amp;subd=osgiknowledge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://osgiknowledge.wordpress.com/2008/07/22/quick-start-osgispringjdbc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e3db7e494f08fcabd2925957473e973?s=96&#38;d=identicon" medium="image">
			<media:title type="html">alexaggregate</media:title>
		</media:content>
	</item>
		<item>
		<title>Eclipse configuration for JDBC/Spring</title>
		<link>http://osgiknowledge.wordpress.com/2008/07/22/eclipse-configuration-for-jdbcspring/</link>
		<comments>http://osgiknowledge.wordpress.com/2008/07/22/eclipse-configuration-for-jdbcspring/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 13:44:06 +0000</pubDate>
		<dc:creator>alexaggregate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://osgiknowledge.wordpress.com/?p=3</guid>
		<description><![CDATA[The article from JavaWorld woulda been just fine, if it hadn&#8217;t left out some details: 1. Spring DM (neither 1.0.2 nor the latest 1.1.0) doesn&#8217;t have spring-jdbc, spring-tx packages in it. They&#8217;re available at Spring website and then you can import them just like every other package (Import &#8211; Plug-in Development &#8211; Plug-ins and Fragments). [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=osgiknowledge.wordpress.com&amp;blog=4292722&amp;post=3&amp;subd=osgiknowledge&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a title="article" href="http://www.javaworld.com/javaworld/jw-04-2008/jw-04-osgi2.html?page=7" target="_blank">article</a> from JavaWorld woulda been just fine, if it hadn&#8217;t left out some details:</p>
<p>1. Spring DM (neither 1.0.2 nor the latest 1.1.0) doesn&#8217;t have spring-jdbc, spring-tx packages in it. They&#8217;re available at Spring website and then you can import them just like every other package (Import &#8211; Plug-in Development &#8211; Plug-ins and Fragments). (page 2)</p>
<p>2. You can use log4j from Spring DM, works for me (page 2).</p>
<p>3. The last page tells us to put &#8220;mysql connector&#8221; to a &#8216;JARs folder&#8217; folder, and then add it to classpath in MANIFEST &#8211; Runtime. What it doesn&#8217;t tell is that you also need to go to MANIFEST &#8211; Exported Packages &#8211; Add and add com.mysql.jdbc (as well as other packages available) (page 7).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/osgiknowledge.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/osgiknowledge.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/osgiknowledge.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/osgiknowledge.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/osgiknowledge.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/osgiknowledge.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/osgiknowledge.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/osgiknowledge.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/osgiknowledge.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/osgiknowledge.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/osgiknowledge.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/osgiknowledge.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/osgiknowledge.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/osgiknowledge.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/osgiknowledge.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/osgiknowledge.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=osgiknowledge.wordpress.com&amp;blog=4292722&amp;post=3&amp;subd=osgiknowledge&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://osgiknowledge.wordpress.com/2008/07/22/eclipse-configuration-for-jdbcspring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4e3db7e494f08fcabd2925957473e973?s=96&#38;d=identicon" medium="image">
			<media:title type="html">alexaggregate</media:title>
		</media:content>
	</item>
	</channel>
</rss>
