0 Replies Latest reply on Mar 11, 2013 11:38 AM by logoff

    Obtain a JBoss instance with Apache Karaf

    logoff

      I want to have an Apache Karaf instance inside JBoss AS7. I have a few options:

       

      1. Build JBoss AS7 with Apache Karaf as module:

      I tried to build JBoss AS from GitHub repository using diferent branches/tags: 7.1.3.Final and master (current 8.0.0.Alpha1-SNAPSHOT)

      Based on the instructions found here I got same error in my modular build doing:

      cd build-modular/
      mvn -Dmodular=karaf clean install
      

       

      [INFO] Scanning for projects...
      [INFO]                                                                         
      [INFO] ------------------------------------------------------------------------
      [INFO] Building JBoss Application Server: Build Modular 8.0.0.Alpha1-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO] 
      [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jboss-as-build-modular ---
      [INFO] 
      [INFO] --- maven-enforcer-plugin:1.2:enforce (ban-bad-dependencies) @ jboss-as-build-modular ---
      [INFO] 
      [INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-java-version) @ jboss-as-build-modular ---
      [INFO] 
      [INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven-version) @ jboss-as-build-modular ---
      [INFO] 
      [INFO] --- buildnumber-maven-plugin:1.2:create-timestamp (get-build-timestamp) @ jboss-as-build-modular ---
      [INFO] 
      [INFO] --- buildnumber-maven-plugin:1.2:create (get-scm-revision) @ jboss-as-build-modular ---
      [INFO] Checking for local modifications: skipped.
      [INFO] Updating project files from SCM: skipped.
      [INFO] Executing: /bin/sh -c cd /home/logoff/soft/jboss-as/build-modular && git rev-parse --verify HEAD
      [INFO] Working directory: /home/logoff/soft/jboss-as/build-modular
      [INFO] Storing buildNumber: bfeb0721e0a10c630d164a861c01e343b27ee313 at timestamp: 1363002756518
      [INFO] Executing: /bin/sh -c cd /home/logoff/soft/jboss-as/build-modular && git rev-parse --verify HEAD
      [INFO] Working directory: /home/logoff/soft/jboss-as/build-modular
      [INFO] Storing buildScmBranch: UNKNOWN
      [INFO] 
      [INFO] --- maven-antrun-plugin:1.7:run (modular-config) @ jboss-as-build-modular ---
      [INFO] Executing tasks
      
      main:
      
      init:
      
      init.standalone:
      
      generate-standalone-configs:
           [echo] Generate subsystems definition for logging:osgi,osgi:karaf,configadmin to /home/logoff/soft/jboss-as/build-modular/target/standalone-subsystems.xml
           [echo] Generate module dependencies from /home/logoff/soft/jboss-as/build-modular/target/standalone-subsystems.xml to /home/logoff/soft/jboss-as/build-modular/target/standalone-module-dependencies.txt
           [echo] Static modules: [org.jboss.as.standalone,org.jboss.as.domain-http-error-context,,,   org.jboss.logging,   org.jboss.vfs,   org.slf4j,   org.jboss.logging.jul-to-slf4j-stub]
           [java] Exception in thread "main" java.io.FileNotFoundException: /home/logoff/soft/jboss-as/build-modular/../build/src/main/resources/modules/org/jboss/as/logging/main/module.xml (No such file or directory)
           [java]      at java.io.FileInputStream.open(Native Method)
           [java]      at java.io.FileInputStream.<init>(FileInputStream.java:138)
           [java]      at org.jboss.as.config.assembly.ModuleParser.parse(ModuleParser.java:61)
           [java]      at org.jboss.as.config.assembly.GenerateModulesDefinition.processModuleDependency(GenerateModulesDefinition.java:193)
           [java]      at org.jboss.as.config.assembly.GenerateModulesDefinition.process(GenerateModulesDefinition.java:130)
           [java]      at org.jboss.as.config.assembly.GenerateModulesDefinition.main(GenerateModulesDefinition.java:104)
           [java] Java Result: 1
           [echo] Merging standalone configuration/standalone/template-osgi.xml and /home/logoff/soft/jboss-as/build-modular/target/standalone-subsystems.xml into /home/logoff/soft/jboss-as/build-modular/target/standalone.xml, using StandaloneMain
      
      init.domain:
      
      generate-domain-configs:
      
      build-standalone-server:
          [mkdir] Created dir: /home/logoff/soft/jboss-as/build-modular/target/jboss-as-karaf-8.0.0.Alpha1-SNAPSHOT
           [copy] Copying 240 files to /home/logoff/soft/jboss-as/build-modular/target/jboss-as-karaf-8.0.0.Alpha1-SNAPSHOT
           [copy] Copied 43 empty directories to 4 empty directories under /home/logoff/soft/jboss-as/build-modular/target/jboss-as-karaf-8.0.0.Alpha1-SNAPSHOT
           [copy] Copying 1 file to /home/logoff/soft/jboss-as/build-modular/target/jboss-as-karaf-8.0.0.Alpha1-SNAPSHOT/standalone/configuration
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 5.659s
      [INFO] Finished at: Mon Mar 11 12:52:39 CET 2013
      [INFO] Final Memory: 16M/168M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (modular-config) on project jboss-as-build-modular: An Ant BuildException has occured: The following error occurred while executing this line:
      [ERROR] /home/logoff/soft/jboss-as/build-modular/build-modular-config.xml:113: Includesfile /home/logoff/soft/jboss-as/build-modular/target/standalone-module-dependencies.txt not found.
      [ERROR] around Ant part ...<ant antfile="build-modular-config.xml" inheritRefs="true">... @ 4:62 in /home/logoff/soft/jboss-as/build-modular/target/antrun/build-main.xml
      [ERROR] -> [Help 1]
      [ERROR] 
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
      
      

      I opened an issue for version 7.1.3.final in JBoss JIRA and another for current master version 8.0.0.Alpha1-SNAPSHOT. Both were rejected because it is not a bug.

       

       

      2. Use OSGi subsystems to obtain an OSGi runtime with Apache Karaf capabilities and dependencies

       

      Using a clean installation of JBoss AS 7.1.1.Final from the official download page, I tried to configure an standalone instance modifying the standalone/standalone.xml configuration file. I based my job in this JIRA issue. My last try was:

       


      <?xml version='1.0' encoding='UTF-8'?>
      
      
      <server xmlns="urn:jboss:domain:1.2">
      
      
          <extensions>
              <extension module="org.jboss.as.clustering.infinispan"/>
              <extension module="org.jboss.as.configadmin"/>
              <extension module="org.jboss.as.connector"/>
              <extension module="org.jboss.as.deployment-scanner"/>
              <extension module="org.jboss.as.ee"/>
              <extension module="org.jboss.as.ejb3"/>
              <extension module="org.jboss.as.jaxrs"/>
              <extension module="org.jboss.as.jdr"/>
              <extension module="org.jboss.as.jmx"/>
              <extension module="org.jboss.as.jpa"/>
              <extension module="org.jboss.as.logging"/>
              <extension module="org.jboss.as.mail"/>
              <extension module="org.jboss.as.naming"/>
              <extension module="org.jboss.as.osgi"/>
              <extension module="org.jboss.as.pojo"/>
              <extension module="org.jboss.as.remoting"/>
              <extension module="org.jboss.as.sar"/>
              <extension module="org.jboss.as.security"/>
              <extension module="org.jboss.as.threads"/>
              <extension module="org.jboss.as.transactions"/>
              <extension module="org.jboss.as.web"/>
              <extension module="org.jboss.as.webservices"/>
              <extension module="org.jboss.as.weld"/>
          </extensions>
      
      
          <management>
              <security-realms>
                  <security-realm name="ManagementRealm">
                      <authentication>
                          <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
                      </authentication>
                  </security-realm>
                  <security-realm name="ApplicationRealm">
                      <authentication>
                          <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
                      </authentication>
                  </security-realm>
              </security-realms>
              <management-interfaces>
                  <native-interface security-realm="ManagementRealm">
                      <socket-binding native="management-native"/>
                  </native-interface>
                  <http-interface security-realm="ManagementRealm">
                      <socket-binding http="management-http"/>
                  </http-interface>
              </management-interfaces>
          </management>
      
      
          <profile>
              <subsystem xmlns="urn:jboss:domain:logging:1.1">
                  <console-handler name="CONSOLE">
                      <level name="DEBUG"/>
                      <formatter>
                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                      </formatter>
                  </console-handler>
                  <periodic-rotating-file-handler name="FILE">
                      <formatter>
                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                      </formatter>
                      <file relative-to="jboss.server.log.dir" path="server.log"/>
                      <suffix value=".yyyy-MM-dd"/>
                      <append value="true"/>
                  </periodic-rotating-file-handler>
                  <logger category="com.arjuna">
                      <level name="WARN"/>
                  </logger>
                  <logger category="org.apache.tomcat.util.modeler">
                      <level name="WARN"/>
                  </logger>
                  <logger category="sun.rmi">
                      <level name="WARN"/>
                  </logger>
                  <logger category="jacorb">
                      <level name="WARN"/>
                  </logger>
                  <logger category="jacorb.config">
                      <level name="ERROR"/>
                  </logger>
                  <root-logger>
                      <level name="TRACE"/>
                      <handlers>
                          <handler name="CONSOLE"/>
                          <handler name="FILE"/>
                      </handlers>
                  </root-logger>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:configadmin:1.0"/>
              <subsystem xmlns="urn:jboss:domain:datasources:1.0">
                  <datasources>
                      <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
                          <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
                          <driver>h2</driver>
                          <security>
                              <user-name>sa</user-name>
                              <password>sa</password>
                          </security>
                      </datasource>
                      <drivers>
                          <driver name="h2" module="com.h2database.h2">
                              <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                          </driver>
                      </drivers>
                  </datasources>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
                  <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:ee:1.0"/>
              <subsystem xmlns="urn:jboss:domain:ejb3:1.2">
                  <session-bean>
                      <stateless>
                          <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
                      </stateless>
                      <stateful default-access-timeout="5000" cache-ref="simple"/>
                      <singleton default-access-timeout="5000"/>
                  </session-bean>
                  <pools>
                      <bean-instance-pools>
                          <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                          <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                      </bean-instance-pools>
                  </pools>
                  <caches>
                      <cache name="simple" aliases="NoPassivationCache"/>
                      <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/>
                  </caches>
                  <passivation-stores>
                      <file-passivation-store name="file"/>
                  </passivation-stores>
                  <async thread-pool-name="default"/>
                  <timer-service thread-pool-name="default">
                      <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>
                  </timer-service>
                  <remote connector-ref="remoting-connector" thread-pool-name="default"/>
                  <thread-pools>
                      <thread-pool name="default">
                          <max-threads count="10"/>
                          <keepalive-time time="100" unit="milliseconds"/>
                      </thread-pool>
                  </thread-pools>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="hibernate">
                  <cache-container name="hibernate" default-cache="local-query">
                      <local-cache name="entity">
                          <transaction mode="NON_XA"/>
                          <eviction strategy="LRU" max-entries="10000"/>
                          <expiration max-idle="100000"/>
                      </local-cache>
                      <local-cache name="local-query">
                          <transaction mode="NONE"/>
                          <eviction strategy="LRU" max-entries="10000"/>
                          <expiration max-idle="100000"/>
                      </local-cache>
                      <local-cache name="timestamps">
                          <transaction mode="NONE"/>
                          <eviction strategy="NONE"/>
                      </local-cache>
                  </cache-container>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
              <subsystem xmlns="urn:jboss:domain:jca:1.1">
                  <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
                  <bean-validation enabled="true"/>
                  <default-workmanager>
                      <short-running-threads>
                          <core-threads count="50"/>
                          <queue-length count="50"/>
                          <max-threads count="50"/>
                          <keepalive-time time="10" unit="seconds"/>
                      </short-running-threads>
                      <long-running-threads>
                          <core-threads count="50"/>
                          <queue-length count="50"/>
                          <max-threads count="50"/>
                          <keepalive-time time="10" unit="seconds"/>
                      </long-running-threads>
                  </default-workmanager>
                  <cached-connection-manager/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
              <subsystem xmlns="urn:jboss:domain:jmx:1.1">
                  <show-model value="true"/>
                  <remoting-connector/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:jpa:1.0">
                  <jpa default-datasource=""/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:mail:1.0">
                  <mail-session jndi-name="java:jboss/mail/Default">
                      <smtp-server outbound-socket-binding-ref="mail-smtp"/>
                  </mail-session>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:naming:1.1"/>
      
      
      
      
              <subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="eager">
                  <properties>
                      <property name="org.osgi.framework.startlevel.beginning">
                          3
                      </property>
                  </properties>
                  <capabilities>
                      <capability name="org.apache.mina:mina-core:2.0.1" startlevel="1"/>
                      <capability name="org.apache.sshd:sshd-core:0.8.0" startlevel="1"/>
      
      
                      <capability name="org.apache.felix:org.apache.felix.configadmin:1.2.8" startlevel="1"/>
                      <capability name="org.apache.felix:org.apache.felix.fileinstall:3.2.4" startlevel="1"/>
      
      
                      <capability name="org.ops4j.pax.logging:pax-logging-api:1.6.10" startlevel="1"/>
                      <capability name="org.ops4j.pax.logging:pax-logging-service:1.6.10" startlevel="1"/>
                      <capability name="org.ops4j.pax.url:pax-url-mvn:1.2.8" startlevel="1"/>
                      <capability name="org.ops4j.pax.url:pax-url-wrap:1.2.8" startlevel="1"/>
      
      
                      <capability name="org.apache.aries.blueprint:org.apache.aries.blueprint:0.3.2" startlevel="1"/>
                      <capability name="org.apache.aries.jmx:org.apache.aries.jmx.blueprint:0.3" startlevel="1"/>
                      <capability name="org.apache.aries.jmx:org.apache.aries.jmx:0.3" startlevel="1"/>
                      <capability name="org.apache.aries.jmx:org.apache.aries.jmx.api:0.3" startlevel="1"/>
                      <capability name="org.apache.aries.proxy:org.apache.aries.proxy:0.3.1" startlevel="1"/>
                      <capability name="org.apache.aries:org.apache.aries.util:0.3.1" startlevel="1"/>
      
      
                      <capability name="org.apache.servicemix.bundles:org.apache.servicemix.bundles.asm:3.3.1_1" startlevel="1"/>
      
      
                      <capability name="org.apache.karaf.admin:org.apache.karaf.admin.command:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.admin:org.apache.karaf.admin.core:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.admin:org.apache.karaf.admin.management:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.deployer:org.apache.karaf.deployer.features:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.deployer:org.apache.karaf.deployer.kar:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.deployer:org.apache.karaf.deployer.spring:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.deployer:org.apache.karaf.deployer.blueprint:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.deployer:org.apache.karaf.deployer.wrap:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.diagnostic:org.apache.karaf.diagnostic.command:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.diagnostic:org.apache.karaf.diagnostic.common:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.diagnostic:org.apache.karaf.diagnostic.core:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.diagnostic:org.apache.karaf.diagnostic.management:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.features:org.apache.karaf.features.command:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.features:org.apache.karaf.features.core:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.features:org.apache.karaf.features.management:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.jaas:org.apache.karaf.jaas.config:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.jaas:org.apache.karaf.jaas.modules:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.jaas:org.apache.karaf.jaas.command:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.jaas:org.apache.karaf.jaas.boot:2.2.10" startlevel="3"/>
                      <capability name="org.apache.karaf.shell:org.apache.karaf.shell.commands:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.shell:org.apache.karaf.shell.config:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.shell:org.apache.karaf.shell.console:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.shell:org.apache.karaf.shell.dev:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.shell:org.apache.karaf.shell.log:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.shell:org.apache.karaf.shell.osgi:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.shell:org.apache.karaf.shell.packages:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.shell:org.apache.karaf.shell.ssh:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.management:org.apache.karaf.management.server:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.management.mbeans:org.apache.karaf.management.mbeans.system:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.management.mbeans:org.apache.karaf.management.mbeans.bundles:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.management.mbeans:org.apache.karaf.management.mbeans.services:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.management.mbeans:org.apache.karaf.management.mbeans.config:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.management.mbeans:org.apache.karaf.management.mbeans.log:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.management.mbeans:org.apache.karaf.management.mbeans.packages:2.2.10" startlevel="2"/>
                      <capability name="org.apache.karaf.management.mbeans:org.apache.karaf.management.mbeans.dev:2.2.10" startlevel="2"/>
      
      
                  </capabilities>
              </subsystem>
      
      
      
      
              <subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
              <subsystem xmlns="urn:jboss:domain:remoting:1.1">
                  <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/>
              <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
              <subsystem xmlns="urn:jboss:domain:security:1.1">
                  <security-domains>
                      <security-domain name="other" cache-type="default">
                          <authentication>
                              <login-module code="Remoting" flag="optional">
                                  <module-option name="password-stacking" value="useFirstPass"/>
                              </login-module>
                              <login-module code="RealmUsersRoles" flag="required">
                                  <module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
                                  <module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
                                  <module-option name="realm" value="ApplicationRealm"/>
                                  <module-option name="password-stacking" value="useFirstPass"/>
                              </login-module>
                          </authentication>
                      </security-domain>
                      <security-domain name="jboss-web-policy" cache-type="default">
                          <authorization>
                              <policy-module code="Delegating" flag="required"/>
                          </authorization>
                      </security-domain>
                      <security-domain name="jboss-ejb-policy" cache-type="default">
                          <authorization>
                              <policy-module code="Delegating" flag="required"/>
                          </authorization>
                      </security-domain>
                  </security-domains>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:threads:1.1"/>
              <subsystem xmlns="urn:jboss:domain:transactions:1.1">
                  <core-environment>
                      <process-id>
                          <uuid/>
                      </process-id>
                  </core-environment>
                  <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
                  <coordinator-environment default-timeout="300"/>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
                  <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
                  <virtual-server name="default-host" enable-welcome-root="true">
                      <alias name="localhost"/>
                      <alias name="example.com"/>
                  </virtual-server>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:webservices:1.1">
                  <modify-wsdl-address>true</modify-wsdl-address>
                  <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
                  <endpoint-config name="Standard-Endpoint-Config"/>
                  <endpoint-config name="Recording-Endpoint-Config">
                      <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
                          <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
                      </pre-handler-chain>
                  </endpoint-config>
              </subsystem>
              <subsystem xmlns="urn:jboss:domain:weld:1.0"/>
          </profile>
      
      
          <interfaces>
              <interface name="management">
                  <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
              </interface>
              <interface name="public">
                  <inet-address value="${jboss.bind.address:127.0.0.1}"/>
              </interface>
              <interface name="unsecure">
                  <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
              </interface>
          </interfaces>
      
      
          <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
              <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
              <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
              <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
              <socket-binding name="ajp" port="8009"/>
              <socket-binding name="http" port="8080"/>
              <socket-binding name="https" port="8443"/>
              <socket-binding name="osgi-http" interface="management" port="8090"/>
              <socket-binding name="remoting" port="4447"/>
              <socket-binding name="txn-recovery-environment" port="4712"/>
              <socket-binding name="txn-status-manager" port="4713"/>
              <outbound-socket-binding name="mail-smtp">
                  <remote-destination host="localhost" port="25"/>
              </outbound-socket-binding>
          </socket-binding-group>
      
      
      </server>
      
      

       

       

      I made changes on OSGi subsystem. I chnage the OSGi default subsystem:

        • Configuring an eager activation instead of lazy.
        • Adding Apache Karaf 2.2.10 OSGi bundles.
        • Adding Apache Karaf dependencies.

      I got a resolved dependency tree, but there was OSGi constraint violations like:


      16:17:43,079 ERROR [org.jboss.osgi.framework.internal.ResolverPlugin] (MSC service thread 1-6) Cannot resolve: [org.apache.karaf.shell.ssh:2.2.10]: org.jboss.osgi.resolver.XResolverException: Constraint violation for package 'org.slf4j' when resolving module Module[org.apache.karaf.shell.ssh:2.2.10] between existing import Module[org.ops4j.pax.logging.pax-logging-api:1.6.10].org.slf4j BLAMED ON [[Module[org.apache.karaf.shell.ssh:2.2.10]] package; (&(package=org.slf4j)(version>=1.6.0)(!(version>=2.0.0)))] and uses constraint Module[system.bundle:0.0.0].org.slf4j BLAMED ON [[Module[org.apache.karaf.shell.ssh:2.2.10]] package; (&(package=org.apache.sshd.common)(version>=0.8.0)(!(version>=1.0.0))), [Module[org.apache.sshd.core:0.8.0]] package; (&(package=org.slf4j)(version>=1.6.0)(!(version>=2.0.0)))]
                at org.jboss.osgi.resolver.felix.FelixResolver.resolveInternal(FelixResolver.java:117) [jbosgi-resolver-felix-1.0.13.Final.jar:1.0.13.Final]
                at org.jboss.osgi.resolver.spi.AbstractResolver.resolveAll(AbstractResolver.java:177) [jbosgi-resolver-spi-1.0.13.Final.jar:1.0.13.Final]
                at org.jboss.osgi.framework.internal.ResolverPlugin.resolveAll(ResolverPlugin.java:195) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
                at org.jboss.osgi.framework.internal.PackageAdminPlugin.resolveBundles(PackageAdminPlugin.java:385) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
                at org.jboss.as.osgi.service.AutoInstallIntegration$1.start(AutoInstallIntegration.java:176) [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]
                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]
                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]
      
      

       

       

      Some of them are not reported as ERROR, but as DEBUG. It seems that System Bundle exports org.apache.aries.blueprint package and Apache Aries Blueprint bundle (org.apache.aries.blueprint:org.apache.aries.blueprint) too. It happens too with other bundles exporting SLF4J (org.slf4j).

       

      In conclusion, it is a nightmare configuring JBoss AS 7 to have an instance of Apache Karaf running. How can I do it? It is possible? What is the better option? I prefer to use stable release to do it, but all the solutions are valid for me.

       

      Thank you!