JBoss Fuse 앱이 Docker 빌드에서 작동하지 않습니다.

JBoss Fuse 앱이 Docker 빌드에서 작동하지 않습니다.

JBoss Fuse, 특히 AMQ와 관련된 문제를 해결하는 데 누군가 도움을 줄 수 있기를 바랍니다. 저는 6.0.0.redhat-024-p5와 함께 버전 6.0.0.redhat-024를 사용하고 있습니다. 이것을 컨테이너에 배포하려고 하는데 AMQ에 문제가 있는 것 같습니다. 내 애플리케이션을 배포할 때 문제는 다음과 같습니다.

[root@4ca73a25d4cf home]# client -r 2 -d 60 -u admin -p admin "features:install example-app"
Refreshing bundles org.springframework.context.support (104)
Error executing command: Could not start bundle mvn:com.example/example.broker.services/1.0-SNAPSHOT in feature(s) example-base-0.0.0: Unresolved constraint in bundle example.broker.services [254]: Unable to resolve 254.0: missing requirement [254.0] osgi.wiring.package; (osgi.wiring.package=org.apache.activemq)

분명히 이는 종속성 문제가 누락된 것처럼 보이지만 Docker 빌드 프로세스의 일부로 애플리케이션을 설치하려고 할 때만 이 문제가 발생하므로 이것이 Red Herring이라고 확신합니다. 이것을 증명하기 위해 나는 다음을 가지고 있습니다:

  1. 동일한 OS의 가상 머신에 앱을 성공적으로 설치했습니다.
  2. docker 빌드를 사용하지 않고 빈 컨테이너에 앱을 설치했습니다(즉, 컨테이너를 실행하고 실행한 다음 Fuse 및 앱 설치를 수동으로 실행함).

위의 두 가지 방법에서는 문제가 발생하지 않습니다. 앱이 예상대로 설치되고 실행됩니다. 위 설치에 사용된 명령은 빌드에 사용하는 Dockerfile에서 가져온 것입니다. 이 문제는 (어쨌든) docker 빌드와 연결된 것 같습니다.

앱이 설치되면 AMQ에 어떤 작업이 수행되는 것 같습니다. 애플리케이션 설치 지점까지 컨테이너를 빌드하면 AMQ 기능이 괜찮습니다.

[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:list | grep 118"
[ 118] [Active     ] [Created     ] [       ] [   50] activemq-karaf (5.8.0.redhat-60024)
[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:list | grep 128"
[ 128] [Active     ] [            ] [       ] [   60] JBoss A-MQ Fabric (6.0.0.redhat-057)

새로 고침하면 번들을 시작하고 중지하면 모든 것이 정상입니다.

[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:refresh 118" 
[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:list | grep 118"
[ 118] [Active     ] [Created     ] [       ] [   50] activemq-karaf (5.8.0.redhat-60024)
[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:stop 118"
[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:start 118"

[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:headers 118"

activemq-karaf (118)
--------------------
Manifest-Version = 1.0
Bnd-LastModified = 1365188424349
Tool = Bnd-1.50.0
Built-By = mockbuild
Embed-Transitive = true
Implementation-Version = 5.8.0.redhat-60024
Build-Jdk = 1.6.0_24
Implementation-Title = Apache ActiveMQ
Created-By = Apache Maven Bundle Plugin

Bundle-Vendor = Red Hat, Inc.
Bundle-Name = activemq-karaf
Bundle-DocURL = http://redhat.com
Bundle-Description = Provides resources for running ActiveMQ in Apache Karaf
Bundle-SymbolicName = activemq-karaf
Bundle-Version = 5.8.0.redhat-60024
Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-ManifestVersion = 2

Export-Service = 
    org.apache.felix.service.command.Function;
        osgi.command.function=browse;
        osgi.command.scope=activemq,
    org.apache.felix.service.command.Function;
        osgi.command.function=bstat;
        osgi.command.scope=activemq,
    org.apache.felix.service.command.Function;
        osgi.command.function=purge;
        osgi.command.scope=activemq,
    org.apache.felix.service.command.Function;
        osgi.command.function=query;
        osgi.command.scope=activemq,
    org.apache.felix.service.command.Function;
        osgi.command.function=list;
        osgi.command.scope=activemq

Import-Package = 
    org.apache.activemq.console,
    org.apache.activemq.console.command,
    org.apache.activemq.console.formatter,
    org.apache.felix.gogo.commands;version="[0.11,1)",
    org.apache.felix.gogo.commands.basic;version="[0.11,1)",
    org.apache.felix.service.command;status=provisional;version="[0.11,1)",
    org.apache.karaf.shell.console;version="[2.3,3)",
    org.apache.karaf.shell.console.commands;version="[2.3,3)",
    org.osgi.framework;version="[1.3,2)",
    org.osgi.service.blueprint;version="[1.0.0,2.0.0)",
    org.osgi.service.blueprint.container;version="[1.0,2)"
Export-Package = 
    org.apache.activemq.karaf.commands;
        uses:="org.apache.felix.service.command,
            org.apache.felix.gogo.commands.basic,
            org.apache.felix.gogo.commands,
            org.osgi.service.blueprint.container,
            org.apache.karaf.shell.console.commands,
            org.apache.karaf.shell.console,
            org.osgi.framework,
            org.apache.activemq.console.command,
            org.apache.activemq.console.formatter,
            org.apache.activemq.console";
        version=5.8.0.redhat-60024

[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:headers 128"

JBoss A-MQ Fabric (128)
-----------------------
Specification-Title = JBoss A-MQ Fabric
Tool = Bnd-1.15.0
Specification-Version = 6.0.0.redhat-057
Specification-Vendor = Red Hat
Embed-Dependency = !*
Implementation-Version = 6.0.0.redhat-057
Build-Jdk = 1.6.0_45
Implementation-Vendor-Id = org.jboss.amq
Created-By = Apache Maven Bundle Plugin
Implementation-Title = JBoss A-MQ Fabric
Manifest-Version = 1.0
Bnd-LastModified = 1385007431709
Built-By = hudson
Implementation-Vendor = Red Hat

Bundle-Vendor = Red Hat
Bundle-Activator = org.fusesource.mq.fabric.Activator
Bundle-Name = JBoss A-MQ Fabric
Bundle-DocURL = http://fabric.fusesource.org/
Bundle-Description = JBoss A-MQ Fabric
Bundle-SymbolicName = org.jboss.amq.mq-fabric
Bundle-Version = 6.0.0.redhat-057
Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-ManifestVersion = 2

Export-Service = 
    javax.jms.ConnectionFactory

Import-Package = 
    javax.jms;version="[1.1,2)",
    org.apache.activemq,
    org.apache.activemq.broker,
    org.apache.activemq.command,
    org.apache.activemq.network,
    org.apache.activemq.spring,
    org.apache.activemq.transport.discovery,
    org.apache.activemq.util,
    org.apache.xbean.spring.context;version="[3.12,4)",
    org.apache.xbean.spring.context.impl;version="[3.12,4)",
    org.apache.zookeeper;version="[3.4,4)",
    org.codehaus.jackson.annotate;version="[1.9,2)",
    org.fusesource.fabric.groups;version="[7.2,7.3)",
    org.fusesource.fabric.groups.internal;version="[7.2,7.3)",
    org.fusesource.fabric.zookeeper;version="[7.2,7.3)",
    org.fusesource.fabric.zookeeper.internal;version="[7.2,7.3)",
    org.fusesource.fabric.zookeeper.utils;version="[7.2,7.3)",
    org.linkedin.util.clock,
    org.osgi.framework;version="[1.6,2)",
    org.osgi.service.cm;version="[1.4,2)",
    org.osgi.util.tracker;version="[1.5,2)",
    org.slf4j;version="[1.6,2)",
    org.springframework.beans.factory;version="[3,4)",
    org.springframework.beans.factory.xml;version="[3,4)",
    org.springframework.context.support;version="[3,4)",
    org.springframework.core.io;version="[3,4)",
    scala;version="[2.9,2.10]",
    scala.collection;version="[2.9,2.10]",
    scala.collection.generic;version="[2.9,2.10]",
    scala.collection.immutable;version="[2.9,2.10]",
    scala.collection.mutable;version="[2.9,2.10]",
    scala.reflect;version="[2.9,2.10]",
    scala.runtime;version="[2.9,2.10]"
Export-Package = 
    org.fusesource.mq.fabric;
        uses:="scala.reflect,
            org.osgi.framework,
            org.osgi.service.cm,
            scala,
            org.springframework.core.io,
            org.springframework.beans.factory.xml,
            org.apache.xbean.spring.context,
            scala.runtime,
            scala.collection,
            scala.collection.mutable,
            org.apache.activemq.broker,
            org.fusesource.fabric.zookeeper,
            org.apache.activemq.network,
            org.apache.activemq.util,
            org.slf4j,
            org.apache.activemq.spring,
            org.apache.xbean.spring.context.impl,
            scala.collection.generic,
            org.fusesource.fabric.groups,
            scala.collection.immutable,
            javax.jms,
            org.apache.activemq,
            org.springframework.context.support,
            org.fusesource.fabric.groups.internal,
            org.osgi.util.tracker,
            org.springframework.beans.factory,
            org.apache.activemq.transport.discovery,
            org.apache.activemq.command,
            org.codehaus.jackson.annotate,
            org.fusesource.fabric.zookeeper.utils,
            org.apache.zookeeper,
            org.linkedin.util.clock,
            org.fusesource.fabric.zookeeper.internal";
        version=7.2.0.redhat-057

다음 명령을 사용하여 애플리케이션을 설치하려고 하면:

client -r 2 -d 60 -u admin -p admin "addurl mvn:com.example/example.features/1.0-SNAPSHOT/xml/features"
client -r 2 -d 60 -u admin -p admin "features:install example-app"

위에 설명된 오류 메시지가 표시되지만 결과적으로 AMQ 번들이 손상된 것 같습니다.

[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:headers 118"

activemq-karaf (118)
--------------------
Manifest-Version = 1.0
Bnd-LastModified = 1365188424349
Tool = Bnd-1.50.0
Built-By = mockbuild
Embed-Transitive = true
Implementation-Version = 5.8.0.redhat-60024
Build-Jdk = 1.6.0_24
Implementation-Title = Apache ActiveMQ
Created-By = Apache Maven Bundle Plugin

Bundle-Vendor = Red Hat, Inc.
Bundle-Name = activemq-karaf
Bundle-DocURL = http://redhat.com
Bundle-Description = Provides resources for running ActiveMQ in Apache Karaf
Bundle-SymbolicName = activemq-karaf
Bundle-Version = 5.8.0.redhat-60024
Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-ManifestVersion = 2

Export-Service = 
    org.apache.felix.service.command.Function;
        osgi.command.function=browse;
        osgi.command.scope=activemq,
    org.apache.felix.service.command.Function;
        osgi.command.function=bstat;
        osgi.command.scope=activemq,
    org.apache.felix.service.command.Function;
        osgi.command.function=purge;
        osgi.command.scope=activemq,
    org.apache.felix.service.command.Function;
        osgi.command.function=query;
        osgi.command.scope=activemq,
    org.apache.felix.service.command.Function;
        osgi.command.function=list;
        osgi.command.scope=activemq

Import-Package = 
    org.apache.activemq.console,        <--- RED
    org.apache.activemq.console.command,    <--- RED
    org.apache.activemq.console.formatter,  <--- RED
    org.apache.felix.gogo.commands;version="[0.11,1)",
    org.apache.felix.gogo.commands.basic;version="[0.11,1)",
    org.apache.felix.service.command;status=provisional;version="[0.11,1)",
    org.apache.karaf.shell.console;version="[2.3,3)",
    org.apache.karaf.shell.console.commands;version="[2.3,3)",
    org.osgi.framework;version="[1.3,2)",
    org.osgi.service.blueprint;version="[1.0.0,2.0.0)",
    org.osgi.service.blueprint.container;version="[1.0,2)"
Export-Package = 
    org.apache.activemq.karaf.commands;
        uses:="org.apache.felix.service.command,
            org.apache.felix.gogo.commands.basic,
            org.apache.felix.gogo.commands,
            org.osgi.service.blueprint.container,
            org.apache.karaf.shell.console.commands,
            org.apache.karaf.shell.console,
            org.osgi.framework,
            org.apache.activemq.console.command,
            org.apache.activemq.console.formatter,
            org.apache.activemq.console";
        version=5.8.0.redhat-60024

When I try and start it:

[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:start 118"
Error executing command: Error starting bundles:
    Unable to start bundle 118: Unresolved constraint in bundle activemq-karaf [118]: Unable to resolve 118.0: missing requirement [118.0] osgi.wiring.package; (osgi.wiring.package=org.apache.activemq.console)

JBoss AMQ 번들에도 동일:

[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:headers 128"

JBoss A-MQ Fabric (128)
-----------------------
Specification-Title = JBoss A-MQ Fabric
Tool = Bnd-1.15.0
Specification-Version = 6.0.0.redhat-057
Specification-Vendor = Red Hat
Embed-Dependency = !*
Implementation-Version = 6.0.0.redhat-057
Build-Jdk = 1.6.0_45
Implementation-Vendor-Id = org.jboss.amq
Created-By = Apache Maven Bundle Plugin
Implementation-Title = JBoss A-MQ Fabric
Manifest-Version = 1.0
Bnd-LastModified = 1385007431709
Built-By = hudson
Implementation-Vendor = Red Hat

Bundle-Vendor = Red Hat
Bundle-Activator = org.fusesource.mq.fabric.Activator
Bundle-Name = JBoss A-MQ Fabric
Bundle-DocURL = http://fabric.fusesource.org/
Bundle-Description = JBoss A-MQ Fabric
Bundle-SymbolicName = org.jboss.amq.mq-fabric
Bundle-Version = 6.0.0.redhat-057
Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-ManifestVersion = 2

Export-Service = 
    javax.jms.ConnectionFactory

Import-Package = 
    javax.jms;version="[1.1,2)",
    org.apache.activemq,                                <--- RED
    org.apache.activemq.broker,                         <--- RED
    org.apache.activemq.command,                        <--- RED
    org.apache.activemq.network,                        <--- RED
    org.apache.activemq.spring,                         <--- RED
    org.apache.activemq.transport.discovery,            <--- RED
    org.apache.activemq.util,                           <--- RED
    org.apache.xbean.spring.context;version="[3.12,4)",
    org.apache.xbean.spring.context.impl;version="[3.12,4)",
    org.apache.zookeeper;version="[3.4,4)",
    org.codehaus.jackson.annotate;version="[1.9,2)",
    org.fusesource.fabric.groups;version="[7.2,7.3)",
    org.fusesource.fabric.groups.internal;version="[7.2,7.3)",
    org.fusesource.fabric.zookeeper;version="[7.2,7.3)",
    org.fusesource.fabric.zookeeper.internal;version="[7.2,7.3)",
    org.fusesource.fabric.zookeeper.utils;version="[7.2,7.3)",
    org.linkedin.util.clock,
    org.osgi.framework;version="[1.6,2)",
    org.osgi.service.cm;version="[1.4,2)",
    org.osgi.util.tracker;version="[1.5,2)",
    org.slf4j;version="[1.6,2)",
    org.springframework.beans.factory;version="[3,4)",
    org.springframework.beans.factory.xml;version="[3,4)",
    org.springframework.context.support;version="[3,4)",
    org.springframework.core.io;version="[3,4)",
    scala;version="[2.9,2.10]",
    scala.collection;version="[2.9,2.10]",
    scala.collection.generic;version="[2.9,2.10]",
    scala.collection.immutable;version="[2.9,2.10]",
    scala.collection.mutable;version="[2.9,2.10]",
    scala.reflect;version="[2.9,2.10]",
    scala.runtime;version="[2.9,2.10]"
Export-Package = 
    org.fusesource.mq.fabric;
        uses:="scala.reflect,
            org.osgi.framework,
            org.osgi.service.cm,
            scala,
            org.springframework.core.io,
            org.springframework.beans.factory.xml,
            org.apache.xbean.spring.context,
            scala.runtime,
            scala.collection,
            scala.collection.mutable,
            org.apache.activemq.broker,
            org.fusesource.fabric.zookeeper,
            org.apache.activemq.network,
            org.apache.activemq.util,
            org.slf4j,
            org.apache.activemq.spring,
            org.apache.xbean.spring.context.impl,
            scala.collection.generic,
            org.fusesource.fabric.groups,
            scala.collection.immutable,
            javax.jms,
            org.apache.activemq,
            org.springframework.context.support,
            org.fusesource.fabric.groups.internal,
            org.osgi.util.tracker,
            org.springframework.beans.factory,
            org.apache.activemq.transport.discovery,
            org.apache.activemq.command,
            org.codehaus.jackson.annotate,
            org.fusesource.fabric.zookeeper.utils,
            org.apache.zookeeper,
            org.linkedin.util.clock,
            org.fusesource.fabric.zookeeper.internal";
        version=7.2.0.redhat-057

번들을 시작하면 다음과 같은 오류가 발생합니다.

[root@8cdbdd27720a home]# client -r 2 -d 60 -u admin -p admin "osgi:start 128"
Error executing command: Error starting bundles:
    Unable to start bundle 128: Unresolved constraint in bundle org.jboss.amq.mq-fabric [128]: Unable to resolve 128.1: missing requirement [128.1] osgi.wiring.package; (osgi.wiring.package=org.apache.activemq)

왜 이런 일이 일어나는지 아는 사람이 있나요? 수동으로 수행하면 작동하지만 Docker 빌드의 일부로 실패하는 이유는 무엇입니까?

관련 정보