You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2008/09/08 21:21:30 UTC

DO NOT REPLY [Bug 45764] New: Embedded fails to configure hosts with HostConfig

https://issues.apache.org/bugzilla/show_bug.cgi?id=45764

           Summary: Embedded fails to configure hosts with HostConfig
           Product: Tomcat 6
           Version: 6.0.18
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: mhuffman@cadrc.calpoly.edu


I admit that I am new to Tomcat, but the following seems like a bug. 

When attempting to launch Tomcat embedded, hosts (specifically StandardHosts)
created are not configured with a HostConfig. Consequently, all deployment
flags for WAR deployment like autoDeploy and deployOnStartup are ignored. I
recommend adding the following to the implementation of createHost(..) in the
Embedded class:

    public Host createHost(String name, String appBase) {

        ... // logging code

        StandardHost host = new StandardHost();

        host.setAppBase(appBase);
        host.setName(name);

       +// Host config should listen for lifecycle changes in host (notably the
start event)
       +HostConfig deployer = new HostConfig();
       +host.addLifecycleListener(deployer);  

        return (host);
    }

The implementation of createContext() is similarly designed to use the
ContextConfig, so I assume this was omitted on accident. Otherwise, those
wanting the auto deployment capabilities when running embedded must override
the createHost() method or create a HostConfig listener manually. This change
seems well in line with the API documentation, which details that this function
should "Create, configure, and return a Host...".

If however, this was purposefully omitted, please let me know why.

Thanks,
Mike Huffman


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45764] Embedded fails to configure hosts with HostConfig

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45764





--- Comment #2 from Michael Huffman <mh...@cadrc.calpoly.edu>  2008-09-10 11:59:51 PST ---
The term "operate correctly" depends on what "correct" means. I assumed that
when I created a Host it would automatically support operations like auto
deployment (by called setAutoDeploy()). Although a Host can operate without a
HostConfig, it doesn't accomplish functionality implied by flags and values set
in the Host. I didn't see anywhere in the documentation which mentioned this
caveat. To me, this seems different than the ContextConfig, and would likely be
useful in all cases. 

It seems this behavior was as designed, however, it would be helpful to add
documentation to the Host which describes this issue when running Embedded.
Specifically, that some flags set into the Host (like autoDeploy) are ignored
unless a HostConfig is attached.

Thanks,
Mike


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45764] Embedded fails to configure hosts with HostConfig

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45764





--- Comment #3 from Remy Maucherat <re...@apache.org>  2008-09-10 12:36:15 PST ---
I disagree. Configuring the host means deploying the applications, and in
embedded it seems odd to use the auto deployer (which allows direct
manipulation by the user). Configuring a context means something more
essential, obviously.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45764] Embedded fails to configure hosts with HostConfig

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45764


Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #1 from Mark Thomas <ma...@apache.org>  2008-09-10 09:26:57 PST ---
The short version is that a Context requires a ContextConfig to operate
correctly (read web.xml etc) whereas a Host does not require a HostConfig to
operate correctly. Forcing the use of a HostConfig seems like a bad idea to me.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org