Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CC4AE9140 for ; Wed, 21 Mar 2012 10:10:38 +0000 (UTC) Received: (qmail 74406 invoked by uid 500); 21 Mar 2012 10:10:38 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 74359 invoked by uid 500); 21 Mar 2012 10:10:38 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 74351 invoked by uid 99); 21 Mar 2012 10:10:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Mar 2012 10:10:38 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of njbartlett@gmail.com designates 74.125.82.177 as permitted sender) Received: from [74.125.82.177] (HELO mail-we0-f177.google.com) (74.125.82.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Mar 2012 10:10:31 +0000 Received: by werp11 with SMTP id p11so1070564wer.22 for ; Wed, 21 Mar 2012 03:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type; bh=GKb+yFVwJ3HO9Pq0MOru0HRQ3hJ6HObH5FnAGcBWjGc=; b=VJFqhpifPJZ7UJf3WO8N/0LwSFRQS+AH92bJM0TUar/u6E7jZxYN303Ln796egS41C ChddAJkvYiiQZon7RJYzVUt+34f4JITtivvKEEfKxOYv+UcxMqWw0XBL3BrX0RQkF8FJ 077Dvnq7XGLszfBoKrBixR2ey6ELoqgjcLrU1F1rk1JuTwnSYdpeUI4RqXb5c+rBXUfQ VTSsGK+mu7oiKujFGjZGYmwF2k8ysQeOHlTFMG58af/tWc47sZiJ7lW3cvsV++STZ4FX FZ+p+yU+Iesog/2dQxMM2CrZVJxNF1T+f5jDxRSlVB6TExdzLXo4HbHyeGQEljsHfhHL I9gg== Received: by 10.216.139.67 with SMTP id b45mr2228306wej.0.1332324610756; Wed, 21 Mar 2012 03:10:10 -0700 (PDT) Received: from Applicative-3.local (cpc1-finc4-0-0-cust612.4-2.cable.virginmedia.com. [213.106.170.101]) by mx.google.com with ESMTPS id e6sm3353012wix.8.2012.03.21.03.10.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Mar 2012 03:10:09 -0700 (PDT) Date: Wed, 21 Mar 2012 10:10:04 +0000 From: Neil Bartlett To: users@felix.apache.org Message-ID: In-Reply-To: References: <4F6319A6.2060109@die-schneider.net> <4F64D646.2050708@die-schneider.net> <4F2F925C53AC43E5BF3B1F2F3C425082@gmail.com> <4F687468.3070700@die-schneider.net> Subject: Re: Connect a bundle to a data base X-Mailer: sparrow 1.5 (build 1043.1) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="4f69a8fc_66ef438d_6251" X-Virus-Checked: Checked by ClamAV on apache.org --4f69a8fc_66ef438d_6251 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline You DO need to import that package "javax.sql" (the rule is that you import ALL packages you use except java.*, e.g. you don't import java.lang, java.io, java.util etc). This specific package will be exported by the System Bundle, i.e. the OSGi framework itself. The same is true for all the javax.* packages that are normally offered by the JRE. Regards, Neil On Wednesday, 21 March 2012 at 10:02, elMateo wrote: > I'm working with the code of Neil and I have a problem: Felix show a > java.lang.ClassNotFoundException: javax.sql.DataSource not found > > I import the javax.sql package in my manifest file but I don't know if I > need a bundle with this package in my Apache Felix. If I need a bundle with > this, what is this bundle? I don't find a bundle called javax.sql and I > have imported the MySQL connector/J bundle too. > > On Tue, Mar 20, 2012 at 1:13 PM, Christian Schneider < > chris@die-schneider.net (mailto:chris@die-schneider.net)> wrote: > > > Absolutely. That is what I wanted to say in my last post. The only problem > > with this aproach is that you hardcode the database type in your bridge > > bundle. > > ( At least if you dont want to mess with the classloader). > > > > As you probably will not have that many database types in one use case > > this is probably ok though. > > > > Christian > > > > > > Am 20.03.2012 11:27, schrieb Neil Bartlett: > > > > You certainly don't need Glassfish... you don't need Karaf or Blueprint > > > either. > > > > > > There is a tendency on many mailing lists to respond to beginner > > > questions with answers like "you can do this with product X" where X > > > happens to be the product that the person is working on or selling. Those > > > products may indeed add value but they are rarely the only or the simplest > > > way to achieve what you want! > > > > > > To register a DataSource service with pure OSGi, it's as simple as > > > writing this code in a BundleActivator (using MySQL as an example): > > > > > > DataSource ds = new com.mysql.jdbc.jdbc2.optional.**MysqlDataSource(); > > > context.registerService(**DataSource.class.getName(), ds, null); > > > > > > This would be your "bridge" bundle that you deploy alongside the MySQL > > > driver JAR. For other database types, write a different 2 lines of code and > > > deploy that bundle instead. > > > > > > Kind regards, > > > Neil > > > > > > > -- > > Christian Schneider > > http://www.liquid-reality.de > > > > Open Source Architect > > Talend Application Integration Division http://www.talend.com > > > > > > ------------------------------**------------------------------**--------- > > To unsubscribe, e-mail: users-unsubscribe@felix.**apache.org > > For additional commands, e-mail: users-help@felix.apache.org (mailto:users-help@felix.apache.org) > > > > > --4f69a8fc_66ef438d_6251--