This one time, at band camp, Robert Kent said:
RK>Thanks for the advice. As I move forward, I'll consider this approach to
RK>generalizing the location of the xml files.
RK>
RK>As far as the security context, is there a way to make Castor look for the
RK>castor.properties in a folder that's inside my security context? Right now,
RK>it's looking for that file in $JAVA_HOME/jre/lib , as if it was hardcoded to
RK>look there (obviously, I've not set that in my code anywhere).
RK>
RK>Thanks again,
RK>Rob Kent
RK>
RK>----- Original Message -----
RK>From: "Robert Cooper" <[EMAIL PROTECTED]>
RK>To: <[EMAIL PROTECTED]>
RK>Sent: Sunday, January 26, 2003 3:53 PM
RK>Subject: Re: [castor-dev] Re: JSP Integration
RK>
RK>I worked around this problem with my database.xml and mappings.xml by
RK>setting up an initializer servlet that loads first in my servlet context
RK>that uses the servletContext.getResource() method to pass out a URL. In
RK>Tomcat this resolves to something like "jndi:/WEB-INF/classes", but it
RK>should work with any application server to provide a URL object to the
RK>proper files, when you can then call .toExternalForm() on when
RK>initializing castor.
RK>
RK>As to access control exceptions, you should look at the security context
RK>your servlet engine is running in. Generally Tomcat 4.1.X and WebLogic
RK>6+ (that I know about) reset the security context for each application
RK>to only have access to it's deployment directory. Any attempt to read or
RK>write outside of that will throw and access exception no matter what the
RK>user-level permission on the folder are.
There should be no need to place any items in the $JAVA_HOME directory
at all. Also, there should be no need to place anything in the
$CATALINA_HOME/common/lib directory either. All jars and resources
for an application should be placed in the application's respective
WEB-INF/lib directory.
Regarding the mapping and database descriptors, Robert Cooper's comments
are correct in terms of the security manager. Placement of the Castor
descriptors is certainly up to you, however, I've always had very good
luck placing them in the CLASSPATH for the application (WEB-INF/classes)
and fetching them from there. See the following message from the list
archives:
http://www.mail-archive.com/[email protected]/msg07008.html
HTH.
Bruce
--
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev