tomcat crash

2007-05-07 Thread Sunder Ravadi

hi,

While implementing ejb apps,My tomcat 4.1 server is
crashing bcos of the jboss-j2ee.jar file in the lib(copied from the
JBOSS/client dir)
directory.But without it the client application(jsp in
this case) is not able to access the EJBHome and
EJBObject class.Is http://class.is/ there anyway to get around this.I
would really appreciate if somebody could answer this

Thanks
sunder


Re: Handling SSL Client Auth abort

2007-05-07 Thread Subscriber

Hi,

...unfortunately I never get that far where I can catch the 
exception. 
The exception is thrown within Tomcat and in my application code.



(I'll assume there's a rather critical not missing from the last
clause in the above sentence.)

Of course - NOT in my application code :-)

If the client refuses the certificate or otherwise breaks the connection
during the SSL negotiation, no servlet has been selected to receive the
message, so there's no one to deliver the exception to.  The servlet
spec doesn't seem to have any notion of container-oriented error pages,
so I think you're out of luck without custom code inside Tomcat.

 - Chuck


This is OK - but how do I put custom code into the Tomcat? I've already 
coded a custom realm for the purpose of verifying the certificate - 
could I use this realm to catch the exception?


Regards,
kews

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Multiple instances when starting Tomcat

2007-05-07 Thread Moley Harey

Hi folks,

I am having problems using Tomcat 5.5.20 with Java  jdk1.5.0_08 in a Debien
machine.
The problem is that every time I start Tomcat then 15 instances are started
instead of one single process as I am used to in other Tomcat environments I
have used before.

As so many processes are running after some time the machine run out of CPU
memory and starts being very very slow...

What could be causing this behaviour?
I have tested the same version of Tomcat+Java in a Ubuntu Dapper and works
fine, it just creates one single process when I start Tomcat...

Thanks in advance,

Mh


tomcat 6 and system property

2007-05-07 Thread Manca Davide
Hello to everyone in the List,

 

I have a problem with system property with Tomcat 6.

 

I have various webapp under various hosts under one Tomcat. I'm trying
to set system-properties for every webapps, I mean that every single
webapp should have one or more system-property. In resin 2 or 3 it is
possible setting them in the webapp web.xml like that:

 

  system-property config.filename=/tmp/commenti.config.xml/

 

  system-property log4j.configuration=file:tmp/log4j.properties/

  system-property config.location=file /

 

I tried the same way in Tomcat 6 but it doesn't see system-properties.

 

And I cannot use the -D into the Java or Tomcat start command because of
I have a lot of webapps under one Tomcat.

 

Thanks a lot.

 

Best regards.

Dave.



Re: tomcat 6 and system property

2007-05-07 Thread Mikolaj Rydzewski

Manca Davide wrote:

I have various webapp under various hosts under one Tomcat. I'm trying
to set system-properties for every webapps, I mean that every single
webapp should have one or more system-property. In resin 2 or 3 it is
possible setting them in the webapp web.xml like that:

 


  system-property config.filename=/tmp/commenti.config.xml/

 


  system-property log4j.configuration=file:tmp/log4j.properties/

  system-property config.location=file /

 


I tried the same way in Tomcat 6 but it doesn't see system-properties.
  

So? The system-property / syntax is Resin specific.

And I cannot use the -D into the Java or Tomcat start command because of
I have a lot of webapps under one Tomcat.
  
I'd rather use context parameters or environment entries 
(http://tomcat.apache.org/tomcat-6.0-doc/config/context.html) than 
system properties.


--
Mikolaj Rydzewski [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


Cookie's value and double quotes with tomcat 6.0.10

2007-05-07 Thread valery.brinnel

Hi everyone!

First, thanks for reading this.

Here is the situation: 

Entrust (a provider of security solutions) offers Java-based security 
applications for enterprises. 
Their installer installs an own Java virtual machine for each application as 
well as an own Tomcat (v 5.5.17)

As we are already running some self-developed servlets, 
we wish to extract the server application and run it with our own JVM (6u1) and 
Tomcat (6.0.10).
That's what we did: the servlets are up and running. 

But we are apparently facing a problem regarding the cookie's value.
When I am running the ISAPI redirector in DEBUG mode, I get this:

[Fri May 04 17:59:08 2007] [1308:1988] [debug] jk_ajp_common.c (684): Header[3] 
[Set-Cookie] = 
[EntrustTruePassID=\7.0|Y249U[...]PUx1ZnRoYW5zYSwgYz1kZQ==|1|2007-05-04 
15:59:08 UTC|1200|50|-61|Qx2M2Q==|[...]3VmobNkg8j46JaoSkgMCTU=\; 
Domain=.blabla.com; Path=/; Secure]

The cookie's value is twice double quoted - the inner double quotes have been 
backslashed.
On a test server, with the native install of this application, the same log 
entry looks like this:

[Fri May 04 15:57:29 2007] [1884:3676] [debug] jk_ajp_common.c (684): Header[3] 
[Set-Cookie] = [EntrustTruePassID=7.[...]fDs==|1|2007-05-04 13:57:29 
UTC|1200|50|0|Qx2M2Q==|[..]/d5wFNo145sdCJHdGXkayL8v3RFTSv2VT5Wvd6zixINFvHywI55zeDJq8len0=;
 domain=.blabla.com; path=/; secure]

Because the cookie's value has been changed, the authentication process fails:

Fri May 04 17:59:09 2007 - WARNING   - 
[SessionValidationImpl::checkAuthentication()] - Auth cookie: Reporting Error:
TruePass: TPAuthCookie - Could not create the cookie using the cookie string
Line number: 253
File name: AuthCookie.cpp
caused by TruePass: TPAuthCookie - Could not validate the 
authentication cookie
Line number: 976
File name: AuthCookie.cpp
caused by TruePass: TPAuthCookie - The authentication cookie string is 
improperly formatted
Line number: 763
File name: AuthCookie.cpp


Before I give up, I would like to ask the specialists, if I am missing any 
point here ;)
I read some posts about v0 cookies values problems 
(http://issues.apache.org/bugzilla/show_bug.cgi?id=36863) 
and I am wondering if it may also be a Tomcat problem here.

Tanks a lot for your time
Best regards

Valéry.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Handling SSL Client Auth abort

2007-05-07 Thread Caldarale, Charles R
 From: Subscriber [mailto:[EMAIL PROTECTED] 
 Subject: Re: Handling SSL Client Auth abort
 
 This is OK - but how do I put custom code into the Tomcat? 

Download and modify the source.

 I've already coded a custom realm for the purpose of 
 verifying the certificate - could I use this realm to
 catch the exception?

Depends on where the exception is coming from.  If it's during the
initial SSL negotiation, I don't thing the realm has been invoked; it's
likely to have been triggered in the connector (but I haven't looked at
the SSL code, so I can't be sure).  Look at the stack trace associated
with the exception.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Fwd: static fields suddenly started sharing]

2007-05-07 Thread Roger Parkinson
I have two different applications and they both make use of a common jar 
library. The common library has several static fields.
Up until last week the static fields in one application never saw the 
static fields in the other but I changed something and suddenly they do.
All the advice I've found through searching the web suggests this cannot 
happen because the two apps use different class loaders. But it 
definitely is happening.

I'm getting it on Tomcat 4.1 and 5.5 (my two live platforms).

I am trying to figure out what I changed to make this happen because it 
is causing me problems. The changes I made were a restructure, shifting 
things around into different folders in my eclipse project, but the same 
jar files are in WEB-INF/lib as there always were.


Can anyone suggest where I should be looking? I'm wondering if I am 
managing to call something I shouldn't too early in the application 
initialisation. Each of the apps has a context listener that does some 
stuff on startup of the app (including initialising some statics), but 
they haven't changed since it was working. I still have the older 
structure and it still works, and I can't see any relevant changes,


Thanks for any help
Roger



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Multiple instances when starting Tomcat

2007-05-07 Thread Enrico Donelli

I think that you have many processes because each tomcat  thread is
mapped on a system process.
I think this depends on the java vm/kernel, but I don't know the details.
But it shouldn't be a problem, as long as I know.
Also on my debian system, with kernel 2.4, I have the same behaviuor.

Hope this helps
Enrico


On 07/05/07, Moley Harey [EMAIL PROTECTED] wrote:

Hi folks,

I am having problems using Tomcat 5.5.20 with Java  jdk1.5.0_08 in a Debien
machine.
The problem is that every time I start Tomcat then 15 instances are started
instead of one single process as I am used to in other Tomcat environments I
have used before.

As so many processes are running after some time the machine run out of CPU
memory and starts being very very slow...

What could be causing this behaviour?
I have tested the same version of Tomcat+Java in a Ubuntu Dapper and works
fine, it just creates one single process when I start Tomcat...

Thanks in advance,

Mh



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Fwd: static fields suddenly started sharing]

2007-05-07 Thread Filip Hanik - Dev Lists

Roger Parkinson wrote:
I have two different applications and they both make use of a common 
jar library. The common library has several static fields.
Up until last week the static fields in one application never saw the 
static fields in the other but I changed something and suddenly they do.
All the advice I've found through searching the web suggests this 
cannot happen because the two apps use different class loaders. But it 
definitely is happening.

I'm getting it on Tomcat 4.1 and 5.5 (my two live platforms).

I am trying to figure out what I changed to make this happen because 
it is causing me problems. The changes I made were a restructure, 
shifting things around into different folders in my eclipse project, 
but the same jar files are in WEB-INF/lib as there always were.


Can anyone suggest where I should be looking? I'm wondering if I am 
managing to call something I shouldn't too early in the application 
initialisation. Each of the apps has a context listener that does some 
stuff on startup of the app (including initialising some statics), but 
they haven't changed since it was working. I still have the older 
structure and it still works, and I can't see any relevant changes,
you sure you haven't added WEB-INF/lib to a classpath in a startup 
script or done something else funky like that.


what you could do, is to create a little script that does

ClassLoader parent = this.getClass().getClassLoader();
while ( parent != null ) {
 if (parent instance of URLClassLoader) {
   //print URLs using getURLS() method
 }
 parent = parent.getParent();
}

Filip


Thanks for any help
Roger



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat randomly cannot connect to SMTP host

2007-05-07 Thread Fargusson.Alan
I see you got a number of good suggestions.  If you still have this problem you 
could try doing a netstat command to see if your server is holding the 
connections to the SMTP server.  I have seen this type of thing cause some 
weird problems.

If your server is holding several connections to the SMTP server it would mean 
that the application isn't closing the socket when it is done.

-Original Message-
From: Raymond Holguin [mailto:[EMAIL PROTECTED]
Sent: Friday, May 04, 2007 12:38 PM
To: users@tomcat.apache.org
Subject: Tomcat randomly cannot connect to SMTP host


Hello,
I have tomcat 5.0.28 running on my Linux machine, and all my 
applications running under this tomcat experience the same problem at 
the same time which is why I believe it to be a tomcat issue.
When my applications attempt to send out an email I get this error message

(Mail server connection failed; nested exception is 
javax.mail.MessagingException: Could not connect to SMTP host: xx, 
port: 25; nested exception is: java.net.ConnectException: Connection 
refused)

The SMTP server is fine, because I can use it from other applications 
not on that tomcat server.  I can also telnet into the SMTP server just 
fine from that same machine, so i don't believe its a server/port 
blocking issue on the OS or hardware level.  The only way I am able to 
resolve the problem is to restart Tomcat.  Once Tomcat is restarted, 
then all operation with emailing works fine again.  I cannot seem to 
force the issue to happen so i don't know how reproduce it on demand, 
even though I know that would help in solving the issue.  This problem 
just seems to come up randomly and wont go away until I restart tomcat.
If anyone can please help me solve this issue that would be greatly 
appreciated.  I have important applications running on this machine and 
its a great inconvenience to those using the applications when this 
problem comes up.
Thank you
-Ray

-- 

Raymond Holguin
Programmer Analyst
College of Humanities, Arts, and Social Sciences
Tel: (951) 827-6212
Email: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat5 on Mac OS X, problem with book or installation?

2007-05-07 Thread Martin Gainty
apologies for he late reply but I wanted to ask if the servlet-name and 
servlet-mapping

and welcome-file-list from web.xml for entry jspbook have been entered

here is an example that may help (sub in jspbook)
servlet
 servlet-namejspbook/servlet-name
 servlet-classpackage.jspbook/servlet-class
 init-param
param-valuejspbook.properties/param-value
 /init-param
/servlet
servlet-mapping
   servlet-namejspbook/servlet-name
   url-pattern/jspbook/url-pattern
/servlet-mapping
   welcome-file-list
   welcome-fileindex.jsp/welcome-file
   /welcome-file-list

Does this help?
Martin--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: Kevin O'Mara [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Saturday, May 05, 2007 8:33 PM
Subject: Tomcat5 on Mac OS X, problem with book or installation?



I am using tomcat5 5.5.20, Revision 3, java/tomcat5 from MacPorts.

I am following the instructions for the Addison Wesley book: Servlets and 
JavaServer Pages: The J2EE Web Tier from the first chapter.


The first chapter may be found here: http://www.jspbook.com/jspbook-01.pdf

I am on the part where the author is creating the jspbook directory and is 
placing a web.xml file in the $CATALINA_HOME/webapps/jspbook/WEB-INF 
directory, and a jspbook.xml file in the $CATALINA_HOME/webapps directory. 
I cannot get the webapps/jspbook directory to be recognized by my Tomcat 
setup no matter what I do, after following these steps and continuous 
restarting of the server. I am assuming that it is ok to forgo the editing 
of the server.xml file like the book says.


This is the error I receive after retrieving http://localhost:8080 -


 HTTP Status 404 - /jspbook/



*type* Status report

*message* _/jspbook/_

*description* _The requested resource (/jspbook/) is not available._




 Apache Tomcat/5.5.20


Please help.  Thanks in advance.

--


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Apache Tomcat Native library

2007-05-07 Thread axetroll

At installation of Tomcat, when you need to choose what components will be
installed, click + Tomcat and check the option NATIVE

 :D 



Paul Robinshaw-2 wrote:
 
 Hi
 
 Can somebody please tell me what this means on startup of Tomcat The
 Apache
 Tomcat Native library which allows optimal performance in production
 environments was not found on the java.library.path
 
 Thanks
 
 DF
 
 

-- 
View this message in context: 
http://www.nabble.com/Apache-Tomcat-Native-library-tf1362917.html#a10360862
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



getting user info in a HTTP Server / Tomcat proxy configuration

2007-05-07 Thread Bill Higgins

We currently have a proxy server that has both Apache HTTP Server and Tomcat
installed, with httpd acting as both a proxy for the local Tomcat
installation, and also for a number of downstream servers.  Currently we use
httpd Basic Auth on the proxy box and send the Basic Auth header downstream
to the other servers.

We would like to begin using Tomcat form based authentication on the proxy
box and somehow only send the user id on to downstream servers as a custom
HTTP header.  My question is this:

Is it possible for Apache HTTP Server to defer authentication to Tomcat
(which will use form based auth), and then ask Tomcat for (essentially) the
value of 'HttpServletRequest#getRemoteUser()' to send to the downstream
servers?

E.g. here's the desired behavior

1.  Unauthenticated user sends request to proxy box
2.  Apache HTTP Server determines that the request is intended for the local
Tomcat defers processing to Tomcat
3.  Tomcat determines that the requested URI is a protected resource and
therefore redirects the user to login page; user successfully logs on and
Tomcat redirects to originally requested page

(later)

1.  User authenticated in flow 1 now attempts to reach a URI that Apache
HTTP Server determines should be handled by a downstream server
2.  Apache server asks Tomcat for the authenticated user's username and adds
this information as a custom header on the request to downstream server (e.g.
X-Userid: JohnS)

--

- Bill


Re: [Fwd: static fields suddenly started sharing]

2007-05-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Roger,

Roger Parkinson wrote:
 I have two different applications and they both make use of a common
 jar library. The common library has several static fields.

[snip]

 I am trying to figure out what I changed to make this happen because
 it is causing me problems. The changes I made were a restructure,
 shifting things around into different folders in my eclipse project,
 but the same jar files are in WEB-INF/lib as there always were.

That's odd. If you really have those JAR files in WEB-INF/lib, then they
/should/ be in different ClassLoaders and therefore has their own
webapp-private static fields.

It is possible that you also added the library in question to the
server/lib directory at some point?

 Can anyone suggest where I should be looking?

I'm sure you have already read the Tomcat Class Loader HOW-TO
(http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html), but
I'll mention it just in case.

* WEB-INF/lib should be private to the app
* TOMCAT_HOME/shared/lib should truly be shared (unified static)
* TOMCAT_HOME/common/lib should truly be shared (unified static)
  but Tomcat itself can access the library, too

 I'm wondering if I am managing to call something I shouldn't too
 early in the application initialisation.

Probably not. If you want a wall between the apps, then
order-of-initialization shouldn't be a problem. Your webapps should be
entirely separate.

 Each of the apps has a context listener that does some stuff on
 startup of the app (including initialising some statics), but they
 haven't changed since it was working. I still have the older 
 structure and it still works, and I can't see any relevant changes,

Are you moving from TC 4.1 to TC 5.5? I believe that the class-loading
rules didn't change from 4.1-5.0-5.5, but it's possible that there's
some kind of bug in 4.1 that was preserved for some reason while 5.0 and
5.5 work properly.

Someone else on the list will have to comment on that.

You should look for all relevant copies of that JAR file to determine
what's happening. Let us know where you can find copies (if you can)
outside of the WEB-INF/lib directories of your various webapps.

Just out of curiosity, which library are we talking about?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGP2GX9CaO5/Lv0PARArB9AKCGHIgiyaqDcoEclgbtI+d8RY4JywCbBB6J
Gq+XPloztCr73l9MBC8Hzh8=
=mmDV
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat randomly cannot connect to SMTP host

2007-05-07 Thread Raymond Holguin

Dear all,
   Yes you have all given me great advice and I appreciate it.  Like I 
mentioned this is a random issue that occurs, and currently it is 
working fine.  So when it goes down again I will try out some of your 
suggestions.  As for the code its a basic spring bean setup for the mailer


bean id=mailSender 
class=org.springframework.mail.javamail.JavaMailSenderImpl

   property name=hostvaluesmtp.xxx.xxx/value/property
/bean

Then in my java code I have a service class that I call whenever I want 
to send a message


private void sendMsg(String subject, String msgString, String[] toMail, 
String fromMail, String[] ccMail) throws FRSException {

   try {
   SimpleMailMessage msg = new SimpleMailMessage();
   msg.setTo(toMail) {
   if ( ccMail != null) {
   msg.setCc(ccMail);
   }
   msg.setSubject(subject);
   msg.setFrom(fromMail);
   msg.setSentDate(Calendar.getInstance().getTime());
   msg.setText(new String(msgString));
   mailSender.send(msg);
   } catch (MailException me) {
   logger.error(me);
   throw new FRSException(me.getMessage());
   }
}

Fargusson.Alan wrote:

I see you got a number of good suggestions.  If you still have this problem you 
could try doing a netstat command to see if your server is holding the 
connections to the SMTP server.  I have seen this type of thing cause some 
weird problems.

If your server is holding several connections to the SMTP server it would mean 
that the application isn't closing the socket when it is done.

-Original Message-
From: Raymond Holguin [mailto:[EMAIL PROTECTED]
Sent: Friday, May 04, 2007 12:38 PM
To: users@tomcat.apache.org
Subject: Tomcat randomly cannot connect to SMTP host


Hello,
I have tomcat 5.0.28 running on my Linux machine, and all my 
applications running under this tomcat experience the same problem at 
the same time which is why I believe it to be a tomcat issue.

When my applications attempt to send out an email I get this error message

(Mail server connection failed; nested exception is 
javax.mail.MessagingException: Could not connect to SMTP host: xx, 
port: 25; nested exception is: java.net.ConnectException: Connection 
refused)


The SMTP server is fine, because I can use it from other applications 
not on that tomcat server.  I can also telnet into the SMTP server just 
fine from that same machine, so i don't believe its a server/port 
blocking issue on the OS or hardware level.  The only way I am able to 
resolve the problem is to restart Tomcat.  Once Tomcat is restarted, 
then all operation with emailing works fine again.  I cannot seem to 
force the issue to happen so i don't know how reproduce it on demand, 
even though I know that would help in solving the issue.  This problem 
just seems to come up randomly and wont go away until I restart tomcat.
If anyone can please help me solve this issue that would be greatly 
appreciated.  I have important applications running on this machine and 
its a great inconvenience to those using the applications when this 
problem comes up.

Thank you
-Ray

  



--

Raymond Holguin
Programmer Analyst
College of Humanities, Arts, and Social Sciences
Tel: (951) 827-6212
Email: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



jsp:include no longer working in 5.5.23

2007-05-07 Thread Scott Dunbar
I've been using the same code for years since the Tomcat 3.x days and an 
upgrade to 5.5.23 has now broken my site.


If I do a:

jsp:include page=/some/path/to/some.html /

I get:

The requested resource (/some/path/to/some.html) is not available.  It 
is available and this particular file hasn't been modified for a very 
long time.  If I change it to:


jsp:include page=../some/path/to/some.html /

which is where it is physically, I get

Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:467)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

*root cause*

java.lang.NullPointerException

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965)
org.apache.jsp.index_jsp._jspService(index_jsp.java:42)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


Any thoughts?





Re: static fields suddenly started sharing]

2007-05-07 Thread Johnny Kewl
I've never played with tomcats class loaders but I was wondering why you 
want to place a distinct class so high in the Tomcat classloader tree.

See the  http://tomcat.apache.org/tomcat-4.1-doc/class-loader-howto.html

I think the only reason it could have behaved at all as distinct classes in 
the first place is because of Tomcats unusual class loading behavior...


In normal class loading theres a ask your mama principle at work... so 
this is the wrong impression.
All the advice I've found through searching the web suggests this cannot 
happen because the two apps use different class loaders. But it definitely 
is happening.
A class loader will normally ask its mama before it tries to load a 
class so one would expect it to move up the tree. If 2 children share 
the same mama and mama can see the class, mama will load it normally.


Webapps break this rule if they can see the class, then they ignore 
mama but if they cant see the class, then they will ask mama this is 
unusual in terms of class loading, but its there for our sanity, because as 
users, the classes we stick in the web app, we expect to come first because 
we thinking in the box however for normal applications if the class has 
been loaded by mama already, we dont care where it comes from.


I would expect in a normal application, for the class to be shared... and 
this goes for tomcat as well, EXCEPT if the classes were ALSO in the web-app 
lib.
So and I'm guessing I think all thats happened is those classes have 
been taken out of the Web-App/lib and if you stick them back in there, they 
will behave distinctly again. They have no choice now but to ask mama 
and if mama has already loaded the class... she wont do it again, she'll 
share it.


Remember that this may happen indirectly and this is wot I'm not sure 
of... if an lib under web-app/lib referred to the common class, then I'm not 
sure wot the class loader would do... ie the web-app class loader will pull 
the class in from web-app/libs and when it finds the dependency will it 
get it from mama and treat it as a web-app class... or as a common one???
Thing about class loaders is they are left very much up to the discretion of 
the programmer... can make them do anything, so the only thing that matters 
is how the tomcat developers want you to use them...


Anyway... I think you playing with fire... I mean if you stuck a singleton 
in a common classloader... you would expect it to be shared so why dont 
you just move them down the tree take them out of common and give each 
web-app its own copy unless you want it to behave as a shared static 
class.


I think the way its structured now, static fields sharing makes sense... 
that they behaved distinctly at all... is weird.



- Original Message - 
From: Roger Parkinson [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Monday, May 07, 2007 5:02 PM
Subject: [Fwd: static fields suddenly started sharing]


I have two different applications and they both make use of a common jar 
library. The common library has several static fields.
Up until last week the static fields in one application never saw the 
static fields in the other but I changed something and suddenly they do.
All the advice I've found through searching the web suggests this cannot 
happen because the two apps use different class loaders. But it definitely 
is happening.

I'm getting it on Tomcat 4.1 and 5.5 (my two live platforms).

I am trying to figure out what I changed to make this happen because it is 
causing me problems. The changes I made were a restructure, shifting 
things around into different folders in my eclipse project, but the same 
jar files are in WEB-INF/lib as there always were.


Can anyone suggest where I should be looking? I'm wondering if I am 
managing to call something I shouldn't too early in the application 
initialisation. Each of the apps has a context listener that does some 
stuff on startup of the app (including initialising some statics), but 
they haven't changed since it was working. I still have the older 
structure and it still works, and I can't see any relevant changes,


Thanks for any help
Roger



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to avoid infinite loop during filter processing?

2007-05-07 Thread webzo
Hello,
I am trying to something fairly simple and have a problem-
Basically, I use a filter that intercepts access to ALL jsp pages,
determines whether the user needs to be authenticated. If
authentication is required, the filter passes it on to the next filter
(filterchain.doFilter( ) ), else continues on to to originally
requested page. Problem is, when I try to redirect to the originally
requested page (because no authentication is required), the redirect is
also again intercepted by the filter and we go through the same loop
again- infinite loop. Is there a way to avoid this?

Thanks.

Av.




 

Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jsp:include no longer working in 5.5.23

2007-05-07 Thread Rashmi Rubdi

On 5/7/07, Scott Dunbar [EMAIL PROTECTED] wrote:

I've been using the same code for years since the Tomcat 3.x days and an
upgrade to 5.5.23 has now broken my site.


I would safely assume there have been significant changes between 3.x
and 5.5.23, if I were you I would start fresh, also the instructions
for 5.5.23 are different compared to older versions.

Tomcat 3.x follows JSP 1.1 syntax

Tomcat 5.5.x follows JSP 2.0 syntax


If I do a:

jsp:include page=/some/path/to/some.html /



In the above page URL, what is some? Is it a folder under the root
context or is /some/ the context itself?

Knowing the absolute path of some.html would help in knowing whether
it's under a root context or not.


I get:

The requested resource (/some/path/to/some.html) is not available.  It
is available and this particular file hasn't been modified for a very
long time.  If I change it to:

jsp:include page=../some/path/to/some.html /

which is where it is physically, I get


Most likely the path is incorrect, knowing the absolute path helps, in
diagnosing the problem



Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:467)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

*root cause*

java.lang.NullPointerException

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965)
org.apache.jsp.index_jsp._jspService(index_jsp.java:42)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


Any thoughts?



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Error allocating a servlet instance after editing web.xml.

2007-05-07 Thread Riyaz Shaikh

Here it is...

It seems like a component of our application uses the eclipse OSGI
framework (org.eclipse.birt.core.framework.osgi.OSGILauncher) during
its startup. I'm looking into how it might result in this issue. But
I'm curious as to how such an error can cause the whole Tomcat to go
down.

Thanks,
Riyaz

On 5/7/07, Martin Gainty [EMAIL PROTECTED] wrote:

Please display the web.xml for the webapp

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message -
From: Riyaz Shaikh [EMAIL PROTECTED]
To: users@tomcat.apache.org
Sent: Monday, May 07, 2007 7:07 PM
Subject: Error allocating a servlet instance after editing web.xml.


 Problem: If I make any change to my application's web.xml (even as
 small as a single space), I can't access any of Tomcat's
 pages/servlets.

 Info to narrow things down (hopefully):
 - I think Tomcat reloads things whenever a change is made to web.xml.
 But I haven't been able to find some good information on this yet.

 - The application is located under CATALINA_HOME\webapps. I tried
 creating a context file under conf/catalina/localhost and set
 reloadable=false, but it didn't help.

 - Since this problem isn't seen if I edit the web.xml of any of
 Tomcat's example applications, it might have something to do with how
 my application initializes. But nothing shows up in the logs anywhere,
 other than the stack trace I get when I try to access any page. Would
 anyone know which tomcat elements I should enable the debugging info
 for, to get more info about the re-initialization.

 - This is the stack trace I get if I try to access anything, after the
 web.xml editing:

 exception

 javax.servlet.ServletException: Error allocating a servlet instance
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:135)
 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:706)
 java.lang.Thread.run(Thread.java:595)

 root cause

 java.lang.NullPointerException
 
org.eclipse.osgi.framework.internal.core.FrameworkProperties.getProperty(FrameworkProperties.java:58)
 
org.eclipse.osgi.framework.internal.core.FrameworkProperties.getProperty(FrameworkProperties.java:51)
 org.eclipse.osgi.framework.util.SecureAction.getProperty(SecureAction.java:49)
 
org.eclipse.osgi.framework.internal.protocol.StreamHandlerFactory.createURLStreamHandler(StreamHandlerFactory.java:85)
 java.net.URL.getURLStreamHandler(URL.java:1104)
 java.net.URL.init(URL.java:393)
 java.net.URL.init(URL.java:283)
 java.net.URL.init(URL.java:306)
 java.io.File.toURL(File.java:594)
 
org.apache.catalina.loader.WebappClassLoader.getURL(WebappClassLoader.java:2292)
 
org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1966)
 
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1749)
 
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:866)
 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1319)
 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:135)
 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:706)
 java.lang.Thread.run(Thread.java:595)

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE 

RE: How to avoid infinite loop during filter processing?

2007-05-07 Thread Tim Lucia
Sounds like this is a logic problem in your filter; hard to know exactly
what w/o seeing your code  filter definition.  You could change your logic,
possibly by adding a trail of breadcrumbs so the next time through you don't
redirect.  Or, you could consider changing the filter url match pattern to
not include the page(s) to which you are redirecting.

Tim


 -Original Message-
 From: webzo [mailto:[EMAIL PROTECTED]
 Sent: Monday, May 07, 2007 8:38 PM
 To: users@tomcat.apache.org
 Subject: How to avoid infinite loop during filter processing?
 
 Hello,
 I am trying to something fairly simple and have a problem-
 Basically, I use a filter that intercepts access to ALL jsp pages,
 determines whether the user needs to be authenticated. If
 authentication is required, the filter passes it on to the next filter
 (filterchain.doFilter( ) ), else continues on to to originally
 requested page. Problem is, when I try to redirect to the originally
 requested page (because no authentication is required), the redirect is
 also again intercepted by the filter and we go through the same loop
 again- infinite loop. Is there a way to avoid this?
 
 Thanks.
 
 Av.
 
 
 
 
 
 __
 __
 Expecting? Get great news right away with email Auto-Check.
 Try the Yahoo! Mail Beta.
 http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jsp:include no longer working in 5.5.23

2007-05-07 Thread Mark Thomas
Scott Dunbar wrote:
 I've been using the same code for years since the Tomcat 3.x days and an
 upgrade to 5.5.23 has now broken my site.

Check your config for appBase in a host element being set to the same
directory as the docBase for a context. Most likely this will be in a
ROOT context for the host.

appBase = docBase should never have worked but did as a side effect of
a a bug that was fixed a few releases ago.


HTH,

Mark

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]