tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Louis Monteiro <jlmonte...@tomitribe.com>
Subject Re: Bug? 2 Apps in Tomme 1.6.0 with same name EJB not deploy second App
Date Wed, 16 Apr 2014 07:28:19 GMT
I wouldn't say rare actually.
I mean, now (since Java EE 6) we have collapsed EAR, nobody cares about EAR
nightmare, but sometimes they want to share the same business logic on 2
webapps. So that occurs I think.

Definitely, we could do the opposite which is:
- remove old names by default
- add a system property to bind them again if needed

That would allow TomEE to always work out of the box and users to keep some
kind off compatibility if needed.


   --
    Jean-Louis Monteiro
    http://twitter.com/jlouismonteiro
    http://www.tomitribe.com


On Wed, Apr 16, 2014 at 9:21 AM, Romain Manni-Bucau
<rmannibucau@gmail.com>wrote:

> or just change the default.
>
> That said deploying the same ejb in two apps is actually rare so not
> sure we really need to handle it by default.
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014-04-16 9:19 GMT+02:00 Jean-Louis Monteiro <jlmonteiro@tomitribe.com>:
> > We should probably add a sys prop (if it does not already exists) to de
> > activate the old JNDI names.
> > Isn't it?
> >
> >
> > On Wed, Apr 16, 2014 at 7:37 AM, Romain Manni-Bucau
> > <rmannibucau@gmail.com>wrote:
> >
> >> Hi
> >>
> >> 1) no
> >> 2) no
> >> 3) yes http://tomee.apache.org/jndi-names.html
> >>
> >> that's inheritance of old names we keep for compatibility
> >>
> >>
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2014-04-16 4:32 GMT+02:00 Luis Castro <luis_castro@animotion.com.mx>:
> >> > Hello.
> >> >
> >> >
> >> > Environment TOMEE 1.6.0 and OpenEJB Provided
> >> >
> >> >     <dependencies>
> >> >
> >> >         <!-- tomee-->
> >> >         <dependency>
> >> >             <groupId>org.apache.openejb</groupId>
> >> >             <artifactId>apache-tomee</artifactId>
> >> >             <version>1.6.0</version>
> >> >             <classifier>webprofile</classifier>
> >> >             <type>zip</type>
> >> >             <scope>provided</scope>
> >> >         </dependency>
> >> >
> >> >     Use Case 1#
> >> >
> >> > Name aplication "App One" ;
> >> >
> >> > "App One" have the class EJB  "UsuariosFacadeLocal" in package
> >> > com.appone.businesslayer.ejbs.local
> >> >
> >> > Code Example :
> >> > package com.appone.businesslayer.ejbs;
> >> >
> >> > import com.appone.businesslayer.ejbs.local.UsuariosFacadeLocal;
> >> > import javax.ejb.Stateless;
> >> > import javax.ejb.TransactionManagement;
> >> > import javax.ejb.TransactionManagementType;
> >> >
> >> > @Stateless
> >> > @TransactionManagement(TransactionManagementType.CONTAINER)
> >> > public class UsuariosFacade implements UsuariosFacadeLocal {
> >> >
> >> >     @Override
> >> >     public String hello() {
> >> >         return this.getClass().getCanonicalName();
> >> >     }
> >> > }
> >> >
> >> > And deployed and run successful
> >> >
> >> > Another app inside  same server Tomee 1.6.0
> >> > Name aplication "App Two" ;
> >> >
> >> > "App TWO" have the class EJB  "UsuariosFacadeLocal" in package
> >> > com.apptwo.businesslayer.ejbs.local
> >> >
> >> > And deployed and run ERROR:
> >> >
> >> > Grave: Application cannot be deployed as it contains deployment-ids
> which
> >> > are in use: app: /home/programacion/animotion
> >> > app/App1/target/AppOne-1.0-SNAPSHOT
> >> > abr 15, 2014 8:48:12 PM org.apache.openejb.assembler.classic.Assembler
> >> > createApplication
> >> > Grave: DeploymentId already used: UsuariosFacade
> >> > abr 15, 2014 8:48:12 PM org.apache.tomee.catalina.TomcatWebAppBuilder
> >> > startInternal
> >> > Grave: Unable to deploy collapsed ear in war
> >> >
> StandardEngine[Catalina].StandardHost[localhost].StandardContext[/AppOne]
> >> > org.apache.openejb.DuplicateDeploymentIdException: Application cannot
> be
> >> > deployed as it contains deployment-ids which are in use: app:
> >> > /home/programacion/animotion app/App1/target/AppOne-1.0-SNAPSHOT
> >> >     UsuariosFacade
> >> >
> >> >
> >> > I can solved this situation with add anotation "name" in second App
> >> >
> >> > @Stateless(name = "UsuariosFacadeAppTwo")
> >> >
> >> >
> >> > in EAR must not have the same class names, I understand. ,
> >> >
> >> > But in 2 different app?
> >> >
> >> > Questions:
> >> >
> >> > 1) Its Bug ?
> >> > 2) I am making a mistake in the specification?
> >> > 3) Should this be possible? 2 app, 2 different EJB class
> >> >
> >> >
> >> > Attached project, if needed to reproduce the situation
> >> >
> >> > Sorry for google traductor,
> >>
> >
> >
> >
> > --
> >    --
> >     Jean-Louis Monteiro
> >     http://twitter.com/jlouismonteiro
> >     http://www.tomitribe.com
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message