Exactly. It's copied so that it can live in WEB-INF/src (or any source directory outside of the webapp) and then copied into WEB-INF/classes so it's available in classloader.
The line below just makes sure to load it through classloader at runtime.
Eddie
Scott Semyan wrote:
I think I got it:
<echo>Copy .sql file</echo>
<copy todir="${webapp.dir}/WEB-INF/classes/sql">
<fileset dir="${webapp.dir}/WEB-INF/src/sql"
includes="**/*.sql"/>
</copy>
-----Original Message-----
From: Scott Semyan Sent: Wednesday, April 13, 2005 3:52 PM
To: Beehive Developers
Subject: RE: Pending JPetStore Checkin
Next question, with your new code: InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(sqlFi le);
Where does the sql file need to be copied to during the build process? I need to add this to the build.xml file...
S
-----Original Message----- From: Eddie O'Neil Sent: Tuesday, April 12, 2005 3:23 PM To: Beehive Developers Subject: Re: Pending JPetStore Checkin
Scott--
I've got everything wired up and will checkin shortly. One thing that would be great is if there was a db.properties file that lived in WEB-INF/src and could be edited locally by devs. This would include the Derby path that is currently stored in the org.apache.beehive.samples.petstore.data.DBProperties interface.
Any chance you could do that?
Also, I made the following changes to the patch:
- move the SQL file from resources/sql/instDB.sql to WEB-INF/src/sql/instDB.sql - use an InputStream to load the SQL file from context classloader - update petstoreWeb/README to fix the instructions to use the app's Ant targets
Will continue to go over the code and provide feedback. And, if anyone else is interested, the more eyes on this sample, the better. :)
Thanks!
Eddie
Scott Semyan wrote:
Added. Sorry about that.
-----Original Message----- From: Eddie O'Neil Sent: Tuesday, April 12, 2005 12:15 PM To: Beehive Developers Subject: Re: Pending JPetStore Checkin
Scott--
Also looks like the following file is missing:
WEB-INF/src/org/apache/beehive/samples/petstore/forms/AddressForm.java
Can that be added to the patch as well?
Thanks!
Eddie
Scott Semyan wrote:
Cool. Thanks!
Scott
-----Original Message----- From: Eddie O'Neil Sent: Tuesday, April 12, 2005 10:50 AM To: Beehive Developers Subject: Re: Pending JPetStore Checkin
Scott--
Okay; clearly I didn't read the README. :)
But, the SVN version of the WEB-INF/src/build.xml file, the "build"
target copies all of the resources necessary to build and run the app into WEB-INF/lib, and this currently doesn't work. I'll fix it to include the jdbc-control.jar for the SVN build.
As far as the SQL file, that's generally not something we want to have URL addressable under petstoreWeb/resources/sql/instDB.sql. :) So, I'll move this into WEB-INF/src/sql/instDB.sql and go from there.
I'll grab Derby and add it manually, but I think in the long run we
want that to be included. Otherwise, the samples are "some-assembly-required".
:)
Eddie
Scott Semyan wrote:
When you do the first part of the readme:
The first time you build the Petstore web application, you will need to pull in the Beehive runtime libraries. Use the following target
once:
ant -f <BeehiveRoot>\ant\beehive-runtime.xml -Dwebapp.dir=<BeehiveRoot>\samples\petstoreWeb deploy.beehive.webapp.runtime
You will get the JdbcControl classes.
As to the Derby jar, downloading that manually (along with Java, ant,
etc.) is part of the readme.
Scott
-----Original Message----- From: Eddie O'Neil Sent: Tuesday, April 12, 2005 10:30 AM To: Beehive Developers Subject: Re: Pending JPetStore Checkin
One other issue is that we need to upgrade the WEB-INF/src/build*.xml files that build against SVN and against the distribution to satisfy two other issues:
- the JdbcControl classes aren't available in WEB-INF/lib - the Derby JAR isn't available in WEB-INF/lib
Can you add support for this to the Ant files?
Eddie
Eddie O'Neil wrote:
Scott--
Couple of comments:
- having patched my local copy of petstoreWeb, the build.xml file in
WEB-INF/src doesn't work with the targets "clean build". It fails because the OrderItem.java file in WEB-INF/src is duplicated in two
directories:
org/apache/beehve/samples/petstore/model /forms
with the same package:
org.apache.beehive.samples.petstore.model
and this is causing APT to fail with an NPE.
- the file resources/sql/initDB.sql is in the webapp root. I think that this needs to move to WEB-INF/src and be copied by the build file
so that it's available in WEB-INF/classes in classloader at runtime.
Can you update the patch?
Thanks!
Eddie
Scott Semyan wrote:
JIRA: BEEHIVE-518 -----Original Message----- From: Steven Tocco Sent: Tuesday, April 12, 2005 9:45 AM To: Beehive Developers Subject: RE: Pending JPetStore Checkin
I suspect this work will be attached to a JIRA issue with the patch
file, additions, deletions.
Correct?
Steve
-----Original Message----- From: Scott Semyan Sent: Tuesday, April 12, 2005 10:44 AM To: Beehive Developers Subject: Pending JPetStore Checkin
I have a pending checkin to the JPetStore sample. This check-in incorporates using Derby as the data store and adds new or improved
functionality such as multiple addresses, add/edit new user, admin of
the DB, etc. I also fixed many bugs.
This checkin is currently being code reviewed and should appear in the trunk shortly.
Scott Semyan
