Hi Larry,

my virtual host configuration seems fine to me.
I suppose it is a problem of configuring the class loader!?
I have a separate 'work' directory for each virtual
host. And of course I store all classes, .jsp and so on
in the WEB-INF directory of each virtual host's
application.

When I look into the 'work' directories I can see,
that in each one there are the following files:

ls -ltr /var/tomcat/www.tiade-voboe.de/wapps_2FjRolodex
total 29
drwxr-xr-x    4 root     root          104 Jan  9 23:49 ..
-rw-r--r--    1 root     root            1 Jan  9 23:49 webxmlval.txt
-rw-r--r--    1 root     root         8768 Jan  9 23:49 numguess_1.java
-rw-r--r--    1 root     root         4827 Jan  9 23:49 numguess_1.class
-rw-r--r--    1 root     root            1 Jan  9 23:49 numguess.ver
drwxr-xr-x    2 root     root          176 Jan  9 23:49 .

ls -ltr /var/tomcat/javadex.tiade-voboe.de/wapps_2FjRolodex                   
total 29
drwxr-xr-x    4 root     root          104 Jan  9 23:49 ..
-rw-r--r--    1 root     root            1 Jan  9 23:49 webxmlval.txt
-rw-r--r--    1 root     root         8720 Jan  9 23:49 numguess_1.java
-rw-r--r--    1 root     root            1 Jan  9 23:49 numguess.ver
-rw-r--r--    1 root     root         4827 Jan  9 23:49 numguess_1.class
drwxr-xr-x    2 root     root          176 Jan  9 23:49 .

Looks great, doesn't it.
But I get the error regardless!

Not so cheerfull ;)
        Martin 

Am Mittwoch,  9. Januar 2002 15:12 schrieb Larry Isaacs:
> Hi Martin,
>
> I'm not sure why you are getting the exception.  As
> far as I know, what you are attempting should work.
> I would recommend moving the <AutoWebApp> out of the
> <Host> declarations an putting them in server.xml.
> I believe they will still do what you expect if placed
> there.  I don't know if there are side effects if you
> try to use it context local.
>
> There should be separate work directories created
> for both virtual hosts.  Each should compile its
> own numguess.jsp.  Try setting the debug level on
> <SimpleMapper1> to 1 and check the log for
> "Host = ..." and make sure the request is going
> to the virtual host you expect.
>
> I'll see if I can try some experiments and see if
> I can duplicat this when I get a chance.
>
> Cheers,
> Larry
>
> > -----Original Message-----
> > From: Martin v. Boehlen [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 08, 2002 5:05 PM
> > To: [EMAIL PROTECTED]
> > Subject: class loading tc 3.3 & virtual hosts
> >
> >
> > Greetings Users,
> >
> > is it possible to use two completely separate virtual hosts
> > with tomcat ?
> > What I want to do is using two virtual hosts on the same box.
> > One for real web serving and one for development.
> >
> > My problems so far are:
> > 1. Class loading -
> >     Can I configure tomcat in a way that classes don't
> >     interfere between virtual hosts ?
> > 2. Context scope -
> >     Can I use JkMount with a single path for all
> >     applications ?
> > 3. Host aliases
> >     Can I do an 'AutoWebApp' for an 'Alias' and
> >     a full host name at the same time ?
> >
> > Please note, that:
> >     The application name is 'jRolodex', but I used the
> > 'numguess.jsp'
> >     example for testing.
> >     'www' is the web host and
> >     'javadex' is the development host.
> >
> >     A 'build.sh all' copies the application files to host 'javadex'
> >     i.e. the 'docBase' directory of virtual host
> >     'javadex.tiade-voboe.de'.
> >
> >     A 'build.sh dist' produces a 'jRolodex.war' and a 'jRoldex.jar'
> >     in the 'docBase' directory of host 'www.tiade-voboe.de'.
> >
> > Before I plunge into the details, please look at the partial
> > config files, stack and SW version at the end of this mail.
> >
> > Now the gory details:
> >
> > ad 1.  When i change some code in the application and afterwards do a
> >     'build.sh all' for application 'jRolodex' without doing a
> >     'build.sh dist', the first virtual server I hit works fine!
> >     No matter wether it is 'www' or 'javadex'.
> >     The second server always gets an 'Error 500' (see error stack at
> >     end of mail).
> >     It seems to me, that tomcat does not load the appropriate class
> >         definitions.
> >
> > ad 2.  I tried to use '/wapps' as the context path (with and without a
> >         'prefix' in 'AutoWebApp') because I wanted something like
> >         'JkMount /wapps' in 'httpd.conf'. It didn't work. So I have
> >     to mount every application explicitly.
> >
> > ad 3.  I tried to use the 'Alias' definition in 'AutoWebApp'. I.e.:
> >         <AutoWebApp dir="/usr/local/httpd/webapps/javadex"
> >             prefix="/wapps"
> >             host="javadex" />
> >     It worked fine but it didn't work for
> > 'javadex.tiade-voboe.de' (and
> >     vice versa).
> >
> >
> > <!-- --------------- httpd.conf START
> > ---------------------------------- -->
> > # ----- The Waltons, Daltons, everyone
> > <VirtualHost www.tiade-voboe.de:80>
> >     ServerAdmin [EMAIL PROTECTED]
> >     ServerName  www.tiade-voboe.de
> >     DocumentRoot "/usr/local/httpd/htdocs/www"
> >     ServerAlias www       www.tiade-voboe.de
> >
> >     <Directory "/usr/local/httpd/htdocs/www" >
> >     Options Indexes -FollowSymLinks -Includes +MultiViews
> >     Order deny,allow
> >     Allow from all
> >     </Directory>
> >
> >     JkMount /*.jsp ajp13
> >     JkMount /wapps/jRolodex ajp13
> >     JkMount /wapps/jRolodex/* ajp13
> > </VirtualHost>
> >
> > # ----- Tomcat developer
> > <VirtualHost javadex.tiade-voboe.de:80>
> >     ServerAdmin [EMAIL PROTECTED]
> >     ServerName javadex.tiade-voboe.de
> >     DocumentRoot "/usr/local/httpd/htdocs/javadex"
> >     ServerAlias javadex   javadex.tiade-voboe.de
> >
> >     # ----- Here comes the directory accessible by all users
> > of the local
> > network
> >     <Directory "/usr/local/httpd/htdocs/javadex" >
> >     Options Indexes +FollowSymLinks -Includes +MultiViews
> >     Order allow,deny
> >     Allow from 192.168.17.0/255.255.255.0
> >     </Directory>
> >
> >     JkMount /*.jsp ajp13
> >     JkMount /wapps/jRolodex ajp13
> >     JkMount /wapps/jRolodex/* ajp13
> > </VirtualHost>
> > <!-- --------------- httpd.conf END
> > ------------------------------------ -->
> >
> > <!-- --------------- apps-vhosts.xml START
> > ----------------------------- -->
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <Server>
> >
> >
> >     <Host name="www.tiade-voboe.de">
> >         <Alias name="www" />
> >         <Context path=""
> >             docBase="/usr/local/httpd/webapps/www"
> >             debug="0"
> >         reloadable="False" >
> >               <SimpleRealm filename="conf/users/example-users.xml" />
> >               <LogSetter name="www_tc.log"
> >                     path="/var/log/tomcat/www_tc.log"
> >                     verbosityLevel="ERROR"/>
> >               <LogSetter name="www_servlet_log"
> >                     path="/var/log/tomcat/www_servlet.log"
> >                     servletLogger="true"
> >                     verbosityLevel = "ERROR"/>
> >         <AutoDeploy source="/usr/local/httpd/webapps/www"
> >             target="/usr/local/httpd/webapps/www" />
> >         <AutoWebApp dir="/usr/local/httpd/webapps/www"
> >             prefix="/wapps"
> >             host="www.tiade-voboe.de" />
> >         </Context>
> >     </Host>
> >
> >
> >     <Host name="javadex.tiade-voboe.de">
> >         <Alias name="javadex" />
> >         <Context path=""
> >             docBase="/usr/local/httpd/webapps/javadex"
> >             debug="99"
> >         reloadable="True"
> >               <SimpleRealm filename="conf/users/example-users.xml" />
> >               <LogSetter name="javadex_tc.log"
> >                     path="/var/log/tomcat/javadex_tc.log"
> >                     verbosityLevel = "DEBUG"/>
> >               <LogSetter name="javadex_servlet_log"
> >                     path="/var/log/tomcat/javadex_servlet.log"
> >                     servletLogger="DEBUG"/>
> >         <AutoWebApp dir="/usr/local/httpd/webapps/javadex"
> >             prefix="/wapps"
> >             host="javadex.tiade-voboe.de" />
> >         </Context>
> >     </Host>
> >
> >
> > </Server>
> >
> > <!-- --------------- apps-vhosts.xml END
> > ------------------------------- -->
> >
> >
> > <!-- --------------- Error stack START -
> > ------------------------------- -->
> > Error: 500Location: /wapps/jRolodex/numguess.jspInternal
> > Servlet Error:
> > org.apache.jasper.JasperException: object is not an instance
> > of declaring
> > class
> >         at
> > org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(U
> > nknown Source)
> >         at
> > org.apache.jasper.runtime.JspRuntimeLibrary.introspect(Unknown
> > Source)
> >         at numguess_1._jspService(numguess_1.java:84)
> >         at
> > org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
> >         at
> > org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
> >         at org.apache.tomcat.core.Handler.invoke(Unknown Source)
> >         at org.apache.tomcat.core.Handler.service(Unknown Source)
> >         at
> > org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
> >         at
> > org.apache.tomcat.core.ContextManager.internalService(Unknown
> > Source)
> >         at
> > org.apache.tomcat.core.ContextManager.service(Unknown Source)
> >         at
> > org.apache.tomcat.modules.server.Ajp13Interceptor.processConne
> > ction(Unknown
> > Source)
> >         at
> > org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
> >         at
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> > Unknown Source)
> >         at java.lang.Thread.run(Thread.java:539)
> > Root cause:
> > java.lang.IllegalArgumentException: object is not an instance
> > of declaring
> > class
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > orImpl.java:42)
> >         at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > odAccessorImpl.java:28)
> >         at java.lang.reflect.Method.invoke(Method.java:327)
> >         at
> > org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(U
> > nknown Source)
> >         at
> > org.apache.jasper.runtime.JspRuntimeLibrary.introspect(Unknown
> > Source)
> >         at numguess_1._jspService(numguess_1.java:84)
> >         at
> > org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
> >         at
> > org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
> >         at org.apache.tomcat.core.Handler.invoke(Unknown Source)
> >         at org.apache.tomcat.core.Handler.service(Unknown Source)
> >         at
> > org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
> >         at
> > org.apache.tomcat.core.ContextManager.internalService(Unknown
> > Source)
> >         at
> > org.apache.tomcat.core.ContextManager.service(Unknown Source)
> >         at
> > org.apache.tomcat.modules.server.Ajp13Interceptor.processConne
> > ction(Unknown
> > Source)
> >         at
> > org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
> >         at
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> > Unknown Source)
> >         at java.lang.Thread.run(Thread.java:539)
> > <!-- --------------- Error stack
> > END------------------------------- -->
> >
> >
> > <!-- --------------- Software versions START
> > ---------------------- -->
> > <!-- ---- Server side -->
> > srv01:~ # uname -a
> > Linux srv01.tiade-voboe.de 2.4.16 #38 SMP Fri Dec 28 20:37:27
> > CET 2001 i686
> > unknown
> > srv01:~ # java -version
> > java version "1.4.0-beta3"
> > Java(TM) 2 Runtime Environment, Standard Edition (build
> > 1.4.0-beta3-b84)
> > Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)
> > srv01:~ # file /usr/local/httpd/tomcat
> > /usr/local/httpd/tomcat: symbolic link to jakarta-tomcat-3.3
> >
> > <!-- ---- Client side -->
> > martin@maptop:~ > java -version
> > java version "1.3.1_02"
> > Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_02-b02)
> > Java HotSpot(TM) Client VM (build 1.3.1_02-b02, mixed mode)
> > martin@maptop:~ >konqueror --version
> > Qt: 2.3.0
> > KDE: 2.1.2
> > Konqueror: 2.1.1
> > <!-- --------------- Software versions END
> > ------------------------ -->
> >
> > --
> > To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> > For additional commands: <mailto:[EMAIL PROTECTED]>
> > Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>

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

Reply via email to