Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0E1B410A14 for ; Sun, 6 Oct 2013 16:35:45 +0000 (UTC) Received: (qmail 36522 invoked by uid 500); 6 Oct 2013 16:35:44 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 36491 invoked by uid 500); 6 Oct 2013 16:35:43 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 36479 invoked by uid 99); 6 Oct 2013 16:35:42 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Oct 2013 16:35:42 +0000 Date: Sun, 6 Oct 2013 16:35:42 +0000 (UTC) From: "Amichai Rothman (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMQ-4777) ActiveMQ broker silently fails to start in Karaf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMQ-4777?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D137876= 75#comment-13787675 ]=20 Amichai Rothman commented on AMQ-4777: -------------------------------------- Darn, I spoke too soon. While ActiveMQ and my app run properly after this fix, dosgi does not (miss= ing remoteadmin stuff from the compendium). So if the compendium gets insta= lled dosgi works and ActiveMQ fails, and if it is not installed it's the ot= her way around. So still no good :-/ > ActiveMQ broker silently fails to start in Karaf > ------------------------------------------------ > > Key: AMQ-4777 > URL: https://issues.apache.org/jira/browse/AMQ-4777 > Project: ActiveMQ > Issue Type: Bug > Components: OSGi/Karaf > Affects Versions: 5.8.0 > Environment: Kubuntu 64-bit, Oracle JDK 7u40, Karaf 2.3.3 > Reporter: Amichai Rothman > Assignee: Jean-Baptiste Onofr=C3=A9 > > I have an application, deployed into Karaf. I install the activemq-broker= feature, and one of the app bundles uses ActiveMQConnectionFactory to get = a javax.jms.Connection instance and then uses the JMS API only (no other Ac= tiveMQ-specific APIs in use). I'll note that this bundle depends on another= bundle which uses the JMS API as well (no ActiveMQ imports there at all). = The application also depends on other karaf features such as cxf-dosgi. > ActiveMQ fails to start in a couple of ways, depending on the order of in= stallation of the features and app: > At first I got a LinkageError: > java.lang.LinkageError: loader constraint violation: when resolving metho= d "org.apache.activemq.ActiveMQConnectionFactory.createConne > ction()Ljavax/jms/Connection;" the class loader (instance of org/eclipse/= osgi/internal/baseadaptor/DefaultClassLoader) of the current > class, com/myprojectgroup/bus/activemq/ActiveMQSession, and the class lo= ader (instance of org/eclipse/osgi/internal/baseadaptor/D > efaultClassLoader) for resolved class, org/apache/activemq/ActiveMQConnec= tionFactory, have different Class objects for the type Ljava > x/jms/Connection; used in the signature > at com.myprojectgroup.bus.activemq.ActiveMQSession.createConnecti= on(ActiveMQSession.java:38) > at com.myprojectgroup.messaging.jms.Session.open(Session.java:70)= [68:com.myprojectgroup.messaging:0.1.0.SNAPSHOT] > at com.myprojectgroup.messaging.jms.Session$1.run(Session.java:10= 8)[68:com.myprojectgroup.messaging:0.1.0.SNAPSHOT] > The only bundle that exports the javax.jms package is org.apache.geronimo= .specs.geronimo-jms_1.1_spec, though after further investigation I found th= at the activemq-web-console bundle does have another copy of it internally,= which I think might be the cause of the conflict (it does not import the p= ackage in the manifest, so I can't just remove the package from the jar sin= ce it won't find the package exported by the geronimo-jms bundle without a = corresponding import declaration). The activemq-osgi bundle has a DynamicIm= port-Package: *, which may further complicate things. If it also had an exp= licit Import-Package directive for the statically-linked classes it uses su= ch as javax.jms ones, perhaps it would go through the regular bundle classl= oading mechanism and avoid the problem - I think it takes precedence over d= ynamic imports, though I'm not sure). > Next, I played around with reordering the installation, and got to anothe= r failure mode where there is no exception at all or any error in the logs,= but the broker simply fails to start silently. Perhaps this is also caused= by classloader issues but they are just occurring somewhere within ActiveM= Q and being silently ignored. This mode of failure I've managed to recreate= easily: > On a fresh stock installation of Karaf 2.3.3, add two feature urls: > features:addurl mvn:org.apache.activemq/activemq-karaf/5.8.0/xml/features= mvn:org.apache.cxf.dosgi/cxf-dosgi/1.6-SNAPSHOT/xml/features > (you might need to add the apache snapshot repo to karaf for it to find t= he dosgi snapshot feature) > And then install them in this order: > features:install -v cxf-dosgi-discovery-distributed activemq-broker > The broker will not be started, although the logs will have no errors. > Strangely, if you now uninstall the activemq-web-console bundle (not feat= ure) and restart karaf, the broker will start ok. Also if you install only = activemq-broker and not dosgi, it will start ok. > To simplify, I found that instead of the dosgi feature it's enough to ins= tall and start the mvn:org.osgi/org.osgi.compendium/4.3.1 bundle before ins= talling activemq-broker to make it fail - this is from looking at the innar= ds of the dosgi feature, however if I remove this bundle from the feature t= he broker still fails to start, so it's not the only bundle causing problem= s, but just an example. > The only workaround I've found so far is to install everything, then unin= stall the activemq-web-console bundle and restart - then everything works a= s it should. Strangely, not installing it in the first place doesn't work e= ither - the broker won't start unless the web console is first started, the= n uninstalled. > Some details of the LinkageError are in http://pastebin.com/TKZt7hUA (pas= ted to karaf irc channel originally). -- This message was sent by Atlassian JIRA (v6.1#6144)