Return-Path: X-Original-To: apmail-karaf-user-archive@minotaur.apache.org Delivered-To: apmail-karaf-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E1647DA7B for ; Mon, 22 Oct 2012 12:15:26 +0000 (UTC) Received: (qmail 92691 invoked by uid 500); 22 Oct 2012 12:15:26 -0000 Delivered-To: apmail-karaf-user-archive@karaf.apache.org Received: (qmail 92662 invoked by uid 500); 22 Oct 2012 12:15:26 -0000 Mailing-List: contact user-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@karaf.apache.org Delivered-To: mailing list user@karaf.apache.org Received: (qmail 92648 invoked by uid 99); 22 Oct 2012 12:15:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 12:15:25 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bcanhome@googlemail.com designates 209.85.210.48 as permitted sender) Received: from [209.85.210.48] (HELO mail-da0-f48.google.com) (209.85.210.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 12:15:19 +0000 Received: by mail-da0-f48.google.com with SMTP id z8so1444491dad.21 for ; Mon, 22 Oct 2012 05:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=p7XgrZK8q+WA+VHOo22sZ8SMCm8+5dZ+GZPtoQVO55U=; b=rAXbWUFHjDgouQ9Sz+xCRL2kP5i3Fm/yDqRoowG/yXFEuol7Glr0hbkEv73UUfzmrQ Z4XjnOOu1SMB9bk7si6ZapCePbF+zBDWJZhPDrGW2ZjJue0wYV56FlNAywZ3uvj4OASg uzHUX+BNl3acVLFzbvJs5WOeuHlZX7J4uiGxSNiGdcxHDHG9TV+BJkDDpyCbP6iM/NXB FBd78NivZyd338t8DG8slPlMKBEp+iBQr0JTIO7YAWvup759CKgnOmdqAA9wyKarLmL3 dMzsr+2pdfAfWl2ryIOgv2DeRVuAYCHE9Q9tS/7XTiTyxRZl1/i6CjzEfmuVsg6Egbjp isRg== MIME-Version: 1.0 Received: by 10.66.81.138 with SMTP id a10mr25384133pay.53.1350908098251; Mon, 22 Oct 2012 05:14:58 -0700 (PDT) Received: by 10.67.1.170 with HTTP; Mon, 22 Oct 2012 05:14:58 -0700 (PDT) In-Reply-To: References: Date: Mon, 22 Oct 2012 14:14:58 +0200 Message-ID: Subject: Re: "The org.osgi.service.jdbc package is unavailable" after upgrading to Karaf 2.3.0 From: Achim Nierbeck To: user@karaf.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi Bengt, could you do a la, and try to see if one of your bundles got a "GracePeriod" in the blueprint column? Cause we have a rather awkward issue with blueprint during start-up, and I want to make sure it's either related/or not-related :) regards, Achim 2012/10/22 Bengt Rodehav : > Thanks for your reply Charles, > > Your're right I don't need the DataSourceFactory. I mistakenly thought that > the info message was connected to the problem with not finding the data > source via JNDI. Since everything has worked before (using Karaf 2.2.8) I > assumed that the feature descriptor in Karaf 2.3.0 lacked a bundle (that > exported the org.osgi.service.jdbc package). That's why I thought it was a > Karaf problem and not an Aries problem. > > So, I probably do not need the org.osgi.service.jdbc package - it was a > false lead. Still, I do have problems finding the data source via jndi. I > get: > > 2012-10-22 13:36:23,428 | ERROR | y/api/getEntries | container > | ntainer.unit.impl.JndiDataSource 85 | The DataSource > osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/filetransferhistoryjta) > required by bundle > se.digia.connect.services.filetransfer.history-domain/2.3.0.SNAPSHOT could > not be found. > javax.naming.NameNotFoundException: > osgi:service/javax.sql.DataSource/"(osgi.jndi.service.name=jdbc/filetransferhistoryjta)" > at > org.apache.aries.jndi.url.ServiceRegistryContext.lookup(ServiceRegistryContext.java:113)[139:org.apache.aries.jndi.url:1.0.0] > at > org.apache.aries.jndi.url.ServiceRegistryContext.lookup(ServiceRegistryContext.java:144)[139:org.apache.aries.jndi.url:1.0.0] > at > org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161)[137:org.apache.aries.jndi.core:1.0.0] > at javax.naming.InitialContext.lookup(InitialContext.java:392)[:1.6.0_32] > at > org.apache.aries.jpa.container.unit.impl.JndiDataSource.getDs(JndiDataSource.java:65)[134:org.apache.aries.jpa.container:1.0.0] > at > org.apache.aries.jpa.container.unit.impl.DelayedLookupDataSource.getConnection(DelayedLookupDataSource.java:36)[134:org.apache.aries.jpa.container:1.0.0] > at > org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:137)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:112)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:239)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:733)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDataSource(JDBCConfigurationImpl.java:872)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.jdbc.kernel.JDBCStoreManager.getDataSource(JDBCStoreManager.java:179)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setContext(JDBCStoreManager.java:162)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.jdbc.kernel.JDBCStoreManager.setContext(JDBCStoreManager.java:148)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.kernel.DelegatingStoreManager.setContext(DelegatingStoreManager.java:79)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:369)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:323)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:229)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:213)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)[142:org.apache.openjpa:2.1.1] > at > org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)[142:org.apache.openjpa:2.1.1] > at > org.apache.aries.jpa.container.impl.CountingEntityManagerFactory.createEntityManager(CountingEntityManagerFactory.java:71)[134:org.apache.aries.jpa.container:1.0.0] > at > org.apache.aries.jpa.container.context.transaction.impl.JTAPersistenceContextRegistry.getCurrentPersistenceContext(JTAPersistenceContextRegistry.java:152)[135:org.apache.aries.jpa.container.context:1.0.1] > at > org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.getPersistenceContext(JTAEntityManager.java:87)[135:org.apache.aries.jpa.container.context:1.0.1] > at > org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.getCriteriaBuilder(JTAEntityManager.java:391)[135:org.apache.aries.jpa.container.context:1.0.1] > ... > > But the data source seem to be published as a service, the command "ls | > grep -A 4 -B 4 javax.sql.DataSource" gives me the following output: > > Connect :: filetransfer-history-datasource (153) provides: > ---------------------------------------------------------- > javax.sql.XADataSource > javax.sql.DataSource > org.osgi.service.blueprint.container.BlueprintContainer > > I then execute "ls 153" and get: > > Connect :: filetransfer-history-datasource (153) provides: > ---------------------------------------------------------- > objectClass = javax.sql.XADataSource > osgi.jndi.service.name = jdbc/filetransferhistoryjta > osgi.service.blueprint.compname = derbyXADataSource > service.id = 493 > ---- > objectClass = javax.sql.DataSource > osgi.jndi.service.name = jdbc/filetransferhistorynojta > osgi.service.blueprint.compname = derbyDataSource > service.id = 494 > ---- > objectClass = org.osgi.service.blueprint.container.BlueprintContainer > osgi.blueprint.container.symbolicname = > se.digia.connect.services.filetransfer.h > istory-datasource > osgi.blueprint.container.version = 2.3.0.SNAPSHOT > service.id = 495 > > To me it looks like the service is provided with the correct properties. > Maybe it's a jndi problem? I was hoping there was a "jndi" command in the > Karaf shell that I could use to see what can be resolved via jndi but I > can't find such a command. > > I've actually encountered another strange problem. On startup everything > looks fine. But when I try to access the webconsole - it's not there. I then > start to type "list" in the Karaf shell. But as soon as I type the "l" I get > the following message in the console: > > karaf@root> lError executing command: read() with timeout cannot be called > as no > n-blocking operation is disabled > __ __ ____ > / //_/____ __________ _/ __/ > / ,< / __ `/ ___/ __ `/ /_ > / /| |/ /_/ / / / /_/ / __/ > /_/ |_|\__,_/_/ \__,_/_/ > > Apache Karaf (2.3.0) > > Hit '' for a list of available commands > and '[cmd] --help' for help on a specific command. > Hit '' or 'osgi:shutdown' to shutdown Karaf. > > Note that the "Karaf" logo had already been shown so it's shown twice. Also, > in the log I get: > > 2012-10-22 13:28:27,999 | ERROR | Thread-6 | FeaturesServiceImpl > | s.internal.FeaturesServiceImpl$2 1143 | Error installing boot features > java.lang.NullPointerException > at > org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1432)[org.apache.felix.framework-4.0.3.jar:] > at > org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)[org.apache.felix.framework-4.0.3.jar:] > at > org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)[org.apache.felix.framework-4.0.3.jar:] > at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_32] > at > org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:525)[20:org.apache.karaf.features.core:2.3.0] > at > org.apache.karaf.features.internal.FeaturesServiceImpl$2.run(FeaturesServiceImpl.java:1141)[20:org.apache.karaf.features.core:2.3.0] > 2012-10-22 13:28:28,002 | ERROR | Thread-6 | FeaturesServiceImpl > | res.internal.FeaturesServiceImpl 1227 | Error persisting FeaturesService > state > java.lang.IllegalStateException: Invalid BundleContext. > at > org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:514)[org.apache.felix.framework-4.0.3.jar:] > at > org.apache.felix.framework.BundleContextImpl.getDataFile(BundleContextImpl.java:491)[org.apache.felix.framework-4.0.3.jar:] > at > org.apache.karaf.features.internal.FeaturesServiceImpl.saveState(FeaturesServiceImpl.java:1215)[20:org.apache.karaf.features.core:2.3.0] > at > org.apache.karaf.features.internal.FeaturesServiceImpl$2.run(FeaturesServiceImpl.java:1146)[20:org.apache.karaf.features.core:2.3.0] > > If I don't press a key in the shell, I never get these messages but then the > web service will never install. It's as if the installation is hung, waiting > for something. > > Do you or anyone have any clue as to what is happening. I am in the process > of upgrading my custom distribution of Karaf from 2.2.8 to 2.3.0 so I might > have done something very wrong but right now I have no clue as to where I > should look further, > > /Bengt > > > 2012/10/22 Charles Moulliard >> >> Bengt, >> >> This package is not required by Aries JPA as resolution is optional : >> >> org.osgi.service.jdbc;resolution:=optional, >> >> When the Aries JPA Container ManagedPersistenceUnitInfoImpl class is >> called, Aries does a check to verify if the OSGI service is provided. If >> this is not the case, the info is displayed in the log and Aries JPA >> Container continues to load the JPA Container based on your config >> (persistence.xml, datasource, ...). If you are using JPA, you shouldn't use >> the DataSourceFactory. >> >> These links could help you to configure your project >> >> >> http://stackoverflow.com/questions/11861414/openjpa-in-osgi-not-finding-mysql-jdbc-connector-bundle >> http://aries.apache.org/modules/jpaproject.html >> >> >> Regards, >> >> Charles >> >> On Mon, Oct 22, 2012 at 11:25 AM, Bengt Rodehav wrote: >>> >>> I'm trying to upgrade fro Karaf 2.2.8 to Karaf 2.3.0 and have run into a >>> problem regarding datasources. I get the following in my log: >>> >>> 2012-10-22 10:52:59,563 | INFO | Thread-7 | container >>> | l.ManagedPersistenceUnitInfoImpl 50 | The org.osgi.service.jdbc package >>> is unavailable. As a result the Aries JPA container will not offer any >>> DataSourceFactory integration. >>> >>> It's only an INFO message but it seems fatal to me because later on I >>> cannot find my datasource when I try to use it. I publish a data source (for >>> Derby) using Blueprint. I use the following features from the >>> karaf-enterprise descriptor: >>> >>> - transaction >>> - jpa >>> - jndi >>> >>> When I execute "exports | grep -i org.osgi.service.jdbc" on the command >>> line I get an empty result. >>> >>> It seems like this package is needed for Aries JPA Container. What bundle >>> should export it? >>> >>> /Bengt >>> >> >> >> >> -- >> Charles Moulliard >> Apache Committer / Sr. Enterprise Architect (RedHat) >> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com >> >> > -- Apache Karaf Committer & PMC OPS4J Pax Web Committer & Project Lead OPS4J Pax for Vaadin Commiter & Project Lead blog