You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by luca-vercelli <lu...@alkeinformatica.com> on 2016/09/07 14:16:24 UTC

Migrating EJB from Jboss to TomEE

Dear all,
I am trying to migrate an old app developed for JBoss into TomEE. I am
familiar with Tomcat, but not with EE.
The app is made up of 2 folders, let's say app1 and app2.jar.
In JBoss they both are inside server/default/deploy folder. 
app1 is a normal servlet-based app, it works even inside Tomcat/webapps.
app2 is not an app at all, it is an uncompressed JAR. It looks like an EJB.
I have put app1 and app2 inside TomEE/webapps, and they both seems to be
loaded, however app1 "does not see" app2.
Inside app1 there is an instruction:
  Object x = ctx.lookup("some/path/here")
which fails with a NameNotFoundException.

The long story short: how can I make an EJB app2 to appear inside app1
context?

Thank you.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Migrating EJB from Jboss to TomEE

Posted by luca-vercelli <lu...@alkeinformatica.com>.
Thank you, I shall see ASAP.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680061.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Migrating EJB from Jboss to TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
then the class is not seen/scanned, probably due to a wrongly packaging


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-09-08 11:21 GMT+02:00 luca-vercelli <lu...@alkeinformatica.com>
:

> No, I cannot see It.
> There is MassiveLoadingServiceStarter:
>
> Auto-deploying ejb MassiveLoadingServiceStarter:
> EjbDeployment(deployment-id=MassiveLoadingServiceStarter)
> ...
> Auto-creating a container for bean MassiveLoadingServiceStarter:
> Container(type=MESSAGE, id=Default MDB Container)
> ...
> INFO - Jndi(name=MassiveLoadingServiceStarter) -->
> Ejb(deployment-id=MassiveLoadingServiceStarter)
> ...
> INFO - Created Ejb(deployment-id=MassiveLoadingServiceStarter,
> ejb-name=MassiveLoadingServiceStarter, container=Default MDB Container)
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680057.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Migrating EJB from Jboss to TomEE

Posted by luca-vercelli <lu...@alkeinformatica.com>.
Ok, good suggestion. I removed all jboss specific annotations. The error
should bè elsewhere.


Il martedì 27 settembre 2016, Romain Manni-Bucau [via TomEE & OpenEJB] <
ml-node+s979440n4680207h46@n4.nabble.com> ha scritto:

> @Management is a jboss import right? this doesnt mean anything outside
> jboss (like @Service), maybe add @Singleton
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/
> rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com> | JavaEE Factory
> <https://javaeefactory-rmannibucau.rhcloud.com>
>
> 2016-09-27 17:16 GMT+02:00 luca-vercelli <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4680207&i=0>>
> :
>
> > Thank you both.
> >
> > @Romain: you were right, I can access the same object using another jndi
> > name, it is
> > "java:global/app1/LogCaricamentoService!it.packagename.
> > LogCaricamentoServiceLocal"
> >
> > @jayleg: thank you, however I prefer to understand how TomEE works, and
> to
> > use its conventions.
> >
> > Now, I still have a problem: as Romain told, the class
> > MassiveLoadingService
> > is not loaded at all at startup.
> > I cannot understand why.
> > Maybe the name "jboss:custom" is not good here? I think it's just a
> name.
> >
> > Here are the definitions:
> >
> > @Local
> > public interface MassiveLoadingServiceLocal{...}
> >
> > @Management
> > public interface MassiveLoadingServiceManagement { ... }
> >
> > @Service (objectName = "jboss:custom=MassiveLoadingService")
> > @TransactionManagement(TransactionManagementType.BEAN)
> > public class MassiveLoadingService implements
> >                 MassiveLoadingServiceLocal,
> MassiveLoadingServiceManagemen
> > t
> > { ... }
> >
> >
> > Luca
> >
> >
> >
> > --
> > View this message in context: http://tomee-openejb.979440.
> > n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680206.html
> > Sent from the TomEE Users mailing list archive at Nabble.com.
> >
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-
> from-Jboss-to-TomEE-tp4680044p4680207.html
> To unsubscribe from Migrating EJB from Jboss to TomEE, click here
> <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4680044&code=bHVjYS52ZXJjZWxsaUBhbGtlaW5mb3JtYXRpY2EuY29tfDQ2ODAwNDR8LTE2ODUyNTUxMg==>
> .
> NAML
> <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


-- 
-- 
Luca Vercelli

Alké Informatica S.r.l.
C.so Unione Sovietica, 612/15/C
10135 Torino (TO)
Cell.335-84.72.406
Tel. 011-39.17.111
Fax 011-39.17.101




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680210.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Migrating EJB from Jboss to TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
@Management is a jboss import right? this doesnt mean anything outside
jboss (like @Service), maybe add @Singleton


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-09-27 17:16 GMT+02:00 luca-vercelli <lu...@alkeinformatica.com>
:

> Thank you both.
>
> @Romain: you were right, I can access the same object using another jndi
> name, it is
> "java:global/app1/LogCaricamentoService!it.packagename.
> LogCaricamentoServiceLocal"
>
> @jayleg: thank you, however I prefer to understand how TomEE works, and to
> use its conventions.
>
> Now, I still have a problem: as Romain told, the class
> MassiveLoadingService
> is not loaded at all at startup.
> I cannot understand why.
> Maybe the name "jboss:custom" is not good here? I think it's just a name.
>
> Here are the definitions:
>
> @Local
> public interface MassiveLoadingServiceLocal{...}
>
> @Management
> public interface MassiveLoadingServiceManagement { ... }
>
> @Service (objectName = "jboss:custom=MassiveLoadingService")
> @TransactionManagement(TransactionManagementType.BEAN)
> public class MassiveLoadingService implements
>                 MassiveLoadingServiceLocal, MassiveLoadingServiceManagemen
> t
> { ... }
>
>
> Luca
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680206.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

RE: Migrating EJB from Jboss to TomEE

Posted by luca-vercelli <lu...@alkeinformatica.com>.
Thank you both.

@Romain: you were right, I can access the same object using another jndi
name, it is
"java:global/app1/LogCaricamentoService!it.packagename.LogCaricamentoServiceLocal"

@jayleg: thank you, however I prefer to understand how TomEE works, and to
use its conventions.

Now, I still have a problem: as Romain told, the class MassiveLoadingService
is not loaded at all at startup.
I cannot understand why.
Maybe the name "jboss:custom" is not good here? I think it's just a name.

Here are the definitions:

@Local
public interface MassiveLoadingServiceLocal{...}

@Management
public interface MassiveLoadingServiceManagement { ... }

@Service (objectName = "jboss:custom=MassiveLoadingService")
@TransactionManagement(TransactionManagementType.BEAN)
public class MassiveLoadingService implements
                MassiveLoadingServiceLocal, MassiveLoadingServiceManagement
{ ... }


Luca



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680206.html
Sent from the TomEE Users mailing list archive at Nabble.com.

RE: Migrating EJB from Jboss to TomEE

Posted by Jay Leggett <jl...@lenovo.com>.
I had to make similar changes to get EJBs working when migrating from Websphere to TomEE.  I  am not an EJB expert, but I think recent updates of the spec are trying to make the namespace universal to avoid vendor-specific namespaces.  

Also, TomEE's system.properties has a "openejb.jndiname.format" property that allows you to configure the format of the name space.  In some cases, I was able to use this setting to make TomEE's JNDI namespace similar to Websphere's.  I set it to:

openejb.jndiname.format=ejb/{interfaceClass.simpleName}

-----Original Message-----
From: luca-vercelli [mailto:luca.vercelli@alkeinformatica.com] 
Sent: Tuesday, September 27, 2016 10:00 AM
To: users@tomee.apache.org
Subject: Re: Migrating EJB from Jboss to TomEE

After 2 weeks, I can finally work on this again.

Apparently, the Jndi names are completely different between JBoss and TomEE.
For example, where in JBoss I had:
"LogCaricamentoService/local"
and
"queue/massiveLoading/load"

and in TomEE I had to write:

"java:openejb/Deployment/LogCaricamentoService/it.packagename.LogCaricamentoServiceLocal!Local"

and

"java:openejb/Resource/queue/massiveLoading/load"

Is this normal? Or am I missing something?

Thank you.




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680203.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Migrating EJB from Jboss to TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Welcome back ;)

2016-09-27 15:59 GMT+02:00 luca-vercelli <lu...@alkeinformatica.com>
:

> After 2 weeks, I can finally work on this again.
>
> Apparently, the Jndi names are completely different between JBoss and
> TomEE.
> For example, where in JBoss I had:
> "LogCaricamentoService/local"
> and
> "queue/massiveLoading/load"
>
> and in TomEE I had to write:
>
> "java:openejb/Deployment/LogCaricamentoService/it.packagename.
> LogCaricamentoServiceLocal!Local"
>
> and
>
> "java:openejb/Resource/queue/massiveLoading/load"
>
> Is this normal? Or am I missing something?
>
>
It is "normal" it is different for pre-EE6 names (EE 6 brings standard JNDI
names)

However please take note that java:openejb/Deployment is an internal name
you shouldn't use. The name you should use are in the logs (grep "Jndi"). I
recommand the java:global/.... names but short names are fine too
(LogCaricamentoServiceLocal probably).


> Thank you.
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680203.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Migrating EJB from Jboss to TomEE

Posted by luca-vercelli <lu...@alkeinformatica.com>.
After 2 weeks, I can finally work on this again.

Apparently, the Jndi names are completely different between JBoss and TomEE.
For example, where in JBoss I had:
"LogCaricamentoService/local"
and
"queue/massiveLoading/load"

and in TomEE I had to write:

"java:openejb/Deployment/LogCaricamentoService/it.packagename.LogCaricamentoServiceLocal!Local"

and

"java:openejb/Resource/queue/massiveLoading/load"

Is this normal? Or am I missing something?

Thank you.




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680203.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Migrating EJB from Jboss to TomEE

Posted by luca-vercelli <lu...@alkeinformatica.com>.
No, I cannot see It.
There is MassiveLoadingServiceStarter:

Auto-deploying ejb MassiveLoadingServiceStarter:
EjbDeployment(deployment-id=MassiveLoadingServiceStarter)
...
Auto-creating a container for bean MassiveLoadingServiceStarter:
Container(type=MESSAGE, id=Default MDB Container)
...
INFO - Jndi(name=MassiveLoadingServiceStarter) -->
Ejb(deployment-id=MassiveLoadingServiceStarter)
...
INFO - Created Ejb(deployment-id=MassiveLoadingServiceStarter,
ejb-name=MassiveLoadingServiceStarter, container=Default MDB Container)




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680057.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Migrating EJB from Jboss to TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
is MassiveLoadingService  in the logs?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-09-07 17:44 GMT+02:00 luca-vercelli <lu...@alkeinformatica.com>
:

> In startup logs I see this:
>
> INFO - Jndi(name=LogCaricamentoServiceLocal) -->
> Ejb(deployment-id=LogCaricamentoService)
> INFO -
> Jndi(name=global/app1/LogCaricamentoService!it.package.massiveloading.
> service.LogCaricamentoServiceLocal)
> --> Ejb(deployment-id=LogCaricamentoService)
>
> (this in the scenario where app2 is physically embedded into app1).
>
> However, I also see a warning:
> WARNING - Unresolved ejb reference
> "java:comp/env/it.package.massiveloading.service.
> MassiveLoadingServiceStarter/service"
> in bean "LogCaricamentoService".  Will attempt resolution again at runtime.
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680052.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Migrating EJB from Jboss to TomEE

Posted by luca-vercelli <lu...@alkeinformatica.com>.
In startup logs I see this:

INFO - Jndi(name=LogCaricamentoServiceLocal) -->
Ejb(deployment-id=LogCaricamentoService)
INFO -
Jndi(name=global/app1/LogCaricamentoService!it.package.massiveloading.service.LogCaricamentoServiceLocal)
--> Ejb(deployment-id=LogCaricamentoService)

(this in the scenario where app2 is physically embedded into app1).

However, I also see a warning:
WARNING - Unresolved ejb reference
"java:comp/env/it.package.massiveloading.service.MassiveLoadingServiceStarter/service"
in bean "LogCaricamentoService".  Will attempt resolution again at runtime.





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680052.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Migrating EJB from Jboss to TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
did you check the Jndi(.... lines in the startup logs? jboss specific names
(in particular old versions) are different than tomee and EE ones


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-09-07 17:02 GMT+02:00 luca-vercelli <lu...@alkeinformatica.com>
:

> I have just tried physically merging app2 inside app1/WEB-INF/classes, but
> I
> still get the same error :(
>
> Inside app2 there are several classes, this is the one which is supposed to
> be looked-up:
>
> @Local
> public interface LogCaricamentoServiceLocal
>
> with an implementation:
> @Stateless
> public class LogCaricamentoService implements LogCaricamentoServiceLocal
>
> Now, I don't know who exactly is supposed to bind it into the Context.
> However, there is another set of classes that use this class:
>
> @Local
> public interface MassiveLoadingServiceLocal
>
> @Service (objectName = "jboss:custom=MassiveLoadingService")
> @TransactionManagement(TransactionManagementType.BEAN)
> public class MassiveLoadingService implements
>                 MassiveLoadingServiceLocal {
>         ...
>
>         @EJB
>         private LogCaricamentoServiceLocal logCaricamentoDAO;
>         ...
> }
>
> @TransactionManagement(TransactionManagementType.BEAN)
> @MessageDriven(name = "MassiveLoadingServiceStarter", activationConfig = {
>                 @ActivationConfigProperty(propertyName =
> "destinationType", propertyValue
> = "javax.jms.Queue"),
>                 @ActivationConfigProperty(propertyName="destination",
> propertyValue="queue/massiveLoading/load")})
> public class MassiveLoadingServiceStarter implements MessageListener {
>         ...
>         @EJB
>         private MassiveLoadingServiceLocal service;
>         ...
> }
>
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680050.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Migrating EJB from Jboss to TomEE

Posted by luca-vercelli <lu...@alkeinformatica.com>.
I have just tried physically merging app2 inside app1/WEB-INF/classes, but I
still get the same error :(

Inside app2 there are several classes, this is the one which is supposed to
be looked-up:  

@Local
public interface LogCaricamentoServiceLocal

with an implementation:
@Stateless
public class LogCaricamentoService implements LogCaricamentoServiceLocal

Now, I don't know who exactly is supposed to bind it into the Context.
However, there is another set of classes that use this class:

@Local
public interface MassiveLoadingServiceLocal 

@Service (objectName = "jboss:custom=MassiveLoadingService")
@TransactionManagement(TransactionManagementType.BEAN) 
public class MassiveLoadingService implements
		MassiveLoadingServiceLocal {
	...
	
	@EJB
	private LogCaricamentoServiceLocal logCaricamentoDAO;
        ...
}

@TransactionManagement(TransactionManagementType.BEAN)
@MessageDriven(name = "MassiveLoadingServiceStarter", activationConfig = {
		@ActivationConfigProperty(propertyName = "destinationType", propertyValue
= "javax.jms.Queue"),
		@ActivationConfigProperty(propertyName="destination",
propertyValue="queue/massiveLoading/load")})
public class MassiveLoadingServiceStarter implements MessageListener {
        ...
	@EJB
	private MassiveLoadingServiceLocal service;
        ...
}






--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680050.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Migrating EJB from Jboss to TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2016-09-29 14:41 GMT+02:00 luca-vercelli <lu...@alkeinformatica.com>
:

> Well, the ejb points to an "application.properties" file which is in its
> root folder. Actually there are several files with the same name, in
> other jars. I guess the ejb is taking the wrong one.
> In this case the solution is quite simple, I can try to rename it,
> and/or to move it outside the jar. However I guess there can be more
> complicated situations.
>
>
Well even in jboss this is not supposed to work by default but yes a webapp
is basically a (almost) flat classloader so conflicting resources are not
deterministic for jars.


>
> Il 29/09/2016 13:56, Romain Manni-Bucau [via TomEE & OpenEJB] ha scritto:
> > 2016-09-29 13:09 GMT+02:00 luca-vercelli <[hidden email]
> > </user/SendEmail.jtp?type=node&node=4680243&i=0>>
> > :
> >
> >> I thought I had solved, however new problems come out.
> >>
> >> Romain, you wrote:
> >>
> >> > if an
> >> > exploded ejbmodule you can merge it with WEB-INF/classes of app1
> >> > (physically or virtually)
> >>
> >> I packed the ejbmodule into a jar, and put it inside WEB-INF/lib. This
> >> works, however it gives some side-effects (there are clashes in resource
> >> file names).
> >> Maybe I could try some other way. What did you mean with "virtually"?
> >>
> >>
> > virtually will not help, meant considered as in WEB-INF/lib but
> physically
> > in another folder.
> >
> > How does it clash? Could customizing ejbdeployment solve it?
> >
> >
> >> Thank you again!
> >>
> >> Luca
> >>
> >>
> >> Il 07/09/2016 16:20, Romain Manni-Bucau [via TomEE & OpenEJB] ha
> scritto:
> >> > Hi
> >> >
> >> > would need to check what is app2 and also if the communication is
> > @Remote
> >> > or local (this last one means you need to deploy both together) but
> > if an
> >> > exploded ejbmodule you can merge it with WEB-INF/classes of app1
> >> > (physically or virtually)
> >> >
> >> >
> >> > Romain Manni-Bucau
> >> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> >> > <https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
> >> > <http://rmannibucau.wordpress.com> | Github
> >> > <https://github.com/rmannibucau> |
> >> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> >> > <http://www.tomitribe.com> | JavaEE Factory
> >> > <https://javaeefactory-rmannibucau.rhcloud.com>
> >> >
> >> > 2016-09-07 16:16 GMT+02:00 luca-vercelli <[hidden email]
> >> > </user/SendEmail.jtp?type=node&node=4680047&i=0>>
> >> > :
> >> >
> >> >> Dear all,
> >> >> I am trying to migrate an old app developed for JBoss into TomEE. I
> am
> >> >> familiar with Tomcat, but not with EE.
> >> >> The app is made up of 2 folders, let's say app1 and app2.jar.
> >> >> In JBoss they both are inside server/default/deploy folder.
> >> >> app1 is a normal servlet-based app, it works even inside
> > Tomcat/webapps.
> >> >> app2 is not an app at all, it is an uncompressed JAR. It looks like
> an
> >> > EJB.
> >> >> I have put app1 and app2 inside TomEE/webapps, and they both seems
> > to be
> >> >> loaded, however app1 "does not see" app2.
> >> >> Inside app1 there is an instruction:
> >> >>   Object x = ctx.lookup("some/path/here")
> >> >> which fails with a NameNotFoundException.
> >> >>
> >> >> The long story short: how can I make an EJB app2 to appear inside
> app1
> >> >> context?
> >> >>
> >> >> Thank you.
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> View this message in context: http://tomee-openejb.979440.
> >> >> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044.html
> >> >> Sent from the TomEE Users mailing list archive at Nabble.com.
> >> >>
> >> >
> >> >
> >> >
> > ------------------------------------------------------------------------
> >> > If you reply to this email, your message will be added to the
> > discussion
> >> > below:
> >> > http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-
> >> from-Jboss-to-TomEE-tp4680044p4680047.html
> >> >
> >> > To unsubscribe from Migrating EJB from Jboss to TomEE, click here
> >> > <http://tomee-openejb.979440.n4.nabble.com/template/
> >> NamlServlet.jtp?macro=unsubscribe_by_code&node=4680044&code=
> >>
> > bHVjYS52ZXJjZWxsaUBhbGtlaW5mb3JtYXRpY2EuY29tfDQ2ODAwNDR8LTE2
> ODUyNTUxMg==>.
> >> > NAML
> >> > <http://tomee-openejb.979440.n4.nabble.com/template/
> >> NamlServlet.jtp?macro=macro_viewer&id=instant_html%
> >> 21nabble%3Aemail.naml&base=nabble.naml.namespaces.
> >> BasicNamespace-nabble.view.web.template.NabbleNamespace-
> >> nabble.view.web.template.NodeNamespace&breadcrumbs=
> >> notify_subscribers%21nabble%3Aemail.naml-instant_emails%
> >> 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> >> >
> >>
> >> --
> >> Luca Vercelli
> >>
> >> Alké Informatica S.r.l.
> >> C.so Unione Sovietica 612/15/C
> >> 10135 Torino
> >> Tel. 011.39.17.111
> >> Fax. 011.39.17.101
> >> E-mail: [hidden email] </user/SendEmail.jtp?type=node&node=4680243&i=1>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context: http://tomee-openejb.979440.
> >> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680242.html
> >> Sent from the TomEE Users mailing list archive at Nabble.com.
> >>
> >
> >
> > ------------------------------------------------------------------------
> > If you reply to this email, your message will be added to the discussion
> > below:
> > http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-
> from-Jboss-to-TomEE-tp4680044p4680243.html
> >
> > To unsubscribe from Migrating EJB from Jboss to TomEE, click here
> > <http://tomee-openejb.979440.n4.nabble.com/template/
> NamlServlet.jtp?macro=unsubscribe_by_code&node=4680044&code=
> bHVjYS52ZXJjZWxsaUBhbGtlaW5mb3JtYXRpY2EuY29tfDQ2ODAwNDR8LTE2ODUyNTUxMg==>.
> > NAML
> > <http://tomee-openejb.979440.n4.nabble.com/template/
> NamlServlet.jtp?macro=macro_viewer&id=instant_html%
> 21nabble%3Aemail.naml&base=nabble.naml.namespaces.
> BasicNamespace-nabble.view.web.template.NabbleNamespace-
> nabble.view.web.template.NodeNamespace&breadcrumbs=
> notify_subscribers%21nabble%3Aemail.naml-instant_emails%
> 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> >
>
> --
> Luca Vercelli
>
> Alké Informatica S.r.l.
> C.so Unione Sovietica 612/15/C
> 10135 Torino
> Tel. 011.39.17.111
> Fax. 011.39.17.101
> E-mail: luca.vercelli@alkeinformatica.com
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680246.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Migrating EJB from Jboss to TomEE

Posted by luca-vercelli <lu...@alkeinformatica.com>.
Well, the ejb points to an "application.properties" file which is in its
root folder. Actually there are several files with the same name, in
other jars. I guess the ejb is taking the wrong one.
In this case the solution is quite simple, I can try to rename it,
and/or to move it outside the jar. However I guess there can be more
complicated situations.


Il 29/09/2016 13:56, Romain Manni-Bucau [via TomEE & OpenEJB] ha scritto:
> 2016-09-29 13:09 GMT+02:00 luca-vercelli <[hidden email]
> </user/SendEmail.jtp?type=node&node=4680243&i=0>>
> :
> 
>> I thought I had solved, however new problems come out.
>>
>> Romain, you wrote:
>>
>> > if an
>> > exploded ejbmodule you can merge it with WEB-INF/classes of app1
>> > (physically or virtually)
>>
>> I packed the ejbmodule into a jar, and put it inside WEB-INF/lib. This
>> works, however it gives some side-effects (there are clashes in resource
>> file names).
>> Maybe I could try some other way. What did you mean with "virtually"?
>>
>>
> virtually will not help, meant considered as in WEB-INF/lib but physically
> in another folder.
> 
> How does it clash? Could customizing ejbdeployment solve it?
> 
> 
>> Thank you again!
>>
>> Luca
>>
>>
>> Il 07/09/2016 16:20, Romain Manni-Bucau [via TomEE & OpenEJB] ha scritto:
>> > Hi
>> >
>> > would need to check what is app2 and also if the communication is
> @Remote
>> > or local (this last one means you need to deploy both together) but
> if an
>> > exploded ejbmodule you can merge it with WEB-INF/classes of app1
>> > (physically or virtually)
>> >
>> >
>> > Romain Manni-Bucau
>> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
>> > <https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
>> > <http://rmannibucau.wordpress.com> | Github
>> > <https://github.com/rmannibucau> |
>> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
>> > <http://www.tomitribe.com> | JavaEE Factory
>> > <https://javaeefactory-rmannibucau.rhcloud.com>
>> >
>> > 2016-09-07 16:16 GMT+02:00 luca-vercelli <[hidden email]
>> > </user/SendEmail.jtp?type=node&node=4680047&i=0>>
>> > :
>> >
>> >> Dear all,
>> >> I am trying to migrate an old app developed for JBoss into TomEE. I am
>> >> familiar with Tomcat, but not with EE.
>> >> The app is made up of 2 folders, let's say app1 and app2.jar.
>> >> In JBoss they both are inside server/default/deploy folder.
>> >> app1 is a normal servlet-based app, it works even inside
> Tomcat/webapps.
>> >> app2 is not an app at all, it is an uncompressed JAR. It looks like an
>> > EJB.
>> >> I have put app1 and app2 inside TomEE/webapps, and they both seems
> to be
>> >> loaded, however app1 "does not see" app2.
>> >> Inside app1 there is an instruction:
>> >>   Object x = ctx.lookup("some/path/here")
>> >> which fails with a NameNotFoundException.
>> >>
>> >> The long story short: how can I make an EJB app2 to appear inside app1
>> >> context?
>> >>
>> >> Thank you.
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context: http://tomee-openejb.979440.
>> >> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044.html
>> >> Sent from the TomEE Users mailing list archive at Nabble.com.
>> >>
>> >
>> >
>> >
> ------------------------------------------------------------------------
>> > If you reply to this email, your message will be added to the
> discussion
>> > below:
>> > http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-
>> from-Jboss-to-TomEE-tp4680044p4680047.html
>> >
>> > To unsubscribe from Migrating EJB from Jboss to TomEE, click here
>> > <http://tomee-openejb.979440.n4.nabble.com/template/
>> NamlServlet.jtp?macro=unsubscribe_by_code&node=4680044&code=
>>
> bHVjYS52ZXJjZWxsaUBhbGtlaW5mb3JtYXRpY2EuY29tfDQ2ODAwNDR8LTE2ODUyNTUxMg==>.
>> > NAML
>> > <http://tomee-openejb.979440.n4.nabble.com/template/
>> NamlServlet.jtp?macro=macro_viewer&id=instant_html%
>> 21nabble%3Aemail.naml&base=nabble.naml.namespaces.
>> BasicNamespace-nabble.view.web.template.NabbleNamespace-
>> nabble.view.web.template.NodeNamespace&breadcrumbs=
>> notify_subscribers%21nabble%3Aemail.naml-instant_emails%
>> 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>> >
>>
>> --
>> Luca Vercelli
>>
>> Alké Informatica S.r.l.
>> C.so Unione Sovietica 612/15/C
>> 10135 Torino
>> Tel. 011.39.17.111
>> Fax. 011.39.17.101
>> E-mail: [hidden email] </user/SendEmail.jtp?type=node&node=4680243&i=1>
>>
>>
>>
>>
>> --
>> View this message in context: http://tomee-openejb.979440.
>> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680242.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>
> 
> 
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680243.html
> 
> To unsubscribe from Migrating EJB from Jboss to TomEE, click here
> <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4680044&code=bHVjYS52ZXJjZWxsaUBhbGtlaW5mb3JtYXRpY2EuY29tfDQ2ODAwNDR8LTE2ODUyNTUxMg==>.
> NAML
> <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> 

-- 
Luca Vercelli

Alké Informatica S.r.l.
C.so Unione Sovietica 612/15/C
10135 Torino
Tel. 011.39.17.111
Fax. 011.39.17.101
E-mail: luca.vercelli@alkeinformatica.com




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680246.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Migrating EJB from Jboss to TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2016-09-29 13:09 GMT+02:00 luca-vercelli <lu...@alkeinformatica.com>
:

> I thought I had solved, however new problems come out.
>
> Romain, you wrote:
>
> > if an
> > exploded ejbmodule you can merge it with WEB-INF/classes of app1
> > (physically or virtually)
>
> I packed the ejbmodule into a jar, and put it inside WEB-INF/lib. This
> works, however it gives some side-effects (there are clashes in resource
> file names).
> Maybe I could try some other way. What did you mean with "virtually"?
>
>
virtually will not help, meant considered as in WEB-INF/lib but physically
in another folder.

How does it clash? Could customizing ejbdeployment solve it?


> Thank you again!
>
> Luca
>
>
> Il 07/09/2016 16:20, Romain Manni-Bucau [via TomEE & OpenEJB] ha scritto:
> > Hi
> >
> > would need to check what is app2 and also if the communication is @Remote
> > or local (this last one means you need to deploy both together) but if an
> > exploded ejbmodule you can merge it with WEB-INF/classes of app1
> > (physically or virtually)
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
> > <http://rmannibucau.wordpress.com> | Github
> > <https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com> | JavaEE Factory
> > <https://javaeefactory-rmannibucau.rhcloud.com>
> >
> > 2016-09-07 16:16 GMT+02:00 luca-vercelli <[hidden email]
> > </user/SendEmail.jtp?type=node&node=4680047&i=0>>
> > :
> >
> >> Dear all,
> >> I am trying to migrate an old app developed for JBoss into TomEE. I am
> >> familiar with Tomcat, but not with EE.
> >> The app is made up of 2 folders, let's say app1 and app2.jar.
> >> In JBoss they both are inside server/default/deploy folder.
> >> app1 is a normal servlet-based app, it works even inside Tomcat/webapps.
> >> app2 is not an app at all, it is an uncompressed JAR. It looks like an
> > EJB.
> >> I have put app1 and app2 inside TomEE/webapps, and they both seems to be
> >> loaded, however app1 "does not see" app2.
> >> Inside app1 there is an instruction:
> >>   Object x = ctx.lookup("some/path/here")
> >> which fails with a NameNotFoundException.
> >>
> >> The long story short: how can I make an EJB app2 to appear inside app1
> >> context?
> >>
> >> Thank you.
> >>
> >>
> >>
> >> --
> >> View this message in context: http://tomee-openejb.979440.
> >> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044.html
> >> Sent from the TomEE Users mailing list archive at Nabble.com.
> >>
> >
> >
> > ------------------------------------------------------------------------
> > If you reply to this email, your message will be added to the discussion
> > below:
> > http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-
> from-Jboss-to-TomEE-tp4680044p4680047.html
> >
> > To unsubscribe from Migrating EJB from Jboss to TomEE, click here
> > <http://tomee-openejb.979440.n4.nabble.com/template/
> NamlServlet.jtp?macro=unsubscribe_by_code&node=4680044&code=
> bHVjYS52ZXJjZWxsaUBhbGtlaW5mb3JtYXRpY2EuY29tfDQ2ODAwNDR8LTE2ODUyNTUxMg==>.
> > NAML
> > <http://tomee-openejb.979440.n4.nabble.com/template/
> NamlServlet.jtp?macro=macro_viewer&id=instant_html%
> 21nabble%3Aemail.naml&base=nabble.naml.namespaces.
> BasicNamespace-nabble.view.web.template.NabbleNamespace-
> nabble.view.web.template.NodeNamespace&breadcrumbs=
> notify_subscribers%21nabble%3Aemail.naml-instant_emails%
> 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> >
>
> --
> Luca Vercelli
>
> Alké Informatica S.r.l.
> C.so Unione Sovietica 612/15/C
> 10135 Torino
> Tel. 011.39.17.111
> Fax. 011.39.17.101
> E-mail: luca.vercelli@alkeinformatica.com
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680242.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Migrating EJB from Jboss to TomEE

Posted by luca-vercelli <lu...@alkeinformatica.com>.
I thought I had solved, however new problems come out.

Romain, you wrote:

> if an
> exploded ejbmodule you can merge it with WEB-INF/classes of app1
> (physically or virtually)

I packed the ejbmodule into a jar, and put it inside WEB-INF/lib. This
works, however it gives some side-effects (there are clashes in resource
file names).
Maybe I could try some other way. What did you mean with "virtually"?

Thank you again!

Luca


Il 07/09/2016 16:20, Romain Manni-Bucau [via TomEE & OpenEJB] ha scritto:
> Hi
> 
> would need to check what is app2 and also if the communication is @Remote
> or local (this last one means you need to deploy both together) but if an
> exploded ejbmodule you can merge it with WEB-INF/classes of app1
> (physically or virtually)
> 
> 
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
> <http://rmannibucau.wordpress.com> | Github
> <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com> | JavaEE Factory
> <https://javaeefactory-rmannibucau.rhcloud.com>
> 
> 2016-09-07 16:16 GMT+02:00 luca-vercelli <[hidden email]
> </user/SendEmail.jtp?type=node&node=4680047&i=0>>
> :
> 
>> Dear all,
>> I am trying to migrate an old app developed for JBoss into TomEE. I am
>> familiar with Tomcat, but not with EE.
>> The app is made up of 2 folders, let's say app1 and app2.jar.
>> In JBoss they both are inside server/default/deploy folder.
>> app1 is a normal servlet-based app, it works even inside Tomcat/webapps.
>> app2 is not an app at all, it is an uncompressed JAR. It looks like an
> EJB.
>> I have put app1 and app2 inside TomEE/webapps, and they both seems to be
>> loaded, however app1 "does not see" app2.
>> Inside app1 there is an instruction:
>>   Object x = ctx.lookup("some/path/here")
>> which fails with a NameNotFoundException.
>>
>> The long story short: how can I make an EJB app2 to appear inside app1
>> context?
>>
>> Thank you.
>>
>>
>>
>> --
>> View this message in context: http://tomee-openejb.979440.
>> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>
> 
> 
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680047.html
> 
> To unsubscribe from Migrating EJB from Jboss to TomEE, click here
> <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4680044&code=bHVjYS52ZXJjZWxsaUBhbGtlaW5mb3JtYXRpY2EuY29tfDQ2ODAwNDR8LTE2ODUyNTUxMg==>.
> NAML
> <http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> 

-- 
Luca Vercelli

Alké Informatica S.r.l.
C.so Unione Sovietica 612/15/C
10135 Torino
Tel. 011.39.17.111
Fax. 011.39.17.101
E-mail: luca.vercelli@alkeinformatica.com




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044p4680242.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Migrating EJB from Jboss to TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

would need to check what is app2 and also if the communication is @Remote
or local (this last one means you need to deploy both together) but if an
exploded ejbmodule you can merge it with WEB-INF/classes of app1
(physically or virtually)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-09-07 16:16 GMT+02:00 luca-vercelli <lu...@alkeinformatica.com>
:

> Dear all,
> I am trying to migrate an old app developed for JBoss into TomEE. I am
> familiar with Tomcat, but not with EE.
> The app is made up of 2 folders, let's say app1 and app2.jar.
> In JBoss they both are inside server/default/deploy folder.
> app1 is a normal servlet-based app, it works even inside Tomcat/webapps.
> app2 is not an app at all, it is an uncompressed JAR. It looks like an EJB.
> I have put app1 and app2 inside TomEE/webapps, and they both seems to be
> loaded, however app1 "does not see" app2.
> Inside app1 there is an instruction:
>   Object x = ctx.lookup("some/path/here")
> which fails with a NameNotFoundException.
>
> The long story short: how can I make an EJB app2 to appear inside app1
> context?
>
> Thank you.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Migrating-EJB-from-Jboss-to-TomEE-tp4680044.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>