Re: context loaded twice

2004-11-18 Thread QM
On Thu, Nov 18, 2004 at 03:02:08PM +0200, Asher Tarnopolski wrote:
: tomcat not only prints the report twice, it loads the webapp twice,
: because right after the second time i get a nasty exception:

To add on to the response you've already received from someone else:
Tomcat's deploying your webapp twice because you've (implicitly) asked
it to do so.  

In your server config's  tag, make note of the following
attributes:
- autoDeploy: automatically deploy a webapp when it's updated

- deployOnStartup: deploy all webapps found in the appBase when
  Tomcat starts

So if you have an app that's explicitly defined by a  tag, but
the "docBase" and "path" attributes don't match, Tomcat figures you want
to deploy it again.

Short version: make sure autoDeploy and deployOnStartup are both false.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: context loaded twice

2004-11-18 Thread Jardin Xavier
I have encountered the same behavior in the past with out configuration
apache + tomcat, the context start the first time after tomcat restart and a
second time with the first apache connection. Using the following
serveur.xml configuration the thing are now running well:



- Original Message - 
From: "Asher Tarnopolski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 18, 2004 2:02 PM
Subject: context loaded twice


> hi,
> a strange thing i can't find a sollution for.
>
> i have a web app that runs in tomcat's root (placed in \webapps\ROOT).
> don't ask me why, it's just there.
> the controller servlet of the app has 1..
> it also prints in output "START INIT" when loaded.
>
> when i start tomcat i see this:
>
> code:
> --
--
>
> Apache Tomcat/4.1.31WebappLoader[]: Deploying class repositories to work
> directory
> C:\jakarta-tomcat-4.1.31\webapps\ROOT\work\org\apache\jspWebappLoader[]:
> Deploy class files /WEB-INF/classes to
> C:\jakarta-tomcat-4.1.31\webapps\ROOT\WEB-INF\classesWebappLoader[]:
> Reloading checks are enabled for this ContextStandardManager[]: Seeding
> random number generator class java.security.SecureRandomStandardManager[]:
> Seeding of random number generator has been completedStandardWrapper[
> efault]: Loading container servlet defaultSTART INIT
>
> --
--
>
>
> and then once more the same thing:
>
> code:
> --
--
>
>  WebappLoader[/]: Deploying class repositories to work directory
> C:\jakarta-tomcat-4.1.31\webapps\ROOT\work\org\apache\jspWebappLoader[/]:
> Deploy class files /WEB-INF/classes to
> C:\jakarta-tomcat-4.1.31\webapps\ROOT\WEB-INF\classesWebappLoader[/]:
> Reloading checks are enabled for this ContextStandardManager[/]: Seeding
> random number generator class
> java.security.SecureRandomStandardManager[/]: Seeding of random number
> generator has been completedStandardWrapper[/  efault]: Loading container
> servlet defaultSTART INIT
>
> --
--
>
>
> tomcat not only prints the report twice, it loads the webapp twice,
> because right after the second time i get a nasty exception:
>
> code:
> --
--
>
>   ServerLifecycleListener: processContainerAddChild:
> Throwablejavax.management.InstanceAlreadyExistsException:
> Catalina:type=Context,path=/,host=localhost,service=Tomcat-Standalone at
> mx4j.server.MBeanServerImpl.register(MBeanServerImpl.java:1123) at
> mx4j.server.MBeanServerImpl.registerImpl(MBeanServerImpl.java:1054) at
> mx4j.server.MBeanServerImpl.registerMBeanImpl(MBeanServerImpl.java:1002)
> at mx4j.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:978)
>
> --
--
>
>
>
> tomcat doesn't die, and the application runs ok. but still, i don't wanna
> leave it as it is,, knowing that something is wrong.
> any ideas?
> thanks
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



context loaded twice

2004-11-18 Thread Asher Tarnopolski
hi,
a strange thing i can't find a sollution for.

i have a web app that runs in tomcat's root (placed in \webapps\ROOT).
don't ask me why, it's just there.
the controller servlet of the app has 1..
it also prints in output "START INIT" when loaded.

when i start tomcat i see this:

code:


Apache Tomcat/4.1.31WebappLoader[]: Deploying class repositories to work
directory
C:\jakarta-tomcat-4.1.31\webapps\ROOT\work\org\apache\jspWebappLoader[]:
Deploy class files /WEB-INF/classes to
C:\jakarta-tomcat-4.1.31\webapps\ROOT\WEB-INF\classesWebappLoader[]:
Reloading checks are enabled for this ContextStandardManager[]: Seeding
random number generator class java.security.SecureRandomStandardManager[]:
Seeding of random number generator has been completedStandardWrapper[
efault]: Loading container servlet defaultSTART INIT




and then once more the same thing:

code:


 WebappLoader[/]: Deploying class repositories to work directory
C:\jakarta-tomcat-4.1.31\webapps\ROOT\work\org\apache\jspWebappLoader[/]:
Deploy class files /WEB-INF/classes to
C:\jakarta-tomcat-4.1.31\webapps\ROOT\WEB-INF\classesWebappLoader[/]:
Reloading checks are enabled for this ContextStandardManager[/]: Seeding
random number generator class
java.security.SecureRandomStandardManager[/]: Seeding of random number
generator has been completedStandardWrapper[/  efault]: Loading container
servlet defaultSTART INIT




tomcat not only prints the report twice, it loads the webapp twice,
because right after the second time i get a nasty exception:

code:


  ServerLifecycleListener: processContainerAddChild:
Throwablejavax.management.InstanceAlreadyExistsException:
Catalina:type=Context,path=/,host=localhost,service=Tomcat-Standalone   at
mx4j.server.MBeanServerImpl.register(MBeanServerImpl.java:1123) at
mx4j.server.MBeanServerImpl.registerImpl(MBeanServerImpl.java:1054) at
mx4j.server.MBeanServerImpl.registerMBeanImpl(MBeanServerImpl.java:1002)
at mx4j.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:978)





tomcat doesn't die, and the application runs ok. but still, i don't wanna
leave it as it is,, knowing that something is wrong.
any ideas?
thanks

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: application context loaded twice

2002-12-30 Thread Craig R. McClanahan


On Mon, 30 Dec 2002, Mohan Radhakrishnan wrote:

> Date: Mon, 30 Dec 2002 09:52:15 +0530
> From: Mohan Radhakrishnan <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: application context loaded twice
>
> Hi,
>Why would
>
> 
>
>  load my application context twice?
>
> My listener is called twice while the following line
>
> 
>
> loads it only once.
>
>What am I  missing ? Appreciate help.
>

Let's think for a moment about how Tomcat auto-deploys applications from
the "webapps" subdirectory.  Basically, it does the following:

* Scans all the  elements that you've created,
  and deploys an app under the context path you specified.
  In the case of your first example, you're creating the
  "root" webapp for this virtual host from the contents
  of "$CATALINA_HOME/webapps/x".

* Scans all the directories in "webapps" to see if they
  contain a web application.  If so, they are deployed
  under a context path derived from the directory name.
  So, Tomcat sees directory "x" and deploys the *same*
  webapp under context path "/x".

If you do not want this to happen, you need to either ensure that the
directory name matches the context path without the leading slash (use
special directory name "ROOT" for the root webapp, since you cannot have a
zero-length filename on most OSs), or put your context directory someplace
other than "webapps" and use an absolute path for the docBase attribute.

So why didn't your second example load the app twice?  Simple -- "name" is
not a valid context path because it does not start with a slash, so this
 entry was not loaded (although I'll bet there are log messages
that would tell you about this).

> Mohan
>

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




application context loaded twice

2002-12-29 Thread Mohan Radhakrishnan
Hi,
   Why would



 load my application context twice?

My listener is called twice while the following line



loads it only once.

   What am I  missing ? Appreciate help.

Mohan

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




context loaded twice

2002-12-23 Thread Mohan Radhakrishnan
Hi,

 

An empty path like the above causes the context to load twice. My
'contextnotifier' is called twice. 

 

  But this loads it only once.


 I am sure I am missing the concept here. Any help ?

Thanks,
Mohan

--
To unsubscribe, e-mail:   
For additional commands, e-mail: