You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Yann BLAZART <ya...@externe.bnpparibas.com> on 2015/08/13 11:28:15 UTC

Autonomus jar

Hello.

I'm currently trying to use TomEE for my customer.
The goal is to deliver applications as standalone jar.

I successed to do this with tome:exec. But as it launch two process and as it embedded a full tome, I want to try to do it with tome embedded.

So I followed the post 50 shades of TomEE from Tomitribe blog.

<dependencies>
        <dependency>
            <groupId>myAppGroup</groupId>
            <artifactId>myWar</artifactId>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.apache.tomee</groupId>
            <artifactId>tomee-embedded</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-ra</artifactId>
            <version>5.11.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.components</groupId>
            <artifactId>geronimo-connector</artifactId>
            <version>3.1.2</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <filters>
                                <filter> <!-- we don't want JSF to be activated -->
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/faces-config.xml</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>org.apache.tomee.embedded.Main</mainClass>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                    <resource>META-INF/cxf/bus-extensions.txt</resource>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                    <resource>META-INF/openwebbeans/openwebbeans.properties</resource>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

But it doesn't work.

By doing java -jar  xxx.jar , it stop here :

INFO - Starting TomEE from: xxxx
INFO - Initializing ProtocolHandler ["http-bio-8080"]
INFO - Starting service Tomcat
INFO - Starting Servlet Engine: Apache Tomcat/8.0.24
INFO - Starting ProtocolHandler ["http-bio-8080"]
INFO - Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
INFO - ********************************************************************************
INFO - OpenEJB http://tomee.apache.org/
INFO - Startup: Thu Aug 13 11:25:05 CEST 2015
INFO - Copyright 1999-2015 (C) Apache OpenEJB Project, All Rights Reserved.
INFO - Version: 7.0.0-SNAPSHOT
INFO - Build date: 20150813
INFO - Build time: 04:07
INFO - ********************************************************************************
INFO - openejb.home = xxxx
INFO - openejb.base xxxxx
INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@701fc37a
INFO - Succeeded in installing singleton service
INFO - openejb configuration file is xxxxx
INFO - Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service)
INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Using 'openejb.system.apps=false'
INFO - Using 'openejb.deployments.classpath=false'
INFO - Creating TransactionManager(id=Default Transaction Manager)
INFO - Creating SecurityService(id=Tomcat Security Service)
INFO - Using 'openejb.servicemanager.enabled=false'

If I do java -jar  xxx.jar -as-war  , it stop here :


INFO - Creating TransactionManager(id=Default Transaction Manager)
INFO - Creating SecurityService(id=Tomcat Security Service)
INFO - Using 'openejb.servicemanager.enabled=false'
INFO - Using 'openejb.deployments.classpath.filter.systemapps=false'
INFO - Configuring enterprise application:
INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
INFO - Auto-creating a container for bean .Comp1440738283: Container(type=MANAGED, id=Default Managed Container)
INFO - Creating Container(id=Default Managed Container)
INFO - Using directory C:\Users\a41192\AppData\Local\Temp for stateful session passivation
INFO - Configuring Service(id=comp/DefaultManagedExecutorService, type=Resource, provider-id=Default Executor Service)
INFO - Auto-creating a Resource with id 'comp/DefaultManagedExecutorService' of type 'javax.enterprise.concurrent.ManagedExecutorService for '.Comp1440738283'.
INFO - Auto-linking resource-env-ref 'java:comp/DefaultManagedExecutorService' in bean .Comp1440738283 to Resource(id=comp/DefaultManagedExecutorService)
INFO - Configuring Service(id=comp/DefaultManagedScheduledExecutorService, type=Resource, provider-id=Default Scheduled Executor Service)
INFO - Auto-creating a Resource with id 'comp/DefaultManagedScheduledExecutorService' of type 'javax.enterprise.concurrent.ManagedScheduledExecutorService for '.Comp1440738283'.
INFO - Auto-linking resource-env-ref 'java:comp/DefaultManagedScheduledExecutorService' in bean .Comp1440738283 to Resource(id=comp/DefaultManagedScheduledExecutorService)
INFO - Configuring Service(id=comp/DefaultManagedThreadFactory, type=Resource, provider-id=Default Managed Thread Factory)
INFO - Auto-creating a Resource with id 'comp/DefaultManagedThreadFactory' of type 'javax.enterprise.concurrent.ManagedThreadFactory for '.Comp1440738283'.
INFO - Auto-linking resource-env-ref 'java:comp/DefaultManagedThreadFactory' in bean .Comp1440738283 to Resource(id=comp/DefaultManagedThreadFactory)
INFO - Auto-linking resource-env-ref 'java:comp/DefaultManagedExecutorService' in bean EjbModule1823409783.Comp1849015357 to Resource(id=comp/DefaultManagedExecutorService)
INFO - Auto-linking resource-env-ref 'java:comp/DefaultManagedScheduledExecutorService' in bean EjbModule1823409783.Comp1849015357 to Resource(id=comp/DefaultManagedScheduledExecutorService)
INFO - Auto-linking resource-env-ref 'java:comp/DefaultManagedThreadFactory' in bean EjbModule1823409783.Comp1849015357 to Resource(id=comp/DefaultManagedThreadFactory)
INFO - Enterprise application "" loaded.
INFO - Assembling app:
INFO - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@282003e1
INFO - OpenWebBeans Container is starting...
INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
INFO - Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
INFO - Skipping deployment of Class class org.apache.commons.pool2.proxy.CglibProxySourcedue to a NoClassDefFoundError: net/sf/cglib/proxy/Callback
INFO - All injection points were validated successfully.
INFO - OpenWebBeans Container has started, it took 426 ms.
INFO - using default host: localhost
INFO - ------------------------- localhost -> /
INFO - Using 'openejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager'
INFO - The start() method was called on component [org.apache.catalina.webresources.JarResourceSet@322e49ee] after start() had already been called. The second call will be ignored.
INFO - Deployed Application(path=)


Is anybody could help ?


This message and any attachments (the "message") is
intended solely for the intended addressees and is confidential. 
If you receive this message in error,or are not the intended recipient(s), 
please delete it and any copies from your systems and immediately notify
the sender. Any unauthorized view, use that does not comply with its purpose, 
dissemination or disclosure, either whole or partial, is prohibited. Since the internet 
cannot guarantee the integrity of this message which may not be reliable, BNP PARIBAS 
(and its subsidiaries) shall not be liable for the message if modified, changed or falsified. 
Do not print this message unless it is necessary,consider the environment.

----------------------------------------------------------------------------------------------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le "message") 
sont etablis a l'intention exclusive de ses destinataires et sont confidentiels.
Si vous recevez ce message par erreur ou s'il ne vous est pas destine,
merci de le detruire ainsi que toute copie de votre systeme et d'en avertir
immediatement l'expediteur. Toute lecture non autorisee, toute utilisation de 
ce message qui n'est pas conforme a sa destination, toute diffusion ou toute 
publication, totale ou partielle, est interdite. L'Internet ne permettant pas d'assurer
l'integrite de ce message electronique susceptible d'alteration, BNP Paribas 
(et ses filiales) decline(nt) toute responsabilite au titre de ce message dans l'hypothese
ou il aurait ete modifie, deforme ou falsifie. 
N'imprimez ce message que si necessaire, pensez a l'environnement.

Re: Autonomus jar

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hello Yann,

"-as-war" is needed with built in Main (cause you can also deploy actual
war in an embedded fashion). If you jar is called
tomee-deployment-of-my-super-app.jar for instance it will not get scanned
cause tomee-* are ignored. Easy way to check: run it again after having
renamed the jar yann.jar ;)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-08-13 2:28 GMT-07:00 Yann BLAZART <ya...@externe.bnpparibas.com>
:

> Hello.
>
> I'm currently trying to use TomEE for my customer.
> The goal is to deliver applications as standalone jar.
>
> I successed to do this with tome:exec. But as it launch two process and as
> it embedded a full tome, I want to try to do it with tome embedded.
>
> So I followed the post 50 shades of TomEE from Tomitribe blog.
>
> <dependencies>
>         <dependency>
>             <groupId>myAppGroup</groupId>
>             <artifactId>myWar</artifactId>
>             <type>war</type>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.tomee</groupId>
>             <artifactId>tomee-embedded</artifactId>
>             <scope>compile</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.activemq</groupId>
>             <artifactId>activemq-ra</artifactId>
>             <version>5.11.0</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.geronimo.components</groupId>
>             <artifactId>geronimo-connector</artifactId>
>             <version>3.1.2</version>
>         </dependency>
>     </dependencies>
>
>     <build>
>         <plugins>
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-shade-plugin</artifactId>
>                 <version>2.3</version>
>                 <executions>
>                     <execution>
>                         <phase>package</phase>
>                         <goals>
>                             <goal>shade</goal>
>                         </goals>
>                         <configuration>
>                             <filters>
>                                 <filter> <!-- we don't want JSF to be
> activated -->
>                                     <artifact>*:*</artifact>
>                                     <excludes>
>
> <exclude>META-INF/faces-config.xml</exclude>
>                                     </excludes>
>                                 </filter>
>                             </filters>
>                             <transformers>
>                                 <transformer
> implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
>
> <mainClass>org.apache.tomee.embedded.Main</mainClass>
>                                 </transformer>
>                                 <transformer
> implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
>
> <resource>META-INF/cxf/bus-extensions.txt</resource>
>                                 </transformer>
>                                 <transformer
> implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
>
> <resource>META-INF/openwebbeans/openwebbeans.properties</resource>
>                                 </transformer>
>                             </transformers>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>         </plugins>
>     </build>
>
> But it doesn't work.
>
> By doing java -jar  xxx.jar , it stop here :
>
> INFO - Starting TomEE from: xxxx
> INFO - Initializing ProtocolHandler ["http-bio-8080"]
> INFO - Starting service Tomcat
> INFO - Starting Servlet Engine: Apache Tomcat/8.0.24
> INFO - Starting ProtocolHandler ["http-bio-8080"]
> INFO - Using
> 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
> INFO -
> ********************************************************************************
> INFO - OpenEJB http://tomee.apache.org/
> INFO - Startup: Thu Aug 13 11:25:05 CEST 2015
> INFO - Copyright 1999-2015 (C) Apache OpenEJB Project, All Rights Reserved.
> INFO - Version: 7.0.0-SNAPSHOT
> INFO - Build date: 20150813
> INFO - Build time: 04:07
> INFO -
> ********************************************************************************
> INFO - openejb.home = xxxx
> INFO - openejb.base xxxxx
> INFO - Created new singletonService
> org.apache.openejb.cdi.ThreadSingletonServiceImpl@701fc37a
> INFO - Succeeded in installing singleton service
> INFO - openejb configuration file is xxxxx
> INFO - Configuring Service(id=Tomcat Security Service,
> type=SecurityService, provider-id=Tomcat Security Service)
> INFO - Configuring Service(id=Default Transaction Manager,
> type=TransactionManager, provider-id=Default Transaction Manager)
> INFO - Using 'openejb.system.apps=false'
> INFO - Using 'openejb.deployments.classpath=false'
> INFO - Creating TransactionManager(id=Default Transaction Manager)
> INFO - Creating SecurityService(id=Tomcat Security Service)
> INFO - Using 'openejb.servicemanager.enabled=false'
>
> If I do java -jar  xxx.jar -as-war  , it stop here :
>
>
> INFO - Creating TransactionManager(id=Default Transaction Manager)
> INFO - Creating SecurityService(id=Tomcat Security Service)
> INFO - Using 'openejb.servicemanager.enabled=false'
> INFO - Using 'openejb.deployments.classpath.filter.systemapps=false'
> INFO - Configuring enterprise application:
> INFO - Configuring Service(id=Default Managed Container, type=Container,
> provider-id=Default Managed Container)
> INFO - Auto-creating a container for bean .Comp1440738283:
> Container(type=MANAGED, id=Default Managed Container)
> INFO - Creating Container(id=Default Managed Container)
> INFO - Using directory C:\Users\a41192\AppData\Local\Temp for stateful
> session passivation
> INFO - Configuring Service(id=comp/DefaultManagedExecutorService,
> type=Resource, provider-id=Default Executor Service)
> INFO - Auto-creating a Resource with id
> 'comp/DefaultManagedExecutorService' of type
> 'javax.enterprise.concurrent.ManagedExecutorService for '.Comp1440738283'.
> INFO - Auto-linking resource-env-ref
> 'java:comp/DefaultManagedExecutorService' in bean .Comp1440738283 to
> Resource(id=comp/DefaultManagedExecutorService)
> INFO - Configuring Service(id=comp/DefaultManagedScheduledExecutorService,
> type=Resource, provider-id=Default Scheduled Executor Service)
> INFO - Auto-creating a Resource with id
> 'comp/DefaultManagedScheduledExecutorService' of type
> 'javax.enterprise.concurrent.ManagedScheduledExecutorService for
> '.Comp1440738283'.
> INFO - Auto-linking resource-env-ref
> 'java:comp/DefaultManagedScheduledExecutorService' in bean .Comp1440738283
> to Resource(id=comp/DefaultManagedScheduledExecutorService)
> INFO - Configuring Service(id=comp/DefaultManagedThreadFactory,
> type=Resource, provider-id=Default Managed Thread Factory)
> INFO - Auto-creating a Resource with id 'comp/DefaultManagedThreadFactory'
> of type 'javax.enterprise.concurrent.ManagedThreadFactory for
> '.Comp1440738283'.
> INFO - Auto-linking resource-env-ref
> 'java:comp/DefaultManagedThreadFactory' in bean .Comp1440738283 to
> Resource(id=comp/DefaultManagedThreadFactory)
> INFO - Auto-linking resource-env-ref
> 'java:comp/DefaultManagedExecutorService' in bean
> EjbModule1823409783.Comp1849015357 to
> Resource(id=comp/DefaultManagedExecutorService)
> INFO - Auto-linking resource-env-ref
> 'java:comp/DefaultManagedScheduledExecutorService' in bean
> EjbModule1823409783.Comp1849015357 to
> Resource(id=comp/DefaultManagedScheduledExecutorService)
> INFO - Auto-linking resource-env-ref
> 'java:comp/DefaultManagedThreadFactory' in bean
> EjbModule1823409783.Comp1849015357 to
> Resource(id=comp/DefaultManagedThreadFactory)
> INFO - Enterprise application "" loaded.
> INFO - Assembling app:
> INFO - Existing thread singleton service in SystemInstance():
> org.apache.openejb.cdi.ThreadSingletonServiceImpl@282003e1
> INFO - OpenWebBeans Container is starting...
> INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
> INFO - Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
> INFO - Skipping deployment of Class class
> org.apache.commons.pool2.proxy.CglibProxySourcedue to a
> NoClassDefFoundError: net/sf/cglib/proxy/Callback
> INFO - All injection points were validated successfully.
> INFO - OpenWebBeans Container has started, it took 426 ms.
> INFO - using default host: localhost
> INFO - ------------------------- localhost -> /
> INFO - Using
> 'openejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager'
> INFO - The start() method was called on component
> [org.apache.catalina.webresources.JarResourceSet@322e49ee] after start()
> had already been called. The second call will be ignored.
> INFO - Deployed Application(path=)
>
>
> Is anybody could help ?
>
>
> This message and any attachments (the "message") is
> intended solely for the intended addressees and is confidential.
> If you receive this message in error,or are not the intended recipient(s),
> please delete it and any copies from your systems and immediately notify
> the sender. Any unauthorized view, use that does not comply with its
> purpose,
> dissemination or disclosure, either whole or partial, is prohibited. Since
> the internet
> cannot guarantee the integrity of this message which may not be reliable,
> BNP PARIBAS
> (and its subsidiaries) shall not be liable for the message if modified,
> changed or falsified.
> Do not print this message unless it is necessary,consider the environment.
>
>
> ----------------------------------------------------------------------------------------------------------------------------------
>
> Ce message et toutes les pieces jointes (ci-apres le "message")
> sont etablis a l'intention exclusive de ses destinataires et sont
> confidentiels.
> Si vous recevez ce message par erreur ou s'il ne vous est pas destine,
> merci de le detruire ainsi que toute copie de votre systeme et d'en avertir
> immediatement l'expediteur. Toute lecture non autorisee, toute utilisation
> de
> ce message qui n'est pas conforme a sa destination, toute diffusion ou
> toute
> publication, totale ou partielle, est interdite. L'Internet ne permettant
> pas d'assurer
> l'integrite de ce message electronique susceptible d'alteration, BNP
> Paribas
> (et ses filiales) decline(nt) toute responsabilite au titre de ce message
> dans l'hypothese
> ou il aurait ete modifie, deforme ou falsifie.
> N'imprimez ce message que si necessaire, pensez a l'environnement.
>