-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul,

On 6/27/2014 1:25 PM, Paul Taylor wrote:
> On 27/06/2014 19:59, Christopher Schultz wrote:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>> 
>> Paul,
>> 
>> On 6/27/14, 8:34 AM, Paul Taylor wrote:
>>> I have a simple WAR based web application that uses lucene 
>>> created indexes to provide search results in a xml format, the
>>>  location of the indexes (outside of the war) are referred in 
>>> the web.xml.
>>> 
>>> It works fine locally but I want to deploy it using Elastic 
>>> Beanstalk within Amazon Webservices but for it to work I need 
>>> the data files within the war, then I can allow EB to create 
>>> new instances when load balancing/scaling and it will work 
>>> because the data fields are included in the war at deployment 
>>> time. I have checked that EB does unjar the war so that when my
>>> code comes to use the files they will be real files not still
>>> contained within the War.
>>> 
>>> With that in mind where could i put the data files so they not 
>>> considered  by tomcat as java classes , and supplementary 
>>> question how do I modify my pom file to do this with maven
>> What?
>> 
>> Java won't try to load random files as .class files.
> I tried putting the files into the resources directory of my maven 
> project, when I deployed the resulting war it would start (did 
> previously) and opening the war found the files were added under 
> WEB-INF/classes, that is what I meant. So I need to put them 
> somewhere else.
> 

It sounds like you're not building these within the deployed
application, but adding them at build time.

Why can't your application read the files from WEB-INF/classes with
getResourceAsStream?

We put a bunch of configuration information in our web applications.
We tend to load these up with a servlet context listener at startup,
and then make the information available via a singleton. The
information isn't changed while the application is available.

>> Are you launching Lucene from within the startup process of your 
>> webapp? I don't see any support for loading Lucene indexes from 
>> within a ZIP file (e.g. WAR, JAR) so you might have to bootstrap
>>  the following when deploying:
>> 
>> 1. Know where your files are within the WAR 2. In a 
>> ServletContextListener -- perhaps the one that actually sets-up 
>> Lucene -- do the following:
>> 
>> a. Unpack each file of your index into ${tmpdir}/lucene (or 
>> whatever) b. Configure Lucene with an IndexReader that looks at 
>> ${tmpdir}/lucene
>> 
>> 3. Clean-up after yourself during undeploy
>> 
> Actually I don't have a startup process as such, the first user 
> request will just do a search which will cause the index to be 
> accessed. But perhaps a startup proces is what is what I need. The
>  data files are stored in amazon s3 so perhaps i could use servlet
>  init to get the s3 file and put it somewhere relative to the 
> deployed app and then use.
> 
> Paul

/mde/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTrdbCAAoJEEFGbsYNeTwtwsMIAKf5xIsV4ZLdJolSK+oGhyyN
Q/IQ6uhrlIz/6D8QKSG/yR/jHTY0R8pLffJ/wlxofoVMWMHQQ0zlLmIwKnRwkpzI
Ta9CfXPPduijmVVUQZdQuLCTr3f6QRoLMCYYX6kbgz/ypIPzaeTSZMm2dJvOa6AH
je5jhAia4KyNsK9YRz2LLgF4vdL2d32wmdN+/GXU+bc3t7LvuXZEBbr9NXFVvFMf
Wz/teQ5ATVWDoVjEebm7QKr00pkDMlmm/uDZrsoqXtxuGhTOI791WupUtekO4Dgu
ruTxytopufoTJYicB8ttIirKVNT5MBI4+VtNvTpJsQGdAMqsHQo5BV0Fk5WGMoU=
=IPEV
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to