You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by David Blevins <da...@visi.com> on 2009/12/09 11:42:59 UTC
Re: Where to place my third party jars ?
On Nov 24, 2009, at 4:06 PM, Jean-Louis MONTEIRO wrote:
>
>
>
> Martin Elkjær wrote:
>>
>> Hi,
>>
>> Just started using OpenEJB last week - but so far I'm very satisfied!
>> I've migrated an web application running on Tomcat with GWT on top an
>> Hibernate in the bottom. So far every things seems to be running,
>> but I
>> need
>> some advice for fine-tuning. I've read through the documentation,
>> but some
>> questions still keeps coming... :-)
>>
> Thanks for that!
>
> Martin Elkjær wrote:
>>
>> 1. Where should I place 3rd party libs for my application ? If I
>> put them
>> in
>> WEB-INF/lib the openEJB startup is very very slow - guess it is
>> because
>> it's
>> scanning all the jars - if I put them in the openEJB/lib folder it
>> starts
>> very fast. So my question is: Is there a way to tell OpenEJB not to
>> scan
>> the
>> whole WEB-INF/lib folder but only WEB-INF/classes ??
>>
> IMO, you should not put your jars in openejb/lib. It's better to fit
> servlet
> API and put your jars in WEB-INF/lib
> By the way, you can exclude jars to avoid full application scanning.
> By
> default, OpenEJB scans all jars.
> In the last release (or may be in the trunk), we added a set of jars
> to
> exclude, but you can definitely exclude/include whatever you want.
>
> https://issues.apache.org/jira/browse/OPENEJB-1107
> https://issues.apache.org/jira/browse/OPENEJB-1107 --> builtin
> exclude list
>
> If you need to exclude/include some jars, have a look here
> http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html
> http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html
> .
>
> Don't forget the note at the bottom of the page.
You know I don't think that takes effect when scanning a webapp
classpath, but it does seem like functionality almost everyone will
need. Maybe we should come up with a nice xml format and push for
some standardization next spec round (Java EE 7).
> Martin Elkjær wrote:
>>
>> 2. I'm planning to use JMS in the near future.
>> My plan is to use ActiveMQ in embedded mode, mostly because of the
>> simple
>> setup and speed (same JVM). But is this OK ?
>> I've done some testing trying to use MySQL for storing messages,
>> but it
>> doesn't seem to work (no tables are created in the database
>> scheme?!?!) My
>> setup is :
>> -------------------------------------------------------------
>> <Resource id="My JMS Resource Adapter"
>> type="ActiveMQResourceAdapter">
>> # Broker configuration URI as defined by ActiveMQ
>> # see http://activemq.apache.org/broker-configuration-uri.html
>>
>> BrokerXmlConfig broker:(tcp://localhost:61616)?useJmx=false
>>
>> # Broker address
>>
>> ServerUrl vm://localhost?async=true
>>
>> # DataSource for persistence messages
>>
>> DataSource jmsDatabase
>> </Resource>
I think you have to use "vm:" instead of "tcp:" or ActiveMQ won't
really go into embedded mode. There is a "persistent" property that
can be used in the BrokerXmlConfig -- you'd think they wouldn't need
it by the fact that a DataSource was set, but it can't hurt to set it
explicitly.
Try this for your ActiveMQResourceAdapter config:
<Resource id="My JMS Resource Adapter" type="ActiveMQResourceAdapter">
# Broker configuration URI as defined by ActiveMQ
# see http://activemq.apache.org/broker-configuration-uri.html
BrokerXmlConfig broker:()/localhost?persistent=true
# Broker address
ServerUrl vm://localhost?async=true
# DataSource for persistence messages
DataSource jmsDatabase
</Resource>
Let us know if that works out cause we could document this on our site
and hopefully save people some time.
-David