You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Krenn Daniel <Da...@team-con.de> on 2019/05/13 14:51:18 UTC

ActiveMQ and Apache Karaf 4.2.4

Hello dear fellow karaf users!

Recently I have been trying to dockerize our karaf application. I started with baby steps and I followed this tutorial: http://matthieure.me/karaf/docker/2018/01/03/karaf-custom-distribution-with-docker.html
This allows me to start a karaf instance in docker and also access the console no problem.
This changes when I try to define some bootFeatures in the POM. It's just the standard bundle, camel, and a few camel features, like camel-http4 and camel-milo.
I can no longer install any additional features as it just throws an OutOfMemoryError. (java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space)
Doesn't matter which feature I choose, it's always the same error.
Also, sometimes commands like log:tail stop working, it just says it doesn't know the command.
If someone is interested, here is my pom:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <!--
      Licensed to the Apache Software Foundation (ASF) under one or more
      contributor license agreements.  See the NOTICE file distributed with
      this work for additional information regarding copyright ownership.
      The ASF licenses this file to You under the Apache License, Version 2.0
      (the "License"); you may not use this file except in compliance with
      the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    -->

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.tcon</groupId>
    <artifactId>karaf</artifactId>
    <version>1.0</version>
    <packaging>karaf-assembly</packaging>

    <name>karaf-feature</name>
    <description>karaf details</description>

    <repositories>
        <!-- Apache ServiceMix repository (for region) -->
        <repository>
            <id>apache.servicemix.m2</id>
            <name>Apache ServiceMix M2 repository</name>
            <url>http://svn.apache.org/repos/asf/servicemix/m2-repo</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <!-- OPS4J SNAPSHOT repository -->
        <repository>
            <id>ops4j.sonatype.snapshots.deploy</id>
            <name>OPS4J snapshot repository</name>
            <url>https://oss.sonatype.org/content/repositories/ops4j-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <!-- Apache SNAPSHOT -->
        <repository>
            <id>apache.snapshots.deploy</id>
            <name>Apache snapshot repository</name>
            <url>https://repository.apache.org/content/groups/snapshots-group</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>framework</artifactId>
            <version>4.2.4</version>
            <type>kar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>standard</artifactId>
            <version>4.2.4</version>
            <classifier>features</classifier>
            <type>xml</type>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>spring</artifactId>
            <version>4.2.4</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>enterprise</artifactId>
            <version>4.2.4</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.karaf</groupId>
            <artifactId>apache-camel</artifactId>
            <version>3.0.0-M1</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <!--<dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-karaf</artifactId>
            <version>5.15.9</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency> -->
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/filtered-resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.karaf.tooling</groupId>
                    <artifactId>karaf-maven-plugin</artifactId>
                    <version>4.2.4</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>process-resources</id>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <configuration>
                    <installedFeatures>
                        <feature>wrapper</feature>
                    </installedFeatures>
                    <!-- <startupFeatures/> -->
                   <bootFeatures>
                        <!-- standard distribution -->
                        <feature>standard</feature>
                        <feature>camel</feature>
                        <feature>camel-http4</feature>
                        <feature>camel-mongodb3</feature>
                        <feature>camel-blueprint</feature>
                        <feature>camel-core</feature>
                        <feature>camel-groovy</feature>
                        <feature>camel-jackson</feature>
                        <feature>camel-jetty9</feature>
                        <feature>camel-jms</feature>
                        <feature>camel-jsonpath</feature>
                        <feature>camel-milo</feature>
                        <feature>camel-swagger-java</feature>
                        <!--<feature>activemq</feature> -->
                        <!-- minimal distribution -->
                        <!--<feature>minimal</feature>-->
                    </bootFeatures>
                    <javase>1.8</javase>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


What am I doing wrong? Outside of the docker context this works normally. Can you please help me find the issue?

Regards,
Daniel
Daniel Krenn
Consultant MES
Daniel.Krenn@team-con.de<ma...@team-con.de>
 |   Tel. +49 (9931) 981 365



 
 ​T.CON GmbH & Co. KG 
 
 ​Hauptsitz
 Straubinger Straße 2
 94447 Plattling 
 T: +49 (0)9931 981 100
 F: +49 (0)9931 981 199  www.mescat.de >
 www.team-con.de >
 
 Messetermine >
 facebook   |  twitter  |  xing  |  linkedin  |  youtube | instagram
 
Geschäftsführer: Karl Fuchs, Michael Gulde, Stefan Fiedler
​KG, AG Deggendorf HRA 1618 Pers. haftender Ges.
 T.CON Beteiligungs-GmbH AG
 Deggendorf HRB 2053
 
Besuchen Sie uns auf folgenden Events:
Erhalten Sie wichtige Informationen von T.CON. Jetzt anmelden.

Re: ActiveMQ and Apache Karaf 4.2.4

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

I'm suggesting to take a look on:

http://blog.nanthrax.net/?p=893

Regarding your OOM exception, did you try to increase the heap (Xmx) ?

Regards
JB

On 13/05/2019 16:51, Krenn Daniel wrote:
> Hello dear fellow karaf users!
> 
>  
> 
> Recently I have been trying to dockerize our karaf application. I
> started with baby steps and I followed this tutorial:
> http://matthieure.me/karaf/docker/2018/01/03/karaf-custom-distribution-with-docker.html
> 
> This allows me to start a karaf instance in docker and also access the
> console no problem.
> 
> This changes when I try to define some bootFeatures in the POM. It’s
> just the standard bundle, camel, and a few camel features, like
> camel-http4 and camel-milo.
> 
> I can no longer install any additional features as it just throws an
> OutOfMemoryError. (java.util.concurrent.ExecutionException:
> java.lang.OutOfMemoryError: Java heap space)
> 
> Doesn’t matter which feature I choose, it’s always the same error.
> 
> Also, sometimes commands like log:tail stop working, it just says it
> doesn’t know the command.
> 
> If someone is interested, here is my pom:
> 
>  
> 
> <?xmlversion="1.0"encoding="UTF-8"?>
> 
> <projectxmlns="http://maven.apache.org/POM/4.0.0"
> 
>    
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> 
>  
> 
>     <!--
> 
>       Licensed to the Apache Software Foundation (ASF) under one or more
> 
>       contributor license agreements.  See the NOTICE file distributed with
> 
>       this work for additional information regarding copyright ownership.
> 
>       The ASF licenses this file to You under the Apache License,
> Version 2.0
> 
>       (the "License"); you may not use this file except in compliance with
> 
>       the License.  You may obtain a copy of the License at
> 
>  
> 
>          http://www.apache.org/licenses/LICENSE-2.0
> 
>  
> 
>       Unless required by applicable law or agreed to in writing, software
> 
>       distributed under the License is distributed on an "AS IS" BASIS,
> 
>       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> 
>       See the License for the specific language governing permissions and
> 
>       limitations under the License.
> 
>     -->
> 
>  
> 
>     <modelVersion>4.0.0</modelVersion>
> 
>  
> 
>     <groupId>com.tcon</groupId>
> 
>     <artifactId>karaf</artifactId>
> 
>     <version>1.0</version>
> 
>     <packaging>karaf-assembly</packaging>
> 
>  
> 
>     <name>karaf-feature</name>
> 
>     <description>karaf details</description>
> 
>  
> 
>     <repositories>
> 
>         <!-- Apache ServiceMix repository (for region) -->
> 
>         <repository>
> 
>             <id>apache.servicemix.m2</id>
> 
>             <name>Apache ServiceMix M2 repository</name>
> 
>             <url>http://svn.apache.org/repos/asf/servicemix/m2-repo</url>
> 
>             <releases>
> 
>                 <enabled>true</enabled>
> 
>             </releases>
> 
>             <snapshots>
> 
>                 <enabled>false</enabled>
> 
>             </snapshots>
> 
>         </repository>
> 
>         <!-- OPS4J SNAPSHOT repository -->
> 
>         <repository>
> 
>             <id>ops4j.sonatype.snapshots.deploy</id>
> 
>             <name>OPS4J snapshot repository</name>
> 
>            
> <url>https://oss.sonatype.org/content/repositories/ops4j-snapshots/</url>
> 
>             <releases>
> 
>                 <enabled>false</enabled>
> 
>             </releases>
> 
>             <snapshots>
> 
>                 <enabled>true</enabled>
> 
>             </snapshots>
> 
>         </repository>
> 
>         <!-- Apache SNAPSHOT -->
> 
>         <repository>
> 
>             <id>apache.snapshots.deploy</id>
> 
>             <name>Apache snapshot repository</name>
> 
>            
> <url>https://repository.apache.org/content/groups/snapshots-group</url>
> 
>             <releases>
> 
>                 <enabled>false</enabled>
> 
>             </releases>
> 
>             <snapshots>
> 
>                 <enabled>true</enabled>
> 
>             </snapshots>
> 
>         </repository>
> 
>     </repositories>
> 
>  
> 
>     <dependencies>
> 
>         <dependency>
> 
>             <groupId>org.apache.karaf.features</groupId>
> 
>             <artifactId>framework</artifactId>
> 
>             <version>4.2.4</version>
> 
>             <type>kar</type>
> 
>         </dependency>
> 
>         <dependency>
> 
>             <groupId>org.apache.karaf.features</groupId>
> 
>             <artifactId>standard</artifactId>
> 
>             <version>4.2.4</version>
> 
>             <classifier>features</classifier>
> 
>             <type>xml</type>
> 
>         </dependency>
> 
>         <dependency>
> 
>             <groupId>org.apache.karaf.features</groupId>
> 
>             <artifactId>spring</artifactId>
> 
>             <version>4.2.4</version>
> 
>             <classifier>features</classifier>
> 
>             <type>xml</type>
> 
>             <scope>runtime</scope>
> 
>         </dependency>
> 
>         <dependency>
> 
>             <groupId>org.apache.karaf.features</groupId>
> 
>             <artifactId>enterprise</artifactId>
> 
>             <version>4.2.4</version>
> 
>             <classifier>features</classifier>
> 
>             <type>xml</type>
> 
>             <scope>runtime</scope>
> 
>         </dependency>
> 
>         <dependency>
> 
>             <groupId>org.apache.camel.karaf</groupId>
> 
>             <artifactId>apache-camel</artifactId>
> 
>             <version>3.0.0-M1</version>
> 
>             <classifier>features</classifier>
> 
>             <type>xml</type>
> 
>             <scope>runtime</scope>
> 
>         </dependency>
> 
>         <!--<dependency>
> 
>             <groupId>org.apache.activemq</groupId>
> 
>             <artifactId>activemq-karaf</artifactId>
> 
>             <version>5.15.9</version>
> 
>             <classifier>features</classifier>
> 
>             <type>xml</type>
> 
>             <scope>runtime</scope>
> 
>         </dependency> -->
> 
>     </dependencies>
> 
>  
> 
>     <build>
> 
>         <resources>
> 
>             <resource>
> 
>                 <directory>src/main/resources</directory>
> 
>                 <filtering>false</filtering>
> 
>                 <includes>
> 
>                     <include>**/*</include>
> 
>                 </includes>
> 
>             </resource>
> 
>             <resource>
> 
>                 <directory>src/main/filtered-resources</directory>
> 
>                 <filtering>true</filtering>
> 
>                 <includes>
> 
>                     <include>**/*</include>
> 
>                 </includes>
> 
>             </resource>
> 
>         </resources>
> 
>         <pluginManagement>
> 
>             <plugins>
> 
>                 <plugin>
> 
>                     <groupId>org.apache.karaf.tooling</groupId>
> 
>                     <artifactId>karaf-maven-plugin</artifactId>
> 
>                     <version>4.2.4</version>
> 
>                     <extensions>true</extensions>
> 
>                 </plugin>
> 
>             </plugins>
> 
>         </pluginManagement>
> 
>         <plugins>
> 
>             <plugin>
> 
>                 <groupId>org.apache.maven.plugins</groupId>
> 
>                 <artifactId>maven-resources-plugin</artifactId>
> 
>                 <version>2.6</version>
> 
>                 <executions>
> 
>                     <execution>
> 
>                         <id>process-resources</id>
> 
>                         <goals>
> 
>                             <goal>resources</goal>
> 
>                         </goals>
> 
>                     </execution>
> 
>                 </executions>
> 
>             </plugin>
> 
>             <plugin>
> 
>                 <groupId>org.apache.karaf.tooling</groupId>
> 
>                 <artifactId>karaf-maven-plugin</artifactId>
> 
>                 <configuration>
> 
>                     <installedFeatures>
> 
>                         <feature>wrapper</feature>
> 
>                     </installedFeatures>
> 
>                     <!-- <startupFeatures/> -->
> 
>                    <bootFeatures>
> 
>                         <!-- standard distribution -->
> 
>                         <feature>standard</feature>
> 
>                         <feature>camel</feature>
> 
>                         <feature>camel-http4</feature>
> 
>                         <feature>camel-mongodb3</feature>
> 
>                         <feature>camel-blueprint</feature>
> 
>                         <feature>camel-core</feature>
> 
>                         <feature>camel-groovy</feature>
> 
>                         <feature>camel-jackson</feature>
> 
>                         <feature>camel-jetty9</feature>
> 
>                         <feature>camel-jms</feature>
> 
>                         <feature>camel-jsonpath</feature>
> 
>                         <feature>camel-milo</feature>
> 
>                         <feature>camel-swagger-java</feature>
> 
>                         <!--<feature>activemq</feature> -->
> 
>                         <!-- minimal distribution -->
> 
>                         <!--<feature>minimal</feature>-->
> 
>                     </bootFeatures>
> 
>                     <javase>1.8</javase>
> 
>                 </configuration>
> 
>             </plugin>
> 
>         </plugins>
> 
>     </build>
> 
>  
> 
> </project>
> 
>  
> 
>  
> 
> What am I doing wrong? Outside of the docker context this works
> normally. Can you please help me find the issue?
> 
>  
> 
> Regards,
> 
> Daniel
> 
> *Daniel* *Krenn*
> Consultant MES
> 
> Daniel.Krenn@team-con.de <ma...@team-con.de>
> 
> 	
> 
>  |   Tel. +49 (9931) 981 365
> 
> 	
> 
>  
> 
>  
> 
> ​
>  ​T.CON GmbH & Co. KG
>  ​Hauptsitz
>  Straubinger Straße 2
>  94447 Plattling 
>  *T: +49 (0)9931 981 100* <tel:+499931981100>
>  F: +49 (0)9931 981 199 
> 
> 	
>  *www.mescat.de* <http://www.mescat.de/> >
>  *www.team-con.de* <http://www.team-con.de/> >
>  
>  *Messetermine*
> <http://www.team-con.de/unternehmen/news-veranstaltungen/veranstaltungen.html> >
>  *facebook* <https://www.facebook.com/TEAMCONde>   |  *twitter  *
> <https://twitter.com/team_consulting>|  *xing*
> <https://www.xing.com/companies/t.congmbhco.kg>  |  *linkedin  *
> <https://www.linkedin.com/company/t-con-gmbh-&-co-kg>*|  *
> <http://www.youtube.com/user/TEAMCONde?>*youtube*
> <https://www.youtube.com/user/TEAMCONde?> *|*
> <http://www.youtube.com/user/TEAMCONde?> *instagram*
> <https://www.instagram.com/team.consulting/>
>  
> 
> 	
> T.CON GmbH & Co. KG <https://www.team-con.de/>
> 
> Geschäftsführer: Karl Fuchs, Michael Gulde, Stefan Fiedler
> ​KG, AG Deggendorf HRA 1618 Pers. haftender Ges.
> T.CON Beteiligungs-GmbH AG
> Deggendorf HRB 2053
> 
> Besuchen Sie uns auf folgenden Events:
> 
> DSAG
> <https://www.team-con.de/unternehmen/news-veranstaltungen/veranstaltungen/dsag-technologietage>
> 
> Hannover Messe
> <https://www.team-con.de/unternehmen/news-veranstaltungen/veranstaltungen/hannover-messe-2019.html>
> 
> Erhalten Sie wichtige Informationen von T.CON. *Jetzt anmelden.*
> <https://www2.team-con.de/newsletter>
> 
> MES CAT Webinare
> <https://www.team-con.de/unternehmen/news-veranstaltungen/webinare.html>
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com