Craig R. McClanahan wrote:

> 
> In 4.0.x, automatically deployed contexts with no <Context> entry do not
> have any resources assigned to match up the resource references.
> Therefore, you must explicitly define such webapps in the server.xml file
> to give them access to the corresponding JNDI resources.


What's the story on double deployment? Can it make a mess of my operation? What 
wouldbe the preferable way of handling multiple virtual hosts with JNDI on my mind?

So far, I've been just creating one user account per virtual host, make a 
./webapp dir and setup <Host ...> so it has appbase point to ~account/webapp. 
Then I would add any "system" contexts, like /docs and /manager.


> In the HEAD branch (what will become 4.1), Tomcat supports the notion of a
> separate "context descriptor file", which is an XML file that just
> contains the <Context> element for a particular webapp, plus all of its
> nested elements.  This gives you the following options (in addition to the
> auto-deploy support in 4.0):
> 
> * Put a context description file in the appBase
>   directory and that webapp will be auto-deployed
>   with its resource definitions.
> 
> * Use the /install command of the Manager webapp
>   to dynamically deploy a context description file
>   (and associated WAR or webapp directory).
> 
> You can see this in action with a nightly build of Tomcat 4 -- the Admin
> and Manager webapps themselves are deployed in this way.

So, this is a CVS beta or what? Anyway, it looks nice.

Oh, and one last thing. I'm using 4.0.1 and like some other guys, SAX is 
spitting an error on my web.xml:

PARSE error at line 68 column 11
org.xml.sax.SAXParseException: The content of element type "web-app" must match 
"(icon?,display-name?,des
cription?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,sessi
on-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-
constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".

My web.xml file is:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
      "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
     "http://java.sun.com/dtd/web-app_2_3.dtd";>

<web-app>
   <description>E-Mail address book Admin GUI</description>

   <servlet>
     <servlet-name>OrgUnitServlet</servlet-name>
     <servlet-class>yu.co.ev.EVnet.mail.OrgUnitServlet</servlet-class>
       <init-param>
         <param-name>RedirectURL</param-name>
         <param-value>orgUnitDisplay.jsp?id=</param-value>
         <description>URL to redirect a client</description>
       </init-param>
   </servlet>
   <servlet-mapping>
     <servlet-name>OrgUnitServlet</servlet-name>
     <url-pattern>/servlets/OrgUnit</url-pattern>
   </servlet-mapping>

   <servlet>
     <servlet-name>EmailUserServlet</servlet-name>
     <servlet-class>yu.co.ev.EVnet.mail.EUserServlet</servlet-class>
     <init-param>
       <param-name>RedirectURL</param-name>
       <param-value>eUserDisplay.jsp?id=</param-value>
       <description>URL to redirect a client</description>
     </init-param>
   </servlet>
   <servlet-mapping>
     <servlet-name>EmailUserServlet</servlet-name>
     <url-pattern>/servlets/EUser</url-pattern>
   </servlet-mapping>

   <resource-ref>
     <description>
       javax.sql.DataSource for this application,
       as configured in server.xml
     </description>
     <res-ref-name>jdbc/AddressBookDB</res-ref-name>
     <res-type>javax.sql.DataSource</res-type>
     <res-auth>container</res-auth>
   </resource-ref>
</web-app>

The only thing I've done is add <resource-ref> part. The ordering of elements 
seams to be OK. So, what could be the problem?

Nix.


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to