You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by sapozal <sa...@gmail.com> on 2014/10/29 12:01:49 UTC
Cant invite EJB from another Tomcat
I arrive to the conclusion that Tomee have a very serious problem in EJB
container.
I created a simple EJB, deployed into Tomee
I created a very simple EJB client inside of DoGet of very simple Servlet
and inserted this Servlet into another Tomcat
thats what I get on invocation
java.lang.NoClassDefFoundError: javax/ejb/EJBHome
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:264)
com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
javax.naming.InitialContext.init(InitialContext.java:242)
javax.naming.InitialContext.<init>(InitialContext.java:216)
and thats despite that both openejb-client-4.7.1.jar and
javaee-api-6.0-6-tomcat.jar are in lib of tomcat-client.
Seems that all topic with EJB invocation from servlet of another tomcat/
Grails app is very problematic...
any help? anything Im doing wrong?
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650.html
Sent from the TomEE Dev mailing list archive at Nabble.com.
Re: Cant invite EJB from another Tomcat
Posted by Romain Manni-Bucau <rm...@tomitribe.com>.
are you able to share everything useful to reproduce it (we have
tomcat/tomee but I'd like to get your test apps)?
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014-10-29 12:01 GMT+01:00 sapozal <sa...@gmail.com>:
> I arrive to the conclusion that Tomee have a very serious problem in EJB
> container.
>
> I created a simple EJB, deployed into Tomee
> I created a very simple EJB client inside of DoGet of very simple Servlet
> and inserted this Servlet into another Tomcat
> thats what I get on invocation
> java.lang.NoClassDefFoundError: javax/ejb/EJBHome
> java.lang.Class.forName0(Native Method)
> java.lang.Class.forName(Class.java:264)
> com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
> javax.naming.InitialContext.init(InitialContext.java:242)
> javax.naming.InitialContext.<init>(InitialContext.java:216)
> and thats despite that both openejb-client-4.7.1.jar and
> javaee-api-6.0-6-tomcat.jar are in lib of tomcat-client.
> Seems that all topic with EJB invocation from servlet of another tomcat/
> Grails app is very problematic...
> any help? anything Im doing wrong?
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
Re: Cant invite EJB from another Tomcat
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Rails surely conflicts as well with ee api it provides
Le 29 oct. 2014 21:15, "Thiago Veronezi" <th...@veronezi.org> a écrit :
> I just noticed that you are using that... it looks like.
>
> I'm not able to reproduce it. The only way I could do it was by using the
> regular...
>
> <dependency>
> <groupId>org.apache.openejb</groupId>
> <artifactId>javaee-api</artifactId>
> <version>yourversion</version>
> </dependency>
>
> ... in the tomcat web app. Make sure that you are using the "tomcat"
> classifier version of that jar.
>
> []s,
> Thiago.
>
>
> On Wed, Oct 29, 2014 at 4:06 PM, Thiago Veronezi <th...@veronezi.org>
> wrote:
>
> > Use this dependency instead...
> >
> > <dependency>
> > <groupId>org.apache.openejb</groupId>
> > <artifactId>javaee-api</artifactId>
> > <version>yourversion</version>
> > <classifier>tomcat</classifier>
> > </dependency>
> >
> > Please note the "classifier".
> >
> > []s,
> > Thiago.
> >
> >
> >
> > On Wed, Oct 29, 2014 at 1:42 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com
> > > wrote:
> >
> >> 2014-10-29 18:28 GMT+01:00 sapozal <sa...@gmail.com>:
> >> > to be honest- those projects are linked to our inner projects, will be
> >> not
> >> > simple to disconnect it.
> >> > But I posted a client code, server could be any ejb that you want-
> just
> >> call
> >> > it MyEjb.
> >> > I am pretty sure this is a reproducable problem, however it is always
> a
> >> > possibility that I am wrong and everything is ok
> >> >
> >> >
> >>
> >> just a matter of time we can spend "reproducing", if you give us 2
> >> modules fast to build then testing is quick, if we need to create a
> >> project etc...we need to dedicate more time. Personally I can't do it
> >> right now
> >>
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650p4672669.html
> >> > Sent from the TomEE Dev mailing list archive at Nabble.com.
> >>
> >
> >
>
Re: Cant invite EJB from another Tomcat
Posted by Thiago Veronezi <th...@veronezi.org>.
I just noticed that you are using that... it looks like.
I'm not able to reproduce it. The only way I could do it was by using the
regular...
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>javaee-api</artifactId>
<version>yourversion</version>
</dependency>
... in the tomcat web app. Make sure that you are using the "tomcat"
classifier version of that jar.
[]s,
Thiago.
On Wed, Oct 29, 2014 at 4:06 PM, Thiago Veronezi <th...@veronezi.org>
wrote:
> Use this dependency instead...
>
> <dependency>
> <groupId>org.apache.openejb</groupId>
> <artifactId>javaee-api</artifactId>
> <version>yourversion</version>
> <classifier>tomcat</classifier>
> </dependency>
>
> Please note the "classifier".
>
> []s,
> Thiago.
>
>
>
> On Wed, Oct 29, 2014 at 1:42 PM, Romain Manni-Bucau <rmannibucau@gmail.com
> > wrote:
>
>> 2014-10-29 18:28 GMT+01:00 sapozal <sa...@gmail.com>:
>> > to be honest- those projects are linked to our inner projects, will be
>> not
>> > simple to disconnect it.
>> > But I posted a client code, server could be any ejb that you want- just
>> call
>> > it MyEjb.
>> > I am pretty sure this is a reproducable problem, however it is always a
>> > possibility that I am wrong and everything is ok
>> >
>> >
>>
>> just a matter of time we can spend "reproducing", if you give us 2
>> modules fast to build then testing is quick, if we need to create a
>> project etc...we need to dedicate more time. Personally I can't do it
>> right now
>>
>> >
>> > --
>> > View this message in context:
>> http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650p4672669.html
>> > Sent from the TomEE Dev mailing list archive at Nabble.com.
>>
>
>
Re: Cant invite EJB from another Tomcat
Posted by Thiago Veronezi <th...@veronezi.org>.
Use this dependency instead...
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>javaee-api</artifactId>
<version>yourversion</version>
<classifier>tomcat</classifier>
</dependency>
Please note the "classifier".
[]s,
Thiago.
On Wed, Oct 29, 2014 at 1:42 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:
> 2014-10-29 18:28 GMT+01:00 sapozal <sa...@gmail.com>:
> > to be honest- those projects are linked to our inner projects, will be
> not
> > simple to disconnect it.
> > But I posted a client code, server could be any ejb that you want- just
> call
> > it MyEjb.
> > I am pretty sure this is a reproducable problem, however it is always a
> > possibility that I am wrong and everything is ok
> >
> >
>
> just a matter of time we can spend "reproducing", if you give us 2
> modules fast to build then testing is quick, if we need to create a
> project etc...we need to dedicate more time. Personally I can't do it
> right now
>
> >
> > --
> > View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650p4672669.html
> > Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Re: Cant invite EJB from another Tomcat
Posted by Romain Manni-Bucau <rm...@gmail.com>.
2014-10-29 18:28 GMT+01:00 sapozal <sa...@gmail.com>:
> to be honest- those projects are linked to our inner projects, will be not
> simple to disconnect it.
> But I posted a client code, server could be any ejb that you want- just call
> it MyEjb.
> I am pretty sure this is a reproducable problem, however it is always a
> possibility that I am wrong and everything is ok
>
>
just a matter of time we can spend "reproducing", if you give us 2
modules fast to build then testing is quick, if we need to create a
project etc...we need to dedicate more time. Personally I can't do it
right now
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650p4672669.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
Re: Cant invite EJB from another Tomcat
Posted by sapozal <sa...@gmail.com>.
to be honest- those projects are linked to our inner projects, will be not
simple to disconnect it.
But I posted a client code, server could be any ejb that you want- just call
it MyEjb.
I am pretty sure this is a reproducable problem, however it is always a
possibility that I am wrong and everything is ok
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650p4672669.html
Sent from the TomEE Dev mailing list archive at Nabble.com.
Re: Cant invite EJB from another Tomcat
Posted by Romain Manni-Bucau <rm...@gmail.com>.
2014-10-29 17:34 GMT+01:00 sapozal <sa...@gmail.com>:
> Ok.
> It seems to me that I figured out the scope of the problem.
> When you are running an EJB client as a part of web application from normal,
> non-Tomee tomcat, you need some j2ee jar, open-ejbclient is not enough since
> it is not including all javax.ejb.* classes.
>
> However javaee-api-6.0-6-tomcat.jar or regulqr javaee-api-6.jar has many
> "offending" classes- javax/servlet/Servlet, javax/el/* classes and
> javax/transaction classses.
> those classes already are used in the regular tomcat.
> So it is impossible for the EJB client to properly load javax.ejb.
> objects....
> thats the difference between simple java application and java web
> application.
>
> If I am right this bug is very easy for reproducing, and , for my opinion it
> definitely have critical priority- you cant do web application EJB client
> for Tomee EJB server....
>
>
Never try to put a criticity like it or people tend to forget you
(that's what I saw and to be honest that's understandable, people are
not paid to do your work ;)).
That said do you care packaging 2 projects we can build (mvn package)
and deploy to reproduce?
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650p4672667.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
Re: Cant invite EJB from another Tomcat
Posted by sapozal <sa...@gmail.com>.
Ok.
It seems to me that I figured out the scope of the problem.
When you are running an EJB client as a part of web application from normal,
non-Tomee tomcat, you need some j2ee jar, open-ejbclient is not enough since
it is not including all javax.ejb.* classes.
However javaee-api-6.0-6-tomcat.jar or regulqr javaee-api-6.jar has many
"offending" classes- javax/servlet/Servlet, javax/el/* classes and
javax/transaction classses.
those classes already are used in the regular tomcat.
So it is impossible for the EJB client to properly load javax.ejb.
objects....
thats the difference between simple java application and java web
application.
If I am right this bug is very easy for reproducing, and , for my opinion it
definitely have critical priority- you cant do web application EJB client
for Tomee EJB server....
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650p4672667.html
Sent from the TomEE Dev mailing list archive at Nabble.com.
Re: Cant invite EJB from another Tomcat
Posted by sapozal <sa...@gmail.com>.
You right.
Here is the content of DoGet of my Servlet
Properties p = new Properties();
p.put("java.naming.factory.initial",
"org.apache.openejb.client.RemoteInitialContextFactory");
p.put("java.naming.provider.url", "http://127.0.0.1:8080/tomee/ejb"); //
user and pass optional
p.put("java.naming.security.principal", "both");
p.put("java.naming.security.credentials", "tomcat");
InitialContext ctx = null;
try {
ctx = new InitialContext(p);
} catch (NamingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
MyEjbRemote mBean =null;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
cl.loadClass("org.apache.openejb.client.EJBObjectProxy");
mBean = (MyEjbRemote) ctx.lookup("MyEjbRemote");
} catch (NamingException | ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return mBean;
This code fails with abovementioned exception.
I am using last distribution of Tomcat7 as a client and last release of
Tomee as a server.
I added jar to tomcat/lib and it is still the same issue.
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650p4672658.html
Sent from the TomEE Dev mailing list archive at Nabble.com.
Re: Cant invite EJB from another Tomcat
Posted by Thiago Veronezi <th...@veronezi.org>.
It's possibly a bug, but it is hard to say without a sample app that
reproduces it. ;)
On Wed, Oct 29, 2014 at 9:00 AM, sapozal <sa...@gmail.com> wrote:
> Hi.
> No, no such issues inside of tomcat logs. Looks like a critical showstopper
> bug...
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650p4672653.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Re: Cant invite EJB from another Tomcat
Posted by Romain Manni-Bucau <rm...@gmail.com>.
javaee-api-6.0-6-tomcat.jar in tomcat/lib should help but once again
saying there is bug without giving anything to show it doesn't make
the solution close and we have users doing it so it is surely just a
setup issue.
Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau
2014-10-29 14:00 GMT+01:00 sapozal <sa...@gmail.com>:
> Hi.
> No, no such issues inside of tomcat logs. Looks like a critical showstopper
> bug...
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650p4672653.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
Re: Cant invite EJB from another Tomcat
Posted by sapozal <sa...@gmail.com>.
Hi.
No, no such issues inside of tomcat logs. Looks like a critical showstopper
bug...
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650p4672653.html
Sent from the TomEE Dev mailing list archive at Nabble.com.
Re: Cant invite EJB from another Tomcat
Posted by Jean-Louis Monteiro <jl...@tomitribe.com>.
Hi,
can you check in the logs that you don't have a tomcat message saying
"Offending ...." and mentioning the javaee-api-6.0-6-tomcat.jar file?
Tomcat may notice that the jar contains Java EE APIs and then decides to
ignore it.
--
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com
On Wed, Oct 29, 2014 at 12:01 PM, sapozal <sa...@gmail.com> wrote:
> I arrive to the conclusion that Tomee have a very serious problem in EJB
> container.
>
> I created a simple EJB, deployed into Tomee
> I created a very simple EJB client inside of DoGet of very simple Servlet
> and inserted this Servlet into another Tomcat
> thats what I get on invocation
> java.lang.NoClassDefFoundError: javax/ejb/EJBHome
> java.lang.Class.forName0(Native Method)
> java.lang.Class.forName(Class.java:264)
>
> com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
>
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
>
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
> javax.naming.InitialContext.init(InitialContext.java:242)
> javax.naming.InitialContext.<init>(InitialContext.java:216)
> and thats despite that both openejb-client-4.7.1.jar and
> javaee-api-6.0-6-tomcat.jar are in lib of tomcat-client.
> Seems that all topic with EJB invocation from servlet of another tomcat/
> Grails app is very problematic...
> any help? anything Im doing wrong?
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Cant-invite-EJB-from-another-Tomcat-tp4672650.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>