Re: Broken tomcat 6.0 config after SSL install.

2011-03-26 Thread David Fisher

 Taking the whole of the message above, it would look as if the new guy
 wasn't too sure about how to set up SVN  SSL under Tomcat, and chose to set
 it up on a front-end Apache instead. (Which, in the principle, is also how I
 would set it up, since I have no idea if there exists an SVN-capable webapp
 for Tomcat).
 
 The fact that you are seeing JSP pages raw probably means that he set
 things up so that Apache can bypass Tomcat, and serve the JSP pages directly
 from the Tomcat webapps directories (which is not good).
 
 The way in which this kind of setup is normally done, is ascii-graphically
 as follows :
 
 browser --(1)-- Apache + connector --(2)-- Tomcat
 
 and usually in such a case, you would arrange for only the connection (1) to
 be HTTPS (in other words, one would terminate SSL at the Apache level),
 and have the conversation between Apache and Tomcat (2) remain unencrypted
 (particularly if they are on the same server).
 
 For the connector at the Apache level, there exists several possibilities
 :
 1) mod_jk (at the Apache level), talking to a Connector
 ..protocol=AJP/1.3 on the Tomcat side

 b) mod_proxy  mod_proxy_ajp at the Apache level, also talking to a
 Connector ..protocol=AJP/1.3 on the Tomcat side
 c) mod_proxy  mod_proxy_http at the Apache level, talking to a Connector
 ..protocol=HTTP/1.1 on the Tomcat side

ProxyPass and ProxyPassReverse also work.

 
 Then, you have to configure Apache and its connector properly, so that it
 will :
 - process locally what is not destined to Tomcat (such as probably the SVN
 bit)
 - pass-through (or rather proxy) to Tomcat what belongs to Tomcat (such as
 requests for JSP pages)

Yup.

 The proper way to do that depends on the connector which is used.
 So you would first need to find out which that is.  Any Proxy...
 statements in the Apache configuration ?

...

 Hope that helps a bit to clarify what is going on.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 Thanks for all the good suggestions thus far.
 
 Going forward, we will implement the connector approach.  But for now,
 we just want to get 'back' to the previous configuration where tomcat
 was handling it's requests just fine.  Svn can wait.
 
 We don't have any specific proxies and I don't think there are any
 proxy statements in the config files.
 
 For our main flow of requests, tomcat was listening on a custom port,
 which was (or should have been) totally unrelated to the https port.
 
 I've just been trying to get the config back to where it was, but have
 been unsuccessful.  Stopping apache results in no web processing.  How
 can I get tomcat to be THE web server again?

Why? You can easily get this done, you are closer than you think. I'll show you 
how we do it.

We are on Solaris 10, Tomcat 6.0.29 and the latest HTTPD 2.2 package.

We actually have the 3 different tomcats behind httpd on this server - 
confluence, jira, and our own admin webapps.

The svn+ssh is configured as a separate virtual host as is our admin webapps.
SVN also has viewvc setup and the svn is password protected.
There are also apache hosted directories.

Here is a good part of our config with domain names changed:

Here is the admin site's conf/server.xml:

 Connector port=8445 protocol=HTTP/1.1 SSLEnabled=true
   enableLookups=false disableUploadTimeout=true
   maxThreads=150 scheme=https secure=true
   clientAuth=false sslProtocol=TLS
   URIEncoding=UTF-8 keystorePass=xx 
keystoreFile=/my/servers.jks / 

   Engine name=Catalina defaultHost=localhost
  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
Valve className=org.apache.catalina.valves.RemoteAddrValve
 allow=10.10.*.*,127.0.0.1/
Valve className=org.apache.catalina.valves.FastCommonAccessLogValve
   directory=logs  prefix=access_local. suffix=.log
 pattern=common resolveHosts=false/
  /Host
  Host name=admin.x.com appBase=webapps-admin 
  unpackWARs=true autoDeploy=true
Valve className=org.apache.catalina.valves.AccessLogValve
  prefix=access_public. suffix=.log pattern=common/
  /Host
/Engine

Here is the httpd.conf

NameVirtualHost *:80
NameVirtualHost *:443
SSLProtocol -ALL +SSLv2 +SSLv3
VirtualHost _default_:80
Redirect permanent / https://ops.x.com/
/VirtualHost
VirtualHost *:80
ServerName ops.x.com
Redirect permanent / https://ops.x.com/
/VirtualHost
VirtualHost *:443
ServerName ops.x.com
SSLEngine On
SSLProxyEngine On
SSLCertificateFile /opt/pkg/etc/httpd/server.crt
SSLCertificateKeyFile /opt/pkg/etc/httpd/server.key
SSLCACertificateFile /opt/pkg/etc/httpd/intermediate.crt


Re: Populating Oracle v$session.program from Tomcat Context.xml

2011-03-16 Thread David Fisher
Chris,

 You can use the following in the connectionInitSqls to make sure a suitable
 variable it set
 
 exec dbms_application_info.set_action('INSERTING');
 
 The site http://psoug.org/reference/sys_context.html references a bucket
 load of different context parameters that can be set - CLIENT_IDENTIFIER and
 CLIENT_INFO seem likely candidates. Then each time a connection is added to
 the pool, suitable context parameters are set, and you can view them when
 querying gv$session.
 
 This seems like a suitable fix for the question originally posed.l I would
 like to learn if this won't work, what is wrong with it. Without feedback,
 hard to understand what is wrong

I plan to try this technique soon. It would really help us understand our 
oracle load from tomcat vs. applications.

Thanks!

Regards,
Dave
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Populating Oracle v$session.program from Tomcat Context.xml

2011-03-16 Thread David Fisher
 We'd like to be able to tell apart database sessions from the 15 or so
 tomcat applications we have running on our web-servers. Most of them
 use similar logins, so we can't query the username from gv$session. We
 were hoping to instead query to program field to tell them apart.
 
 We were able to make this functionality work with the thin client, but
 we'd rather use the OCI client because it allows our web-apps to
 reconnect to the database service after a loss of connectivity (say
 during a cluster node reboot).

I believe that it is possible to do Fast Connection Failover using the Thin 
driver. We were on the verge of testing, but have been waiting months of some 
required Solaris patches to be applied by our overworked Sysadmin. But it ought 
to be possible.

You have write your own ConnectionManager class. We plan to try these jars - 
ojdbc6.jar, ons.jar and ucp.jar from Oracle.

Your connection string gets complex, but essentially ONS is contacted by the 
Oracle Grid Infrastructure to reset connections.

Here is how we understand it for our aborted tests.

1) FCF helps do auto switch over in the java thin client
2) ONS passes to FCF the message sent to Data Guard from Oracle Restart during 
an auto switchover or fail over. It also passes the message from Data Guard 
during a manual switchover.
3) Data Guard does the database switch over. 
4) Oracle Restart - monitors the data guard observer and triggers auto switch 
or fail over via data guard. It also manages restarting other needed oracle 
applications in the right order. Listener, dbconsole, agents, etc...

I'm interested if anyone has experience with it?

Regards,
Dave


 
 So far though we've had no luck in getting it to work with OCI. Most
 of the suggestions and info out on the web imply that the best way to
 do it with OCI is programmatically from the java app. That's the
 dilemma. Do we have to take the time to change our apps to populate
 the program field, or can we do it from the context.xml file from our
 app?
 
 On Tue, Mar 15, 2011 at 8:23 PM, Jorge Medina
 cerebrotecnolog...@gmail.com wrote:
 What is the problem that you are trying to solve?
 
 On Mon, Mar 14, 2011 at 4:25 PM, Dan random.da...@gmail.com wrote:
 On Mon, Mar 14, 2011 at 11:25 AM, Dan random.da...@gmail.com wrote:
 On Mon, Mar 14, 2011 at 10:57 AM, chris derham ch...@derham.me.uk wrote:
 We have some working tomcat 6 instances that we'd like to identify
 
 
 Can you use the combination of machine and schema name to identify the
 instance? You didn't detail your environment, but if you have a cluster,
 then the machine name would uniquely identify the instance. If you have
 multiple different instances on the same machine, then surely the schema
 name would allow you to identify which user it is? This covers all
 possibilities unless you have different apps on the same machine in
 different tomcat instances talking to the same schema.
 
 Chris
 
 
 We are running all of our web-applications from two machines, and they
 all use the same schema/username, so unfortunately I need the program,
 client_info, module, etc field to identify them.
 
 We are running a RAC, and I'm querying gv$session which should get me
 all cluster member connections.
 
 As David said, this does work with the thin driver, but I need the
 service/load balancing functionality from OCI. Any more suggestions
 are welcome!
 
 
 Does anyone else have any additional thoughts on this? I'd sure
 appreciate more input.
 
 TIA,
 
 Dan
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Populating Oracle v$session.program from Tomcat Context.xml

2011-03-14 Thread David Fisher
 Hello all...
 
 We have some working tomcat 6 instances that we'd like to identify by
 querying the v$session.program field the oracle database they connect
 to. While there are no errors on startup for the tomcat instance, and
 we can connect to the database, nothing gets populated in v$session.
 This functionality seems to work for the oracle thin driver, but when
 I try using OCI nothing happens. The original field values persist.
 I've also tried the module and client_info fields, also with no luck.
 
 Here’s a sample from my resource block minus the extra stuff.
 
 Resource name=jdbc/resource
auth=Container
type=javax.sql.DataSource
driverClassName=oracle.jdbc.OracleDriver
connectionProperties=v$session.program=MyApp;
url=jdbc:oracle:oci:@MyService/
 
 I’ve posted this question to the oracle support forums with no luck,
 but I’m assuming more people here are running oracle than people there
 running tomcat. Any help would be greatly appreciated.

We've used both OCI from Fortran and Thin Drivers from Java for a long time.

As far as whether V$SESSION.PROGRAM is filled. It is not consistent for the 
Thin Driver, it depends on proper matching of the thin driver version with the 
Oracle. For example version 9 JDBC does not populate PROGRAM on Oracle 8 
database.

I have never seen the OCI set the PROGRAM value, but then we have been using 
the version 6 driver (code is from the early 90s). We are upgrading to Oracle 
11 and I still haven't ever seen the OCI driver populate PROGRAM.

So, I am also interested.

Regards,
Dave
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Populating Oracle v$session.program from Tomcat Context.xml

2011-03-14 Thread David Fisher
 We have some working tomcat 6 instances that we'd like to identify
 
 
 Can you use the combination of machine and schema name to identify the
 instance? You didn't detail your environment, but if you have a cluster,
 then the machine name would uniquely identify the instance. If you have
 multiple different instances on the same machine, then surely the schema
 name would allow you to identify which user it is? This covers all
 possibilities unless you have different apps on the same machine in
 different tomcat instances talking to the same schema.
 
 Chris
 
 
 We are running all of our web-applications from two machines, and they
 all use the same schema/username, so unfortunately I need the program,
 client_info, module, etc field to identify them.
 
 We are running a RAC, and I'm querying gv$session which should get me
 all cluster member connections.
 
 As David said, this does work with the thin driver, but I need the
 service/load balancing functionality from OCI. Any more suggestions
 are welcome!
 
 
 Does anyone else have any additional thoughts on this? I'd sure
 appreciate more input.

I did some googling and I think that you will have to actually set this value 
from your code somehow.

This thread is found in multiple places: 
http://www.rhinocerus.net/forum/databases-oracle-misc/569644-setting-v-session-program.html
 a

The attribute is OCI_ATTR_MEMPOOL_APPNAME.

The package used is dbms_application_info.

Google jdbc api dbms_application_info and this link 
http://stackoverflow.com/questions/53379/using-dbms-application-info-with-jboss 
may help you ...

I do wonder if using module and action from V$session might be more appropriate 
and fine grained.

Regards,
Dave


 
 TIA,
 
 Dan
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JSP ClassNotFoundException on Tomcat 6.0.29/30 Eclipse Helios WTP

2011-01-19 Thread David Fisher
 I'm developing an web application on Eclipse Helios, WTP, Tomcat 6.0.29(and 
 just upgraded to 6.0.30).
 
 I suffer from ClassNotFoundException a lot of times on both 6.0.29/30.
 It's not about usual classes or jar. It's about JSP generated java class.
 
 For example, when I request /jsps/test.jsp, the stack trace looks like the 
 following.
 
 java.lang.ClassNotFoundException: org.apache.jsp.jsps.test_blahblah.class
 
 But org.apache.jsp.jspa.test_blahblah.class surely exists in the work 
 directory.
 
 When this happens, I just shutdown the tomcat on eclipse and start it again. 
 That's all. Then the jsp works fine. But after a few minutes it happens again.

This happens to us under Tomcat 6.0.29 if we rebuild a jar file that is in the 
${CATALINA_HOME}/lib directory. Could this be your issue?

Regards,
Dave


 
 What's the problem??
 It does not happen on Jetty 7.
 
 Thanks,
 KwonNam.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JSP ClassNotFoundException on Tomcat 6.0.29/30 Eclipse Helios WTP

2011-01-19 Thread David Fisher
 I'm developing an web application on Eclipse Helios, WTP, Tomcat 6.0.29(and 
 just upgraded to 6.0.30).
 
 I suffer from ClassNotFoundException a lot of times on both 6.0.29/30.
 It's not about usual classes or jar. It's about JSP generated java class.
 
 For example, when I request /jsps/test.jsp, the stack trace looks like the 
 following.
 
 java.lang.ClassNotFoundException: org.apache.jsp.jsps.test_blahblah.class
 
 But org.apache.jsp.jspa.test_blahblah.class surely exists in the work 
 directory.
 
 When this happens, I just shutdown the tomcat on eclipse and start it again. 
 That's all. Then the jsp works fine. But after a few minutes it happens 
 again.
 
 This happens to us under Tomcat 6.0.29 if we rebuild a jar file that is in 
 the ${CATALINA_HOME}/lib directory. Could this be your issue?

Sorry, please ignore, I didn't fully read your post, still drinking my morning 
coffee.

Regards,
Dave



 
 Regards,
 Dave
 
 
 
 What's the problem??
 It does not happen on Jetty 7.
 
 Thanks,
 KwonNam.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Several hosts within one tomcat / catch-all problem

2010-11-21 Thread David Fisher
Hi Konstantin,

 BTW, you can put those names in an external file and use it in the
 server.xml as an XML entity. Like the example in
 http://wiki.apache.org/tomcat/FAQ/Password

Inspired by this thread and having a similar issue in maintaining virtual host 
aliases I edited my server.xml as follows:

I added this before the Server.

!DOCTYPE aliases-xml [
  !ENTITY aliases SYSTEM /path/to/network/storage/aliases.txt
]

I moved my Alias tags to /path/to/network/storage/aliases.txt, substituting 
aliases;

This works very well. Thanks!

 and use JMX or call mapper.addHostAlias(..) directly to add aliases
 programmatically at runtime.  (though there is no guarantee that the
 Mapper API does not change between Tomcat minor releases).

I investigated what an implementation of this might look like at a higher 
level. In looking through the Tomcat interfaces it looks like this is similar 
to the notion of automatically creating Context for users with a UserConfig 
listener.

It would be an AliasConfig class extending HostConfig.
  Listener className=my.web.server.listener.package.AliasConfig 
aliases=/path/to/alias/file/

Then in the start event function it is as simple as 
host.addAlias(subDomainName); for each alias found in the aliases file.

Does this make sense?

Regards,
Dave


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] RE: Tomcat Consultant

2010-11-18 Thread David Fisher
I recently heard the story about how PL/1 got its name. I heard this recently 
from my brother who worked with the son of the inventor of APL, Kenneth E. 
Iverson.

It was at IBM and APL was developed only the inventor wanted to call it The 
Programming Language - TPL. When it went to the committee he was you can't call 
it that there already is a TPL project. Outcome - neither language got the name 
TPL - instead we have APL and PL/1.

Dave

On Sep 29, 2010, at 3:31 PM, Allen Razdow wrote:

 OK, the I'm gray-haired and remember when memory was core game ;-), I was
 a regular Multics user myself, on MIT's Honeywell machines (with drum
 disks), as well as an assembler programmer on PDP-1, 4 and 9.  The 4 had a
 125 kHz clock speed. I vaguely remember the PIC OS, but haven't googled it
 yet. 
 
 -Allen
 
 -Original Message-
 From: David Fisher [mailto:dfis...@jmlafferty.com]
 Sent: Wednesday, September 29, 2010 5:41 PM
 To: Tomcat Users List
 Subject: Re: [OT] RE: Tomcat Consultant
 
 PL/1 was a nice break from extending FORTRAN IV with BAL (Assembler).
 
 Wow real pointers and character strings!
 
 I seem to recall there was a version on the Prime minicomputers - IRC
 they had a version of the PIC OS.
 
 Primos came out of the Boston area, was a son of Multics and a brother
 OS to Unix. Wiki proves my memory fairly accurate -
 http://en.wikipedia.org/wiki/Prime_Computer
 
 
 That's the system I worked on. At one point, I worked in a university
 environ and had access to source.  We did a few tweaks to allow better
 support for hundreds of students, or the occasional custom tool/command.
 It was really nice to work in something like PL/P for that stuff.
 
 I'm not sure what you meant by PIC OS, unless you meant the Pick
 Database model, which was originally implemented as a combined OS/DB
 setup.  Prime did offer a version of the DB model, called INFORMATION,
 which ran on the standard OS.  It was a really nice rapid deployment
 engine.
 
 That's it. I couldn't recall because I didn't use it. We used the MIDAS
 database which transitioned pretty well from home grown assembler based /
 hash indexed keys.
 
 They also had a version of Oracle available for it, though I never used
 it.  I had used some other 3rd-party relational DB products, and
 INFORMATION ran rings around them.  The Pick data model was designed with
 standard business data in mind, so it had some useful features that ran
 fairly fast.  I work in Oracle now, and am quite impressed with its speed,
 but having to do all those table joins can sometimes be a real pain.
 
 We went with Oracle 5/6 when my boss spun out as an independent and we
 migrated to Sun in 1991. Oracle had an interesting Hypercard Stack
 interface for Macs around then. Only trouble for me is it wouldn't save
 your sql ddl, it was the schema.
 
 
 
 On Sep 28, 2010, at 12:52 PM, Jeffrey Janner wrote:
 
 PL/1, boy that brings back memories.
 I worked for years on a mini-computer who's O/S was written using a
 combination of a PL/1 subset and machine code.  Really nice, Unix-like
 O/S, that had Unix beat in some areas, lacked behind it in others.
 Really kind of miss it these days.
 However, I don't think it really took 4+ years to really learn PL/1.
 I seemed to have pretty well mastered it in a semester -- maybe a
 little longer.  I really liked how easy it was to get done what you
 needed to do.  And you'd think with IBM's clout it would have gotten
 better penetration, but they seemed more intent on other technologies.
 Probably not enough commission in it compared to COBOL.
 
 -Original Message-
 From: michel [mailto:compu...@videotron.ca]
 Sent: Friday, September 24, 2010 8:50 PM
 To: Tomcat Users List
 Subject: Re: Tomcat Consultant
 
 Don't know about you, but I was left really, really worried about
 actually
 being on a project under those conditions.
 
 
 Lots of room for doing a crash-and-burn ...
 
 
 Back when I started in the business in 1982 I had to learn PL-1, the
 best
 darned language that never managed  to get a good market share. It
 was
 said
 that it took four years to really learn how to use it. These days
 all
 you
 need is a crash course to be an expert!
 
 
 
 
 
 
 - Original Message -
 From: Brian bbprefix-m...@yahoo.com
 To: 'Tomcat Users List' users@tomcat.apache.org
 Sent: Friday, September 24, 2010 9:42 PM
 Subject: RE: Tomcat Consultant
 
 
 That is true sometimes. I was hired by Arthur Andersen (RIP), they
 sent
 me
 to an SAP crash-course, the tipe of course that shows you zillions
 of
 Powerpoint slides and you get out of the course with tons of doubts.
 Then
 they sent me directly to a proyect, and I bet they billed a lot for
 my
 time.
 I was introduced as an experienced SAP consultant.
 
 
 -Original Message-
 From: michel [mailto:compu...@videotron.ca]
 Sent: Friday, September 24, 2010 07:35 PM
 To: Tomcat Users List
 Subject: Re: Tomcat Consultant
 
 I once worked for a consulting company that wasn't

Re: Malicious host is crashing my server

2010-11-07 Thread David Fisher
You could modify the RequestDumpFilter to only dump the request for that ip 
address.

Regards,
Dave

Sent from my iPhone

On Nov 7, 2010, at 12:28 PM, Assaf ass...@yahoo.com wrote:

 A filter to block is good. But then I would not be able to see him doing it 
 again and then find out the issue.
 
 Assaf
 
 
 - Original Message 
 From: Caldarale, Charles R chuck.caldar...@unisys.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Sun, November 7, 2010 6:48:20 PM
 Subject: RE: Malicious host is crashing my server
 
 From: Assaf [mailto:ass...@yahoo.com] 
 Subject: Malicious host is crashing my server
 
 what can I do to better protect?
 
 As a temporary preventive measure, you can disable access from this 
 particular 
 IP address by configuring the RemoteAddrValve in server.xml:
 
 Valve className=org.apache.catalina.valves.RemoteAddrValve 
 deny=79\.177\.23\.102/
 
 That should give you some time to work out the real fix.
 
 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: how can i turn off This is very likely to create a memory leak.

2010-10-28 Thread David Fisher
 ok, i revoke my nevermind message, even after I removed
 JreMemoryLeakPreventionListener
 I still get the warning. Even weirder:
 
 Oct 28, 2010 3:50:55 PM org.apache.catalina.core.StandardService stop
 INFO: Stopping service Catalina
 Oct 28, 2010 3:50:55 PM org.apache.catalina.loader.WebappClassLoader
 clearReferencesThreads
 SEVERE: The web application [/moskitodemo] appears to have started a
 thread named [Poller SunPKCS11-Darwin] but has failed to stop it. This
 is very likely to create a memory leak.
 
 
 Note the word 'likely' is not 'defiantly', it is possible that your
 implementation is 'not' creating a memory leak.
 
 
 but a SEVERE log message should be pretty sure and not likely.

I agree a WARNING or INFO is more correct on shutdown. This would only be 
SEVERE if you were restarting your container with a manager or dropping in a 
new WAR and the JVM will continue running.

Maybe the Memory Leak detection ought to have some parameter about whether the 
Sys Admin actually cares? Or, better couldn't it know if the whole JVM is going 
down and adjust the level and message accordingly?

My 2 cents.

Regards,
Dave


 
 If tomcat launches an independent thread (not a tomcat thread) that refers
 to objects within the tomcat instance (and its pool of threads), this is
 when a memory leak would occur.
 
 This is because objects referenced by the independent thread 'and' the
 tomcat instance would not be GC'ed when tomcat shuts down, because they are
 still referenced by a living thread.
 
 I really don't get it. I'm stopping tomcat. What do I care about
 objects living in a webapp which is DEAD in a second in a VM which
 will be dead in another second?
 
 
 'Generally' you will want to stop the independent threads when tomcat shuts
 down, thus removing the 'likelihood' of memory leaks.
 
 No actually I don't care. If they have jobs to do, they are free to
 define their shutdown hooks. Otherwise all daemon threads are
 automatically killed if the vm is killed.
 
 
 If the independent threads have their own shut down hooks that realise
 tomcat is shutting down and dereference any appropriate objects, a memory
 leak will 'not' occur.
 
 If you want your independent threads to shut down with tomcat because they
 do not have the own mechanisms, implement a
 ServletContextListener.contextDestroyed that does so.
 
 Yeah, but I actually don't. I mean I'm hitting ctrl-c in a terminal
 with running bin/catalina.sh run.
 I just want to get rid of the message to prevent the admins from
 jumping up and down cause they detect a SEVERE message in the logs...
 regards
 Leon
 
 
 
 Regards,
 
 Simon
 
 Oct 28, 2010 3:50:55 PM org.apache.catalina.loader.WebappClassLoader
 clearReferencesThreads
 SEVERE: The web application [/moskitodemo] appears to have started a
 thread named [MoskitoIntervalUpdater] but has failed to stop it. This
 is very likely to create a memory leak.
 Oct 28, 2010 3:50:55 PM org.apache.catalina.loader.WebappClassLoader
 clearReferencesThreads
 SEVERE: The web application [/moskitodemo] appears to have started a
 thread named [MoskitoMemoryReader] but has failed to stop it. This is
 very likely to create a memory leak.
 Oct 28, 2010 3:50:55 PM org.apache.catalina.loader.WebappClassLoader
 clearReferencesThreads
 SEVERE: The web application [/moskitodemo] appears to have started a
 thread named [MoskitoMemoryPoolReader] but has failed to stop it. This
 is very likely to create a memory leak.
 Oct 28, 2010 3:50:55 PM org.apache.catalina.loader.WebappClassLoader
 clearReferencesThreads
 SEVERE: The web application [/moskitodemo] appears to have started a
 thread named [MoskitoMemoryPoolReader] but has failed to stop it. This
 is very likely to create a memory leak.
 Oct 28, 2010 3:50:55 PM org.apache.catalina.loader.WebappClassLoader
 clearReferencesThreads
 SEVERE: The web application [/moskitodemo] appears to have started a
 thread named [Thread-6] but has failed to stop it. This is very likely
 to create a memory leak.
 Oct 28, 2010 3:50:56 PM org.apache.coyote.http11.Http11Protocol destroy
 INFO: Stopping Coyote HTTP/1.1 on http-8080
 
 anyplace else except the server.xml to fix it?
 
 regards
 Leon
 
 On Thu, Oct 28, 2010 at 3:46 PM, Leon Rosenberg
 rosenberg.l...@gmail.com  wrote:
 
 
 nevermind, found it, sorry for disturbing.
 
 On Thu, Oct 28, 2010 at 3:44 PM, Leon Rosenberg
 rosenberg.l...@gmail.com  wrote:
 
 
 Hello,
 
 I investigated an issue (another thread) with new error messages after
 tomcat update:
 
 SEVERE: The web application [/moskitodemo] appears to have started a
 thread named [MoskitoMemoryPoolReader] but has failed to stop it. This
 is very likely to create a memory leak.
 
 
 After some research and discussions with colleagues we came to the
 conclusion that this message is ... well not helping us. Is there a
 possibility to turn it off? Its annoying to have such messages in the
 logs
 after a server shutdown. For explanation: I'm not planing to use
 webapp reload in my 

Re: Is there any JMX property which indicates no requests is being processed?

2010-10-21 Thread David Fisher
Hi,

I was just playing with the correct jmx properties. My purpose is to see what 
are the maximum requests and watch the health of my servers.

MBeanServerConnection mbs = jmxpool.getConnection(host);
ObjectName query = new 
ObjectName(Catalina:type=RequestProcessor,worker=*,name=*);
SetObjectInstance set;
try {
set = mbs.queryMBeans(query, null);
} catch (Exception e) {
continue;
}
for (ObjectInstance inst : set) {
Integer cnt = (Integer) mbs.getAttribute(inst.getObjectName(), 
requestCount);
if (cnt == 0) continue;
String name = inst.getObjectName().getKeyProperty(worker) + 
/ + inst.getObjectName().getKeyProperty(name);
// I haven't tried the following parameters, but this what is 
there in jconsole.
String currentUri = (String) 
mbs.getAttribute(inst.getObjectName(), currentUri);
String currentQueryString = (String) 
mbs.getAttribute(inst.getObjectName(), currentQueryString);
Long sent = (Long) mbs.getAttribute(inst.getObjectName(), 
requestBytesSent);
Long received = (Long) mbs.getAttribute(inst.getObjectName(), 
requestBytesReceived);
Long total = (Long) mbs.getAttribute(inst.getObjectName(), 
requestProcessingTime);

// Do whatever you want.
}

Good luck.

Regards,
Dave

On Oct 21, 2010, at 1:58 PM, Ruslan Gainutdinov wrote:

 Hello!
 
 Is there any JMX property which indicates no requests is being processed, and
 no requests are waiting in the queue?
 
 I am trying to develop a way to gracefully shutdown tomcat as part of
 mod_jk cluster.
 
 Because requests can be long (up to 1 hour) and must be successfully 
 processed,
 there must be separate way to ensure no requests are in queue before
 shutting down server.
 
 With kindest personal regards,
 Ruslan Gainutdinov
 rusla...@gmail.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] RE: Tomcat Consultant

2010-09-29 Thread David Fisher
 PL/1 was a nice break from extending FORTRAN IV with BAL (Assembler).
 
 Wow real pointers and character strings!
 
 I seem to recall there was a version on the Prime minicomputers - IRC
 they had a version of the PIC OS.
 
 Primos came out of the Boston area, was a son of Multics and a brother
 OS to Unix. Wiki proves my memory fairly accurate -
 http://en.wikipedia.org/wiki/Prime_Computer
 
 
 That's the system I worked on. At one point, I worked in a university environ 
 and had access to source.  We did a few tweaks to allow better support for 
 hundreds of students, or the occasional custom tool/command. It was really 
 nice to work in something like PL/P for that stuff.

 I'm not sure what you meant by PIC OS, unless you meant the Pick Database 
 model, which was originally implemented as a combined OS/DB setup.  Prime did 
 offer a version of the DB model, called INFORMATION, which ran on the 
 standard OS.  It was a really nice rapid deployment engine.

That's it. I couldn't recall because I didn't use it. We used the MIDAS 
database which transitioned pretty well from home grown assembler based / hash 
indexed keys.

  They also had a version of Oracle available for it, though I never used it.  
 I had used some other 3rd-party relational DB products, and INFORMATION ran 
 rings around them.  The Pick data model was designed with standard business 
 data in mind, so it had some useful features that ran fairly fast.  I work in 
 Oracle now, and am quite impressed with its speed, but having to do all those 
 table joins can sometimes be a real pain.

We went with Oracle 5/6 when my boss spun out as an independent and we migrated 
to Sun in 1991. Oracle had an interesting Hypercard Stack interface for Macs 
around then. Only trouble for me is it wouldn't save your sql ddl, it was the 
schema.


 
 On Sep 28, 2010, at 12:52 PM, Jeffrey Janner wrote:
 
 PL/1, boy that brings back memories.
 I worked for years on a mini-computer who's O/S was written using a
 combination of a PL/1 subset and machine code.  Really nice, Unix-like
 O/S, that had Unix beat in some areas, lacked behind it in others.
 Really kind of miss it these days.
 However, I don't think it really took 4+ years to really learn PL/1.
 I seemed to have pretty well mastered it in a semester -- maybe a
 little longer.  I really liked how easy it was to get done what you
 needed to do.  And you'd think with IBM's clout it would have gotten
 better penetration, but they seemed more intent on other technologies.
 Probably not enough commission in it compared to COBOL.
 
 -Original Message-
 From: michel [mailto:compu...@videotron.ca]
 Sent: Friday, September 24, 2010 8:50 PM
 To: Tomcat Users List
 Subject: Re: Tomcat Consultant
 
 Don't know about you, but I was left really, really worried about
 actually
 being on a project under those conditions.
 
 
 Lots of room for doing a crash-and-burn ...
 
 
 Back when I started in the business in 1982 I had to learn PL-1, the
 best
 darned language that never managed  to get a good market share. It
 was
 said
 that it took four years to really learn how to use it. These days
 all
 you
 need is a crash course to be an expert!
 
 
 
 
 
 
 - Original Message -
 From: Brian bbprefix-m...@yahoo.com
 To: 'Tomcat Users List' users@tomcat.apache.org
 Sent: Friday, September 24, 2010 9:42 PM
 Subject: RE: Tomcat Consultant
 
 
 That is true sometimes. I was hired by Arthur Andersen (RIP), they
 sent
 me
 to an SAP crash-course, the tipe of course that shows you zillions
 of
 Powerpoint slides and you get out of the course with tons of doubts.
 Then
 they sent me directly to a proyect, and I bet they billed a lot for
 my
 time.
 I was introduced as an experienced SAP consultant.
 
 
 -Original Message-
 From: michel [mailto:compu...@videotron.ca]
 Sent: Friday, September 24, 2010 07:35 PM
 To: Tomcat Users List
 Subject: Re: Tomcat Consultant
 
 I once worked for a consulting company that wasn't  a big 5, but
 had
 some
 pretty good contact. They hired me out of Montreal on Friday, had
 me
 in
 Denver  on Sunday and spending 2 weeks in a training center so I
 could
 become an instant 'expert' they could hire out for big $$$ on
 different
 projects.
 
 Then I spent 3 months at home while they tried to get some
 contacts,
 and
 then got canned when they couldn't, then the guys who hired me got
 canned
 ...
 
 I can't figure out how these companies can get away with this
 nonsense.
 
 
 
 
 
 - Original Message -
 From: Martin Gainty mgai...@hotmail.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Friday, September 24, 2010 8:13 PM
 Subject: RE: Tomcat Consultant
 
 
 
 triple your budget when the big 5 consultant steps out a
 lamberghini
 in a
 1000 brooks brothers suit
 
 add 25% to the rate if he looks younger than zuckerberg
 
 BTW: big 5 consultants only speak english or hindi..you'll need a
 hindi
 translator for spanish
 
 how about unisys???
 
 Saludos 

Re: [OT] RE: Tomcat Consultant

2010-09-28 Thread David Fisher
PL/1 was a nice break from extending FORTRAN IV with BAL (Assembler).

Wow real pointers and character strings!

I seem to recall there was a version on the Prime minicomputers - IRC they had 
a version of the PIC OS.

Primos came out of the Boston area, was a son of Multics and a brother OS to 
Unix. Wiki proves my memory fairly accurate - 
http://en.wikipedia.org/wiki/Prime_Computer

On Sep 28, 2010, at 12:52 PM, Jeffrey Janner wrote:

 PL/1, boy that brings back memories.
 I worked for years on a mini-computer who's O/S was written using a 
 combination of a PL/1 subset and machine code.  Really nice, Unix-like O/S, 
 that had Unix beat in some areas, lacked behind it in others.  Really kind of 
 miss it these days.
 However, I don't think it really took 4+ years to really learn PL/1.  I 
 seemed to have pretty well mastered it in a semester -- maybe a little 
 longer.  I really liked how easy it was to get done what you needed to do.  
 And you'd think with IBM's clout it would have gotten better penetration, but 
 they seemed more intent on other technologies.  Probably not enough 
 commission in it compared to COBOL.
 
 -Original Message-
 From: michel [mailto:compu...@videotron.ca]
 Sent: Friday, September 24, 2010 8:50 PM
 To: Tomcat Users List
 Subject: Re: Tomcat Consultant
 
 Don't know about you, but I was left really, really worried about
 actually
 being on a project under those conditions.
 
 
 Lots of room for doing a crash-and-burn ...
 
 
 Back when I started in the business in 1982 I had to learn PL-1, the
 best
 darned language that never managed  to get a good market share. It was
 said
 that it took four years to really learn how to use it. These days all
 you
 need is a crash course to be an expert!
 
 
 
 
 
 
 - Original Message -
 From: Brian bbprefix-m...@yahoo.com
 To: 'Tomcat Users List' users@tomcat.apache.org
 Sent: Friday, September 24, 2010 9:42 PM
 Subject: RE: Tomcat Consultant
 
 
 That is true sometimes. I was hired by Arthur Andersen (RIP), they sent
 me
 to an SAP crash-course, the tipe of course that shows you zillions of
 Powerpoint slides and you get out of the course with tons of doubts.
 Then
 they sent me directly to a proyect, and I bet they billed a lot for my
 time.
 I was introduced as an experienced SAP consultant.
 
 
 -Original Message-
 From: michel [mailto:compu...@videotron.ca]
 Sent: Friday, September 24, 2010 07:35 PM
 To: Tomcat Users List
 Subject: Re: Tomcat Consultant
 
 I once worked for a consulting company that wasn't  a big 5, but had
 some
 pretty good contact. They hired me out of Montreal on Friday, had me
 in
 Denver  on Sunday and spending 2 weeks in a training center so I
 could
 become an instant 'expert' they could hire out for big $$$ on
 different
 projects.
 
 Then I spent 3 months at home while they tried to get some contacts,
 and
 then got canned when they couldn't, then the guys who hired me got
 canned
 ...
 
 I can't figure out how these companies can get away with this
 nonsense.
 
 
 
 
 
 - Original Message -
 From: Martin Gainty mgai...@hotmail.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Friday, September 24, 2010 8:13 PM
 Subject: RE: Tomcat Consultant
 
 
 
 triple your budget when the big 5 consultant steps out a lamberghini
 in a
 1000 brooks brothers suit
 
 add 25% to the rate if he looks younger than zuckerberg
 
 BTW: big 5 consultants only speak english or hindi..you'll need a
 hindi
 translator for spanish
 
 how about unisys???
 
 Saludos Cordiales desde EEUU
 Martin Gainty
 __
 No altere ni interrumpa por favor esta transmisión. Gracias
 
 
 
 
 
 Date: Fri, 24 Sep 2010 15:55:28 -0400
 Subject: Re: Tomcat Consultant
 From: cerebrotecnolog...@gmail.com
 To: users@tomcat.apache.org
 
 I should have copyrights on my name. LOL
 
 On Fri, Sep 24, 2010 at 3:49 PM, Brian bbprefix-m...@yahoo.com
 wrote:
 
 
 -Original Message-
 From: Jorge Medina [mailto:cerebrotecnolog...@gmail.com]
 Sent: Friday, September 24, 2010 02:43 PM
 To: Tomcat Users List
 Subject: Re: Tomcat Consultant
 
 Hey, you don't need a Big-5 consulting company.
 
 
 Esto si que sonó gracioso.
 Aca en Peru, Arthur Andersen (QEPD) tenia a unos 3 socios, uno de
 los
 cuales
 se llamaba JORGE MEDINA. :-D
 
 
 
 You need a a couple of experts: a networking guy and a Tomcat
 guy.
 But anyway, I'm sure a Fortune 500 have the money to overpay one
 of
 the
 Big-5.
 
 Now, from my understanding, Tomcat is only a web app container
 while
 Websphere is an application server.
 Therefore, depending on your application you may not be able to
 migrate
 it
 to Tomcat, but rather to Glassfish. Glassfish is also an
 application
 server.
 
 -Jorge
 
 
 
 On Fri, Sep 24, 2010 at 1:57 PM, Christopher Schultz
 ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 To whom it may concern,
 
 On 9/24/2010 1:25 PM, tdelesio wrote:
 My fortune 500 

Re: Why an email list, and not a forum?

2010-09-23 Thread David Fisher
You can use something like gmane.org:

http://dir.gmane.org/gmane.comp.jakarta.tomcat.user


On Sep 23, 2010, at 5:33 PM, Brian wrote:

 But what if you just want to receive responses to your question, instead of
 receiving all the emails that is being writen?
 Mail lists are an old method. Web based forums are more efficient. And even
 forums (such are the ones powered by phpBB) are not the latest solution.
 
 -Original Message-
 From: michel [mailto:compu...@videotron.ca]
 Sent: Thursday, September 23, 2010 07:27 PM
 To: Tomcat Users List
 Subject: Re: Why an email list, and not a forum?
 
 web based means that people have to keep checking a website, instead of
 having the information sent to them as it happens ... like having pizza
 home
 delivered.
 
 
 Michel
 
 
 - Original Message -
 From: Brian bbprefix-m...@yahoo.com
 To: users@tomcat.apache.org
 Sent: Thursday, September 23, 2010 8:19 PM
 Subject: Why an email list, and not a forum?
 
 
 Hi,
 
 
 
 Just a thought: Why is this support taking place in an email list,
 instead
 aof a web based forum?
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [ANN] CI for Tomcat 6 and 7 docs now available

2010-09-17 Thread David Fisher

 Mark Thomas wrote:
 ...
 If you want to start down this path and see how it goes, I am happy to
 talk you through step by step.
 
 I may (hem, probably will) need that at some point.
 But let me try following the basic steps you outlined, first.
 
 quoting :
 
 If you do get involved then the process would be something along the
 lines of:
 (one time tasks)
 - added : install or update Java JDK .. done
 - install svn .. done
 - install ant .. done
 - checkout source .. (done too, thanks Wesley)
 ( The current url for tc7 is http://svn.apache.org/repos/asf/tomcat/trunk)
 - build Tomcat .. done
 
 (per change task)
 - change docs
 
 Where ? I do not see any docs here.

http://svn.apache.org/repos/asf/tomcat/trunk/webapps/docs/

 - build Tomcat to test changes

ant build-docs

http://svn.apache.org/repos/asf/tomcat/trunk/build.xml

 style=webapps/docs/tomcat-docs.xsl

Good luck. Looks better than the ancient Forrest xslt we use for POI. :-)

Regards,
Dave

 - use svn to create a patch
 - create a Bugzilla entry for the patch
 - committer reviews and applies the pacth / suggests changes
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: 2 POST requests to underlying Server

2010-08-11 Thread David Fisher
There should be one or more devices inserted in (a)

 client browser (port 2345) --(a)-- (port 80) apache ---(b)--- mod_jk (port 
 1234) ---(c)--- (port 8109) tomcat  -- DB

There should be a firewall, or who knows what a hacker may have inserted.

There might be a load balancer.

If either of these is misconfigured then who knows.

The technique that everyone is suggesting is a form of Divide and Conquer - 
and is something that every programmer must learn to employ. Refusal is a waste 
of everyone's time including the OP.

http://en.wikipedia.org/wiki/Divide_and_conquer_algorithm

Regards,
Dave

On Aug 11, 2010, at 9:04 AM, André Warnier wrote:

 Karthik,
 
 let me try again :
 
 Karthik Nanjangude wrote:
 Hi
 Maybe you could try a capture from the client system (the one
 w/ a browser open).
 As I have already posted the form [ please check last few mails exchanged ]
 If the Sample test on the web application is performed from Outer side world 
 [http://www.xyx.com/abcd ]
 Tcp dump captured on Apache Http Server, 2 Post request are clearly visible 
 with 12 sec apart.
  If the Sample test on the same hosted web application performed from within 
  the internally IP/Port hosted [ http://xyx/abcd ]
 
  Tcp dump captured on JBoss [Tomcat Built in ] 1 Post request is visible
 
 
 Let me use my graphic artwork again :
 
 case a)
 
 client browser (port 2345) --(a)-- (port 80) apache ---(b)--- mod_jk (port 
 1234) ---(c)--- (port 8109) tomcat  -- DB
 
 result (per trace on (c)): 2 POSTs (and 2 rows in database DB)
 
 case b)
 
 client  browser (port 2345) (d)--- (port 8080 or 8180..) tomcat  -- DB
 
 result (per trace on (d) ?): 1 POST (in database DB)
 
 
 What you have told us so far, is that when you watch the TCP traffic in (c) 
 above, you see 2 POST requests, from port 1234 (mod_jk) to port 8109 (tomcat 
 AJP connector).
 
 But because these are on the internal link between Apache and Tomcat, it is 
 difficult for us to see if these are really the /same/ request, duplicated by 
 Apache/mod_jk, or just two totally unrelated POST requests from different 
 clients.
 That is because, at the level of (c), ALL requests will look like they come 
 from port 1234 (mod_jk) to port 8109 (tomcat).
 
 
 What you have NOT proven to us so far, is that those 2 POST requests are NOT 
 also in (a).
 THAT is what we want to know, at 100%.
 
 We want to know this, because we believe that Apache or mod_jk do not just 
 duplicate POST requests.  We do not believe that they do that, because if 
 they did that, then you would not be the only person to mention this problemm 
 and there would be LOTS of peoplehaving problems with their bank accounts.
 
 Currently, we believe that it is about 10,000 times more probable, that the 2 
 POST requests are generated by something not working as you expect, but /on 
 the browser side/.
 
 Maybe we are wrong.
 But to change our belief, you will have to bring real proof.
 You are going to have to show us a trace done at the level (a), showing 1 
 single POST request, and a trace done at the same time at the level (c), 
 showing 2 POST requests.
 
 
 
 If the Sample test on the same hosted web application performed from within 
 the internally IP/Port hosted [ http://xyx/abcd ]
 Tcp dump captured on JBoss [Tomcat Built in ] 1 Post request is visible
 Both of the samples were verified in 2 Browsers [IE 7+ / FF3 +] more then 6 
 times and the info is captured via tcp Dump.
 request with wget rather than browsers
 Since the Application is in Production and need some Window Time for taking 
 samples.
 I would definitely get back with the results  by EOD 2 morrow
 With regards
 Karthik
 -Original Message-
 From: David Smith [mailto:d...@cornell.edu]
 Sent: Wednesday, August 11, 2010 7:23 PM
 To: Tomcat Users List
 Subject: Re: 2 POST requests to underlying Server
 Any chance we could see a snippet of access log showing the two
 requests?  All I really see here is two packet captures that *look* like
 they are from in between tomcat and iis (or whatever you are running as
 a front-end web server).  Since 10 addresses are not routeable this
 looks like all internal traffic.  Any chance you could verify this is
 happening (or not) between the client browser and your front-end web
 server?  Maybe you could try a capture from the client system (the one
 w/ a browser open).
 --David
 On 8/11/10 2:08 AM, Karthik Nanjangude wrote:
 Hi
 
 Ok I have copied the wire shark test samples for the 2 Post Requests [ 
 Apache to JBOSS (Tomcat Internal )..This was taken Aug 9, 2010
 
 
 
 
 ~~
 1nd Post Request
 
 No. TimeSourceDestination   Protocol 
 Info
  10022 30.516874   10.151.41.160 10.151.41.163 TCP  
 33403  8109 [PSH, ACK] Seq=2079 Ack=4544 Win=15600 Len=65 TSV=2265749122 
 TSER=2977204079
 
 Frame 10022 (131 bytes on wire, 131 bytes captured)
Arrival Time: Aug  

Re: [OT] Tomcat unexpectedly shuts down

2010-08-10 Thread David Fisher
Hi Andre,

 So I am not objecting to using 3000 MB of Heap, I am just curious.
 If someone like Eric Robinson can run a non-trivial multi-user Tomcat 
 application with an average 64 MB of Heap and you can do pretty much the 
 same, then I am curious as to which Tomcat application (or situation) may 
 require 3,000 MB of Heap, which is 50 times more.

I will give you an example of two reasons for a large heap -

(1) You host a large data set that you treat as a global in memory database 
achieving lighting quick sorts and filters across any column. This consumes a 
large amount of memory for the life of the JVM. Daily refreshes require double 
space in transition. The size of the heap will limit the size of the data set.

(2) You need to produce large Excel spreadsheets or Powerpoint decks using 
Apache POI. Due to the binary nature of the file formats everything is 
constructed in memory and the memory footprint of the Java objects is much 
larger. The XML versions don't give you any relief as they are Zip files. This 
means you need large amounts of space for short periods of time. Again more 
memory means the more head room you have for these requests. You have to know 
your app well to know if you have enough room for the very occasional large 
request. If that can be too big then you will need to build an execution queue 
of some type behind your web app.

Regards,
Dave
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Running PHP?

2010-08-02 Thread David Fisher
 Hi,
 
 Maybe I should not ask, but why post with the text as an attachment?
 
 You're using Outlook Express, maybe the problem is at your end.

Your PGP signature is an attachment.

--enig2B65BBFD3FC6C4840C488F3D
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc

-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)

Regards,
Dave

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Connection Refused On Tomcat Server Shutdowns if...

2010-07-22 Thread David Fisher
If you look at catalina.sh you will see that stop does not include 
CATALINA_OPTS:

  $_RUNJAVA $JAVA_OPTS \
-Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \
-Dcatalina.base=$CATALINA_BASE \
-Dcatalina.home=$CATALINA_HOME \
-Djava.io.tmpdir=$CATALINA_TMPDIR \
org.apache.catalina.startup.Bootstrap $@ stop

Change your catalina.sh to include your CATALINA_OPTS and it ought to work.

Looks like a bug in Tomcat to me.

Regards,
Dave

On Jul 22, 2010, at 8:02 AM, John A Parker wrote:

 Using apache-tomcat-6.0.28...
 
 We are encountering issue with catalina.sh stops IF we use a variable to 
 set the SHUTDOWN port.
 
 e.g.:
 CATALINA_OPTS = ...-Dco.shutdown.port=8104 ...
 server.xml =...
 !-
 Server port=8104 shutdown=SHUTDOWN
 --
 Server port=${co.shutdown.port} shutdown=SHUTDOWN
 ...
 
 
 After startup we see...
 
 ...
 java 24389 tcowner   42u  IPv6 8406404   TCP 
 localhost.localdomain:8104 (LISTEN)
 
 
 But on shutdown we get...
 
 SEVERE: Catalina.stop:
 java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.init(Socket.java:375)
at java.net.Socket.init(Socket.java:189)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
 Tomcat did not stop in time. PID file was not removed.
 
 
 IF however I swap the server.xml SHUTDOWN port lines shown above then the 
 catalina.sh stop works as it should.
 
 
 Any ideas on why the dynamic port definition works on startup but not on 
 shutdown?
 
 
 Thanks in advance,
 
 John A Parker
 Cornell University
 (607) 255-9356
 john.a.par...@cornell.edumailto:john.a.par...@cornell.edu
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Script to restart Tomcat

2010-07-15 Thread David Fisher
I've found that you cannot always rely on the shutdown script closing tomcat 
quickly. If you have a thread that is not properly managed maybe not at all.

In my restart scripts I find the PID of the tomcat process, run the shutdown 
script, sleep 10 seconds, test if the PID is still active and if so I kill it. 
It is then safe to run the startup script.

That ought to work on any type of unix including Mac 10.

Regards,
Dave

On Jul 15, 2010, at 2:47 PM, Jordan Michaels wrote:

 Most restart scripts that I've seen for Tomcat are home-brewed. Just google 
 for Tomcat restart script and I'm sure you'll find something a bit more 
 advanced then what you're using below.
 
 Warm regards,
 Jordan Michaels
 Vivio Technologies
 http://www.viviotech.net/
 Open BlueDragon Steering Committee
 Railo Community Distributions
 
 On 07/15/2010 02:25 PM, laredotornado wrote:
 
 Hi,
 
 I'm using Tomcat 6.0.26 on Mac 10.6.3.  I put this script together to try
 and restart Tomcat ...
 
 ==Start restart.sh ==
 sh /Library/Tomcat/Home/bin/shutdown.sh
 sh /Library/Tomcat/Home/bin/startup.sh
 End restart.sh =
 
 but what I'm noticing is that sometimes when the script is run, if there was
 only one Tomcat process running, there are now two Tomcat processes running,
 and I'm wondering if somehow the startup.sh script is being run before
 shutdown.sh has completed.
 
 My question is, is this true, or do you have a shell script to restart
 Tomcat cleanly?
 
 Thanks, - Dave
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem redirecting http to https in Tomcat 4

2010-07-14 Thread David Fisher
Robedan,

I recall that we started doing the following in Tomcat 4.1:

In the webapps WEB-INF/web.xml we inserted the following right before 
/web-app:

security-constraint
 web-resource-collection
  web-resource-nameEntire Application/web-resource-name
  url-pattern/*/url-pattern
 /web-resource-collection
 user-data-constraint
  transport-guaranteeCONFIDENTIAL/transport-guarantee
 /user-data-constraint
/security-constraint

This forced http:// requests to be https:// for that webapps.

I hope it works for you

Regards,
Dave

On Jul 14, 2010, at 11:02 AM, Christopher Schultz wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Robedan,
 
 On 7/14/2010 1:29 PM, Robedan wrote:
 Can you post all
 active Connector elements from your conf/server.xml file?
 
 Attached.
 
 [inlined here:]
 
 Connector className=org.apache.coyote.tomcat4.CoyoteConnector
 port=80 minProcessors=5 maxProcessors=75 enableLookups=true
 redirectPort=443 acceptCount=100 debug=0
 connectionTimeout=2 useURIValidationHack=false
 disableUploadTimeout=true/
 
 Okay, that's a standard HTTP connector. If the webapp demands a
 transport-guarantee of CONFIDENTIAL or INTEGRAL, the connection should
 be automatically upgraded by Tomcat by sending the client a redirect to
 the same URL but with https:// and the redirectPort set above. So, if
 you request http://host/myapp/foo.jsp, then Tomcat should redirect to
 https://host/myapp/foo.jsp given the above configuration (use of the
 default redirectPort of 443 does not result in :443 being added to the
 end of the host portion, since it's the default).
 
 The above plus the transport-guarantee should be all you need. What is
 your experience when you use these two settings together?
 
 Connector className=org.apache.coyote.tomcat4.CoyoteConnector
 port=443 minProcessors=5 maxProcessors=75 enableLookups=true
 acceptCount=100 debug=0 scheme=https secure=true
 useURIValidationHack=false disableUploadTimeout=true
[...]
 /Connector
 
 Technically, the configuration of the HTTPS connector is not relevant:
 Tomcat won't ever downgrade your connection for you.
 
 The web.xml file should be in
 your webapp's deployment directory under WEB-INF/web.xml.
 
 I've tried it there, but with the same results.
 
 What were those results? Give us an example of a URL that should
 redirect to a secure URL. Can you use wget or something similar to show
 what the server interaction is?
 
 This is the only application that will ever be on this server, so
 either should work, yes?
 
 Yes, either should work, but there's no reason to be sloppy, is there?
 
 Your vendor needs to get with the program and
 start supporting a version of Tomcat that was written in the last 5 years.
 
 Amen! I may end up trying what you did, but I'm not familiar with Tomcat yet.
 I'm a quick study though...
 
 Is this a custom webapp that your company owns, or is this something
 you've bought from someone else, and they refuse to support a newer
 version of Tomcat? I would imagine that security and performance would
 be goals worthy of their attention. Maybe they already have your money,
 though ;)
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAkw9+7QACgkQ9CaO5/Lv0PCN5wCggQeCkCZRUwbNg8zsKcXvRzPt
 HAkAoIJz9mXkxJn3q9oXGQ5iTa25+weH
 =6NBV
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat/webapp bundled deployment

2010-07-13 Thread David Fisher
That is pretty much what i do, but I recommend that you adopt an overlay 
approach. It will make it easy for you to take new versions of Tomcat when they 
are available.

Here is how I currently deploy to Solaris.

(1) I use a blessed tomcat distribution from 
http://tomcat.apache.org/download-60.cgi

(2) I build a tarball that contains files to be installed relative to the 
tomcat directory

- bin/setenv.sh - to configure the environment.
- conf/server.xml - to configure tomcat hosts
- conf/tomcat-users.xml - to enable a user for jmx and the manager
- conf/context.xml - to configure the context.
- Catalina/domainname/manager.xml - to manage my domain.
- lib/*.jar  - common jar files - poi, lucene, log4j, etc.
- webapps-wars/ROOT.war - my webapp - I separate the base in server.xml

(3) I have an installation script that always assumes that there is either a 
previous install or a fresh installation of Tomcat.

- stops tomcat.
- makes sure that examples and other default tomcat applications are removed.
- changes the directory to the tomcat base.
- untars the tarball over tomcat.
- modifies the jvmroute in the conf/server.xml so my apache front ends can load 
balance with mod_jk.

If you can use cygwin then you may be able to create a single script for both 
Windows and Linux.

Regards,
Dave

On Jul 13, 2010, at 8:23 AM, Noah Cantor wrote:

 Hello, I would like to deploy Tomcat bundled with a few applications (both
 webapps and non-web applications).  Preferably, this would all be stored in
 one file (be it a jar, ear, or any other format), and upon decompressing, I
 could simply run a script that would activate the server, load the webapps
 onto the server, and launch the non-web applications.  My first question is
 how can I package Tomcat along with all other necessary source/class files,
 scripts and whatnot.  I would be interested in packaging via Eclipse, but
 any other method would be fine as well.
 
 I am currently running Tomcat v6.0.18 on Windows XP, but I plan to deploy on
 both Windows XP and Linux (various possible flavors).
 
 If more information is needed, please let me know, and I will reply as
 quickly as I can.  Thanks for your help.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PDF to acrobat

2010-06-29 Thread David Fisher
You will want to do this:

   response.setContentType(application/pdf);
   response.setHeader(Content-disposition, inline);

For an attachment / download you will want to do:

   response.setContentType(application/pdf);
   response.setHeader(Content-disposition, 
attachment;filename=downloaded.pdf);

Of course browser settings and how your Adobe Reader, Preview or Browser 
plugins are configured may override the inline?

What browsers and OS's matter to you? Older IE versions are pretty sticky. 
Firefox can be set to download no matter what.

Regards,
Dave

On Jun 29, 2010, at 12:08 PM, Dola Woolfe wrote:

 Hi,
 
 I set
 
 response.setContentType(application/pdf);
 
 
 as a result, the served up content triggers a Download rather than opening 
 acrobat within browser window.
 
 
 Do I get to control what happens at client end? I want acrobat to open within 
 browser.
 
 How do I achieve that?
 
 Thanks,
 
 Dola
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting Up AJP Workers as a Failover

2010-06-23 Thread David Fisher
Hi Rainer,

Thank you for your reply - it really has helped out today in several ways.

 I've got myself in a situation where I need a stopgap quick fix - until we 
 can respond correctly.

It turns out I was overreacting and we have other better tools to fix the 
troubles - no need to discuss as they are application specific.

 I have the following workers file:
 
 # define the worker list
 worker.list=LoadBalancer
 
 # Define the LB worker
 worker.LoadBalancer.type=lb
 worker.LoadBalancer.balance_workers=webprod1,webprod2
 worker.LoadBalancer.sticky_session=1
 
 # configure each worker
 worker.webprod1.type=ajp13
 worker.webprod1.host=webprod1
 worker.webprod1.port=8009
 worker.webprod1.lbfactor=100
 
 worker.webprod2.type=ajp13
 worker.webprod2.host=webprod2
 worker.webprod2.port=8009
 worker.webprod2.lbfactor=100
 
 If I change the last line to worker.webprod2.lbfactor=0 will webprod2 only 
 be used if webprod1 is disconnected or otherwise in an error state?
 
 No, value 0 ist not supported and will automatically be changed to 1.
 
 What about using activation=disabled?

This worked really well today when one of our new Sun 2270s ran into an OS bug 
and slowly locked up. I just made the bad machine deactivated while we got 
support and applied the workaround.

 What are you trying to achieve?

I was thinking of de-load-balancing glad to re-think and abandon a silly 
notion.

 
 You should also look at the example configuration bundled with the 1.2.30 
 sources. It contains nice suggestions about timeouts that your configuration 
 is lacking.

This was extremely helpful -  we now plan is to build 1.2.30 from source and 
begin using it very soon - we will likely use this well-annotated example for 
the basis of our configuration.

I knew I could count on the Tomcat Community.

BR,
Dave

 My other choice is to turn off one of the server's Tomcat instance.
 
 The real solution might take a day or two and that is to put back JSESSIONID 
 - meanwhile I'm looking at how to fix occasional strangeness for users. If 
 someone has a way to force JSESSIONID with a valve or filter that would be 
 great.
 
 Yes my jvmroutes are set.
 
 Regards,
 
 Rainer
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Setting Up AJP Workers as a Failover

2010-06-22 Thread David Fisher
Hi All,

I've got myself in a situation where I need a stopgap quick fix - until we can 
respond correctly.

I have the following workers file:

# define the worker list
worker.list=LoadBalancer

# Define the LB worker
worker.LoadBalancer.type=lb
worker.LoadBalancer.balance_workers=webprod1,webprod2
worker.LoadBalancer.sticky_session=1

# configure each worker
worker.webprod1.type=ajp13
worker.webprod1.host=webprod1
worker.webprod1.port=8009
worker.webprod1.lbfactor=100

worker.webprod2.type=ajp13
worker.webprod2.host=webprod2
worker.webprod2.port=8009
worker.webprod2.lbfactor=100

If I change the last line to worker.webprod2.lbfactor=0 will webprod2 only be 
used if webprod1 is disconnected or otherwise in an error state?

My other choice is to turn off one of the server's Tomcat instance.

The real solution might take a day or two and that is to put back JSESSIONID - 
meanwhile I'm looking at how to fix occasional strangeness for users. If 
someone has a way to force JSESSIONID with a valve or filter that would be 
great.

Yes my jvmroutes are set.

Regards,
Dave
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: POI/XML issues in server environment

2010-06-17 Thread David Fisher
Hi All,

Over here from POI where I helped Jorge track things down in Tomcat. I 
suggested he come over here for help, but he seems to have started at the 
beginning and is getting the exact same initial questions that were asked on 
POI User.

Here's what was determined. One of the webapps on his production server uses an 
older XercesImpl Jar in his endorsed directory. This causes a conflict with POI 
that is not handled very well. I've opened a bugzilla in POI so that we'll 
eventually have a more informative error message. We'll need to check to see 
versions of XML Parser implementations active in the JVM to find out what POI 
OOXML's minimum requirement really is. Any suggestions about how to do that 
would be very helpful.

The thread should be easy enough to find on the POI User list. In it Jorge 
provided a screenshot of his production server's common/lib and it was packed 
with jars. No surprise there is a conflict.

Regards,
Dave

On Jun 16, 2010, at 5:05 PM, Terence M. Bandoian wrote:

 Any possibility that the Excel file was modified (e.g. FTP)?  I've used POI 
 in a Tomcat 5.5 webapp on Windows Server and didn't see any problems like 
 this.
 
 -Terence Bandoian
 
 
 Jorge Moya wrote:
 Hello guys.
 
 For the past couple of days, I've been working as an intern in a local
 company and I'd like to mention I'm kind of new with Tomcat and POI. My
 first task was to update a java code they had to extract information of
 excel 97-2003 files to the new POI so that I could also extract and work
 with Excel 2007+ files. I got it working with a local .class test and
 ant.xml build. I then proceeded to update the webservice app in our server
 to function along with Tomcat and this is where the problems began that have
 been bothering me for the past week. Whenever I try to extract .xlsx files I
 get the following error:
 
 org.apache.poi.openxml4j.exceptions.InvalidFormatException: Can't read
 content types part !
at
 org.apache.poi.openxml4j.opc.internal.ContentTypeManager.init(ContentTypeManager.java:107)
at
 org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager.init(ZipContentTypeManager.java:56)
at
 org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:136)
at
 org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:585)
 
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:222)
at
 org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:63)
at com.msights.core.utils.ExcelFile.loadFile(ExcelFile.java:84)
at com.msights.core.utils.GroupLoader.loadFiles(GroupLoader.java:50)
at
 com.msights.core.validation.ValidationModule.run(ValidationModule.java:154)
at java.lang.Thread.run(Thread.java:595)
 
 Now, I've established a long conversation with the POI userlist and came to
 the conclusion I'm having some issues with some of the .jar files and
 classes. This is notably so because I established a local Tomcat environment
 and I can extract the information just fine. I'm kind of at odds on how I
 could fix that issues (Tomcat in the server manipulates a couple of webapps)
 and maybe you guys could offer me a solution.
 
 Java version is 1.5.0_18-b02
 Windows version is Windows Server 2003 SP2
 Tomcat version: 5.5.20
 
 Libraries:
 *http://bit.ly/casaPs*
 Shared only has cewcanative.jar
 
 Any idea of what's causing the problem?
 
 Thanks in advance.
 
  
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context Chicken Egg Problem

2009-12-15 Thread David Fisher

Hi Chris,


Current architecture is to share a jar in shared/lib between the main
webapps, an admin webapps and a localhost only management webapps.  
This

was originally in Tomcat 3. New architecture will separate each, drop
the management webapps and we'll control contexts via multicasting,  
jmx,

and/or servlets.


Any reason to share the JAR instead of weploying it several times?
Memory and disk space are pretty cheap.


We are running on 8 year old Sun Netra boxes and our loaded set takes  
up half of the available memory which is less than 1GB. Redeployment  
on Tomcat 6.0 will include new boxes. The economy is tough, we've been  
waiting for new hardware ... should be soon. Then we can make each  
Tomcat pretty generic and each context self contained with its own  
instance of our JAR.


One question is whether we will need to share our oracle JAR. We don't  
currently use JNDI, we manage the connection pool directly. If we want  
to limit the poolsize based on the machine then we need to share.  
Otherwise we can allocate smaller pools to each webapps that needs  
access. I suppose our results will vary depending on whose JDBC we are  
using. Currently we use Oracle 8, but with our refresh will go to  
Oracle 10. What do you think?


Thanks.

Regards,
Dave

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context Chicken Egg Problem

2009-12-11 Thread David Fisher

Hi Chris,


public class UniverseLoader extends HttpServlet {

   protected long timeLoaded;

   public void init() throws ServletException {
   new Thread(new LoadUniverseTask()).start();
   }

   public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
   response.getWriter().println(Universe loaded:  + new
Date(timeLoaded));
   }


So, until your initialization routine finishes, your code reports that
the universe was loaded on Thu Jan 01 00:00:00 UTC 1970?


Good point. We only use the servlet for debugging. So, we haven't  
fixed this obvious bug.


Also, where do you store information about the universe being  
(properly)
loaded so that your servlets don't try to use missing/unavailable  
objects?


Hidden in the details that I cut out is a call to another class, we  
check to see if that class has completed its task via an isLoaded  
boolean.


Finally, you might consider using a ServletContextListener instead  
of a
Servlet, as this is the recommended practice for context setup. You  
can
still provide a servlet to report on the status of the load if you'd  
like.


Thanks for the tip, I'll add it to our internal JIRA for additional re- 
factoring as we re-architect to go to Tomcat 6 from Tomcat 5.5. We  
share this universe between webapps on the container for historical  
reasons. We hope for horizontal scale and Tomcat 6 anywhere. We'll  
need each of our apps to be an independent WAR to scale each  
individually.


Current architecture is to share a jar in shared/lib between the main  
webapps, an admin webapps and a localhost only management webapps.  
This was originally in Tomcat 3. New architecture will separate each,  
drop the management webapps and we'll control contexts via  
multicasting, jmx, and/or servlets.


Regards,
Dave



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

iEYEARECAAYFAksiYIoACgkQ9CaO5/Lv0PAYVwCeIQKFynF+BdR0NRdCRYGV/D8E
gKAAn33nUUZPK7ut84Wbk7vU0UebYYZy
=hjHK
-END PGP SIGNATURE-



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context Chicken Egg Problem

2009-12-10 Thread David Fisher

You could launch each webapps initialization code in a separate thread.

Here is what we do. Our load is very heavy and our servers are  
responsive after restart much sooner using this technique.


UniverseLoader.java:
package com.example;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Date;

public class UniverseLoader extends HttpServlet {

protected long timeLoaded;

public void init() throws ServletException {
new Thread(new LoadUniverseTask()).start();
}

public void doGet(HttpServletRequest request, HttpServletResponse  
response) throws ServletException, IOException {
response.getWriter().println(Universe loaded:  + new  
Date(timeLoaded));

}

public void loadUniverse() throws Exception {
long timeStart = System.currentTimeMillis();

// Your initialization code

long elapsed = (System.currentTimeMillis() - timeStart) / 1000;
log(Universe loaded:  + elapsed +  seconds);
timeLoaded = System.currentTimeMillis();
}

private class LoadUniverseTask implements Runnable {
public void run(){
try {
loadUniverse();
} catch(Exception e){
StringWriter msg = new StringWriter();
PrintWriter pout = new PrintWriter(msg);
e.printStackTrace(pout);
}
}

}
}

In WEB-INF/web.xml
servlet
servlet-nameUniverseLoader/servlet-name
servlet-classcom.example.UniverseLoader/servlet-class
load-on-startup1/load-on-startup
/servlet
servlet-mapping
servlet-nameUniverseLoader/servlet-name
url-pattern/loaduniverse/url-pattern
/servlet-mapping

Regards,
Dave

On Dec 10, 2009, at 5:34 PM, sh...@radiantblue.com wrote:


Thank you Chuck. That is exactly what I was looking for.


 Original Message 
Subject: RE: Context Chicken  Egg Problem
From: Caldarale, Charles R chuck.caldar...@unisys.com
Date: Thu, December 10, 2009 6:24 pm
To: Tomcat Users List users@tomcat.apache.org


From: sh...@radiantblue.com [mailto:sh...@radiantblue.com]
Subject: RE: Context Chicken  Egg Problem

just a curiosity as to what is happening under the Tomcat
covers during this scenario.


Tomcat initialization is single-thread, so if webapp A happens to get
initialized before B, and the initialization thread running inside A
makes an HTTP request that targets a yet-to-be initialized webapp in  
the

same Tomcat instance, you have a deadlock. Someday maybe, we'll see
multi-threaded initialization.

- 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Control character in cookie value

2009-12-09 Thread David Fisher

Christopher Schultz wrote:


I'm surprised that nobody else has noticed that the control  
characters

in question were already posted by Itay... it's just that nobody
bothered to read the error message properly :)


And we are quite flabbergasted that you did not peruse the thread
carefully, or you would have no doubt noticed that even prior to the
actual data showing the Base64 wrapping in its full glory, the reason
had been given beforehand.


I did read the thread carefully, and nowhere was it explained why this
error message was being emitted:

SEVERE: Exception in the filter chain
javax.servlet.ServletException: #{identity.login}:
java.lang.IllegalArgumentException: Control character in cookie value,
consider BASE64 encoding your value


Itay showed it here:


*After encoding:*
Base64.encodeBytes(sb.toString().getBytes()) =

aXRheS5zYWhhckBnbWFpbC5jb206LTMzY2RmYjZmOjEyNTZhOTBjOWFjOi04MDAwOjM2Nzg1NzQ1

Base64.encodeBytes(sb.toString().getBytes()).getBytes()
[97, 88, 82, 104, 101, 83, 53, 122, 89, 87, 104, 104, 99, 107, 66,  
110, 98,
87, 70, 112, 98, 67, 53, 106, 98, 50, 48, 54, 76, 84, 77, 122, 89,  
50, 82,
109, 89, 106, 90, 109, 79, 106, 69, 121, 78, 84, 90, 104, 79, 84,  
66, 106,
79, 87, 70, 106, 79, 105, 48, 52, 77, 68, 65, 119, 79, 106, 77, 50,  
78, 122,
103, 49, 78, 122, 81, 49, 10, 78, 106, 99, 48, 79, 68, 99, 49, 79,  
68, 89,

53, 77, 122, 103, 61]


Note the 10 between the 49 and 78 towards the end.

It was wrapped as André mentioned, and then when Itay did this:

But look like problem is fixed. I extended the encodeToken method  
and change

it to be
return Base64.encodeBytes(sb.toString().getBytes(),
Base64.DONT_BREAK_LINES);
And now it works (like a charm)! but i'm not sure it solve all the
scenarios/possibilities.


This confirmed it for me.

I never saw any JSP code with the text #{identity.login} in it  
anywhere.


But all is well now, since Itay added the magical no-wrap parameter  
in

his call.


Well, you may have solved /a/ problem, but you either didn't solve the
originally-reported one, or there were really two problems originally
reported. It's not clear to me if they are a single issue or two.


Maybe #{identity.login} is a seam artifact?

Anyway an interesting dialog as always on tomcat_user. Thanks.

Regards,
Dave



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

iEYEARECAAYFAksf+q0ACgkQ9CaO5/Lv0PCJLwCfSV86+GS4htSUowQKjQPmSq86
4+8AoItHPDj02Mo+KaDx/kA9pNV1kjoJ
=8ox5
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Persistent Storage for Webapps

2009-10-12 Thread David Fisher

So you have multiple contexts on a host, each of which needs separate,
persistent storage?

If you don't want to keep track of a property files, you could write  
a bean
with a method that takes a HttpRequest as a argument, and returns a  
file

path based on the info in the request.  You would have to dedicate a
directory on your server as the root for the persistence system.  
Then build

subdirectories based on info available in the request object.

I could go on if you want, but basically I'm trying to say there is  
more
than enough info in each HttpRequest to allow you build a flexible,  
scalable

persistence system without having to resort to .properties files which
you'll then have to squirrel away somewhere and remember to update  
each time

you change your Context name, etc.  Just look at the javadocs for
HttpRequest.  See especially getContextPath() and getLocalName().


Yes, these are good points about managing persistent data.

The OP's original issue with updating his WAR and deleting the data  
directory - followed by trying to use temporary points out a  
misconception about persistence that system administrators live to  
solve. Persistent data has no business being in the webapps.


Webapps need to find the correct data. The system admin needs to  
backup the data and perhaps restore it.


If Tomcat server A dies then does the service need to reappear on  
Tomcat server B where is the data? This suggests that you should have  
your data on a network mount point.


What if your webapps is insanely sucessful and you need to put your  
server in the cloud? Where are you going to find your user's data? Did  
you hear what happened to T-Mobile and the Sidekick - they just lost  
most every client's contacts stored in their cloud


If you are stubborn and I've been myself with virtual host config on  
the Tomcat 3.3 model, you will later spend dear effort programming  
yourself out of the box. In my case we are nearly ready to go to  
Tomcat 6 and a single Webapps completely in a single WAR able to run  
multiple hosts (not SSL). Network storage and file-locking are  
required, you can never assume you are the only one touching a file.


But now we are off topic, managing persistent data can take numerous  
forms - see Apache Lucene, Hadoop, CouchDB, ... and then there are the  
SQL...


Regards,
Dave








On Mon, Oct 12, 2009 at 12:57 PM, Jesse Long j...@unknown.za.net  
wrote:



Tobias Crefeld wrote:


Am Mon, 12 Oct 2009 13:01:44 +0200
schrieb Jesse Long j...@unknown.za.net:



In my webapp I need persistent storage. I am building my webapp  
as a

.war file, and copying it into $CATALINE_HOME/webapps/

Tomcat extracts $CATALINA_HOME/webapps/app.war to
$CATALINA_HOME/webapps/app/

The war file contains an empty directory /WEB-INF/data . During
operations, data files are created under /WEB-INF/data/




WEB-INF should contain only static files which shouldn't be  
accessible
by Webclients (directly), e.g. by /app/data/filename . So it seems  
to

be a bad place





Question: id /WEB-INF/ in the extracted directory the correct place
for persistent data storage? If not, where is?




AFAIK there is no general advise where to put dynamic, persistent  
data.
As system administrator I prefer solutions that give me the  
opportunity
to decide myself where to put dynamic data. There are a lot of  
reasons

for this: securing against disk space overflow, backup, priviledge
separation, etc.

Following this way you might create a properties-file outside the
Tomcat-hierarchy at a sensible place (e.g. /etc/app.properties) with
the paths your application should use.
Another way is to define a Tomcat-parameter during JVM-startup  
that will
contain the path to your data-directory. As this might not survive  
the

next update of Tomcat itself I don't like this kind of configuration
but some applications and classes are working this way.





My goal is to find a consistent way of creating persistent data
relative to the context. I dont want to have to configure context
parameters with data directory paths for each installation.




untested idea: If you have no control over the filesystem of the
target Tomcat you could create a mini-application named data.war  
that
you are deploying. Of course there is always the danger of  
accidentally
erasing the data by re-deploying this pseudo-application. And you  
will

have to find a way by valves, etc. to preserve this path from being
accessed by web-clients. Maybe it is enough if you leave out the
context-entry.


Thanks for your answers Tobias. Unfortunately we have a very real  
use case

for multiple instances on one host, with different data paths. So,
/etc/app.properties is not usable, but /etc/app-context path derived
data.properties might be but virtual hosting would break. No way to
identify unique host consistently.

Also, I could use a path name derived from the temp directory name,  
but
nothing says the temp directory name will be consistent. 

Re: Running multiple tomcats

2009-08-21 Thread David Fisher
Solaris 10 can turn off ports at the OS level. Your sysadmin may have  
those ports turned off. You may need to talk to the sysadmin of the box.


Regards,
Dave

On Aug 21, 2009, at 8:18 AM, Malladi, Sasikanth wrote:


No, no forwarding problems, as I can access the original instance at 
http://myhost:8080
It's just that my instance at http://myhost:8008 is not responding.
It's not the localhost, but a remote Solaris box.


Regards,
Sashi



-Original Message-
From: llg [mailto:l...@portaildulibre.fr]
Sent: Friday, August 21, 2009 11:16 AM
To: Tomcat Users List
Subject: Re: Running multiple tomcats



Le 21/08/09 17:06, Malladi, Sasikanth a écrit :
Thank you for the reply. I've used netstat to ensure none of my  
ports are being currently used.

I updated the AJP connector to 8090 (from the original 8009).
As I said before, the startup seems smooth, with no errors/ 
exceptions being reported.
However, I can't access my instance via the web (the other instance  
is accessible).



Did you try on local (localhost:8008) ?

Is your box behind firewall or routers (forwarding problems) ?

Laurent


Any other tips/hints?

Thanks,
Sashi


-Original Message-
From: llg [mailto:l...@portaildulibre.fr]
Sent: Friday, August 21, 2009 10:37 AM
To: Tomcat Users List
Subject: Re: Running multiple tomcats

Hi,

   perhaps you forgot the AJP Connector (8009).

You can see all listened ports with command :
netstat -laputen | grep java


Laurent

Le 21/08/09 16:31, Malladi, Sasikanth a écrit :


Hi all, I'm a relative newbie to this particular request.

I'm working on a Solaris 10 box which has an old (2003!) version  
of Tomcat running on the default 8080 port.


I've downloaded the latest Tomcat to my home directory and changed  
the server.xml to port 8008 instead of 8080.
I've also changed the shutdown port to 8001 (from 8005) so as not  
to clash with the existing instance.


I've set the CATALINA_HOME, CATALINA_BASE, JAVA_HOME to the right  
locations.


Then I ran startup.sh. Everything seemed to be good. I tailed the  
log file and it looks ok.

However, I can't access the default homepage at http://myhost:8008.
I've shutdown the server for now. Neither the startup nor the  
shutdown commands gave me any error.


#:   ./shutdown.sh
Using CATALINA_BASE:   /home//apache-tomcat-6.0.20
Using CATALINA_HOME:   /home//apache-tomcat-6.0.20
Using CATALINA_TMPDIR: /home//apache-tomcat-6.0.20/temp
Using JRE_HOME:   /opt/SDK/jdk

What could I be missing?

Thanks a lot for your help!

Sashi

P.S. Here's the catalina.out from my logs dir:

Aug 21, 2009 2:14:54 PM  
org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows  
optimal performance in production environments was not found on  
the java.library.path: /opt/SDK/jdk/jre/lib/sparc/server:/opt/SDK/ 
jdk/jre/lib/sparc:/opt/SDK/jdk/jre/../lib/sparc:/usr/local/CAlib:/ 
opt/CA/CAlib:/usr/lib:/usr/ucblib:/export/opt/CA/SharedComponents/ 
iTechnology:/export/opt/CA/eTrustAudit//odbc/lib:/export/opt/CA/ 
eTrustAudit//lib:/usr/jdk/packages/lib/sparc:/lib:/usr/lib

Aug 21, 2009 2:14:54 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8008
Aug 21, 2009 2:14:54 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1196 ms
Aug 21, 2009 2:14:54 PM org.apache.catalina.core.StandardService  
start

INFO: Starting service Catalina
Aug 21, 2009 2:14:54 PM org.apache.catalina.core.StandardEngine  
start

INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
Aug 21, 2009 2:14:56 PM org.apache.coyote.http11.Http11Protocol  
start

INFO: Starting Coyote HTTP/1.1 on http-8008
Aug 21, 2009 2:14:56 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Aug 21, 2009 2:14:57 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=1/52  config=null
Aug 21, 2009 2:14:57 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2142 ms
Aug 21, 2009 2:21:04 PM org.apache.coyote.http11.Http11Protocol  
pause

INFO: Pausing Coyote HTTP/1.1 on http-8008
Aug 21, 2009 2:21:05 PM org.apache.catalina.core.StandardService  
stop

INFO: Stopping service Catalina
Aug 21, 2009 2:21:05 PM org.apache.coyote.http11.Http11Protocol  
destroy

INFO: Stopping Coyote HTTP/1.1 on http-8008

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





Re: XSS vulnerability in Tomcat Host Header

2009-07-23 Thread David Fisher

On Jul 23, 2009, at 4:00 AM, Mark Thomas wrote:


Konstantin Kolinko wrote:

2009/7/22 Rémy Maucherat remy.mauche...@gmail.com:
On Wed, Jul 22, 2009 at 2:37 PM, Mark Thomasma...@apache.org  
wrote:
You'll need to provide more details. Nothing stands out from the  
security pages.


Please provide step by step instructions to reproduce from a  
clean Tomcat

installation.

Please also note that potential security vulnerabilities should  
be reported
privately (see http://tomcat.apache.org/security.html), rather  
than to a public
list. Since you have posted to a public list, there is no point  
continuing in

private.
I don't think the host is used in HTML generated by Tomcat. OTOH,  
like
the other strings returned by the API,  
ServletRequest.getServerName is

not XSS filtered.



At least, if there are concerns about that, there is a workaround:

you can specify proxyName  attribute on a Connector element in  
server.xml


In that case the one that is in request will be ignored.

Documentation is here:
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html


For the record, private mail with more detail has indicated that  
this is an
issue in an application deployed to Tomcat, rather than Tomcat  
itself. The issue

has been forwarded to the appropriate folks to be dealt with.


I am glad that this was discussed in public.

We make use of getServerName, and in most cases it is filtered  
appropriately. However, for completeness, we are looking at all uses  
of this method.


Regards,
Dave



Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat is idle when Oracle crashed

2009-04-20 Thread David Fisher
I've been investigating Oracle configuration myself - this page was  
helpful to me for Oracle 10g -

http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/readme_10201.html

It contains a reference to the following bug -


BUG-3209390
JDBC OCI Driver's TAF functionality will not work, when used
in conjunction with JDBC Fast Connection Failover. The problem is
that when TAF is enabled, JDBC Fast Connection Failover
will likely remove connections, that were actually detected
and failed over by TAF. There is no work-around. Users cannot
use TAF and Fast Connection Failover together.


This is also stated for 11g:
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/111070_readme.html

So I guess you'll need to figure out how - if possible - to  
reestablish your connections after the Oracle failover.


Or, maybe you should use the thin client instead of the OCI? I don't  
know the details you should be talking to an Oracle expert on metalink.


Regards,
Dave


On Apr 20, 2009, at 2:30 PM, shak.shaik wrote:



We've production environment as follows.
We have two web servers with load balancing capability. We've two  
Oracle DB
servers and we are using Virtual IP to connect to one of the db  
servers. our

web server is tomcat 6.0

br

Our application should up and running even there is no DB  
connectivity and

it is tested and proved.
Also we use TAF (Transparent Application Failover. if one db server  
is down,
all db connections has to rout to another db server) as part of its  
db URL.

br
But last week, one of our DB server got crashed and from the moment  
db got

crashed, our website is not reachable.

br
When I checked the logs, I didn't see any JDBC exceptions or any other
generic exceptions. . Same time I saw the status as started for  
tomcat

service in windows service (Control Panel - Services).
br
Our network people argue that there are no issues from their side.  
Why the

tomcat is Idle and web site is not found in case of DB crash?
br
Any suggestions or work around will be greatly appreciated.

Thanks.

--
View this message in context: 
http://www.nabble.com/Tomcat-is-idle-when-Oracle-crashed-tp23145324p23145324.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JK 1.2.28 - load balancer worker fails on startup with one worker down ?

2009-04-17 Thread David Fisher
An interesting discussion. Since I am about to configure such a load  
balancer and we prefer to use DNS, understanding this type of detail  
is critical.


The OP said that the reason that the DNS did not resolve was that the  
machine had been moved off the network. That may have been an event  
out of the control of the sysadmin for the web service. Suppose  
someone takes a server away and then a week later apache and mod_jk  
are restarted via a cron job in the middle of the night? Suddenly the  
web service is down.


I think that one could argue that if a configuration has been  
successful then this error should be a warning and if the  
configuration file has been altered since the past time it is a fatal  
error. That may be too much extra logic and it is non-deterministic as  
a configuration file change is hard to detect accurately.


Perhaps more helpful would be to have a sysadmin email address in the  
config and then when things go fatal send an email with the  
appropriate log information. It is all about catching appropriately  
thrown error classes. What logging facility does mod_jk use? It could  
be that plugging in a special logger in this situation makes sense.


Regards,
Dave

On Apr 17, 2009, at 5:28 AM, André Warnier wrote:


Rainer Jung wrote:
[...]

What remains for me is your suggestion, that the error is not a fatal
one, since there are other balanced workers left. We could include  
such

a check in the startup code, although I'm not really convinced, that
your problem is a good reason for this.
I'm open to more argumntation and suggestions :)

Argumentation #1 against a change in logic:
The OP argues that one single unresolvable balanced worker should  
not stop the other 4 from working, hence that the balancer should  
start anyway, since 80% of the capacity is still available.  It  
sounds reasonable in principle.
But what if there are only 2 balanced workers in total, of which one  
is unresolvable at start ? would it be normal to start with only one  
balanced worker available anyway ?

If not, then where's the limit of acceptable ?

Argumentation #2 against a change in logic:
Suppose the balancer would start, with the resolved workers only.
Suppose the resolving problem comes from a typo, not the fact that  
the given host is temporarily out of the DNS system, but a definite  
non-existing host.  It will not be retried, so there will never be  
another error/warning message. The host itself may be ok and respond  
to pings etc.., it will just never be hit by Apache's mod_jk, so  
this would be a very quiet error.
How is the sysadmin going to figure out that there is, basically, a  
problem ?


Argumentation for a change in logging:
It would be clearer if the error message stated explicitly that the  
balancer worker was not started due to a /configuration/ error, see  
above message(s).


But then, if even I could figure it out from the existing error  
message, then just about everyone should be able to.
And what would be the use of the likes of me, if everything was  
clear ?

;-)

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JK 1.2.28 - load balancer worker fails on startup with one worker down ?

2009-04-17 Thread David Fisher

Rainer -

Wouldn't this type of dynamics occur if your workers were in a cloud?  
Or if you needed a lot more very quickly for peak processing?


Am I correct to think that if someone is being so dynamic with their  
worker's DNS configuration then they should automate using the status  
worker to handle configuration after initial startup of mod_jk?


http://tomcat.apache.org/connectors-doc/reference/status.html

Unfortunately, I don't see a way to add or remove a worker? I think  
that this type of dynamic configuration would be very helpful in  
managing a cloud of tomcat workers.


I would be pretty cool to be able to put Tomcat Workers into service  
merely by starting up a VM that uses DHCP to get its IP by name. The  
VM could then know to register itself with a mod_jk status worker.  
Wouldn't this make a Tomcat Cloud super easy to manage? It could even  
be geographically diverse and migratory.


Regards,
Dave

On Apr 17, 2009, at 10:16 AM, Rainer Jung wrote:


On 17.04.2009 18:02, André Warnier wrote:
To my knowledge, the only case where the DNS would fail to provide  
an IP

address of a correctly-written FQDN name, is if you have some
configuration where your hosts register themselves under some  
variable

IP address when they startup.  But that would be a strange setup for
servers, no ?


Maybe some combination with DHCP? But I still don't like the concept  
of

this type of dynamics.

Regards,

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Virtual Hosts

2009-04-15 Thread David Fisher
Can anybody offer any guidance or advice on how I can set up some  
virtual

hosts for my application that has multiple skins.

I want to be able to go to http://flavour1 instead of having to  
type in
http://longhostname/service/program.jsp?skins=flavour1, and similar  
for

flavour2, flavour3, etc..

All the documentation seems to point to virtual directories, and  
when I have

tried to use the syntax detailed here
http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html
http://gandhim.wordpress.com/2008/01/31/tomcat-55-virtual-directory/
http://www.experts-exchange.com/Web/Web_Servers/Apache/ 
Q_21242062.html


Tomcat tries to open a directory called /service/program.jsp? 
skins=flavour1/


How do I phrase the context syntax correctly?

MTIA

Rob



Write a Servlet Filter that parses HttpServletRequest.getServerName()
and performs the same action that whatever handles the  
skins=flavour1

parameter does.

In server.xml set the Engine attribute defaultHost to the single host
that will handle your application.

(This assumes that you know what you're doing re: DNS)


I use this technique and it works in Tomcat 5.5. I have multiple  
domains hosted, and I name each as Aliases in the Host in server.xml.


This works unless the OP also needs to make https connections. In that  
case, all of the virtual hosts will need to be in the same main domain  
and a wildcard certificate will be required.


*.domain.com

vs.

www.domain1.com
www.domain2.com

If you must use https (which I do) and to have multiple domains then I  
have to choose which domain has the correct certificate and the others  
will not match. That wasn't too awful until Firefox 3. It is a pain.


There is no known (at least to me) solution to this except for putting  
Apache in front of Tomcat and handle the certificates and virtual host  
there.


Then use Filter technique to choose the appropriate skin.

I hope my remarks anticipate the next question from the OP, otherwise  
I'm sorry if this a thread hijack


Regards,
Dave





p

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Virtual Hosts

2009-04-15 Thread David Fisher

Hi Charles,


I have multiple domains hosted, and I name each as
Aliases in the Host in server.xml.


If you only have one Host element, aliases are unnecessary.  You  
only need Alias elements when multiple Hosts are configured and  
you want Tomcat to route more than one domain to them.


Exactly. We started with Tomcat 3. We have multiple Hosts - localhost  
with internal webapps for monitoring our main webapps and performing  
internal services. We keep a large cache and have a number of jars in  
shared/lib.


We are currently re-architecting so that we can go to Tomcat 6 where  
the games that we have been playing are out of bounds.


We'll have one stack and control access with a Filter and/or Valve.  
This way we have everything in one webapps and it will be a single  
Context that we can put everything into a war - deploy to the Cloud.


I would hope that configuring such unneeded Alias elements doesn't  
add processing time doing any comparisons, but I haven't looked at  
the code to verify that.


We can make apache do this work for us in front. I've been lurking on  
this list for some time. In a few weeks we will build our first  
version of this and I am confident that should we encounter trouble I  
can get advice from the good people like you here on the Tomcat users  
list.


Best Regards,
Dave

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: mod_headers and .htaccess for P3P policy

2009-01-07 Thread David Fisher
When I had to deal with p3p policy then I simply put a directory  
called w3c in my webapps and dropped in a p3p.xml and  
policy.xml. Afterwards my webapp on a different url in tomcat could  
be opened in an iframe by our partners IIS served ASP application.


w3c/p3p.xml
w3c/policy.xml

Is this what you are looking for?

Regards,
Dave

On Jan 7, 2009, at 7:49 AM, Sergio Arrighi wrote:


Hello to everyone,

I'm using apache 6 on a Windows server machine.
I'm hosting a webapplication which is used in a third party web site  
included in an IFRAME.
I've an issue with IE6 an IE7 about session replication. I've read  
on the internet that this issue is dued to P3P policies and that  
it's sufficient to add a clause to the header like this:


IfModule mod_headers.c
Header set P3P policyref=\/w3c/p3p.xml\, CP=\NOI DSP COR NID CUR  
ADM DEV OUR BUS\

# OR THIS, SIMPLER
Header set P3P policyref=\/w3c/p3p.xml\
/IfModule

I've read on the internet that this is possible using .htaccess file  
in the webapp directory.

I've tried with no success.
Could someone please explain this procedure to me??

Thanks a lot

Sergio Arrighi

--
*I.M.I.N. Holding s.r.l.*
Sergio Arrighi
sergio.arri...@iminholding.com mailto:sergio.arri...@iminholding.com
Cell. 3455805121

Vicolo Molino, 2
21052 Busto Arsizio
Varese
Tel. +39 0331324679
Fax. +39 0331324678
www.iminholding.com


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



FYI - Apple Updates Tomcat to 6.0.18 on MacOSX Servers

2008-10-14 Thread David Fisher

Just noticed the following on an Apple MacOSX 10.5 Security Update:


  Tomcat

  CVE-ID: CVE-2007-6286, CVE-2008-0002, CVE-2008-1232,  
CVE-2008-1947, CVE-2008-2370, CVE-2008-2938, CVE-2007-5333,  
CVE-2007-5342, CVE-2007-5461


  Available for: Mac OS X Server v10.5.5

  Impact: Multiple vulnerabilities in Tomcat 6.0.14

  Description: Tomcat on Mac OS X v10.5 systems is updated to  
version 6.0.18 to address several vulnerabilities, the most serious  
of which may lead to a cross site scripting attack. These issues  
only affect Mac OS X Server systems. Further information is  
available via the Tomcat site at http://tomcat.apache.org/


Regards,
Dave

-
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: XP/Vista/Office 2007/IE Compatibility Question

2008-09-30 Thread David Fisher

Martin,

3) If the software is not independent of Office 2007, is it  
compatible
with it? If not, what is the compatible version and what are the  
costs

involved in upgrading?
MGthe way TC handles Microsoft Compound Documents such as XLS and  
DOC files are thru POI Apache interface

MGhttp://www.apachenews.org/archives/001180.html
MGThis common POI interface allows access to HSSF (binary file  
format, .xls) and XSSF (ooxml file format, .xlsx)
MGi think its safe to assume POI access to legacy .doc Documents  
and .xls Spreadsheets is assumed
MGin other words read access to POI docs is almost assured..write  
capability is another matter


There is NOT as much support as you say - please read the note more  
carefully. The Apache POI project is working on OOXML and this support  
is limited and in Beta form - POI 3.5 Beta 3 was released just this  
Sunday. (Announcement attached below.)


Support for .doc files is nowhere near as robust as .xls,

If you have questions about POI you can send an email to [EMAIL PROTECTED]

Regards,
Dave

From the Apache POI Team:

The POI team is pleased to announce the availability of Apache POI  
3.5 beta 3, our latest beta including OOXML (Office Open XML) support.


Apache POI is well-known in the Java field as a library for reading  
and

writing OLE2 office file formats, such as Excel, PowerPoint, Visio and
Word. With POI 3.5, it also support the new OOXML formats introduced  
in Office 2007. See http://poi.apache.org/ for more details



Release Highlights:

 POI-SS - Java API To Access Microsoft Excel Format Files
 * This common interface allows access to HSSF (binary file format,
.xls) and XSSF (ooxml file format, .xlsx) in the same way
 * Very similar to HSSF usermodel, allowing easy translation of old
code support to the new format
 * All of HSSF should support this interface
 * Partial implementation of XSSF for this interface

 POI-XSSF - Java API To Access Microsoft Excel 2007 OOXML Format Files
 * partial implementation of high level interface
 * text extraction supported
 * low level, low memory parsing supported

 POI-XSLF - Java API To Access Microsoft PowerPoint 2007 OOXML  
Format Files

 * text extraction supported

 POI-XWPF - Java API To Access Microsoft Word 2007 OOXML File Formats
 * text extraction supported

In addition, all fixes from the forthcoming 3.2 release (svn trunk)  
are included. This includes a large number of formula fixes and  
improvements, and initial Publisher file format support. For full  
changelog details, and documentation, please see /docs/ in the  
distribution. The documentation on the website reflects the state of  
work on POI 3.2.



The source and binaries can be downloaded from your local mirror:
http://www.apache.org/dyn/closer.cgi/poi/dev/

The release is also available from the central Maven repository under
Group ID org.apache.poi and Version 3.5-beta3. Note that the  
ooxml support is not available via Maven, as the dependencies are  
not packaged.



For the Apache POI Team
Nick Burch






Re: Tomcat migration from T5 to T5.5 mail

2008-09-30 Thread David Fisher

Hi,

Just a thought, but you might want to check the permissions on the jar  
files. I've gotten errors like that when I lacked permission to read.


Regards,
Dave

On Sep 30, 2008, at 6:54 AM, AlexM3 wrote:



Hello,

Firt of all thanks for your fast answer.

- My Java versión is jdk1.5.0_06, it's the same that is using the  
old Tomcat
5 and it works. Anyway I've tried to remove aplication.jar and an  
error asks

for him.

- I've tested my linux system mail function and it works, the  
aplication

deployed in Tomcat 5 works too.

- My context.xml is:

?xml version=1.0 encoding=UTF-8?
!-- The contents of this file will be loaded for each web  
application --

Context
   Resource name=mail/Session auth=Container
   type=javax.mail.Session
   mail.smtp.host=localhost/

/Context

- What i've done to configure the mail is the same as your guide  
Albretch

says:
1. Copy mail.jar and activation.jar to $CATALINA_HOME/common/lib
2. Edit context.xml and add the ressource mail/Session:

Resource name=mail/Session auth=Container  
type=javax.mail.Session

mail.smtp.host=localhost/

3. Edit web.xml and add the resource-ref:

resource-ref
 description
   Resource reference to a factory for javax.mail.Session
   instances that may be used for sending electronic mail
   messages, preconfigured to connect to the appropriate
   SMTP server.
 /description
 res-ref-name
   mail/Session
 /res-ref-name
 res-type
   javax.mail.Session
 /res-type
 res-auth
   Container
 /res-auth
/resource-ref

4. The code is written and tested.

Any idea?
--
View this message in context: 
http://www.nabble.com/Tomcat-migration-from-T5-to-T5.5-mail-tp19739822p19740598.html
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]




-
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: Can I get Millisecond precision in Access Logs?

2008-09-16 Thread David Fisher

It is. The docs are here:
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/valves/AccessLogValve.html

I use

Valve  
className=org.apache.catalina.valves.AccessLogValve
   directory=logs  prefix=unity_access.  
suffix=.log pattern=%h %v %t %s %b %D %{RUNNING}c %r/


The AccessLogValve must be used and it is the %D spec that show  
milliseconds.


Tomcat 5.5.x

Regards,
Dave

On Sep 16, 2008, at 11:39 AM, Jonathan Mast wrote:

Is it possible to obtain timestamps with millisecond precision in  
access

logs?  I don't see anything about specifying the date-time stamps on
AccessLogValve page and was wondering if there wasn't a way to get  
this

data.

Tomcat 5.5

Thanks



-
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: Can I get Millisecond precision in Access Logs?

2008-09-16 Thread David Fisher

Correct, I realized after I posted.

I guess you'll have to get the source code for AccessLogValve and roll  
your own override...


I found this article via google accesslogvalve tomcat source

4th link:
http://www.devx.com/Java/Article/32730/1954 includes a source code  
archive and the example in the article shows milliseconds on the  
timestamp.


5th link:
http://www.docjar.com/html/api/org/apache/catalina/valves/AccessLogValve.java.html 
 is tomcat 6 source and you quickly see what to look for in the code:


874   timeFormatter = new SimpleDateFormat(HH:mm:ss);

HTH

Dave

On Sep 16, 2008, at 2:27 PM, Jonathan Mast wrote:

Ah, but %D is the time taken to process the request in ms.  It's not  
the

timestamp.

On Tue, Sep 16, 2008 at 3:14 PM, David Fisher  
[EMAIL PROTECTED]wrote:



It is. The docs are here:

http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/valves/AccessLogValve.html

I use

  Valve  
className=org.apache.catalina.valves.AccessLogValve
 directory=logs  prefix=unity_access.  
suffix=.log

pattern=%h %v %t %s %b %D %{RUNNING}c %r/

The AccessLogValve must be used and it is the %D spec that show
milliseconds.

Tomcat 5.5.x

Regards,
Dave


On Sep 16, 2008, at 11:39 AM, Jonathan Mast wrote:

Is it possible to obtain timestamps with millisecond precision in  
access

logs?  I don't see anything about specifying the date-time stamps on
AccessLogValve page and was wondering if there wasn't a way to get  
this

data.

Tomcat 5.5

Thanks




-
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: [a little OT] Can I get Millisecond precision in Access Logs?

2008-09-16 Thread David Fisher

Mark,

Interesting but shouldn't the getDate method be slightly different:

  if ((systime - currentDate.getTime())  1000) {

In this line if currentDate is at millisecond 900 then the next second  
starts with the millisec and that is 100 ms later.


long cachedtime = currentDate.getTime();
  if ((systime - cachedtime  999 - cachedtime%1000) {

Yes, I know it is a quibble about what is probably fuzzy logic. But  
I'm just a guy who learned to typeset using integers in ebcdic at 300  
dpi in Fortran and IBM Sys 370 Assembler and this is a classic next  
pixel problem with proportional width characters at a small font size.


(A comment for all those US-ASCII-7 haters - look up the EBCDIC code  
table :-) or better look up Hollerith who invented Punchcards for the  
1890 US Census. There is some logic to it that is very similar to  
QWERTY...)


Regards,
Dave



On Sep 16, 2008, at 2:46 PM, Mark Thomas wrote:


Jonathan Mast wrote:
Is it possible to obtain timestamps with millisecond precision in  
access

logs?


One of the nice things about open source is that you can read the  
source

code to see exactly how it does things. In this case you want

http://svn.apache.org/repos/asf/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/valves/AccessLogValve.java

Look for getDate()

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]




-
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: Log4j Logging

2008-06-24 Thread David Fisher


(This must be national logging questions month :-)


More like International logging month - everyone upgrading to tomcat  
5.5 or better is forced to confront this issue, many are under a lot  
of pressure, and they don't all read English. The differences are  
subtle and lost in translation.


(1) I submit that this paragraph on http://tomcat.apache.org/tomcat-5.5-doc/logging.html 
 makes people react poorly as it offers nothing except a gotcha and  
you got more to learn.


An important consequence for Tomcat 5.5 is that the Logger element  
found in previous versions to create a localhost_log is no longer a  
valid nested element of Context. Instead, the default Tomcat  
configuration will use java.util.logging. If the developer wishes to  
collect detailed internal Tomcat logging (i.e what is happening  
within the Tomcat engine), then they should configure a logging  
system such as java.util.logging or log4j as detailed next.


(2) There ought to be a link to some page describing how to convert a  
Logger into something useful in Tomcat 5.5.


There is the page http://wiki.apache.org/tomcat/FAQ/Logging but there  
is no link on the logging page to the FAQ.


(3) On the logger FAQ page the Configuration link is dead! http://tomcat.apache.org/tomcat-5.0-doc/config/logger.html 
 gives a 404.


(4) You offer two different methods which is great, but now not only  
is someone who just wants to convert their Logger is forced to  
choose between two unknowns.


So, a table comparing log4j vs JULI for various logging requirements  
would really help. A user could look it over and be more likely to  
know whether they should prefer to try log4j or JULI.


Classloading and where to put jars and why is important.

(5) It looks like Ole is working on some documentation improvements I  
hope these comments will help.


The current state of logging documentation only frustrates the already  
frustrated.


But really thanks - I do like Tomcat.

Regards,
Dave


-
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: Log4j Logging

2008-06-24 Thread David Fisher

It now points to http://tomcat.apache.org/tomcat-4.1-doc/config/logger.html

That's perfect for me.

Thank you very much,
Dave

On Jun 24, 2008, at 3:30 PM, Mark Thomas wrote:


David Fisher wrote:
(3) On the logger FAQ page the Configuration link is dead! http://tomcat.apache.org/tomcat-5.0-doc/config/logger.html 
 gives a 404.


Fixed. Note, the FAQ is now on a wiki so anyone who spots an error  
can just

fix it.

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]





-
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: logging with multiple web applications

2008-06-17 Thread David Fisher

Hi Chuck,

These threads have clarified things for me as well. Thanks.


From: Jamie [mailto:[EMAIL PROTECTED]
Subject: Re: logging with multiple web applications

Ok. I currently have the log4j-1.2.14.jar file in the WEB-INF/lib
directory. I will remove it.


No, that's where it's supposed to be; one copy for each webapp.  I  
was referring to Tomcat's lib directory, not each webapp's.



I do have shared JARs and class files across web apps.


That is most likely the source of your problem.


This is a strongly desired feature as the intention is to
minimize the memory footprint of each web app.


Unless you have many thousands of shared classes, your concern is  
probably unfounded.  By introducing such run-time dependencies, you  
pretty much guarantee that you have to take the whole server down  
to update a single webapp, and created versioning hell when you  
need to update a shared library for one particular webapp but not  
the others.  Memory is cheap; don't be afraid of configuring a  
larger PermGen when needed.


Yes, this where I am. Memory is not cheap when you are running old  
hardware w/o option to replace and have your own webapps large area.  
But you are correct about tomcat's reasonable approach to the  
problem. I'll need to do containers as singletons. If a webapps is  
too PermGen intensive with 4000 clases, etc. maybe it needs its own  
isolation.



Is there a way to use shared libs/classes and
have the logging output separate?


Yes, but it's ugly: each caller of a method in a shared class must  
pass in a reference to the webapp's logger, rather than letting the  
shared class have its own.  You really don't want to do that, since  
it complicates and obfuscates the interface.  Just stop sharing  
your classes.


Once I put apache in front I can.

I'm not replying in the related classloader thread, but that is  
helpful as well in thinking about going from 5.5.25 to 6.


As always - illuminating.

Regards,
Dave



 - 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]





-
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 producing (near) duplicate Catalina logs

2008-06-13 Thread David Fisher

Hi Andre,


I tried, but I'm not finding it.
Am I the only one in that situation ?


No, I've tried to read both the log4j docs and the tomcat logging  
docs. Nowhere is there a good working example that describes some real  
world situations. My trouble is different from yours, but I believe we  
are both looking for the same thing, an effective guide to tomcat  
logging.


The tomcat documentation for JULI talks about using both at the same  
time etcetera and somewhere in the muddle switches between.


Sorry, I don't think this is a hijack, it is my frustration.

Here is my situation which is complex and I KNOW is too complicated to  
ask for advise on the totality - I've been on the list to absorb  
relevant info, and maybe I'm ready.


When we went to 5.5.25 we lost all the really nice SIMPLE logging w/o  
bulletproof instructions on how to replace it. It would be nice to  
have a cookbook that directly translates the one config to the other  
showing how to do it with JULI, with log4j and with both happily co- 
existing. This last, for me has been the key part.


My trouble involves my rather weird configuration that grew from  
tomcat 3.3 to 4.1 to 5.5. I recently added Roller 4.0 and had to do a  
weirder config due its 16MB per context permgen space requirements for  
4000 classes moving many of its jars to tomcat/shared/lib ended my  
OOM. All my contexts logs are hijacked by Roller, and that is a roller  
question that I can't ask due to my weird configuration. But if I  
understood better how logging and tomcat interact I could understand.


Watching this list I am confident that I could reconfigure with apache  
in front of tomcats w/my webapp and other tomcats w/Roller. This would  
be ideal, and different logging mechanisms could be used in each  
tomcat. And my problem would stop, ... And it is what will be done.  
I prefer it for many reasons which many on this list have graciously  
provided.


I would still like to have someone help me guide through the logging  
configuration in some simple scenarios.


If this is done then I promise the people on this wonderful group that  
I'll try to distill it into a reasonable FAQ.


I'm on Solaris 8, w/Java 5.

My host context on Tomcat 4.1.31 looks like:

Host name=my.url.com appBase=webapps-url 
Valve  
className=org.apache.catalina.valves.AccessLogValve
   directory=logs  prefix=my_url_access.  
suffix=.log

   pattern=common/
Logger className=org.apache.catalina.logger.FileLogger
   directory=logs  prefix=my_url_logger.  
suffix=.log

   timestamp=true/
/Host

In Tomcat 5.5.26:

Host name=my.url.com appBase=webapps-unity 
Valve  
className=org.apache.catalina.valves.FastCommonAccessLogValve
   directory=logs  prefix=my_url_access.  
suffix=.log pattern=common/

/Host

How do I translate my 4.1.31 Logger to log4j in Tomcat 5.5.25? How do  
I do the same for JULI logging? How do I combine the two?


How does the classloader come into play? I know it has some affect  
because there is mention in the docs of tomcat/common/ vs. tomcat/ 
shared/?


Do the answers differ for Tomcat 6?

Now do you see why we simple users who must spend time programming  
their apps, are confused? Especially when you go from having a VERY  
SIMPLE interface to options you don't care about but are forced to  
make. Like which health care plan?


This is critical to me, I ought to go to Tomcat 6 and Java 6 as I go  
to Apache / Tomcat (for load balancing, SSL front end and splitting  
parts of webapps between differently configured tomcats, I certainly  
don't want to waste time with logging configuration,


Regards,
Dave



 


-
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: Requests being processed at a certain moment

2008-06-03 Thread David Fisher

Alvaro,

You certainly can easily use a Filter with your JSPs.

Take a look at the jsp-examples webapps included with tomcat. If you  
look at WEB-INF/web.xml and the structure of WEB-INF/classes/ you  
should see how to use the example that Jim provided.


For example RequestDumper:

In web.xml

filter-mapping
filter-nameRequest Dumper Filter/filter-name
url-pattern/*/url-pattern
/filter-mapping

In classes/filters/RequestDumper.java:

public void doFilter(ServletRequest request, ServletResponse  
response,

 FilterChain chain)
throws IOException, ServletException {

if (filterConfig == null)
return;

// Render the generic servlet request properties
StringWriter sw = new StringWriter();
PrintWriter writer = new PrintWriter(sw);
writer.println(Request Received at  +
   (new Timestamp(System.currentTimeMillis(;

// Log the resulting string
writer.flush();
 
filterConfig.getServletContext().log(sw.getBuffer().toString());


// Pass control on to the next filter
chain.doFilter(request, response);

}

I'm sure you can combine these examples.

Good luck. Don't be afraid of Servlets they are your friend. You'll  
certainly want to know them if you need to do any binary content.


Regards,
Dave

On Jun 3, 2008, at 10:15 AM, Álvaro Morillas (Sortes Ing. Inf. S.L.)  
wrote:


Although I don't use servlets, only jsp's, it's a solution I've  
thought,
using a log taglib. The problem is that I must insert the code in  
every jsp

and it's painful XD

I was looking for an easier solution if it's available.

Thanks anyway :)



Álvaro Morillas Correa
VicioJuegos.com - Sortes Ing. Inf., S.L.

Plaza Mayor, 25, 1º, Of. 9-B
28911 Leganés (Madrid)
Teléfono: 916943388 – Móvil: 617315926
Horario: L-J: 9:00-14:00, 15:00-18:30 | V: 9:00-15:00


-Mensaje original-
De: Jim Cox [mailto:[EMAIL PROTECTED]
Enviado el: martes, 03 de junio de 2008 16:30
Para: Tomcat Users List
Asunto: Re: Requests being processed at a certain moment

I use a filter servlet to log entry/exit timestamps for requests  
along with
some shell scripting to process the logs looking for still open  
requests.
I've been using it for over a year for a production site, it's been  
very

useful for debugging unexplained slowdowns, hangs, etc.

Filter is pretty simple, essentially:

public void doFilter(...) {
 int request_id = ++s_request_id ;
 long lStart = System.currentTimeMillis() ;
 logger_.info(request_id +  processing request for ' +  
sRequestedUrl +

') ;
 try {
   fc.doFilter(request, response) ;
 }
 finally {
   logger_.info(request_id +  processed in  +  
(System.currentTimeMillis()

- lStart) +  msec) ;
 }
}


On Tue, Jun 3, 2008 at 10:15 AM, Álvaro Morillas (Sortes Ing. Inf.  
S. L. ) 

[EMAIL PROTECTED] wrote:

Hi everyone. This is my first post in this group. I hope this  
question

hasn't been answered before.



I have a problem with my web application. It is growing and in  
certain

peak
moments the server gets very busy. I work with Tomcat 5.5 and IIS.  
I think
the problem is within my programming (not configuration). Because  
of that
I'm trying to see what requests are being processed in a certain  
moment by

Tomcat and for how long they've been there so I can tune them.



Is there any application I can use to see that? Or I have to use  
the logs

and analize them in any way?



I hope there is an easy solution for my problem.



Thanks in advance.





Álvaro Morillas Correa

Sortes Ingeniería Informática, S.L.

http://www.sortes.com

Pza. Mayor, 25, Of. 9-B - 28911 Leganés (Madrid)

Horario: L-J: 9:00-14:00 15:00-18:30 V: 9:00-15:00

Tfno: 91 694 33 88 Fax: 91 693 10 47










-
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: COMPATABILITY APACHE /TOMCAT/CONNECTOR

2008-05-29 Thread David Fisher

Hi -

I'm a bit of a hacker with server.xml, but your problem is with  
duplicate ports so look at ALL port usage in both server.xml files.


Maybe you should try changing the redirect port for TC2 to 8444.

There should not be a redirect port for AJP/1.3

Do you define an HTTPS connector? If not, then I think you should  
leave out the redirectPort for HTTP/1.1 (I may be wrong here and you  
need it to avoid defaults.)


Do you define the shutdown port? That must also be unique.

Regards,
Dave

On May 29, 2008, at 11:27 AM, karthikn wrote:


Hi

Using this configuration, TOMCAT2 will never start up.

I am confused 

TC1

Connector port=8081 protocol=HTTP/1.1  
connectionTimeout=2 redirectPort=8443 /

Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /



TC2

Connector port=8082 protocol=HTTP/1.1  
connectionTimeout=2 redirectPort=8443 /

Connector port=8010 protocol=AJP/1.3 redirectPort=8443 /




Yes I am able to start both TOMCATS  on Ports 8081 /8082  
configurations in server.xml


am i still missing anything in here.


with regards
karthik


Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Karthik,

karthikn wrote:
| Tomcat 1 is on c:/TOMCAT1   on startup port - 8081
| Connector port=8081 protocol=HTTP/1.1  
connectionTimeout=2

| redirectPort=8443 /
|
| Tomcat 2 is on d:/TOMCAT2  on startup port -  8082
| Connector port=8082 protocol=HTTP/1.1  
connectionTimeout=2

| redirectPort=8443 /

Are you sure?

| TOMCAT1  .server.xml is as follows
|
| Connector port=8081 protocol=HTTP/1.1  
connectionTimeout=2

| redirectPort=8443 /
| Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /
| Engine name=Catalina defaultHost=localhost jvmRoute=node01

This configuration looks good, although you probably don't need the
HTTP/1.1 connector at all, unless you want to be able to contact each
Tomcat individually.

| TOMCAT2  .server.xml is as follows
|
| Connector port=8081 protocol=HTTP/1.1  
connectionTimeout=2

| redirectPort=8443 /
| Connector port=8010 protocol=AJP/1.3 redirectPort=8443 /
| Engine name=Catalina defaultHost=localhost jvmRoute=node02

You have a port conflict with your HTTP/1.1 connector between the two
Tomcats. It doesn't matter what service you're trying to run: you  
cannot

have two things listening on the same port at the same time.

Using this configuration, TOMCAT2 will never start up.

You also need to re-port your workers.properties file.

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

iEYEARECAAYFAkg+yYEACgkQ9CaO5/Lv0PBLuQCgrHgsprXjv5zXkyXO4gQiktLf
1QMAn08pl4PyOXOvk2DjgaAMqRJwbRjX
=mReW
-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]





-
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: COMPATABILITY APACHE /TOMCAT/CONNECTOR

2008-05-29 Thread David Fisher

Hi Chris,


David,

David Fisher wrote:
| Maybe you should try changing the redirect port for TC2 to 8444.

Why?

| There should not be a redirect port for AJP/1.3

Why not?

I agree that the OP should really simplify his or her configuration,  
but

you seem to be stabbing in the dark with suggestions.


I was admittedly Hacking around

The redirect port is used solely for redirects. No ports are bound,  
etc.

The redirectPort for all connectors on all TC instances should be
exactly the same (otherwise they won't properly be load-balanced after
the redirect). They should probably be set to 443 or not set at  
all to

accept the default (443).


Thanks for clearing this up for me. I'm learning by listening. The OP  
has posted a bunch and you guys have been incredibly patient - quite a  
model!


Regards,
Dave




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

iEYEARECAAYFAkg/DhgACgkQ9CaO5/Lv0PDzngCfYj1RXA2Wuzg2kVTIluDXm+Z/
NgkAoIYbynsPU1yzGsepwzzkH4Amhsgl
=bu75
-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]





-
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: Save POJO Application Server Definition

2008-05-15 Thread David Fisher


Jeez, give the guy a break, if you don't want to read his posts then
don't read them. His name appears next to them, it's easy to ignore  
if

you want to.

I don't know 'Johnny' personally and I agree he can be a bit  
ebulliant


I don't mind ebullient as long as he knows what he's talking about,  
and Johnny certainly does; he's been a big help to me from time to  
time.
I also have no problem with a two or three line tagline in a message  
like the one he uses for Harbor, but think it would be better if it  
were placed at the bottom of the message so it's not so intrusive.


I find Johnny's emails interesting and helpful as well.

All that I was asking for was for him to put his taglines (however  
many he wants) at the end - like everyone else - sorry if I was too  
sarcastic. Peace.


Regards,
Dave




JMHO, but the TC mailing list supervisors have the final say, of  
course...


D




-
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: Load Balnce and failover for Tomcat

2008-05-13 Thread David Fisher
I think what the experts are saying is that even if your webapps is  
started it could be dependent on a large startup operation.


Take for example Apache Roller which can take several minutes to  
rebuild its persistence state and while up will reject requests.


The only way to know if the webapps is up is to test it with a  
request to your webapps.


So, the answer will differ for each webapps and the resource to ask  
will differ as well.


Best of luck.

Regards,
Dave

On May 13, 2008, at 7:46 AM, Stront wrote:






From: Stront [mailto:[EMAIL PROTECTED]
2. That all of the webapps are running.


That's webapp-dependent, surely?  Tomcat can't determine all the  
ways in

which your application can fail.

But it can tell if the app has started; Tomcat's manager displays a  
list of

apps and whether it is running.
--
View this message in context: 
http://www.nabble.com/Load-Balance-and-failover-for-Tomcat-tp17207372p17207537.html
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]





-
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: Save POJO Application Server Definition

2008-05-13 Thread David Fisher
We know you think your stuff is so kewl, but would you please stop  
leading all your email with an evangelical tag line.


That would be so cool of you.

Thanks,

Regards,
Dave

On May 13, 2008, at 3:14 PM, Johnny Kewl wrote:


---
HARBOR: http://coolharbor.100free.com/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
Making the Java dream come true.
---




Re: Shared Javascript, CSS, and Image Files

2008-05-13 Thread David Fisher

Hi,

Probably you should refer to it as shared/test.js without the  
leading /


Regards,
Dave

On May 13, 2008, at 6:21 PM, John Buchholz wrote:


Hi,

I am looking for the recommended solution for when multiple webapps  
need to use the same sets or javascript, css, and image files.  I  
have created a symbolic link in $CATALINA_HOME/webapps/myapp called  
shared pointing to /home/myhome/shared_files.   When I refer to / 
shared/test.js in my jsp, it does not recognize it.  Is there  
something I need to do to tell Tomcat to follow symbolic links or  
even better is there a recommended location under $CATALINA_HOME for  
me to add my collection of shared files that will be seen by all  
webapps?


I am using Tomcat 5.5.23.

Thanks so much for your help.




-
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: logging catalina.out and localhost-##.log - don't append

2008-05-09 Thread David Fisher

On May 9, 2008, at 1:43 PM, Caldarale, Charles R wrote:


From: Robert Koberg [mailto:[EMAIL PROTECTED]
Subject: RE: logging catalina.out and localhost-##.log - don't append

I am starting/stopping from a console with ./bin/startup.sh


So modify the script (or wrapper it) to do rm -f ./logs/* and you're
done.


Of course, if you need to restart your tomcat immediately and look at  
your old logs to debug a problem - or if someone else does a year  
from now.


It will drive you nuts wondering where they went. In this case you  
can do a log rotate something like this:


#!/bin/sh
DIR=/export/home/apachecat

file='/export/home/apachecat/tomcat/logs/catalina.out'
for num in 5 4 3 2 1 0; do
pnum=`expr $num + 1`
mv $file.$num $file.$pnum
done
mv $file $file.0

Regards,
Dave



 - 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]





-
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: access files from jsp

2008-04-29 Thread David Fisher

Henry doesn't say if these are text files or binary files.

If these are binary files like PDF, PPT and XLS files then a servlet  
will be needed - not a jsp.


We use variations like the following in both Tomcat 4.1.31 and Tomcat  
5.5.26


public class OpenFileServlet extends HttpServlet{

public void doGet (HttpServletRequest request,  
HttpServletResponse response) throws ServletException, IOException {


// You probably want to look up the url - which is really a  
path.

String url = request.getParameter(url);
if(url == null) return;

// You'll know your mime types for your content.
String ext = request.getParameter(ext);
String content_type;

if (.ppt.equals(ext)) {content_type = application/vnd.ms- 
powerpoint; }
else if (.xls.equals(ext)) {content_type = application/ 
vnd.ms-excel; }

else {content_type = application/pdf;}

// we don't like to inline Office documents.
boolean is_inline = application/pdf.equals(content_type);

File f = new File(url);

if ( f.exists()  f.length()  0) {
response.setContentType( content_type);
// The following works way better in Windows IE than ext=
response.setHeader(Content-disposition,  
(is_inline?inline:attachment)+;filename= + f.getName());

int lng = (int)f.length();
response.setContentLength( lng );
FileInputStream fis = new FileInputStream(f);
byte[] chunk = new byte[16184];
int count;
while ((count = fis.read(chunk)) =0 ) {
  response.getOutputStream().write(chunk,0,count);
}
fis.close();
} else {
log(File not found:  + url);
}
}
}



FYI - this approach really became necessary about when 4.1.29 came out  
- at that time Tomcat got pretty strict with non-Text being served via  
JSP. All of our PDF and PPT content broke in Windows IE. And we had to  
back out a whole release.


Regards,
Dave

On Apr 29, 2008, at 1:39 PM, David Smith wrote:

So... the remote file is available to the local system on a  
network drive. That's a fun one. There are a couple of different  
ways to do this.


1. Using Windows fileshares

Let me preface this by saying *I've* never done this. The few times  
I've had a tomcat server on a Windows machine, it only ever accessed  
local files. There are people on the list with way more experience  
than I have.


As I understand it, as long as tomcat is running under a user  
account that has privileges to read the remote file, you could use a  
UNC path with java standard file access classes and methods to read  
the file. The mapped drive letter wouldn't work unless tomcat was  
only running while you are logged in. In a jsp, this could be done  
with a scriptlet:


!-- import your classes at the top of the jsp --
jsp:scriptlet
try {
FileInputStream remoteFileReader = new FileInputStream( \\\ 
\remoteServer\\archive\\files\\myFile.txt ) ;

// do something with the file
} catch ( Exception e ) {
// do something if the access fails
} finally {
try {
remoteFileReader.close() ;
} catch ( Exception e ) {}
}
/jsp:scriptlet

It should be mentioned the system account most services run under by  
default does not have any privilege to access remote files via UNC  
path, so you'll have to customize your tomcat installation a  
little. ... Or always be logged into the system and have it running  
as you which isn't the most ideal method.


2. Using a webserver on the remote system

This I have done and it's more platform independent. Your jsp can  
request it from the remote server using standard taglibs:


(note standard.jar and jstl.jar must be in your webapp's WEB-INF/lib  
directory)


!-- import the core taglib from jstl at the top of the file. Docs  
for the jstl taglib can help with this --


c:import url=http://remoteSystem.dns.com/http/path/to/file.txt;  
var=fileContents /
!-- Do something with the file contents, it'll be available in  
the fileContents page context attribute --



--David

henry human wrote:

Thanks David,
I try to clarify my situation.
I have a JSP running in local computer in tomcat. This
JSP should read from a remote machine. The files are
under d:\archive\files. These directory which provide
a repository functionality could not be transfer
somewhere else. The files “must be” saved there. 1) Scennario one:  
The remote machine does not hava e

webserver
2) Scenario two: a tomcat is running on remote
computer
My questions:
1) Do I need the webserver at all to access remotely
the files?
2) Is it poosile to access the data on d:\archive…
without to put them in a webserver directory or not?
If no, do I need configuration for the webserver (f.i.
tomcat)to allow access to the files from outside?

--- David Smith [EMAIL PROTECTED] schrieb:



Here's the picture you painted in the original email
and I based my answer on:

1. You 

Re: access files from jsp

2008-04-29 Thread David Fisher

Hi Henry,



most of these files are PDF, XLS and not only TXT
format.
You are meaning that with a JSP definitvly one can
reads only TXT files?


When I had the trouble I was referred to the JSP spec and it is meant  
for serving marked up Text formats. Encoding translations can happen  
with JSP. With JSP it is easy to insert whitespace which will damage a  
PDF or XLS file.


So, you want a servlet. Servlets send only want you want to send.

You can mount your remote system as a disk on your web server system  
and then use pathnames as the url in my sample. We've done this  
since Tomcat 3.0.3.


Pretty simple.

It is up to you if you need to obfuscate your file pathnames.

Glad to help.

Regards,
Dave




i understood with help of
--- David Fisher [EMAIL PROTECTED] schrieb:


Henry doesn't say if these are text files or binary
files.

If these are binary files like PDF, PPT and XLS
files then a servlet
will be needed - not a jsp.

We use variations like the following in both Tomcat
4.1.31 and Tomcat
5.5.26

public class OpenFileServlet extends HttpServlet{

public void doGet (HttpServletRequest request,

HttpServletResponse response) throws
ServletException, IOException {

// You probably want to look up the url -
which is really a
path.
String url = request.getParameter(url);
if(url == null) return;

// You'll know your mime types for your
content.
String ext = request.getParameter(ext);
String content_type;

if (.ppt.equals(ext)) {content_type =
application/vnd.ms-
powerpoint; }
else if (.xls.equals(ext)) {content_type
= application/
vnd.ms-excel; }
else {content_type = application/pdf;}

// we don't like to inline Office
documents.
boolean is_inline =
application/pdf.equals(content_type);

File f = new File(url);

if ( f.exists()  f.length()  0) {
response.setContentType( content_type);
// The following works way better in
Windows IE than ext=

response.setHeader(Content-disposition,
(is_inline?inline:attachment)+;filename= +
f.getName());
int lng = (int)f.length();
response.setContentLength( lng );
FileInputStream fis = new
FileInputStream(f);
byte[] chunk = new byte[16184];
int count;
while ((count = fis.read(chunk)) =0 )
{

response.getOutputStream().write(chunk,0,count);
}
fis.close();
} else {
log(File not found:  + url);
}
}
}



FYI - this approach really became necessary about
when 4.1.29 came out
- at that time Tomcat got pretty strict with
non-Text being served via
JSP. All of our PDF and PPT content broke in Windows
IE. And we had to
back out a whole release.

Regards,
Dave

On Apr 29, 2008, at 1:39 PM, David Smith wrote:


So... the remote file is available to the local

system on a

network drive. That's a fun one. There are a

couple of different

ways to do this.

1. Using Windows fileshares

Let me preface this by saying *I've* never done

this. The few times

I've had a tomcat server on a Windows machine, it

only ever accessed

local files. There are people on the list with way

more experience

than I have.

As I understand it, as long as tomcat is running

under a user

account that has privileges to read the remote

file, you could use a

UNC path with java standard file access classes

and methods to read

the file. The mapped drive letter wouldn't work

unless tomcat was

only running while you are logged in. In a jsp,

this could be done

with a scriptlet:

!-- import your classes at the top of the jsp

--

jsp:scriptlet
try {
FileInputStream remoteFileReader = new

FileInputStream( \\\

\remoteServer\\archive\\files\\myFile.txt ) ;
// do something with the file
} catch ( Exception e ) {
// do something if the access fails
} finally {
try {
remoteFileReader.close() ;
} catch ( Exception e ) {}
}
/jsp:scriptlet

It should be mentioned the system account most

services run under by

default does not have any privilege to access

remote files via UNC

path, so you'll have to customize your tomcat

installation a

little. ... Or always be logged into the system

and have it running

as you which isn't the most ideal method.

2. Using a webserver on the remote system

This I have done and it's more platform

independent. Your jsp can

request it from the remote server using standard

taglibs:


(note standard.jar and jstl.jar must be in your

webapp's WEB-INF/lib

directory)

!-- import the core taglib from jstl at the top

of the file. Docs

for the jstl taglib can help with this --

c:import



url=http://remoteSystem.dns.com/http/path/to/file.txt;



var=fileContents /
!-- Do something with the file contents,

it'll be available in

the fileContents page context attribute --


--David

henry human wrote:

Thanks David,
I try to clarify my situation.
I have a JSP running in local computer in tomcat.

This

JSP

Re: access files from jsp

2008-04-29 Thread David Fisher
Well, it looks like you can use the reading the file part of my  
approach or David Smith's approach.


If you need to retrieve content from within a Microsoft Office file -  
including properties, etc then you might take a look the Apache POI  
project - http://poi.apache.org/


If you need to do a transformation on a PDF - Apache XMLGraphics may  
be worth a look - http://xmlgraphics.apache.org/


Regards,
Dave

On Apr 29, 2008, at 4:48 PM, henry human wrote:





--- David Smith [EMAIL PROTECTED] schrieb:


No, I don't mean that. It should be able to retrieve
any type of file.
What you can do with it from within a jsp might be
somewhat limited thought.

Ok,


What exactly do you want to do with the file
contents within the  jsp?


I will save them to a Content Server by the JSPs.
I will use some beans and taglib for the logic
implementation.



BTW, I highly recommend you read the documentation
for the jstl taglibs
and do some googling. I'm sure some research would
help you a lot.

--David

henry human wrote:

Hi David,
most of these files are PDF, XLS and not only TXT
format.
You are meaning that with a JSP definitvly one can
reads only TXT files?

i understood with help of
--- David Fisher [EMAIL PROTECTED] schrieb:



Henry doesn't say if these are text files or

binary

files.

If these are binary files like PDF, PPT and XLS
files then a servlet
will be needed - not a jsp.

We use variations like the following in both

Tomcat

4.1.31 and Tomcat
5.5.26

public class OpenFileServlet extends HttpServlet{

public void doGet (HttpServletRequest

request,


HttpServletResponse response) throws
ServletException, IOException {

// You probably want to look up the url

-

which is really a
path.
String url =

request.getParameter(url);

if(url == null) return;

// You'll know your mime types for your
content.
String ext =

request.getParameter(ext);

String content_type;

if (.ppt.equals(ext)) {content_type =
application/vnd.ms-
powerpoint; }
else if (.xls.equals(ext))

{content_type

= application/
vnd.ms-excel; }
else {content_type = application/pdf;}

// we don't like to inline Office
documents.
boolean is_inline =
application/pdf.equals(content_type);

File f = new File(url);

if ( f.exists()  f.length()  0) {
response.setContentType(

content_type);

// The following works way better in
Windows IE than ext=

response.setHeader(Content-disposition,
(is_inline?inline:attachment)+;filename= +
f.getName());
int lng = (int)f.length();
response.setContentLength( lng );
FileInputStream fis = new
FileInputStream(f);
byte[] chunk = new byte[16184];
int count;
while ((count = fis.read(chunk)) =0

)

{

response.getOutputStream().write(chunk,0,count);
}
fis.close();
} else {
log(File not found:  + url);
}
}
}



FYI - this approach really became necessary about
when 4.1.29 came out
- at that time Tomcat got pretty strict with
non-Text being served via
JSP. All of our PDF and PPT content broke in

Windows

IE. And we had to
back out a whole release.

Regards,
Dave

On Apr 29, 2008, at 1:39 PM, David Smith wrote:



So... the remote file is available to the

local



system on a


network drive. That's a fun one. There are a


couple of different


ways to do this.

1. Using Windows fileshares

Let me preface this by saying *I've* never done


this. The few times


I've had a tomcat server on a Windows machine,

it



only ever accessed


local files. There are people on the list with

way



more experience


than I have.

As I understand it, as long as tomcat is running


under a user


account that has privileges to read the remote


file, you could use a


UNC path with java standard file access classes


and methods to read


the file. The mapped drive letter wouldn't work


unless tomcat was


only running while you are logged in. In a jsp,


this could be done


with a scriptlet:

!-- import your classes at the top of the

jsp



--


jsp:scriptlet
try {
FileInputStream remoteFileReader = new


FileInputStream( \\\


\remoteServer\\archive\\files\\myFile.txt ) ;
// do something with the file
} catch ( Exception e ) {
// do something if the access fails
} finally {
try {
remoteFileReader.close() ;
} catch ( Exception e ) {}
}
/jsp:scriptlet

It should be mentioned the system account most


services run under by


default does not have any privilege to access




=== message truncated ===



 __
Gesendet von Yahoo! Mail.
Mehr Möglichkeiten, in Kontakt zu bleiben. http://de.overview.mail.yahoo.com

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

Re: R: How to close idle connections

2008-04-28 Thread David Fisher


On Apr 28, 2008, at 9:59 AM, Alan Chaney wrote:




David Smith wrote:



No, I have at most 20 idle connections, that's goes right, but my  
boss want
less idle connections to avoid to overload the database server. So  
there
isn't way to close an idle connection to remove the relative  
process?
If so, I will set maxIdle=2 and everyone will be happy  
(expecially me :)


I'll bet money the added, idle postgres connections are just  
sleeping while they wait for work.  Given idle connections  
contribute virtually no additional load, don't see his argument  
that idle connections contribute to a database overload.  If the  
minor increase in overhead due to sleeping threads actually  
overloads the database, you need to let your boss know the server  
hardware is way too frail for production use and needs to be  
upgraded.

--David
Agreed. I use postgres and with ps alx | grep postgres each  
connection shows as idle (when its not being used!) and consumes  
about 140k bytes of memory. On a modern server that can hardly be  
considered as any use at all!


The database server will typically have a maximum number of  
connections. For example our Oracle server has been set at 220 for  
sometime. We do well with a connection pool of 8 per tomcat server.


And with a database server the web side is not the only customer.

maxidle=2 is certainly too small, and maxidle=20 too large.

Enrico I would negotiate with your boss and dba about what that value  
should be. They need to understand the trade-off. The dba may be able  
to increase the number of connections on that end.


Regards,
Dave






Alan Chaney





Enrico Sasdelli wrote:

Thanks for reply,


I see you have maxIdle=20.  Do you have more that 20  
connections sitting idle?  Is this really that much of a  
concern?  As long as the connections are released (closed) and  
returned to the pool, I don't see the problem.




No, I have at most 20 idle connections, that's goes right, but my  
boss want
less idle connections to avoid to overload the database server. So  
there
isn't way to close an idle connection to remove the relative  
process?
If so, I will set maxIdle=2 and everyone will be happy  
(expecially me :)



Thank you,
Enrico



The entire idea of a connection pool is the system keeps around a  
set of idle connections for borrow.  When you code get's a  
connection, it comes   from the pool of idle connections and  
returned when you close the


connection.  This speeds up your application by elliminating the  
overhead of contacting the server and constructing a new  
connection whenever you call for one.  The pool just grabs a pre- 
made one off the shelf for you.






--David



-
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]
!DSPAM:4815ddca16721381456296!


-
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: simple JSP redirect to another page -- how to deal with relative URLs

2008-04-25 Thread David Fisher

Seconded.

DIGLLOYD said the following:

From what I can find by googling, redirects have a slew of issues of  
their own. But I'm a newbie at this, so I might be misunderstanding.


The only trouble I've had with redirects is when you redirect to a  
page which redirects to a page which redirects to a page. Browsers  
consider more than a few redirects in a row to be a bad thing and they  
stop. My experience taught me (about 7 years ago) that more then 2 was  
pushing things.


DIGLLOYD are only replacing a single generation of files, as you do  
this relinking how many links do you want to forward or redirect?


Regards,
Dave

On Apr 25, 2008, at 3:27 PM, David Smith wrote:

Never mind .. I saw your other responses and the best solution is  
the redirect option.  After following the redirect, the browser will  
have the correct URL for calculating the full url of each of the  
page's resources.


--David

David Smith wrote:
I see the problem.  You could use absolute paths in jsp includes  
and the servlet container would understand them as relative to the  
webapp's root as opposed to the server's root:


Say you have this file layout

webapp
|index.jsp
|article1
|index.jsp
|article1.html
|article2
|index.jsp
|article1.html

article2/index.jsp could simply have jsp:include file=/article1/ 
article1.html / and it would find article1.html in the article1  
folder.


--David

DIGLLOYD INC wrote:
I previously asked about remapping URLs and got some helpful  
responses. In a nutshell, this was recommended:

http://tuckey.org/urlrewrite/

Looks very good for some purposes.

But I also want to solve a much simpler problem--

I have a very large amount of static content (articles), with each  
article in its own directory.  A main Table of Contents links to  
the start page in each directory, which is *not* index.html (eg  
some-main-page.html).  I don't want to rename or change those  
pages as they have world-wide direct links to them--they have to  
stay as-is.  But I do want to insert an index.jsp page without  
altering any content.


For many of these folders inserting a trival index.jsp solves the  
index-page problem:

%@ include file=the-main-page.html %

(though I do wonder if google consider this unacceptable duplicate  
content)


My pages all use relative links eg .., ./, etc.  So this works  
***when the page being included is in the same directory**.


But when the include page is in another directory, none of the  
relative links work.  None of these variants do the right thing;  
any referenced images cannot be found.


%@ include  file=../ReviewInfo.html %
jsp:include file=../ReviewInfo.html %
jsp:forward page=../some-other-page.html /

The jsp:forward directive seems perfect, but the flaw of not  
changing the current location (eg no cd is done first) makes it  
useless for this purpose.  Or does it?  Is there something I'm  
missing here?


Alternately, is there some other trivial solution?

URL-rewriting is not appropriate in this case; there is no  
particular pattern, just a fair number of specific cases.  I was  
hoping for a simple 1-line index.jsp in each directory.


Lloyd


Lloyd Chambers
http://diglloyd.com

[Mac OS X 10.5.2 Intel, Tomcat 6.0.16]





-
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]




-
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: LD_LIBRARY_PATH issue

2008-04-10 Thread David Fisher

Hi,

Look carefully at the LD_LIBRARY_PATH man page.

At least under Solaris, if you are sudo'ing in some way to root then  
it will not reset LD_LIBRARY_PATH. This is a security measure.


You may need to configure the root to include these libraries.

This was 7 years ago that we encountered this situation, so I can't  
give you detail.


I hope this sets you on the right path.

Regards,
Dave

On Apr 10, 2008, at 10:40 PM, Geofrey Rainey wrote:


Hello,



I am setting up Tomcat to connect to an Oracle RAC cluster using the
Oracle OCI driver.



The documentation I have read says to configure LD_LIBRARY_PATH under
Linux topoint

to the Oracle OCI library file directories, but no matter where I set
LD_LIBRARY_PATH it

does not get honored.

I am getting a JVM crash and a trace file containing the environment
settings shows that

LD_LIBRARY_PATH is always set to the library directories under
$JAVA_HOME.



How do I set the LD_LIBRARY_PATH for Tomcat?



Regards,

Geofrey Rainey.

==
For more information on the Television New Zealand Group, visit us
online at tvnz.co.nz
==
CAUTION:  This e-mail and any attachment(s) contain information that
is intended to be read only by the named recipient(s).  This  
information

is not to be used or stored by any other person and/or organisation.



-
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: How to get Tomcat to pick up Oracle database connections after database shutdown?

2008-04-03 Thread David Fisher
I think you are correct. We manage our Oracle connections ourselves  
using classes12 and a ConnectionPool. I have no need to restart tomcat  
after an Oracle bounce. I do restart my Tomcats much more often than  
Oracle - every day. It has been almost a year since we restarted Oracle.


It could be that Hibernate is your issue. I know that Tomcat can  
manage connections perhaps there is something in that configuration  
that will help.


Good luck.

Dave

On Apr 3, 2008, at 2:45 PM, steve kerver wrote:


Hi- I'm an Oracle DBA, but since I work in a small
company, I've been tasked with restarting our Tomcat
servers everytime I have to shut down or restart our
database.

(If I shutdown the Oracle database and then don't do a
Tomcat restart when the database comes back up, we get
HTTP 500 errors).

To me, this seems silly though- Tomcat should be able
to be aware that no database connection is available,
but when one *does* become available, it should just
pick it up, instead of requiring a restart.

Does anyone here know how to configure this?

Also- FYI, we are using Hibernate.

Any help would be greatly appreciated.

 Thanks!
  -Steve.


  

You rock. That's why Blockbuster's offering you one month of  
Blockbuster Total Access, No Cost.

http://tc.deals.yahoo.com/tc/blockbuster/text5.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]





-
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: Encryption algorithms usage in Tomcat

2008-03-26 Thread David Fisher

Hi,

You want to look at this page: http://www.apache.org/licenses/exports/

You'll need some time to understand it. I did this a couple of years  
ago.


When I last I checked HTTPS support is the only encryption that  
Tomcat does. I don't believe that HTTPS is subject to ECCN, but I'm  
not a lawyer, yada yada .


Good luck,

Regards,
Dave

On Mar 26, 2008, at 1:18 AM, Hitesh Raghav wrote:


Hi,

Could you please redirect me to right point of contact.

I need encryption usage details in Tomcat to receive an export control
classification number (ECCN).

Please let me know in case any other details are needed.

Thanks,
-Hitesh


-Original Message-
From: Hitesh Raghav [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2008 5:16 AM
To: users@tomcat.apache.org
Subject: Encryption algorithms usage in Tomcat

Hi,

Which encryption algorithms are used in Tomcat? Could I get detailed
information about usage of these algorithms in Tomcat?

Is there any change in encryption algorithm usage in Tomcat from  
v5.5.7

to v5.5.26 and v6.0.16?

Thanks,
-Hitesh


-
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 5.5 and Apache 2.2

2008-03-26 Thread David Fisher

Hi -

There can be three cases (at least)

(1) Your blog software insists on a folder name - a weblog id.

Having played with Roller 4 and Tomcat, I was defeated in trying to  
get what you want. They are working on it in their next version, and  
people have reported how to do it. If you are using Roller you should  
be able to get help there.


What is your blog application?

(2) You need to adjust how apache rewrites the url.

(3) You need to adjust your context or server.xml in tomcat.

Regards,
Dave

On Mar 26, 2008, at 8:20 AM, Lasana Crider wrote:


Hello,

I am trying to do the following:  I want to use www.kriedertech.com  
instead of www.kriedertech.com/blog.  I am using the mod_jk for the  
connector to Apache.  I am having alot of problems doing this.  Can  
anyone help with this?




Lasana




-
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 5.5 and Apache 2.2

2008-03-26 Thread David Fisher

Lasana,


Hi I am using roller and will look there for some help.


Glad to help. I think they will fix this. The project lead has in  
fact done it in his own personal blogs.


I also have another application that I wrote using Java/Struts you  
know the usual and I want to do the same thing.  I have read that  
by changing the war file to ROOT.war would work, is that possible  
option?


It is likely, unless your webapps is like roller and imposes a  
structure on the url.



  Or using mod_rewrite?


I haven't done this myself, but it should work. I don't think it  
solves roller, but I haven't tried.


I haven't yet gone to Apache in front of Tomcat for load balancing  
yet. It is on my road map to replace ancient expensive, but elegant  
Resonate, giving me the scalability I hope to need.


Dave




Lasana

- Original Message 
From: David Fisher [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, March 26, 2008 9:48:31 AM
Subject: Re: Tomcat 5.5 and Apache 2.2

Hi -

There can be three cases (at least)

(1) Your blog software insists on a folder name - a weblog id.

Having played with Roller 4 and Tomcat, I was defeated in trying to
get what you want. They are working on it in their next version, and
people have reported how to do it. If you are using Roller you should
be able to get help there.

What is your blog application?

(2) You need to adjust how apache rewrites the url.

(3) You need to adjust your context or server.xml in tomcat.

Regards,
Dave

On Mar 26, 2008, at 8:20 AM, Lasana Crider wrote:


Hello,

I am trying to do the following:  I want to use www.kriedertech.com
instead of www.kriedertech.com/blog.  I am using the mod_jk for the
connector to Apache.  I am having alot of problems doing this.  Can
anyone help with this?



Lasana




-
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: [OT] Smalltalk (was RE: Tomcat multithread question on externalapplication)

2008-03-25 Thread David Fisher

From: Peter Crowther [mailto:[EMAIL PROTECTED]
Subject: [OT] Smalltalk (was RE: Tomcat multithread question
on externalapplication)

Smalltalk is still the fastest prototyping environment for
some classes of problem that I've used - but I'd prefer
something with a few more safety belts for production use!


Agreed; it definitely has its place (primarily as an OO teaching  
tool, I

think), but things like that scare me when they escape into the real
world.

But then, one of the guys I worked with 30+ years ago wrote a  
production

application in APL... and it stayed in production for several years.


The son of the inventor of APL has made a career out of a proprietary  
version of APL still used by at least one of the large financial  
institutions in new york. The array functionality and compactness of  
expression to say nothing of a whole set of unavailable non-ASCII  
characters. Phew.


I switch between Fortran and Java. We use a 44 year old Fortran 2  
heap sort implementation that is very fast. Our graphics libraries  
have produced FR80 micrographics, Xerox metacode (saw John Warnock's  
name on some hand written engineering specs someone gave us),   
Macintosh PICT, and, finally, Postscript. Lately, we've engineered a  
hook up to Excel and Powerpoint via contributions to Apache POI.


In looking at the Apache XML Graphics project I see a bunch of  
references to Knuth's layout algorithms, so I'm getting out my 29  
year old first edition of TEK and METAFONT.


XML is really SGML ... with a twist.

I just finished reading Jared Diamond's Guns, Germs and Steel,  
tracking the historical movements of people via the similarities in  
languages is very interesting.


Dave



 - 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]





-
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: forwarding a post

2008-03-20 Thread David Fisher

Hi,

PayPal has free solutions that work:

https://www.paypal.com/us/cgi-bin/webscr?cmd=_profile-comparison

I use Website Payments Standard with an IPN back-end without  
trouble for over 5 years on Tomcat 4s, no trouble with recent upgrade  
to 5.5/


We save the shopping cart on the server side and cause the client  
side to go to PayPal.


window.location.replace(
https://www.paypal.com/cgi-bin/webscr? 
cmd=_xclickbusiness=%=ppvsite%invoice=%=invoice%+

item_name=%=URLEncoder.encode(document_name)%+
item_number=%=document_id%amount=%=document_price%+
no_shipping=1no_note=1+
image_url=%=URLEncoder.encode(our logo gif)%
   );

Once the payment has cleared by PayPal they send server to server  
messages back through the IPN process. This includes chargebacks  
echeck clearing, and other exceptions. It is all well documented with  
sample code. Maybe they have better approaches now, but I've no  
reason to change.


Regards,
Dave


On Mar 20, 2008, at 8:58 AM, John Pedersen wrote:


Hi,

At least with Google checkout, I have found a better solution. I  
have a form

with just their button image as a submit, and in my handler I do:

String xmlCart = cart.createXML();
 MerchantInfo mi = GoogleMerchantInfoFactory.createMerchantInfo(
EnvironmentType.Sandbox);
 CheckoutShoppingCartRequest cscr = new CheckoutShoppingCartRequest 
( mi,

xmlCart);
CheckoutResponse checkoutResponse = cscr.send();
 String redirectUrl = checkoutResponse.getRedirectUrl();

It turns out that GC has some java code already that uses the
HttpURLConnection class - it posts the data in the shopping cart, the
retrieves a forwarding url that takes the user to their payment page.
Google's CheckoutShoppingCartRequest contains the HttpURLConnection  
code

which posts the data - server to server.

Thanks for the heads up.

Unfortunately, I don't think Paypal have an equivalent, unless I  
sign up for

their £20/month Paypal Pro ( I am not sure if their code makes this
functionality available - for that price, I won't even look - I'll  
just
stick to using javascript onLoad(submit()) in a page conatining  
nothing but

the Paypal button form.

John

On 20/03/2008, Christopher Schultz [EMAIL PROTECTED]  
wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

John,


John Pedersen wrote:
| Can anyone suggest how I can forward a post using servlets?


[snip]


| Then, depending on which button the user clicks, I want to  
forward the

user
| on to google/paypal using POST, adding the parameters such as cart,
| signature.


This is typically called a man-in-the-middle attack. ;)

Seriously, though, you'll have to build the POST manually. Look at  
the

java.net.HttpURLConnection class. You could also look at HttpClient
(http://hc.apache.org/httpcomponents-client/index.html), which
encapsulates a lot of what you want to do.

Just remember that if you decide to act as a proxy like this, you  
will
have top handle a lot of things like cookie-passing, etc. in order  
to do

it properly.

Perhaps there's a better API for you to use than their user-facing
web-based one... such as a SOAP or REST API where a lot of those  
issues

are removed.

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

iEYEARECAAYFAkfiaE8ACgkQ9CaO5/Lv0PAAVgCffK5ZwvwMZwMVXcDsF295MqjJ
GC0AoKJOK1s4TMfT/fUDUatijBn9c/OB
=mlDx
-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: Running out of memory too easily in Tomcat 6.0.16

2008-03-19 Thread David Fisher

PermGen Space is where classes live.

One of the links on the FAQ should get you on track:

http://opensource.atlassian.com/confluence/spring/pages/ 
viewpage.action?pageId=2669


You are likely doing something seemingly innocent, but there is  
actually a problem.


I got similar errors to yours when I had too many simultaneous  
instances of the same webapp (Apache Roller 4). I ended up with 16000  
classes loaded.


I now have a goofy config due to hacking that issue and my logging  
doesn't work as I want. But my few nagging memory problems are  
solved, ok. I haven't had the luxury of truly figuring out the  
issues. I hope that you do.


Regards,
Dave

On Mar 19, 2008, at 1:32 PM, Scott Mueller wrote:
Thank you for the response Chuck.  Like I said, this is a very  
simple webapp
(aside from the Spring/Hibernate libraries).  Stores nothing ever  
in any
sessions and I can't imagine memory leaks with the simple code.   
Thank you
for those links, I guess I should run a profiler to see exactly  
what's going
on.  In the meantime, what's the proper way to increase the memory  
allocated
to tomcat?  And should I allocate more than my physical ram?  Is  
there a

general formula for how much ram to allocate to tomcat on a machine
dedicated to only that function?

On Wed, Mar 19, 2008 at 11:03 AM, Caldarale, Charles R 
[EMAIL PROTECTED] wrote:


From: Scott Mueller [mailto:[EMAIL PROTECTED]
Subject: Running out of memory too easily in Tomcat 6.0.16

I have a very small and simple Spring + Hibernate application


Once you throw Spring and Hibernate into the mix, nothing is simple.


javax.servlet.ServletException: java.lang.OutOfMemoryError:
PermGen space


Somewhere, you're hanging onto references to objects or classes  
from the
prior deployments.  ThreadLocal usage is a typical way of doing  
this, as
are inappropriate references stored in a Session, but there's no  
limit

to programmer's inventiveness in creating memory leaks.

Read the FAQ:
http://wiki.apache.org/tomcat/FAQ/Memory

Especially this link from there:
http://opensource.atlassian.com/confluence/spring/pages/ 
viewpage.action?
pageId=2669http://opensource.atlassian.com/confluence/spring/ 
pages/viewpage.action?pageId=2669


 - 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]





-
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 is confused between sites

2008-03-18 Thread David Fisher

Both webapps use a resource or class that only allows a single use?

Do you install any jars in any place other than your webapps' WEB-INF/ 
lib?


Have you set up any logging? If log4j, where did you put it?

Regards,
Dave

On Mar 18, 2008, at 12:12 PM, sol42020 wrote:



Most people would think that, but the problem disappears when I  
modify the
server.xml file for Tomcat. When I comment out the tema server,  
tematest
works fine with no errors. Tomcat appears to be confused. The  
applications
work independently, but tema is the only one that works when  
server.xml has
both applications listed. Do you have any other ideas why this  
would happen?



Hassan Schroeder-2 wrote:



So it looks like you have an application error, not a Tomcat problem.
You should probably be asking the app's developers for help, then :-)




--
View this message in context: http://www.nabble.com/Tomcat-is- 
confused-between-sites-tp16121951p16126053.html

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]





-
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: about java.lang.outofmemory error

2008-03-17 Thread David Fisher
I don't know about BIRT (other than it is a project to generate Excel  
reports), but I do know that in Apache POI when you read and write an  
Excel spreadsheet everything is done in memory, and a large amount of  
memory needs to be available if your spreadsheet is large.


I add the following to my catalina.sh to increase memory:

-Xms384m -Xmx724m

I hope this helps, there are limits.

Regards,
Dave

On Mar 17, 2008, at 8:05 AM, hns wrote:



hi
i have developed one web application which contains eclipse birt 2.2
it runs sucessfuly from 2 months but now while data inceresse it cause
problem of showing
one report and gives error java.lang.outofmemory error
i have used tomcat 5.5.25
and jdk 1.5
i feel this is the problem of tomcat 5.5 memory allocation
could it solved any way
please help me
--
View this message in context: http://www.nabble.com/about- 
java.lang.outofmemory-error-tp16092575p16092575.html

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]





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