You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Thiago Antônio Marafon <th...@softplan.com.br> on 2008/10/15 21:53:16 UTC
OpenEJB Tomcat Deployments
Hi all,
I´m evaluation OpenEJB 3.0 with Tomcat 6. Everything is ok, my test
application is working great.
But, I noticed that the more jars the application has, longer is the
Tomcat bootstrap time.
Then I saw this:
http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html
And tried all the alternatives, but it looks like that in Tomcat these
don´t work.
My beans are annotated, there isn´t a ejb-jar.xml, and the .class files
are not in a jar.
Any help?
Cheers,
Thiago
Re: OpenEJB Tomcat Deployments
Posted by David Blevins <da...@visi.com>.
On Apr 29, 2010, at 3:00 PM, Minh wrote:
> I saw minor error when Tomcat start up, but not sure it relates to the
> error...if so, how can I fix this?
>
> Apr 29, 2010 2:41:57 PM org.apache.catalina.loader.WebappClassLoader
> validateJarFile
> INFO:
> validateJarFile(C:\apache-tomcat-6.0.20\webapps\recharge_report\WEB-
> INF\lib\javaee-api-5.0-2.jar)
> - jar not loaded. See Servlet Spec 2.3, section 9.7
> .2. Offending class: javax/servlet/Servlet.class
> context path = /recharge_report
It might relate. Certainly, including another copy of the Java EE
libraries in your webapp is not allowed as the error message says. So
you should remove the javaee-api-5.0-2.jar from your webapp. If by
chance you put any OpenEJB libraries in your webapp as well, that
wouldn't work either.
Follow the four steps on this page if you haven't already:
http://openejb.apache.org/tomcat.html
Once that is done you can develop webapps as you would in a standard
Java EE server.
-David
Re: OpenEJB Tomcat Deployments
Posted by Minh <bm...@hotmail.com>.
Hi,
can someone who has been succefully using OpenEJB with tomcat tell me what I
need to do to make this simple EJB deployed and work on tomcat 6.0.20
i have a very simple EJB Bean. Compiled and then put them in a war file
togther with the servlet HomeAction where I look up the Bean Hello. for some
reason I wont be able to look up for the bean, the bean is always NULL.
Can you tell me if i need to do anythign else or what did i missed? what did
I do wrong here ...any extra deployment sescriptor in web.xml etc ......
I saw minor error when Tomcat start up, but not sure it relates to the
error...if so, how can I fix this?
Apr 29, 2010 2:41:57 PM org.apache.catalina.loader.WebappClassLoader
validateJarFile
INFO:
validateJarFile(C:\apache-tomcat-6.0.20\webapps\recharge_report\WEB-INF\lib\javaee-api-5.0-2.jar)
- jar not loaded. See Servlet Spec 2.3, section 9.7
.2. Offending class: javax/servlet/Servlet.class
context path = /recharge_report
The javaee-api-5.0-2.jar is located inside war-file/WEB-INF\lib\ directory.
thanks
Minh
---------------------------------------------------------------
package edu.ucsd.ehs.service.helloworld;
import javax.ejb.Stateless;
@Stateless
public class HelloBean implements Hello {
public String greet(String s) {
return "Hello " + s + "!";
}
}
--------------------------------------------------------------
package edu.ucsd.ehs.service.helloworld;
import javax.ejb.Local;
@Local
public interface Hello{
public String greet(String s);
}
--------------------------------------------------------------
public class HomeAction extends DispatchAction {
@EJB
private Hello bean;
public ActionForward displayHome(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse
response)throws Exception {
System.out.println("***Context: HomeAction ");
try{
System.out.println("***HomeAction: testing OPENEJB");
String returnedString = bean.greet("OpenEJB User");
System.out.println("***returnedString: " + returnedString);
...
....
------------------------------------------------------------------------------------------
--
View this message in context: http://openejb.979440.n4.nabble.com/OpenEJB-Tomcat-Deployments-tp980872p2076252.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: OpenEJB Tomcat Deployments
Posted by Thiago Antônio Marafon <th...@softplan.com.br>.
Thank you very much David for you extra fast reply!
:-)
Congrats for the great work with OpenEJB!
Thiago
David Blevins escreveu:
> Hi Thiago,
>
> We do in fact scan all of WEB-INF/lib/ and WEB-INF/classes for ejbs.
> The openejb.deployments.classpath.include property applies to
> boot-time scanning of the system classpath, but we could probably rig
> up something that allows you to set that and similar flags for an
> individual webapp.
>
> Filed a jira on it: https://issues.apache.org/jira/browse/OPENEJB-925
> (for notifications:
> https://issues.apache.org/jira/secure/ViewIssue.jspa?id=12406545&watch=true)
>
>
> -David
>
> On Oct 15, 2008, at 4:29 PM, Thiago Antônio Marafon wrote:
>
>> Hello Reza!
>> Thanks for helping me again.
>>
>> I made a simple application, using no jars, with only one annotated
>> EJB, and Tomcat loads in +- 25 seconds.
>> If I make this app depend on Hibernate, Struts and some others jars
>> (20 jars total), still with only one EJB, then Tomcat takes 55
>> seconds to start.
>>
>> I´ve tried to use the openejb.xml to describe the deployments, tried
>> the "openejb.deployments.classpath.include" system property, and I
>> even tried to put the EJB .class files in a jar with an empty
>> ejb-jar.xml file, but Tomcat still takes more than 50 seconds to start.
>>
>> We can´t use all of these jars in Tomcat lib because there are many
>> applications running together and each one using different versions
>> of the libs. Even Hibernate, some of them uses 3.1.3, others 3.2.5.
>> Frequently, the apps are so big that we don´t have time to migrate
>> for the new vesions.
>>
>> It would be possible to put Struts and some others jars in
>> Tomcat/lib, but that is not really nice, specially during
>> development. It is better to have them within the application, so
>> they stay together in the repository (we still don´t use Maven. I
>> hope we do soon).
>>
>> ".. you can always disable class-path scanning by setting the
>> metadata-complete attribute to "true" in the deployment descriptor.
>> However, that will also turn off annotations processing completely."
>>
>> You mean I would have to describe the EJBs using XML?
>>
>> Regards,
>> Thiago
>>
>> Reza Rahman escreveu:
>>> Thiago,
>>>
>>> What kind of boot times are you seeing? How many jars do you have?
>>> Do you need them all in the app or can some of them go in Tomcat/lib
>>> instead? I have to say I haven't seen much of an issue on this, but
>>> I am using OpenEJB for unit testing only, not with Tomcat.
>>>
>>> If performance is a very critical issue, you can always disable
>>> class-path scanning by setting the metadata-complete attribute to
>>> "true" in the deployment descriptor. However, that will also turn
>>> off annotations processing completely. That should improve
>>> performance, right David? Are there any other OpenEJB specific
>>> techniques? I am curious to know myself...
>>>
>>> Cheers,
>>> Reza
>>>
>>>
>>> Thiago Antônio Marafon wrote:
>>>> Hi all,
>>>> I´m evaluation OpenEJB 3.0 with Tomcat 6. Everything is ok, my test
>>>> application is working great.
>>>> But, I noticed that the more jars the application has, longer is
>>>> the Tomcat bootstrap time.
>>>> Then I saw this:
>>>> http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html
>>>>
>>>>
>>>> And tried all the alternatives, but it looks like that in Tomcat
>>>> these don´t work.
>>>> My beans are annotated, there isn´t a ejb-jar.xml, and the .class
>>>> files are not in a jar.
>>>> Any help?
>>>> Cheers,
>>>> Thiago
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: OpenEJB Tomcat Deployments
Posted by David Blevins <da...@visi.com>.
Hi Thiago,
We do in fact scan all of WEB-INF/lib/ and WEB-INF/classes for ejbs.
The openejb.deployments.classpath.include property applies to boot-
time scanning of the system classpath, but we could probably rig up
something that allows you to set that and similar flags for an
individual webapp.
Filed a jira on it: https://issues.apache.org/jira/browse/OPENEJB-925
(for notifications: https://issues.apache.org/jira/secure/ViewIssue.jspa?id=12406545&watch=true)
-David
On Oct 15, 2008, at 4:29 PM, Thiago Antônio Marafon wrote:
> Hello Reza!
> Thanks for helping me again.
>
> I made a simple application, using no jars, with only one annotated
> EJB, and Tomcat loads in +- 25 seconds.
> If I make this app depend on Hibernate, Struts and some others jars
> (20 jars total), still with only one EJB, then Tomcat takes 55
> seconds to start.
>
> I´ve tried to use the openejb.xml to describe the deployments, tried
> the "openejb.deployments.classpath.include" system property, and I
> even tried to put the EJB .class files in a jar with an empty ejb-
> jar.xml file, but Tomcat still takes more than 50 seconds to start.
>
> We can´t use all of these jars in Tomcat lib because there are many
> applications running together and each one using different versions
> of the libs. Even Hibernate, some of them uses 3.1.3, others 3.2.5.
> Frequently, the apps are so big that we don´t have time to migrate
> for the new vesions.
>
> It would be possible to put Struts and some others jars in Tomcat/
> lib, but that is not really nice, specially during development. It
> is better to have them within the application, so they stay together
> in the repository (we still don´t use Maven. I hope we do soon).
>
> ".. you can always disable class-path scanning by setting the
> metadata-complete attribute to "true" in the deployment descriptor.
> However, that will also turn off annotations processing completely."
>
> You mean I would have to describe the EJBs using XML?
>
> Regards,
> Thiago
>
> Reza Rahman escreveu:
>> Thiago,
>>
>> What kind of boot times are you seeing? How many jars do you have?
>> Do you need them all in the app or can some of them go in Tomcat/
>> lib instead? I have to say I haven't seen much of an issue on this,
>> but I am using OpenEJB for unit testing only, not with Tomcat.
>>
>> If performance is a very critical issue, you can always disable
>> class-path scanning by setting the metadata-complete attribute to
>> "true" in the deployment descriptor. However, that will also turn
>> off annotations processing completely. That should improve
>> performance, right David? Are there any other OpenEJB specific
>> techniques? I am curious to know myself...
>>
>> Cheers,
>> Reza
>>
>>
>> Thiago Antônio Marafon wrote:
>>> Hi all,
>>> I´m evaluation OpenEJB 3.0 with Tomcat 6. Everything is ok, my
>>> test application is working great.
>>> But, I noticed that the more jars the application has, longer is
>>> the Tomcat bootstrap time.
>>> Then I saw this:
>>> http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html
>>>
>>> And tried all the alternatives, but it looks like that in Tomcat
>>> these don´t work.
>>> My beans are annotated, there isn´t a ejb-jar.xml, and the .class
>>> files are not in a jar.
>>> Any help?
>>> Cheers,
>>> Thiago
>>>
>>>
>>
>>
>
>
Re: OpenEJB Tomcat Deployments
Posted by Thiago Antônio Marafon <th...@softplan.com.br>.
Hello Reza!
Thanks for helping me again.
I made a simple application, using no jars, with only one annotated EJB,
and Tomcat loads in +- 25 seconds.
If I make this app depend on Hibernate, Struts and some others jars (20
jars total), still with only one EJB, then Tomcat takes 55 seconds to start.
I´ve tried to use the openejb.xml to describe the deployments, tried the
"openejb.deployments.classpath.include" system property, and I even
tried to put the EJB .class files in a jar with an empty ejb-jar.xml
file, but Tomcat still takes more than 50 seconds to start.
We can´t use all of these jars in Tomcat lib because there are many
applications running together and each one using different versions of
the libs. Even Hibernate, some of them uses 3.1.3, others 3.2.5.
Frequently, the apps are so big that we don´t have time to migrate for
the new vesions.
It would be possible to put Struts and some others jars in Tomcat/lib,
but that is not really nice, specially during development. It is better
to have them within the application, so they stay together in the
repository (we still don´t use Maven. I hope we do soon).
".. you can always disable class-path scanning by setting the
metadata-complete attribute to "true" in the deployment descriptor.
However, that will also turn off annotations processing completely."
You mean I would have to describe the EJBs using XML?
Regards,
Thiago
Reza Rahman escreveu:
> Thiago,
>
> What kind of boot times are you seeing? How many jars do you have? Do
> you need them all in the app or can some of them go in Tomcat/lib
> instead? I have to say I haven't seen much of an issue on this, but I
> am using OpenEJB for unit testing only, not with Tomcat.
>
> If performance is a very critical issue, you can always disable
> class-path scanning by setting the metadata-complete attribute to
> "true" in the deployment descriptor. However, that will also turn off
> annotations processing completely. That should improve performance,
> right David? Are there any other OpenEJB specific techniques? I am
> curious to know myself...
>
> Cheers,
> Reza
>
>
> Thiago Antônio Marafon wrote:
>> Hi all,
>> I´m evaluation OpenEJB 3.0 with Tomcat 6. Everything is ok, my test
>> application is working great.
>> But, I noticed that the more jars the application has, longer is the
>> Tomcat bootstrap time.
>> Then I saw this:
>> http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html
>>
>>
>> And tried all the alternatives, but it looks like that in Tomcat
>> these don´t work.
>> My beans are annotated, there isn´t a ejb-jar.xml, and the .class
>> files are not in a jar.
>> Any help?
>> Cheers,
>> Thiago
>>
>>
>
>
Re: OpenEJB Tomcat Deployments
Posted by Reza Rahman <re...@lycos.com>.
Thiago,
What kind of boot times are you seeing? How many jars do you have? Do
you need them all in the app or can some of them go in Tomcat/lib
instead? I have to say I haven't seen much of an issue on this, but I am
using OpenEJB for unit testing only, not with Tomcat.
If performance is a very critical issue, you can always disable
class-path scanning by setting the metadata-complete attribute to "true"
in the deployment descriptor. However, that will also turn off
annotations processing completely. That should improve performance,
right David? Are there any other OpenEJB specific techniques? I am
curious to know myself...
Cheers,
Reza
Thiago Antônio Marafon wrote:
> Hi all,
> I´m evaluation OpenEJB 3.0 with Tomcat 6. Everything is ok, my test
> application is working great.
> But, I noticed that the more jars the application has, longer is the
> Tomcat bootstrap time.
> Then I saw this:
> http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html
>
>
> And tried all the alternatives, but it looks like that in Tomcat these
> don´t work.
> My beans are annotated, there isn´t a ejb-jar.xml, and the .class
> files are not in a jar.
> Any help?
> Cheers,
> Thiago
>
>