Order of context loading

2004-06-28 Thread Andreas Probst
Hi all,

I would like to define the order in which web-apps are loaded. The order in
which the contexts are defined in server.xml seems to be meaningless. Is
there a possibility to achive this? I got several web-apps, some depending
on the services of others, so that's why.

Regards,

Andreas

-- 
Sie haben neue Mails! - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info


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



Re: Order of context loading

2004-06-28 Thread Andreas Probst
Hi QM and all others,

I did search the archive. Among a lot of unrelated messages I 
found one about this. Unfortunately the statement therein is 
very vague, so I'm asking again. If it's been discussed so 
often, there should be something about this in the Tomcat 
documentation though.

Using a second Tomcat is no option in my environment. Can a 
special order be achieved somehow else?

Thank you,

Andreas


On 28 Jun 2004 at 7:02, QM wrote:

 On Mon, Jun 28, 2004 at 11:23:17AM +0200, Andreas Probst wrote:
 : I would like to define the order in which web-apps are loaded. The order in
 : which the contexts are defined in server.xml seems to be meaningless. Is
 : there a possibility to achive this? I got several web-apps, some depending
 : on the services of others, so that's why.
 
 This has been discussed before -- check the archives.
 
 One idea is to use a separate Tomcat engine for the apps that must be
 started first.
 
 -QM
 
 -- 


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



Tomcat does not accept new versions of jar or class files

2004-05-05 Thread Andreas Probst
Hi all,

I've got a strange problem: Tomcat 4 does not use the new class or jar files
I give it. Of course I restarted Tomcat, I even rebooted Windows. 

There is no way to make Tomcat use the new files. A colleage once had the
same problem. After he had deleted the old class file, Tomcat reported a
ClassNotFoundEx or so. Then he put the new class file - and guess what:
Tomcat used the old one again. The colleage actually solved the problem by
booting the Unix machine Tomcat ran on. Unfortunately even this does not
work in my case now.

Has anyone realized similar problems and does know what to do?
Does Tomcat have some kind of caching directory? Or could it be the JVM that
does some caching, in my case 1.4.2_02 from Sun?

Thanks in advance.

Andreas

-- 
Sie haben neue Mails! - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info


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



RE: Tomcat does not accept new versions of jar or class files

2004-05-05 Thread Andreas Probst
Hi,

thank you for your quick response. Now it works. The reason was: I really
got the wrong class file due to a chaining of unfortunate circumstances: the
build process did not run last night and I didn't realize it because my
wristwatch showed the yesterday date (because April's got only 30 days) :-(

Regards,

Andreas

 
 Hi,
 
 Has anyone realized similar problems and does know what to do?
 Does Tomcat have some kind of caching directory? Or could it be the JVM
 that
 does some caching, in my case 1.4.2_02 from Sun?
 
 Neither tomcat nor the JVM do any class caching that would survive a JVM
 restart, much less a system reboot.
 
 Are you sure you're putting the class in the right place?
 
 Yoav Shapira
 
 
 
 
 This e-mail, including any attachments, is a confidential business
 communication, and may contain information that is confidential,
proprietary
 and/or privileged.  This e-mail is intended only for the individual(s) to
whom
 it is addressed, and may not be saved, copied, printed, disclosed or used
by
 anyone else.  If you are not the(an) intended recipient, please
 immediately delete this e-mail from your computer system and notify the
sender. 
 Thank you.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

-- 
Sie haben neue Mails! - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info


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



Re:Reloading an application non-interactively

2003-01-13 Thread Andreas Probst
On 13 Jan 2003 at 17:35, Q. Werty wrote:

 Try this :
 http://admin:password@localhost/manager/reload?path=/myapp
 
 Be aware : username and password can be catched on the wire and
 in log files ...

It doesn't make a difference, whether the name and password are 
put into the URL or into the dialog box. The browser translates 
it into a proper HTTP authentication header. At least that's 
what I tested. And it makes sense that way.

The only difference: third persons could get to know the name 
and password watching over the shoulder  
O O
 |
---

Andreas


 
 
  All, I would like to reload an application non-
 interactively.  I do not
  want to use Ant to do this because it will not be installed 
 on my target
  system. Instead I'd rather use a URL.   That is, I would 
 like to be able
  to enter the username and password as parameters to the URL, 
 not in the
  login dialog.
  
  It should look something like:
  
  http://localhost/manager/reload?path=/myapp;?
 username=admin?password=
  passwd
  
  Does anyone know how to do this?  Or is there another way to 
 reload
  something non-interactively (and not using Ant)?
  
  Thanks.
  Mary
  


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




Re: WebDav Problems

2003-01-11 Thread Andreas Probst
Hi Zsolt,

it might be, that it's a client problem, i.e. Webfolders isn't 
working correctly. I had issues with Webfolders of Windows 98. 
The same installation of Slide (which does WebDAV) worked on 
Windows 2000 Webfolders. Unfortunately I can't tell you more 
about this, it's just a thought.

Andreas


On 11 Jan 2003 at 14:52, Zsolt Koppany wrote:

 Hi,
 
 I use tomcat-4.1.18 and have the following problems with webdav.
 The Windows Client (webdav folder) does not show the modification
 dates of the files neither over the list nor for properties (I'm
 not sure whether thats called properties because I use German
 Windows, but I mean selecting a file and right mouse and the last
 menu entry to get info about file such last modified size etc.).
 This happens with tomcat after downloading and installation, thus
 we have done NO modification on tomcat. How can I get the date
 listed?
 
 The second problem is that webdav does not work correctly (it
 gets problems with directory names) when I change its url
 mapping. We have to do that because we want to integrate webdav
 into our application. The problems occur with the original
 tomcat-4.1.18 after modifying the url mapping. Any ideas how to
 solve this problem?
 
 Zsolt
 
 Modified web.xml
 servlet-mapping
 servlet-namewebdav/servlet-name
 url-pattern/webdav/*/url-pattern
   /servlet-mapping
 
 Original web.xml:
 servlet-mapping
 servlet-namewebdav/servlet-name
 url-pattern//url-pattern
   /servlet-mapping
 -- 
 Zsolt
 


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




Re: WebDav Problems

2003-01-11 Thread Andreas Probst
Hi Zsolt,

I don't see the dates on Win2k either. So I really think it's a 
client problem. I have also a web interface. It shows the dates 
correctly. I've never realized this problem, because I seldom 
test with webfolders and the date was always far right (outside 
the window) so I didn't see the empty column. Excuse me for the 
irritation.

Andreas



On 11 Jan 2003 at 16:36, Zsolt Koppany wrote:

 I have the problem under Windows-98 and 2000.
 
 If I understand you correctly you don't have this problem with
 tomcat and slide and the client it W-2000. Is that correct?
 
 Zsolt
 
 On Sat, 2003-01-11 at 15:37, Andreas Probst wrote:
  Hi Zsolt,
  
  it might be, that it's a client problem, i.e. Webfolders isn't
  working correctly. I had issues with Webfolders of Windows 98.
  The same installation of Slide (which does WebDAV) worked on
  Windows 2000 Webfolders. Unfortunately I can't tell you more
  about this, it's just a thought.
  
  Andreas
  
  
  On 11 Jan 2003 at 14:52, Zsolt Koppany wrote:
  
   Hi,
   
   I use tomcat-4.1.18 and have the following problems with
   webdav. The Windows Client (webdav folder) does not show the
   modification dates of the files neither over the list nor for
   properties (I'm not sure whether thats called properties
   because I use German Windows, but I mean selecting a file and
   right mouse and the last menu entry to get info about file
   such last modified size etc.). This happens with tomcat after
   downloading and installation, thus we have done NO
   modification on tomcat. How can I get the date listed?
   
   The second problem is that webdav does not work correctly (it
   gets problems with directory names) when I change its url
   mapping. We have to do that because we want to integrate
   webdav into our application. The problems occur with the
   original tomcat-4.1.18 after modifying the url mapping. Any
   ideas how to solve this problem?
   
   Zsolt
   
   Modified web.xml
   servlet-mapping
   servlet-namewebdav/servlet-name
   url-pattern/webdav/*/url-pattern
 /servlet-mapping
   
   Original web.xml:
   servlet-mapping
   servlet-namewebdav/servlet-name
   url-pattern//url-pattern
 /servlet-mapping
   -- 
   Zsolt
   
  


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




Re: Applet class not found error

2003-01-10 Thread Andreas Probst
Hi Santosh,

Tomcat won't serve the class files to the client, as it never 
serves files below WEB-INF.
Put your class files somewhere else, but not under WEB-INF. Then 
it will work.

Andreas



On 10 Jan 2003 at 2:04, Santosh Kulkarni wrote:

 I'm getting the error load: class DrawChart not
 found when running my applet over the network. But it
 is perfectly loaded and running when I access it from
 my localhost. I have my jsp under
 webapps/examples/applets/test.jsp which has the
 following applet code.
 applet code=DrawChart.class
 codebase=../WEB-INF/classes/ width=500
 height=100
 My DrawChart.java is under
 webapps/examples/WEB-INF/classes. Is there anything
 wrong in my codebase. Even without the codebase, the
 applet runs fine on localhost but not from the
 network. The same is the case even after giving
 codebase. I'm not using any other class in the
 DrawChart.java. Its a simple applet.
 Please provide a solution.
 
 TIA
 Santosh
 
 
 


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




Re: Applet class not found error

2003-01-10 Thread Andreas Probst
Hi Santosh,

true, but it must not be under WEB-INF.

Andreas


On 10 Jan 2003 at 5:27, Santosh Kulkarni wrote:

 Hi Andreas,
 It worked when I put the class file under
 webapps/examples/applets folder where my jsp was
 located. By default it picks up from the current
 folder and if we put it in some other folder, we need
 to specify the codebase attribute too for the applet
 tag.
 
 Thanks
 Santosh 
 
 --- Andreas Probst [EMAIL PROTECTED] wrote:
  Hi Santosh,
  
  Tomcat won't serve the class files to the client, as
  it never 
  serves files below WEB-INF.
  Put your class files somewhere else, but not under
  WEB-INF. Then 
  it will work.
  
  Andreas
  
  
  
  On 10 Jan 2003 at 2:04, Santosh Kulkarni wrote:
  
   I'm getting the error load: class DrawChart not
   found when running my applet over the network.
  But it
   is perfectly loaded and running when I access it
  from
   my localhost. I have my jsp under
   webapps/examples/applets/test.jsp which has the
   following applet code.
   applet code=DrawChart.class
   codebase=../WEB-INF/classes/ width=500
   height=100
   My DrawChart.java is under
   webapps/examples/WEB-INF/classes. Is there
  anything
   wrong in my codebase. Even without the codebase,
  the
   applet runs fine on localhost but not from the
   network. The same is the case even after giving
   codebase. I'm not using any other class in the
   DrawChart.java. Its a simple applet.
   Please provide a solution.
   
   TIA
   Santosh
   
   
   


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




Re: more on source code control (like CVS)

2003-01-10 Thread Andreas Probst
On 10 Jan 2003 at 14:50, David Boyer wrote:

 Does anyone know of a JSP- or Servlet-based application that'll
 allow browsing of a CVS repository? If I host a CVS server
 locally for our developers, I'd like to use our existing platform
 (Tomcat) to allow browsing (kind of like a JSP/Servlet-based
 version of ViewCVS).

Did you try jCVS?
http://www.jcvs.org/

Andreas


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




Re: Question about Tomcat 4.1.12 WebDAV application

2003-01-08 Thread Andreas Probst
Hi Jim,

it might be that Windows cached your credentials. You could try 
Slide client (jakarta sub project Slide), which requires to type 
in the credentials everytime you start it.
You won't need to start the Slide server or the included Tomcat, 
just the client at pathTo\jakarta-slide-
1.0.16\client\bin\run.bat. (It might be necessary to start 
run.bat by typing bin\run in the client directory.)

Andreas


On 8 Jan 2003 at 10:34, Jim Coble wrote:

 Version: Tomcat 4.1.12 on Solaris 8
 
 I'm trying to configure the WebDAV application included in the
 Tomcat 4.1.12 distribution so that it requires a login to add or
 remove files but not to view them.
 
 If I use the web.xml security-constraint contained in the
 distribution --
 
   security-constraint
 web-resource-collection
   web-resource-nameThe Entire Web
   Application/web-resource-name
   url-pattern/*/url-pattern
 /web-resource-collection
 auth-constraint
   role-nametomcat/role-name
 /auth-constraint
   /security-constraint
 
 -- then all attempts to access the content, including a simple
 browser request for http://localhost:8080/webdav/ require a
 login.
 
 I thought I could password protect only adding and removing files
 by adding http-method for PUT and DELETE as shown below --
 
   security-constraint
 web-resource-collection
   web-resource-nameThe Entire Web
   Application/web-resource-name
   url-pattern/*/url-pattern
   http-methodDELETE/http-method
   http-methodPUT/http-method
 /web-resource-collection
 auth-constraint
   role-nametomcat/role-name
 /auth-constraint
   /security-constraint
 
   -- but, if I do that, I seem to be able to add and remove files
   using my
 WebDAV client (Web Folders on Windows XP) without authenticating.
 
 I can't help but think that I'm missing something obvious.  Can
 anyone help?
 
 Thanks in advance.
 --Jim
 
 ==
 Jim Coble
 Senior Technology Specialist
 Center for Instructional Technology
 Email: [EMAIL PROTECTED]
 Voice: 919-660-5974  Fax: 919-660-5923
 Box 90198, Duke University
 Durham, NC 27708-0198
 ==
 
 
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED] For
 additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 



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




Re: Reading Property files...related to servlets

2003-01-06 Thread Andreas Probst
Hi Sumit,

you could read the properties file yourself as InputStream,
create a temp file from this and pass this temp file or the real
path to the temp file to the other app. It shouldn't be bad for
performance, if only done once. But you can't write to it any
more, because it's temp.

Andreas


On 6 Jan 2003 at 8:35, Shrotriya, Sumit wrote:

 Hi All,
   My application is a servlet and it uses another application
   that tries to
 read a property file.
 Now the problem is that this application was never designed to
 work along with a servlet and does not read its property file
 using a method like
   getServletContext().getResourceAsStream(/foo.html);
  Now the question that I have for you bright folks out there is
  how am I
 supposed to go about
 feeding this application its property file:)

 Thanks,
 -Sumit

 -Original Message-
 From: Shapira, Yoav [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 06, 2003 9:07 AM
 To: Tomcat Users List
 Subject: RE: Relative paths in servlets?


 Hi,
 Did you try getServletContext().getResourceAsStream(/foo.html);
 ?

 Yoav Shapira
 Millennium ChemInformatics


 -Original Message-
 From: Øyvind Hvamstad [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 06, 2003 8:36 AM
 To: [EMAIL PROTECTED]
 Subject: Relative paths in servlets?
 
 Hi, could anyone tell me how to access files using relative
 paths from a servlet? Say, if servlet is mapped to /bar and the
 file foo.html is in the webapps top dir. How do I access the
 foo.html file from the servlet. I tried ../foo.html, /foo.html
 and even getServletContext().getRealPath(/bar)+/../foo.html
 but none works.
 
 Any pointers?
 --
 Øyvind Hvamstad
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]
 For additional commands, e-mail: mailto:tomcat-user-
 [EMAIL PROTECTED]


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

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




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




RE: Memory Usage and Garbage Collection

2003-01-03 Thread Andreas Probst
Hi Craig,

please see intermixed.

On 2 Jan 2003 at 18:18, Craig R. McClanahan wrote:

 
 Instances can be garbage collected IF AND ONLY IF there are no
 live references to that object in a static/instance/local
 variable of some other object that is also in memory.  Only
 instances that are no longer referenced from other object
 instances can be recycled.

Please consider the following service() or doGet() or so of a 
servlet:

public void service(ServletRequest request, ServletResponse 
response)
   throws IOException
{
  OtherObject otherObject = new OtherObject();
  otherObject.doThisAndThat(request, response);
}

Do I have to place the following
otherObject = null;
before the end of service(). Doesn't otherObject be gc-ed 
otherwise? I've never done this.

What about the object instances, which 
otherObject.doThisAndThat() creates? So far I've thought there 
are no live references if otherObject gets gc-ed.

 
 In the case at hand, Tomcat (obviously) has references to all the
 servlets that it has loaded.  Therefore, those servlet instances
 cannot be garbage collected.  Furthermore, any object that is
 referenced by static or instance variables of your servlet class
 can *also* not be garbage collected, because live references
 still exist.  Same thing for session attributes.

OK, this is obvious.

Andreas

deleted the latter parts...




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




RE: Memory Usage and Garbage Collection

2003-01-03 Thread Andreas Probst
Hi thank you,

your reply calms me down again. I guess I got a bit confused by 
the preceding discussion.

Andreas

On 3 Jan 2003 at 8:59, Shapira, Yoav wrote:

 Hi,
 There's clearly some misconceptions on the topic of garbage
 collection ;)  These questions come up very often it seems, on
 this list and others.
 
 Please consider the following service() or doGet() or so of a
 servlet:
 
 public void service(ServletRequest request, ServletResponse
 response)
throws IOException
 {
   OtherObject otherObject = new OtherObject();
   otherObject.doThisAndThat(request, response);
 }
 
 Do I have to place the following
 otherObject = null;
 before the end of service(). Doesn't otherObject be gc-ed
 otherwise? I've never done this.
 
 You don't have to do this.  The otherObject's reference count is
 increase by one when you assign it.  When the method (service()
 above) returns, the reference count for otherObject is reduced by
 one.  If the reference count is zero, otherObject can be garbage
 collected.
 
 What about the object instances, which
 otherObject.doThisAndThat() creates? So far I've thought there
 are no live references if otherObject gets gc-ed.
 
 If otherObject creates local objects, they'll be GCed.  If it
 modifies static objects, those objects stay in a different place
 anyways and don't get GCed when otherObject does.
 
 Back to what Craig mentioned earlier: earlier in the Java life
 time, classes could get GCed themselves.  That really earns you
 very little, so it was removed.  Nowadays demands on classloaders
 and their hierarchies can get very complicated, so re-introducing
 class GC would be difficult anyways.   
 
 A JSP is compiled into a servlet and then loaded into memory. 
 Its bytecode is present only once, and takes up relatively little
 space (usually).  You won't gain much from destroying that
 bytecode and de-allocating its memory.  Same thing for normal
 servlets obviouisly.
 
 What you need to do is tune your garbage collection.  With some
 exceptions, full GCs shouldn't run all the time.  Depending on
 your collector, partial GCs can run all the time.  You'd expect
 that from incremental and concurrent collectors.  If you're
 running on multiple CPUs and have a parallel collector but only
 one System.out log, you'd expect to see GC output there nearly
 all the time.
 
 So you should start playing with your heap (-Xmx), new generation
 size and ration (XX:NewSize, XX:MaxNewSize, XX:NewRatio),
 collector policy (-Xincgc, -Xconcgc, XX:UseParNewGC, etc.) and
 other parameters to see which gives you the best behavior.  Don't
 -Xmx over the physical RAM size.  See the VM options page at:
 http://java.sun.com/docs/hotspot/VMOptions.html
 
 One principle to keep in mind is that memory is cheap, or at
 least considered cheap when it comes to GC performance tuning. 
 The java heap is greedy overall, and this is intended to
 increaser performance. That's why it won't de-allocate space (and
 never return space to the OS) until necessary with the default
 mark/sweep collector.
 
 Make sure to record your verbose:gc output between runs so that
 you can compare behavior.  This is not typically easy to tell by
 instinctive feel. 
 
 Yoav Shapira
 Millennium ChemInformatics
 



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




RE: Memory Usage and Garbage Collection

2003-01-03 Thread Andreas Probst
Hi Craig,

thank you very much for this complete explanation. That's 
perfectly understandable and the GC-behaviour which I had 
expected before. I must have understood something wrong in this 
thread's discussion, which went on yesterday.

Again, thank you very much for your helpful responses (not only 
this one).

Andreas

On 3 Jan 2003 at 11:31, Craig R. McClanahan wrote:

 
 
 On Fri, 3 Jan 2003, Andreas Probst wrote:
 
  Hi Craig,
 
  please see intermixed.
 
  On 2 Jan 2003 at 18:18, Craig R. McClanahan wrote:
 
  
   Instances can be garbage collected IF AND ONLY IF there are
   no live references to that object in a static/instance/local
   variable of some other object that is also in memory.  Only
   instances that are no longer referenced from other object
   instances can be recycled.
 
  Please consider the following service() or doGet() or so of a
  servlet:
 
  public void service(ServletRequest request, ServletResponse
  response)
 throws IOException
  {
OtherObject otherObject = new OtherObject();
otherObject.doThisAndThat(request, response);
  }
 
  Do I have to place the following
  otherObject = null;
  before the end of service(). Doesn't otherObject be gc-ed
  otherwise? I've never done this.
 
 The otherObject reference goes away as soon as the service()
 method returns, so you don't have to actually release it
 yourself.  HOWEVER, you also need to understand what the
 constructor of this class did, and what the doThisAndThat()
 method did -- it's still possible for that class to cause memory
 leaks which you don't know anything about, or possibly can't do
 anything about.
 
 
  What about the object instances, which
  otherObject.doThisAndThat() creates? So far I've thought there
  are no live references if otherObject gets gc-ed.
 
 
 Let's look at a simple case and a complex case:
 
 SIMPLE CASE:  OtherObject has a single instance variable that is
 initialized to a String:
 
   public class OtherObject {
 private String id;
 public OtherObject(String id) {
   this.id = id;
 }
 public String getId() {
   return (this.id);
 }
   }
 
 In this case, the only reference to the String pointed at by id
 is in this instance of OtherObject.  Therefore, when you release
 your reference to the OtherObject instance and the id string that
 was passed in (because the service() method ended), both the
 OtherObject instance and the foo String instance are available
 for GC.
 
 COMPLEX CASE:  OtherObject is a little trickier in its
 initialization -- it provides a factory pattern method that
 creates at most one instance of OtherObject for a particular
 identifier string.  (This is a *very* common design pattern -- in
 fact, Tomcat implements something sort of like this to ensure
 that there is at most one instance of each servlet class.)
 
   public class OtherObject {
 
 // Private constructor -- use the factory method instead
 private OtherObject(String id) {
   this.id = id;
 }
 
 // Private instance variable -- one per instance
 private String id;
 
 // Public getter for the id property
 public String getId() {
   return (this.id);
 }
 
 // Static cache of previously created instances
 private static HashMap cache = new HashMap();
 
 // Factory method for creating OtherObject instances that //
 guarantees to create only one for a particular id string
 public static OtherObject getOtherObject(String id) {
   synchronized (cache) {
 OtherObject instance = (OtherObject) cache.get(id);
 if (instance == null) {
   instance = new OtherObject(id);
   cache.put(id, instance);
 }
 return (instance);
   }
 }
 
   }
 
 To use the factory method, you'd say something like this:
 
 OtherObject otherObject =
 OtherObject.getOtherObject(idstring);
 
 instead of:
 
 OtherObject otherObject = new OtherObject(idstring);
 
 and, no matter how many times you call this with the same
 parameter value, you'd get the same instance back (basically a
 singleton pattern with lazy instantiation).
 
 Now, your otherObject reference still goes away at the end of
 the service() method, right?
 
 Yep.
 
 So the instance, and it's string, can still be GC'd, right?
 
 Nope.
 
 There is still a live reference to each OtherObject instance
 sitting in the static HashMap cache.  Therefore, this instance
 cannot be GC'd, even though *you* have released your own
 reference to it.  And, if the OtherObject class is loaded from
 Tomcat's common/lib directory (for example), there is no way to
 ***ever*** GC this instance, because the public API of the
 OtherObject class doesn't offer any way to clear the cache.
 
 Note also that there is nothing that your servlet can do about
 this -- you can't even know if its happening without consulting
 the documentation and/or the source code for the classes you are
 calling.  But the code above will cause a slowly increasing

Re: servlet path

2003-01-03 Thread Andreas Probst
Hi Vladimer,

look for servlet mapping in the archive and/or in the servlet 
spec.

In web.xml you can put a servlet mapping like

servlet-mapping
   servlet-namewebdav/servlet-name
   url-pattern//url-pattern
/servlet-mapping  

which routs every request to the servlet, which's name is 
webdav.

You might want a mapping like the next one, but I'm not sure, as 
I've never done this before.

servlet-mapping
   servlet-name/servlet-name
   url-pattern//url-pattern
/servlet-mapping  

Andreas



On 3 Jan 2003 at 15:06, Vladimer Shioshvili wrote:

 
 
 
 for some reason i remember seeing somewhere that i can painlessly
 change how servlets are accessed. by this i mean removing
 /servlet for URI path and using xx.com/ instead of
 xx.com/servlet/.
 
 any help appreciated,
 Vlad
 
 
 
 Vladimer Shioshvili
 
 QRC Division of Macro International Inc.
 7315 Wisconsin Avenue, Suite 400W
 Bethesda, MD 20814
 
 Phone: (301) 657 3077 ext. 155 
 
 


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




Re: Two instances of servlet gets created

2003-01-02 Thread Andreas Probst
Hi,

do you call your servlet by the pattern defined in web.xml or by 
the full path with invoker servlet? 

I once read, that using the invoker servlet means creating a new 
instance of your servlet. Maybe that's what causes the second 
init().

Hope this helps

Andreas


On 2 Jan 2003 at 17:22, Mohit Garg wrote:

 I have startup servlet for which one instance is created as soon
 as my tomcat starts. But on the first request to the servlet
 there is another instance created. i.e Another time init() is
 called for the servlet.
 
 


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




Re: Binary Distribution of Tomcat

2003-01-01 Thread Andreas Probst
Hi,

if you're looking for 4.0.6, go to 
http://jakarta.apache.org/builds/jakarta-tomcat-
4.0/release/v4.0.6/bin/

Andreas


On 1 Jan 2003 at 9:36, Ankit Patel wrote:

 Where can I find a binary distribution of Tomcat 4.0. 
 The file jakarta-tomcat-4.0-MMDD.zip is not listed
 in the following url
 http://jakarta.apache.org/builds/jakarta-tomcat-4.0/nightly/
 
 
 Thanks
 AP
 


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




RE: How to start a standalone app from a servlet and problems with reading properties file

2002-12-20 Thread Andreas Probst
On 19 Dec 2002 at 11:14, aps olute wrote:

 
The problem is someone else had written the support class. The
support class
 will only take (File f) as its argument in its constructor. The

You could read your properties, put it into a temp file, which 
you are guaranteed to be able to create, and pass the temp file.

See this very recent message

From: Bill Barker [EMAIL PROTECTED]
Subject: Re: How do load a properties file from servlet?
Date: Thu, 19 Dec 2002 21:27:00 -0800

 support classes are written by separate developers. I can make
 changes to the portion I am responsible for but cant do much with
 the other part.  Anyhow, the support class is having a fit not
 finding this file to read. My servlet sits at
 mycontext/WEB-INF/classes/  and the support class sits at
 mycontext/WEB-INF/classes/util/  so the relative path to that
 support class is then mycontext/WEB-INF/classes/util/ and this is
 where I would put the file it needs?
 
 --- Tim Moore [EMAIL PROTECTED] wrote:
  Well when you call getResourceAsStream, the path is resolved
  relative to the package the class is in, so if the servlet and
  the support class are in different packages, this would be
  expected.
  
  What if you call it on the servlet class from the support
  class?
  
  e.g.,
  
  InputStream is =
  WhateverTheServletIsCalled.class.getResourceAsStream(
  parmPassedFromServlet )
  
  or even better, instead of passing the file name from the
  servlet to the support class, why not have the servlet just
  load the properties and pass the properties object to the
  support class?
  
  -- 
  Tim Moore / Blackboard Inc. / Software Engineer
  1899 L Street, NW / 5th Floor / Washington, DC 20036
  Phone 202-463-4860 ext. 258 / Fax 202-463-4863
  
  
   -Original Message-
   From: aps olute [mailto:[EMAIL PROTECTED]] 
   Sent: Thursday, December 19, 2002 1:45 PM
   To: Tomcat Users List
   Subject: Re: How to start a standalone app from a servlet and
   problems with reading properties file
   
   
   
Tim,
   Thanks for responding. Partial success was I was able to 
   read the properties file using code snippet below in the
   servlet init() method:
   
 Properties p = new Properties();
 InputStream is =
 getClass().getResourceAsStream(configFileName);
   //configFileName is test.properties
 p.load(is)
   
   This property file is loaded and parsed for a property needed
   by a support class. The parameter read is passed to the
   support class. When doing exact same InputStream is =
   getClass().getResourceAsStream(parmPassedFromservlet); in the
   support class, Tomcat does not start. I posted this earlier
   last week on:
   http://marc.theaimsgroup.com/?l=tomcat-userm=103982860916736
   
  w=2
  
  Basically, I am facing two issues, 1) dependent on where I
  start Tomcat from and  2) Using getResourceAsStream() fails in
  the support class. Any tips would be appreciated. Thanks.
  
  __
  Do you Yahoo!?
  Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
  http://mailplus.yahoo.com
  
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
  
  --
  To unsubscribe, e-mail:  
  mailto:[EMAIL PROTECTED] For
  additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED] For
 additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 



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




Re: How to start a standalone app from a servlet and pro

2002-12-20 Thread Andreas Probst
Hi,

excuse me, you're right in one aspect. I realized it later that 
I didn't read the whole question. I just thought: OH AGAIN. But
this doesn't make the answer wrong.

If you're in a servlet, no matter where, you can get the 
ServletContext by getServletContext(). From it you can have for
instance getResourceAsStream(/WEB-INF/file.properties). If 
this doesn't work you might have done something wrong, maybe 
with the slashes or so?

If you're not in a servlet, make sure you pass a ServletContext
from a servlet to where you want to have it.

FileIO can be used, but it's not compatible with the spec. The
servlet spec says you are not guarantied to have FileIO other
than the temp directory and temp files. But also this has been
said many times.

However, if you know there is a file system, you can use normal
File IO. What you need is the right path. You could pass it as 
an init param in web.xml. From the servlet's init() you can get 
the param with getInitParameter(nameOfParam).

What do you mean by starting a standalone application? 


Andreas



On 19 Dec 2002 at 9:43, aps olute wrote:

   May I kindly suggest you read the whole posting before
   suggesting your
 solution.  You have not taken the time to read through it and
 making suggestions without reading the problem.  I did mention
 I tried getResourceAsStream() and had partial success.  The
 issue here is doing it from init() versus doGet() and btw why
 dont you address the question of WHY cant the FILE IO be used?
 what is the underlying reason. 
 
 TIA
 
 --- Andreas Probst [EMAIL PROTECTED] wrote:
  Hi,
  
  this question has been answered many times. Look for
  properties files in the archive.
  
  Hint: Use servletContext.getResourceAsStream();
  
  
  On 19 Dec 2002 at 9:20, aps olute wrote:
  
   
   
Greetings,
  I have been trying to do the following using Tomcat
  4.1.12:
   
   1)  Attempt to have a servlet read a properties or any text
   file.
Reading the file from the doGet() method by:
   
   BufferedReader br = null; 
   br = new BufferedReader(new FileReader(file));  //file is
   test.properties
   
   Result: Varying success, because I dont quite comprehend
   the Tomcat startup directory.  Discovered that there is
   dependency on from where Tomcat was started. For example,
   if started Tomcat by ./bin/starup.sh from tomcat_home/bin/,
   I must have the file the servlet reads located at
   tomcat_cat/bin/.  If I started Tomcat from
   tomcat_home/webapps/  by  ../bin/startup.sh, I must have
   the properties file located at tomcat_home/webapps/ or else
   the servlet will not find this.
   
   2)  Atempt to have a servlet read a properties or any text
   file. Reading the file from the init() method by:
   
   BufferedReader br = null; 
   br = new BufferedReader(new FileReader(file));
   
   Result: Starting Tomcat from tomcat_home/bin/ by
   ./bin/startup.sh, failure to get Tomcat even to start, the
   log shows it only goes as far as Apache Tomcat/4.1.12 and
   stops. Starting Tomcat from tomcat_home/webapps/ by
   ../bin/startup.sh Tomcat starts, some other context are
   running, but the servlet reading this properties file on
   this specific context fails to find the properties file. 
   Is using File IO bad in the init() method? I want to do
   this to initialize a standalone application.
   
   I surmized I cant read a properties file from init() method
   using File class. I did try as one suggested about using
   getResourceAsStream() with partial success.
   
   3) Can a stand alone application be started at all from a
   servlet?  I cant seem to get this to work, either from the
   init() or doGet() method. I can not launch an application
   why from a servlet, why?
   
   Any help on #3 please?
   
  


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




Re: How to start a standalone app from a servlet and problems with reading properties file

2002-12-19 Thread Andreas Probst
Hi,

this question has been answered many times. Look for properties 
files in the archive.

Hint: Use servletContext.getResourceAsStream();


On 19 Dec 2002 at 9:20, aps olute wrote:

 
 
  Greetings,
I have been trying to do the following using Tomcat
4.1.12:
 
 1)  Attempt to have a servlet read a properties or any text file.
  Reading the file from the doGet() method by:
 
 BufferedReader br = null; 
 br = new BufferedReader(new FileReader(file));  //file is
 test.properties
 
 Result: Varying success, because I dont quite comprehend the
 Tomcat startup directory.  Discovered that there is dependency
 on from where Tomcat was started. For example, if started Tomcat
 by ./bin/starup.sh from tomcat_home/bin/, I must have the file
 the servlet reads located at tomcat_cat/bin/.  If I started
 Tomcat from tomcat_home/webapps/  by  ../bin/startup.sh, I must
 have the properties file located at tomcat_home/webapps/ or else
 the servlet will not find this.
 
 2)  Atempt to have a servlet read a properties or any text file. 
 Reading the file from the init() method by:
 
 BufferedReader br = null; 
 br = new BufferedReader(new FileReader(file));
 
 Result: Starting Tomcat from tomcat_home/bin/ by
 ./bin/startup.sh, failure to get Tomcat even to start, the log
 shows it only goes as far as Apache Tomcat/4.1.12 and stops. 
 Starting Tomcat from tomcat_home/webapps/ by ../bin/startup.sh
 Tomcat starts, some other context are running, but the servlet
 reading this properties file on this specific context fails to
 find the properties file.  Is using File IO bad in the init()
 method? I want to do this to initialize a standalone application.
 
 I surmized I cant read a properties file from init() method using
 File class. I did try as one suggested about using
 getResourceAsStream() with partial success.
 
 3) Can a stand alone application be started at all from a
 servlet?  I cant seem to get this to work, either from the init()
 or doGet() method. I can not launch an application why from a
 servlet, why?
 
 Any help on #3 please?
 


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




Re: Weird messages

2002-12-12 Thread Andreas Probst
Hi Zsolt,

I personally find it best to read the response on top and to be 
able to afterwards read the full request if necessary. So I 
don't need to search it between the hundreds of messages that 
come during a day. As bandwiths doesn't matter today, the 
increased size shouldn't be a problem.

Concerning the format I would prefer not to have these messages 
with whole paragraphs in one line, but that's my opinion.

Regards.

Andreas


On 12 Dec 2002 at 14:28, Zsolt Antal wrote:

 Hi,
 
  I'm lurking here about two weeks and I would have a few
  questions about
 the weird messages in this list:
 
 Is the following normal, accepted or simply `we must live with
 it'?
 
 - html post
 - top post (ie.: reply _above_ the quoted message)
 - big sigblocks (over 4-5 lines)
 - original post/question as a reply to a message in an
 absolutelly unrelated thread
 
  Or there is no chance to explain this to the users of this list
  why all
 of the above is bad habit/technique?
 
 (I'm not wondering when I look at the headers from the weird
 posts, especially at the `X-Mailer' field.)
 
 Sorry for my english!
 
  -zsolt
 


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




Re: learning filters

2002-12-11 Thread Andreas Probst
Hi Erik,

now you have already been told, where to look in the first 
place.

I found Hunter's explanation of ServletResponseWrappers etc. not 
so easy to understand. If you have questions with this, I 
recommend the following message:

From: Andreas Probst [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Subject: Re: Is there any way to read the response headers in a 
filter in Tomcat 4.0.3 ?
Date: Mon, 21 Oct 2002 12:43:27 +0200

(I forward this to you.)

Regards.
Andreas



On 11 Dec 2002 at 12:06, Price, Erik wrote:

 I have been learning about servlet programming from Core
 Servlets.  I like this book.  But, since subscribing to this
 list, I have seen mention of filters.  In a message from Yoav
 Shapira I was recommended to use filters to validate form data
 before passing it to a servlet.  This seems to me a cleaner means
 of doing it, as opposed to putting form-validation code in the
 servlet.  However, Core Servlets does not describe how to use
 filters (that I know of).  Is there a reference for this
 technique somewhere, or is it a generic term for a servlet that
 intercepts, acts upon, and passes along data ?  If it is the
 latter then I can figure it out from using
 getDispatcher().forward() etc but if it is a specific technique
 then where can I learn more?
 
 My Tomcat container is v. 4.0.6.
 
 
 Erik
 



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




Re: bypassing memory realms

2002-12-06 Thread Andreas Probst
Hi Mike,

try http://name:pass@www.

How do you know the password?

Andreas

On 6 Dec 2002 at 8:33, J Doe wrote:

 
 Background: Consider two webapps: foo and bar.  When a
 user of foo performs a certain action, foo shares
 files with bar by calling actions on each other via
 HTTP.
 
 We are being asked to put a memory realm on foo and
 bar so that users must login. The problem is that now
 the above system-level communication between foo and
 bar will break.
 
 Question: if one knows the username and password for a
 webapp, can it be placed on the URL?
 
 E.g.
 http://mydomain.com:8080/foo?username=xpassword=y
 
 I've tried this but no luck.
 
 More generally, is there a way to do it with the
 java.net URL class?  
 
 Any ideas?  I realize that perhaps foo and bar could
 communicate in a different way (RMI, JMS) but that is
 not really an option for us.
 
 thanks,
 Mike
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED] For
 additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 



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




Re: bypassing memory realms

2002-12-06 Thread Andreas Probst
I think this is a browser-intern thing. A person looking over 
your shoulder could read it. But IE will translate this into a 
just normal request. There's no difference to a request where IE 
had asked for credentials. From within your servlet you will not 
even be able to realize it.

On 6 Dec 2002 at 19:04, Andreas Probst wrote:

 Hi Mike,
 
 try http://name:pass@www.
 
 How do you know the password?
 
 Andreas
 
 On 6 Dec 2002 at 8:33, J Doe wrote:
 
  
  Background: Consider two webapps: foo and bar.  When a
  user of foo performs a certain action, foo shares
  files with bar by calling actions on each other via
  HTTP.
  
  We are being asked to put a memory realm on foo and
  bar so that users must login. The problem is that now
  the above system-level communication between foo and
  bar will break.
  
  Question: if one knows the username and password for a
  webapp, can it be placed on the URL?
  
  E.g.
  http://mydomain.com:8080/foo?username=xpassword=y
  
  I've tried this but no luck.
  
  More generally, is there a way to do it with the
  java.net URL class?  
  
  Any ideas?  I realize that perhaps foo and bar could
  communicate in a different way (RMI, JMS) but that is
  not really an option for us.
  
  thanks,
  Mike
  
  __
  Do you Yahoo!?
  Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
  http://mailplus.yahoo.com
  
  --
  To unsubscribe, e-mail:  
  mailto:[EMAIL PROTECTED] For
  additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
 
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED] For
 additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 



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




RE: Retrieving username and password from url??

2002-12-02 Thread Andreas Probst
Hi Reynir,

how can you get the Authentication header? As far as I know the
only information you can get is the Principal and the username,
but not the password, neither clear nor encoded.

Andreas


On 2 Dec 2002 at 9:14, Reynir Hübner wrote:

 Hi,

 Depending on the browser and authentication scheme this will may
 try to authenticate against tomcat. There for you should be able
 to do request.getRemoteUser() on (at least) the first request
 that has the authenticative username:password.
 request.getRemoteUser() only returns the username, you can get
 the Authentication header wich is formed like this in BASIC
 authentication scheme: String user_Password = login+ :+
 password; String encoding  = new String
 (Base64.encode(user_Password.getBytes())); String Authentication
 = Basic  + encoding;

 You might be able to do that backwards somehow

 Hope it helps
 -reynir


  -Original Message-
  From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]]
  Sent: 2. desember 2002 08:30
  To: [EMAIL PROTECTED]
  Cc: Sunu Joseph
  Subject: Retrieving username and password from url??
 
 
  Hi,
  Is there a way that I can retrieve the username and password
  from the url given as below using a servlet.
  https://username:password@hostname/servletname /servlet
 
 
 
  Regards,
  Abhishek
 
 
 
 
 


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




Re: Tomcat 4.0.3 getResourceAsStream

2002-12-02 Thread Andreas Probst
Hi Esteban,

try

p.getClass().getResourceAsStream(/WEB-INF/icard.properties);
(inside WEB-INF)
or
p.getClass().getResourceAsStream(/WEB-
INF/classes/icard.properties);
(inside classes)
or
p.getClass().getResourceAsStream(/WEB-
INF/lib/icard.properties);
(inside lib)

If this doesn't work, try
getServletContext().getResourceAsStream(...)
This one will work.

Good luck.

Andreas

On 2 Dec 2002 at 12:33, Esteban González wrote:

 Hi!
 I´ve just moved an old app that we had running using Jserv to
 tomcat4.0.3

 But i have problems with this
 p = new Properties();
 InputStream is =
 p.getClass().getResourceAsStream(/icard.properties);
 I keep getting null no matter where i put the icard.properties
 file.

 i´ve placed icard.properties inside WEB-INF/lib and
 WEB-INF/classes and it´s also on the classpath...

 any workarounds to this issue?...  I´m trying not to use the
 java.io.* approach...

 --
 Esteban González

 Departamento de Sistemas
 ASSIST-CARD International


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




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




Re: Tomcat 4.0.3 getResourceAsStream

2002-12-02 Thread Andreas Probst
Hi Esteban

I think if WEB-INF/classes works, any other directory there will
work too.

Andreas

On 2 Dec 2002 at 12:59, Esteban González wrote:

 Thanks for your help andreas.

 It didn´t work with p.getClass..

 i´m trying with getServletContext().

 But my idea is to have WEB-INF/conf   to place all .properties
 files.

 is that possible?...

 Best regards,
 Esteban

 - Original Message -
 From: Andreas Probst [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Sent: Monday, December 02, 2002 12:57 PM
 Subject: Re: Tomcat 4.0.3  getResourceAsStream


 Hi Esteban,

 try

 p.getClass().getResourceAsStream(/WEB-INF/icard.properties);
 (inside WEB-INF) or p.getClass().getResourceAsStream(/WEB-
 INF/classes/icard.properties); (inside classes) or
 p.getClass().getResourceAsStream(/WEB-
 INF/lib/icard.properties); (inside lib)

 If this doesn't work, try
 getServletContext().getResourceAsStream(...)
 This one will work.

 Good luck.

 Andreas

 On 2 Dec 2002 at 12:33, Esteban González wrote:

  Hi!
  I´ve just moved an old app that we had running using Jserv to
  tomcat4.0.3
 
  But i have problems with this
  p = new Properties();
  InputStream is =
  p.getClass().getResourceAsStream(/icard.properties);
  I keep getting null no matter where i put the icard.properties
  file.
 
  i´ve placed icard.properties inside WEB-INF/lib and
  WEB-INF/classes and it´s also on the classpath...
 
  any workarounds to this issue?...  I´m trying not to use the
  java.io.* approach...
 
  --
  Esteban González
 
  Departamento de Sistemas
  ASSIST-CARD International
 
 


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




Re: tomcat 4 and javax.sevlet.*

2002-11-29 Thread Andreas Probst
On 28 Nov 2002 at 17:11, David Brown wrote:

 Tushar Kulkarni writes: 
 
  Hi,
  I have installed Tomcat4.1. I want to change the directory
  webapps\examples\JSP to say C:\myExamples. So that I can store
  my jsp files in to the myexamples directory and access it
  through the browser with the address ,
  http://localhost:8080/myexamples instead
  http://localhost:8080/examples. Please tell me how to I
  accomplish this task. Thanks 
  
   
 
 
 Hello Tushar, no need to change directories and should not be
 necessary if u create ur application context: /myexamples the
 same way /examples was created. ur installed tc came w the
 application context: /examples ready to go right? but, b4 it
 got tarballed the tc magicians created a .war/.jar file combo
 that gets expanded to: $TOMCAT_HOME/webapps/examples and under
 the: /examples context u will find:
 $TOMCAT_HOME/webapps/examples/WEB-INF/web.xml a very important
 file that is created to define and describe to the tc server how
 to unpack the .war/.jar that was created for the /examples
 application. And, under:
 $TOMCAT_HOME/webapps/examples/WEB-INF/classes u should find a
 myriad of example applications including:
 $TOMCAT_HOME/webapps/examples/WEB-INF/classes/examples (and many
 others). in fact all the examples and demos displayed at:
 http://localhost:8080  r expanded and stored her. allow me to
 recommend: discover how this is done by studying ant and the
 build.xml that escorts the tc server to great heights. if u

Application Developer's Guide with sample build script:
http://jakarta.apache.org/tomcat/tomcat-4.0-
doc/appdev/index.html
or
localPathToTomcat/webapps/tomcat-docs/appdev/index.html

Classloader-Howto:
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-
howto.html
or
localPathToTomcat/webapps/tomcat-docs/class-loader-howto.html

 accomplish this u should have when comleted the following:
 $TOMCAT_HOME/webapps/myexamples when the tc server expands ur
 .war file. And, u should be able to access the contents w/ the
 following url: http://localhost:8080/myexamples. hope this helps,
 david. 
 


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




Re: How do I get the absolute path of a file in a directory above WEB-INF directory of my web application?

2002-11-29 Thread Andreas Probst
If you're trying from inside a servlet or so, the 
getResourceAsStream works fine, as the path pass something like
/WEB-INF/somedir/somefile.someextension.
Try not to use getRealPath.
See list's messages explaining the use of properties files.

If you want to access a directory below WEB-INF from client 
side, Tomcat won't normally do. Everything inside WEB-INF is 
protected from client access. But I could imagine you could 
develop a servlet, which serves these resource if necessary. But 
you should rather not do this.

Andreas

On 29 Nov 2002 at 4:17, Peter Lee wrote:

 On 29 Nov 2002 at 11:03, Andreas Probst wrote:
 
 I can now access the folder directly above the WEB-INF folder.
 Actually, I meant  a folder which is  directly below  the WEB-INF
 folder. This is still causing problems.
 
 Thanks
 
  Hello Peter,
  
  did you try 
  public java.lang.String getRealPath(java.lang.String path) of
  javax.servlet.ServletContext?
  
  or preferrably
  public java.net.URL getResource(java.lang.String path)
  or public java.io.InputStream 
  getResourceAsStream(java.lang.String path)
  
  Which directory do you mean, your webapp's directory, which is
  directly above WEB-INF or do you mean even higher above?
  
  The getResourceAsStream works fine for resources inside your
  webapp and should be used instead of getRealPath.
  
  Hope this helps.
  
  Andreas
  
  
  On 29 Nov 2002 at 1:18, Peter Lee wrote:
  
   I am using Tomcat for servlets. 
   How  do I get the absolute path of a file in a directory
   above WEB-INF directory of my web application?
   
   Thanks
   
   
  
 
 



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




Re: Servlet and Applet working in Tomcat 4.0.4 standalone

2002-11-29 Thread Andreas Probst
On 29 Nov 2002 at 15:43, Patrick Kosiol wrote:

deleted older messages...

 
 Hello,
 
 1. I do not get any expansions.
 2. My DirectorySystem is:
 WEB-INF
 classes
 myApp
 client
 server
 
 Can that works that the client and the server classes are in
 there folders? These Directory is created by JB so that should
 also work in Tomcat.
 
 Patrick
 
A client cannot access files inside or below WEB-INF. Put all 
the files your applet needs above WEB-INF.

If you need the same classes on server and client you must have 
them twice.

For complex deployment see Ant as David suggested. You might 
also want to read the Application Developer's Guide:
http://jakarta.apache.org/tomcat/tomcat-4.0-
doc/appdev/index.html
or
localPathToTomcat/webapps/tomcat-docs/appdev/index.html

Andreas


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




Re: How to get user:password from page header?

2002-11-27 Thread Andreas Probst
Hi Andrew,

there's the class org.apache.util.Base64

to encode from user input to encoded:

Base64 base64 = new Base64();
String base64Encoded = new String(base64.encode(userPass.getBytes()));

What you want is to decode. I suppose method decode would do.

Regards,
Andreas



On 27 Nov 2002 at 6:43, ContestAdmin wrote:

 Andrew Guts wrote:
 
  Hi all,
 
  I am porting an old CGI application to JSP/servlets. I need to
  port user authentication code also. But
  getHeader(authorization) returns encoded string like Basic
  YW5kcmV3Og==. How to get original value like USER:PASSWORD ?
 
  Thanks ahead
 
  Andrew
 
  --
  To unsubscribe, e-mail:  
  mailto:[EMAIL PROTECTED] For
  additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 Hmm...
 
 If I remember right (and I probably don't ;-) this information is
 encoded in Base64. All you need to do is run the 'YW5kcmV3Og=='
 stuff through a decoder.
 
 -CA
 
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED] For
 additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 



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




Re: How do I integrate my CLASSPATH on Tomcat?

2002-11-27 Thread Andreas Probst
Hi Emma,

don't move everything to Tomcat, copy it. Keep your system 
%classpath% as you have and want it. BUT, put (copy) all the 
resources you need in your webapp in the appropriate directory, 
i.e. WEB-INF/lib or if they are classes to WEB-INF/classes.

Maybe the Application Developers' Guide 
 pathToTomcat/webapps/tomcat-docs/appdev/index.html
will help you understanding the source organization and the  
process of webapps development including Ant and so on better.

Regards.
Andreas


On 27 Nov 2002 at 17:39, Emma Johansson wrote:

 Hi David,
 
 I thought I had to integrate my classpath on Tomcat so that
 Tomcat is able to use the jar files in my classpath. My web
 service on tomcat should be able to send an ldap message to
 another server. When I try to do this I get the following root
 cause:
 
 javax.servlet.ServletException:
 connectToMur/ConnectToMurService
 at
 org.apache.jasper.runtime.PageContextImpl.handlePageException(Pag
 eContextImpl.java:497)
 
 at
 org.apache.jsp.processAdd_jsp._jspService(processAdd_jsp.
 java:96) at
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase
 .java:136) at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:8
 53) ... ... ...
 I tried to add the two jar files belonging to ldap to
 tomcat_home/common/lib, but I still get the same error message.
 Maybe I need some more paths from my classpath. While I have
 everything in my classpath I don't want to move everything to
 tomcat, I want tomcat to read from the classpath and this way
 find the files. Is this possible?
 
 
 Regards,
 Emma
 
 
 
 David Brown wrote:
 
  Emma Johansson writes:
 
   Hi!
  
   I'm wondering how I should do to make tomcat use the paths
   that are in my CLASSPATH?
  
   Regards,
   / Emma
  
  
   --
   To unsubscribe, e-mail:  
   mailto:[EMAIL PROTECTED] For
   additional commands, e-mail:
   mailto:[EMAIL PROTECTED]
  
 
 
  Hello Emma, it should not be necessary to make tomcat use
  anything in the CLASSPATH. is there some question about whether
  tomcat is using ur CLASSPATH or not? if tomcat is not using ur
  CLASSPATH how do u know? more info is required: tomcat version,
  what r u trying to do? what application have u defined using
  what implementation?: servlets, jsp, what? david.
 


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




Re: How do I integrate my CLASSPATH on Tomcat?

2002-11-27 Thread Andreas Probst
Please, calm down.
I'm not a paid support staff.

On 27 Nov 2002 at 12:22, Pae Choi wrote:

 Didn't you see the posting that came from original poster again.
 
 I don't want to move everything
 to tomcat, I want tomcat to read from the classpath and this way
 find the files. Is this possible?
 
 And The BEST part, you are not in the position to determine and
 call that. It's customers' call.
 
 Every time, I chat with business folks, ones like you who believe
 whatever think the best is the best for the customers are the
 obstacles and inhibitors for business success.
 
 
 I'm wondering how I should do to make tomcat use the paths that
 are in my CLASSPATH?
 
 Does it say or imply to move JARs or packages to a specific
 location? The question was simple and the my reply included a
 simple suggestion according to the inquiry.
 
 That's true.  A suggestion that probably even works.  But not the
 best answer to the question.
 
 



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




Re: local WEB-INF/web.xml

2002-11-26 Thread Andreas Probst
Hi Paul,

at compile time you need to have servlet.jar inside your 
classpath.

See the Application Developers' Guide at
pathToTomcat/webapps/tomcat-docs/appdev/index.html

Andreas


On 26 Nov 2002 at 16:36, [EMAIL PROTECTED] wrote:

 I tried debugging the source through, my IDE and it threw a
 java.lang.NoSuchMethodError: main
 
 I tried compiling the source through the command prompt and got 
 a load of 'cannot resolve symobol' errors (useful). Below is the
 entire servlet, any ideas where the problem is? The first 2 of 5
 errors when compiling from DOS is: 
 
  LoadMycompServletAtStartup.java:10:package javax.servlet does
 not exist 
 
 and 
 
  LoadMycompServletAtStartup.java:11:package javax.servlet.http
 does not exist 
 
 Do I have a system problem here? The servlet in question below.
 On jave -version I am using VM build 1.4.1...
 
 thanks!
 
 import java.io.*;
 import javax.servlet.*;
 import javax.servlet.http.*;
 import java.util.Hashtable;
 
 public class LoadMycompServletAtStartup implements
 ServletContextListener {
 
   public void contextInitialized(ServletContextEvent sce) {
 
 ServletContext sc = sce.getServletContext();
 
 Hashtable style_index = new Hashtable();
 
 style_index.put(element1, ONE);
 style_index.put(element2, TWO);
 
 sc.setAttribute(style_index, style_index);
   } 
   public void contextDestroyed(ServletContextEvent sce) {}
 
 }
 



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




Re: Embedded Tomcat Problem

2002-11-26 Thread Andreas Probst
Hi,

try to set the complete path like
CLASSPATH=.;c:\path\to\lib\bootstrap.jar etc.
Maybe also without quotes.

In a message today it was suggested not to mix forward and back 
slashes as you did. Subject was:
Re: Problems running Tomcat from command line

I hope this helps. I can't help you with Embedded Tomcat.

Regards.
Andreas

On 26 Nov 2002 at 18:27, Lee Peik Feng wrote:

 Hi all,
 I am running on WinMe platform with jdk1.3.1_04, tomcat 4.1.12
 
 I try to embed tomcat into my Java application but I am facing
 some difficulties. I can't start tomcat as the classpath has
 included a lot of tomcat's jar files, if i take away some jars,
 I'll get NoClassDefFoundError I have moved all jar files to a lib
 folder. I have also change the memory of the batch file to 4096
 
 The last statement I can see from the console show that the
 command is too long: java -classpath
 .;lib/bootstrap.jar;.(cannot reach the end of
 command which should be EmbeddedTomcat)
 
 Below is my batch file that call my EmbeddedTomcat.class
 
 set
 CLASSPATH=.;lib/bootstrap.jar;lib/commons-daemon.jar;lib/tom
 cat-jni.jar ;lib/xercesImpl.jar;lib/xmlParserAPIs.jar set
 CLASSPATH=%CLASSPATH%;lib/xercesImpl.jar;lib/activation.jar;
 lib/ant.jar
 ;lib/commons-collections.jar;lib/commons-dbcp.jar set
 CLASSPATH=%CLASSPATH%;lib/commons-logging-api.jar;lib/commons-
 pool.jar; lib/dom.jar;lib/jasper-compiler.jar set
 CLASSPATH=%CLASSPATH%;lib/jasper-runtime.jar;lib/jaxen-full.ja
 r;lib/jax p-api.jar;lib/jdbc2_0-stdext.jar;lib/jdom.jar
 set
 CLASSPATH=%CLASSPATH%;lib/jndi.jar;lib/jstl.jar;lib/jta.jar
 ;lib/mail. jar;lib/naming-common.jar;lib/naming-factory.jar
 set
 CLASSPATH=%CLASSPATH%;lib/naming-resources.jar;lib/sax.jar;l
 ib/saxpath. jar;lib/servlet.jar;lib/standard.jar set
 CLASSPATH=%CLASSPATH%;lib/xalan.jar;lib/catalina.jar;lib/cat
 alina-ant.j
 ar;lib/commons-beanutils.jar;lib/commons-digester.jar set
 CLASSPATH=%CLASSPATH%;lib/commons-logging.jar;lib/commons-mode
 ler.jar;l ib/jaas.jar;lib/jakarta-regexp-1.2.jar set
 CLASSPATH=%CLASSPATH%;lib/mx4j-jmx.jar;lib/servlets-common.jar
 ;lib/serv lets-default.jar;lib/servlets-invoker.jar set
 CLASSPATH=%CLASSPATH%;lib/servlets-manager.jar;lib/servlets-we
 bdav.jar; lib/tomcat-coyote.jar;lib/tomcat-http11.jar set
 CLASSPATH=%CLASSPATH%;lib/tomcat-jk2.jar;lib/tomcat-jk.jar;l
 ib/tomcat-u til.jar;lib/tomcat-warp.jar set
 CLASSPATH=%CLASSPATH%;C:\jdk1.3.1_04\lib\tools.jar java
 -classpath %CLASSPATH% EmbeddedTomcat
 
 Any help would be appreciated. Thank you.
 
 
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED] For
 additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 



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




Re: Multiple instanceq

2002-11-25 Thread Andreas Probst
Hi Hari,

this has been discussed several times. Try to search the 
archive.

Andreas


On 25 Nov 2002 at 11:36, Hari Venkatesan wrote:

 
 
 Have anybody tried creating multiple tomcat instances. Is there
 any documentation that explains this step by step?
 
 Hari
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED] For
 additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 



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




Re: Applet from servlet

2002-11-25 Thread Andreas Probst
Hello David!


On 25 Nov 2002 at 9:25, David Brown wrote:

 Andreas Probst writes: 
 
  Hi David, 
  
  don't put the class files and jars, which you need for an
  applet, below WEB-INF. Tomcat won't serve these files to the
  user's browser. Just put these files in your webapp's
  directory. If you need the same classes also on the server,
  than you need to have two copies of them. 
  
  Hope this solves your problem. 
  
  Andreas 
  

older messages deleted

 
 
 Hello Andreas, thanx 4 the accurate and speedy reply. i (on a
 hunch) put my applet class under /webapps and can now load which
 ur message confirms (thanx). the history of this applet started
 out as a java standalone which works perfectly from any remote
 client. however to avoid downloads and client compiles i decided
 to convert the standalone to an applet. the applet depends on
 classes12.jar (or classes12.zip if on windoz). again, class not
 found exception because of classes found in classes12.jar. again,
 on a hunch, i unpacked the jar under /webapss along w/ the applet
 class (i know this is a poor solution but it helped throw light).
 when the applet loads i can see that i completes some of the
 init() but eventually hangs w/ the following: Exception:
 java.util.MissingResourceException: Can't find bundle for
 basename Connection.locale en_US 
 
 i know the best solution is for the applet to find the packed jar
 and then all should be ok but how? i have put the jar everywhere:
 classpath, build.xml property, $TOMCAT_HOME/lib,
 $TOMCAT_HOME/common/lib, etc.. any and all ideas, references,
 rants and raves welcomed. david.
 

I think this sounds like an applet problem, which has nothing to 
do with Tomcat. You should now design your application to run 
as a normal applet. Package it and put every resource that it 
needs where I had described before.

I don't know, whether I've understood you right. In case you 
only need to provide an applet without associated servlets, you 
won't need Tomcat. A normal web server, which serves static 
content, will be enough and probably the better performing 
solution.

Regards,
Andreas



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




Re: Applet from servlet

2002-11-24 Thread Andreas Probst
Hi David,

don't put the class files and jars, which you need for an 
applet, below WEB-INF. Tomcat won't serve these files to the 
user's browser. Just put these files in your webapp's directory.
If you need the same classes also on the server, than you need 
to have two copies of them.

Hope this solves your problem.

Andreas


On 24 Nov 2002 at 10:07, David Brown wrote:

 Hello tc-user, has anyone successfully invoked an applet from a
 servlet using: response.sendRedirect(url) where
 url=http://localhost/somehtml.html w/ the APPLET/APPLET tag
 embedded? my efforts so far result in: Exception:
 java.lang.ClassNotFoundException: com.x.y.MyApplet.class. i have
 repackaged the applet in different ways to no avail. i am using
 jakarta-tomcat installed out-of-box and using the same ant
 build infrastructure as the examples and demos: 
 
 $TOMCAT_HOME
   |
   |
   /bin
   /classes
   /common
   /conf
   /lib
   /logs
   /server
   /temp
   /webapps
   /work 
 
 $TOMCAT_HOME
   |
   |
   /webapps
   |
   /myapplication
   |
   /manager
   |
   /ROOT
   |
   /examples
   |
   /webdav 
 
 $TOMCAT_HOME
   |
   |
   /webapps
   |
   /index.html
   |
   /META-INF
   |
   /WEB-INF
 $TOMCAT_HOME
   |
   |
   /webapps
   |
   /WEB-INF
  |
  /web.xml
  |
  /classes 
 
 $TOMCAT_HOME
   |
   |
   /webapps
   |
   /classes
  |
  /com
 |
 /myapplication
 |
 /web
 /beans 
 
 i can place any number of servlets in /web and any number of java
 bean or ordinary class files in /beans and reference their
 constructors, variables and methods from servlets in /web.
 however, no amount of packaging or lack of packaging of an applet
 stored anywhere in this directory tree referenced w/
 APPLET/APPLET in the index.html (see above) will work
 (ClassNotFoundException). TOMCAT VERSION: 4.0.6 JDK: 1.3.1_02
 OS: RH7.2 NETWORK: linux box as router ENVIRONMENT: TOMCAT_HOME,
 JDK_HOME BUILD: ant build.xml 
 
 i welcome any and all ideas, suggestions, rants etc.. thanx,
 david. 
 


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




Re: File Path Problem...

2002-11-21 Thread Andreas Probst
Hello,

maybe you could save the absolute path inside a properties file 
or pass it as an init parameter in web.xml. For each location of 
your app you would have to set this path appropriately. You 
could use absolute paths and wouldn't need to change the source 
code of the application.

Regards,
Andreas


On 21 Nov 2002 at 14:31, Harsha Yalagach wrote:

 Hello,
 
 I am running Tomcat 4.1 on Windows 2000 as a service.
 
 I have written a JSP page where in I am trying to read an
 XML. If I try
 to access the file using absolute path, for eg. c:\abc\xyz.xml,
 the page works without any problem. But if i try to access it
 thru relative path, for eg. ../data/xyz.xml, the tomcat will
 throw a FileNotFoundException saying that xyz.xml doesnt exist in
 SYSTEM-ROOT\System32 dir.
 
 The reason behind this is that the JSP is tring to access the
 file from
 where JVM was started according to Java Documentation, ie
 SYSTEM-ROOT\System32 directory where the Service Control Manager
 starts the Tomcat service which in turn starts the JVM.
 
 So the question is, is there any other way I can use a
 relative path
 inside my application to access a file? (I dont want to use
 absolute path as my application has to be distributed in many
 places).
 
 Thanks in advance...
 Warm Regards,
 Harsha Yalagach
 
 
 --
 Cerebra Integrated Technologies Ltd., Bangalore, India
 
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED] For
 additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 



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




Re: Delete name-value pairs from request

2002-11-13 Thread Andreas Probst
Hi Günter,

I haven't done this, but I suppose you should implement a
RequestWrapper. Extend
javax.servlet.http.HttpServletRequestWrapper.
Your implementation just calls the methods of
HttpServletResponseWrapper. However, if it is asked for your
name/value pair don't call super but return null or whatever is
appropriate. As this Wrapper implements HttpServletRequest and
ServletRequest you can pass this in chain.doFilter...

Look for the following message in the archive. It descibes
ResponseWrapper:

Date: Mon, 21 Oct 2002 12:43:27 +0200
From: Andreas Probst [EMAIL PROTECTED]
Subject: Re: Is there any way to read the response headers in a
filter in Tomcat 4.0.3 ?

Regards,
Andreas

On 13 Nov 2002 at 15:20, Günter Kukies wrote:

 Hello,

 how can I delete a name-value pair from a HTTPServletRequest. I
 need to do it within a Filter request, because I need a
 ServletRequest Object for chain.doFilter(request,response);

 Thanks
 Günter




--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: Java returns bunk date!?

2002-11-10 Thread Andreas Probst
Hi Josh,
yes it is, but in my opinion it's a bit hidden. As starting 
January with 0 isn't what one would expect, it should be 
stressed more in the docs.

in java.util.Calendar:

public static final int MONTH

 Field number for get and set indicating the month. This is a calendar-specific 
value. The first month of the year is JANUARY which is 0; the last depends on
 the number of months in a year. 

in java.util.GregorianCalendar

public GregorianCalendar(int year,
 int month,
 int date)

 Constructs a GregorianCalendar with the given date set in the default time zone 
with the default locale. 

Parameters:
 year - the value used to set the YEAR time field in the calendar.
 month - the value used to set the MONTH time field in the calendar. Month value 
is 0-based. e.g., 0 for January.
 date - the value used to set the DATE time field in the calendar.


Andreas

On 11 Nov 2002 at 10:15, Josh G wrote:

 Ah thanks. Is this covered in the docs and I just missed it?
 
 -Josh
 --
 And can you tell me doctor why I still can't get to sleep?
 And why the channel 7 chopper chills me to my feet?
 And what's this rash that comes and goes, can you tell me what it
 means? God help me, I was only 19
 
 
 - Original Message -
 From: Chakradhar Tallam [EMAIL PROTECTED] To:
 'Tomcat Users List' [EMAIL PROTECTED] Sent:
 Monday, November 11, 2002 9:44 AM Subject: RE: Java returns bunk
 date!?
 
 
  because java's month index starts from 0  ends at 11.
 
  0 - JAN
  1 - FEB
  ...
  11 - DEC
 
  -Original Message-
  From: Josh G [mailto:josh;gfunk007.com]
  Sent: Monday, 11 November 2002 10:41 AM
  To: Tomcat Users List
  Subject: Java returns bunk date!?
 
 
  I'm having a weird problem with tomcat, java is giving me last
  month's
 date!
  It's 11 nov on this machine, but java is returning 11 oct :( I
  don't see
 how
  this could happen?
 
  -Josh
  --
  And can you tell me doctor why I still can't get to sleep? And
  why the channel 7 chopper chills me to my feet? And what's this
  rash that comes and goes, can you tell me what it means? God
  help me, I was only 19
 
 
 
  --
  To unsubscribe, e-mail:
  mailto:tomcat-user-unsubscribe;jakarta.apache.org
  For additional commands, e-mail:
  mailto:tomcat-user-help;jakarta.apache.org
 
 
 
 --
 To unsubscribe, e-mail:  
 mailto:tomcat-user-unsubscribe;jakarta.apache.org For
 additional commands, e-mail:
 mailto:tomcat-user-help;jakarta.apache.org
 



--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: Shutting down and restarting Tomcat

2002-11-08 Thread Andreas Probst
Hi Peter,

try this batch file (startAndStop.bat):

 echo off
 echo.
 echo Calling startup
 echo.
 call startup.bat
 echo.
 echo Started
 echo.
 pause
 
 echo.
 echo Calling shutdown
 echo.
 call shutdown.bat
 echo.
 echo Shut down
 echo.
 pause
 
 startAndStop.bat

The pause command is necessary, because it takes Tomcat a few 
seconds to shut down. The next call will be done after you'll 
have pressed any key.

This script is an endless loop because it calls itself in the 
end. To end it press Ctrl-C or the X-Button in the upper right 
corner.

Andreas


On 7 Nov 2002 at 11:05, Peter Lee wrote:

 I need to shutdown and then restart tomcat repeatedly for my
 testing purposes. I am using a Windows batch file which will call
 shutdown.bat and startup.bat. But each time Tomcat did not
 restart. Is there any better way of doing this?
 
 Thanks


--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: HOW I RUNN?

2002-11-04 Thread Andreas Probst
double click tomcathome/bin/startup.bat

If you get an Out of Environment Space Error Message
see my message from 9 September 2002 14:17:52 +0200 (Subject: 
RE: Tomcat 3.1.* config problem)

Andreas


On 3 Nov 2002 at 23:40, CARLOS RESENDIZ REBOLLO wrote:

 
 
 HOW I CANT RUNN JAKARTA_TOMCAT ON WIN98?
 
 
 


--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: Compiling Servlets

2002-11-02 Thread Andreas Probst
On 1 Nov 2002 at 14:54, Ben Austin wrote:

 What software would you recommend for compiling servlets?
 

Try Jakarta Ant

See Application Developer Guide at 
tomcathome/webapps/tomcat-docs/appdev/index.html



--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: Tomcat and CLASSPATH

2002-11-02 Thread Andreas Probst
Hi Chris,

you could set your classpath in the tomcat startup script. But 
this is not recommended. There were messages a few days ago 
explaining this.

Besides, it might not always be desirable that Tomcat knows when 
classes change...

Andreas


On 2 Nov 2002 at 7:52, Chris gokey wrote:

 Under UNIX it was very convenient for us to create a symbolic
 link from our WEB-INF/lib and WEB-INF/classes directory to the
 respective directories in our package that contained our jars and
 to the base directory of our package structure (for the purpose
 of setting up the CLASSPATH).  But unfortunately this approach is
 not platform independent and won't work under windows.  Is my
 only alternative to copy all these files to WEB-INF?   The
 advantage of symbolically linking is that any time these classes
 changed, Tomcat would automatically know about it. Is there
 another way to tell Tomcat where my claases are?  Possibly
 specify the CLASSPATH in my web.xml file?
 
 Thanks,
 Chris
 
 
 


--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: Where to put Java files/classes

2002-10-27 Thread Andreas Probst
Hi Ryan,

you shouldn't have your source files mixed up with Tomcat. You 
should rather develop somewhere else and use a build tool like 
Jakarta Ant to deploy your app to Tomcat.

Craig's App Developer Guide at
tomcathome/webapps/tomcat-docs/appdev/index.html
gives a very good introduction into the development process.

Good luck.

Andreas


On 26 Oct 2002 at 15:17, Ryan Heusinkveld wrote:

 Hi all,
 
 I am trying to configure Tomcat to allow me to import and use classes that I 
 have created within my jsp pages.  I imported them within my page, but I get 
 the error that the classes cannot be found.  I created a directory under my 
 $CATALINA_HOME called 'src', and packaged my classes accordingly under 
 there.  What do I need to do to tell Tomcat that the classes are under 
 there?  Should I be placing them somewhere else?
 Any help is appreciated.
 
 -Ryan
 


--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: Thank ?????

2002-10-25 Thread Andreas Probst
Hi Fernando,

On 24 Oct 2002 at 19:51, Correo wrote:

 can one web-server run on windows 98  ?

Yes, but I wouldn't recommend this as Win98 is too instable.

 Where I download web server ?

Tomcat as application server: http://jakarta.apache.org/tomcat
Apache as web server: maybe http://www.apache.org

You don't necessarily need both.

 Thank for all Fernando.

Andreas



--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: Help with log4j and log4j.propereties under Tomcat 4.1.2

2002-10-24 Thread Andreas Probst
Hi CC,

I also wanted to have them in WEB-INF. The following code works 
for me (TC 4.0.4). You can even rename the log4j.properties to 
whatever you want. This solution is supposed to work in not 
expanded wars, too.

InputStream log4jPropsIn = 
getServletContext().getResourceAsStream(WEB-INF/log4j.properties);
if (log4jPropsIn == null)
{
  // Set up a simple configuration that logs on the console.
  BasicConfigurator.configure();  
}
else
{
  Properties logProps = new Properties();
  try
  {
logProps.load(log4jPropsIn);
// BasicConfigurator replaced with PropertyConfigurator.
PropertyConfigurator.configure(logProps);
  }
  catch (IOException io)
  {
// Set up a simple configuration that logs on the console.
BasicConfigurator.configure();  
  }
}//else
  logger.info(log4j configuration finished);

Good luck.

Andreas

On 23 Oct 2002 at 10:29, Carson, Chuck wrote:

 
 I am using log4j and have the log4j.jar file located in
 $TOMCAT_HOME/webapps/myapp/WEB-INF/classes. For some reason, I can
 only place the log4j.properties file in the same directory as the jar
 file. Is this proper behavior? I would like to keep the log4j.properties
 file in WEB-INF/.
 
 Thanks for any help
 CC
 
 
 --
 This message contains confidential information and is intended only for
 the individual named. If you are not the named addressee you should not
 disseminate, distribute or copy this e-mail. Please notify the sender
 immediately by e-mail if you have received this e-mail by mistake and
 delete this e-mail from your system. E-mail transmission cannot be
 guaranteed to be secure or error-free as information could be
 intercepted, corrupted, lost, destroyed, arrive late or incomplete, or
 contain viruses. The sender therefore does not accept liability for any
 errors or omissions in the contents of this message, which arise as a
 result of e-mail transmission. If verification is required please
 request a hard-copy version. 
 


--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: Is there any way to read the response headers in a filter in Tomcat 4.0.3 ?

2002-10-21 Thread Andreas Probst
Hi,

you could extend HttpServletResponseWrapper. You overwrite all 
methods which you are interested in, save the values and call 
the super method, so the underlying HttpServletResponse knows 
them. Additionally you write getter methods, which return the 
set values. 

Example:

public class LocalHttpServletResponseWrapper
  extends HttpServletResponseWrapper
{
  public LocalHttpServletResponseWrapper(HttpServletResponse 
res)
  {
super(res);
  }//constructor

  public void setStatus(int sc)
  {
super.setStatus(sc);
this.status = sc;
  }//setStatus

  public int getStatus()
  {
return status;
  }//getStatus

}//class

In your filter you receive a ServletResponse. Cast it to 
HttpServletResponse. Instantiate your 
LocalHttpServletResponseWrapper. Pass this new object to the 
doFilter.
Afterwards you can use your getter methods. The caller of your 
filter will have a normal ServletResponse.

Example:

  public void doFilter(
ServletRequest req,
ServletResponse res,
FilterChain chain)
throws IOException, ServletException
  {
HttpServletResponse hres = (HttpServletResponse) res;
HttpServletRequest hreq = (HttpServletRequest) req;

LocalHttpServletResponseWrapper lres 
  = new LocalHttpServletResponseWrapper(hres);

chain.doFilter(req, lres);
...
int status = lres.getStatus();
...
  }


Good luck.

Andreas


On 21 Oct 2002 at 10:31, [EMAIL PROTECTED] wrote:

 Hi,
 I want to write a filter for Tomcat 4.0.3 which should record all the
 traffic.But I cannot find any way to question the values of  the headers of
 a response in my ResponseWrapper. Normal HttpServletResponse class doesn't
 have any getter methods for headers. In the debugger I can see that there
 is a org.apache.catalina.connector.HttpResponseFacade which implements (via
 superclass) a org.apache.catalina.HttpResponse which has header getter
 methods. But I cannot use that because these classes are invisible. Does
 anybody know a way to provide a reading access to these headers?
 
 thank you
 
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
 



--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: Is there any way to read the response headers in a filter in Tomcat 4.0.3 ?

2002-10-21 Thread Andreas Probst
Forgot one thing. See intermixed.

On 21 Oct 2002 at 12:40, Andreas Probst wrote:

 Hi,
 
 you could extend HttpServletResponseWrapper. You overwrite all 
 methods which you are interested in, save the values and call 
 the super method, so the underlying HttpServletResponse knows 
 them. Additionally you write getter methods, which return the 
 set values. 
 
 Example:
 
 public class LocalHttpServletResponseWrapper
   extends HttpServletResponseWrapper
 {

private int status = -1; // senseless initial value

   public LocalHttpServletResponseWrapper(HttpServletResponse 
 res)
   {
 super(res);
   }//constructor
 
   public void setStatus(int sc)
   {
 super.setStatus(sc);
 this.status = sc;
   }//setStatus
 
   public int getStatus()
   {
 return status;
   }//getStatus
 
 }//class
 
 In your filter you receive a ServletResponse. Cast it to 
 HttpServletResponse. Instantiate your 
 LocalHttpServletResponseWrapper. Pass this new object to the 
 doFilter.
 Afterwards you can use your getter methods. The caller of your 
 filter will have a normal ServletResponse.
 
 Example:
 
   public void doFilter(
 ServletRequest req,
 ServletResponse res,
 FilterChain chain)
 throws IOException, ServletException
   {
 HttpServletResponse hres = (HttpServletResponse) res;
 HttpServletRequest hreq = (HttpServletRequest) req;
 
 LocalHttpServletResponseWrapper lres 
   = new LocalHttpServletResponseWrapper(hres);
 
 chain.doFilter(req, lres);
 ...
   int status = lres.getStatus();
 ...
   }
 
 
 Good luck.
 
 Andreas
 
 
 On 21 Oct 2002 at 10:31, [EMAIL PROTECTED] wrote:
 
  Hi,
  I want to write a filter for Tomcat 4.0.3 which should record all the
  traffic.But I cannot find any way to question the values of  the headers of
  a response in my ResponseWrapper. Normal HttpServletResponse class doesn't
  have any getter methods for headers. In the debugger I can see that there
  is a org.apache.catalina.connector.HttpResponseFacade which implements (via
  superclass) a org.apache.catalina.HttpResponse which has header getter
  methods. But I cannot use that because these classes are invisible. Does
  anybody know a way to provide a reading access to these headers?
  
  thank you
  
  
  
  --
  To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
  For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
  
 
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
 



--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: How to get a message shown immediately by the browser?

2002-10-18 Thread Andreas Probst
Hi Zsolt,

there was a message from Craig R. McClanahan on Tuesday, 
September 10, 2002 10:48 PM. He wrote:

 ...
 * You are opening an HTML element like table or p and not
 closing it
   before the flush, and writing to a browser that does not
   incrementally render (like Netscape 4.x).
 ...
 Counting on incremental output being visible is a very chancy
 bet.

Maybe this explains the delay.

Andreas



On 17 Oct 2002 at 15:40, Zsolt Koppany wrote:

 Hi,
 
 My servlet can run a long time and I would like to give the user some feedback 
 about that. I write html...body... to the browser and execute a 
 out.flush() and response.flushBuffer() bit at least mozilla-1.0.1 still needs 
 a long time to get the message shown.
 
 How can I get the browser show a message as fast as possible?
 
 Zsolt


--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: jakarta slide question.

2002-10-08 Thread Andreas Probst

Hi Bryan,

better ask at Slide Users Mailing List slide-
[EMAIL PROTECTED].

/files is specified in Domain.xml, see 
filespath/files/filespath.

Files can be found in the folder specified in 
contentstore classname=slidestore.reference.FileContentStore
parameter name=rootpathc:\contentstore/parameter
...

If you don't put c:\ in front of it contentstore will be created 
in the directory, where you started Tomcat from, probably 
tomcathome/bin.

Take notice of the comments in Domain.xml and web.xml. Default 
memory store won't be persistent.

Hope that helps.

Andreas

On 8 Oct 2002 at 14:21, bryan wrote:

 
 
 I've got slide setup under Tomcat and I'm accessing it using a
 webfolder. 
 When I access the webfolder I find a sub-folder called files, I suppose
 this is from settings either in my Domain.xml or my web.xml, can anyone
 give me the location in my domain.xml or web.xml that refers to this
 sub-folder, and also can anyone tell me where the actual location of
 files under the files sub-folder would be found?
 
 


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




Re: How to specify the location of a properties file.

2002-10-08 Thread Andreas Probst

Hi Mehdi,

I have my properties file in /WEB-INF. Eclipse doesn't delete it 
there. I access it with

InputStream propsIn  = servletContext.getResourceAsStream(/WEB-
INF/dms.properties);
props.load(propsIn);

As far as I know this also works when the web-app ist deployed 
as a war without expansion.

Hope that helps.

Andreas



On 8 Oct 2002 at 12:48, [EMAIL PROTECTED] wrote:

 
 I use the getResourceAsStram() method also, but i find that my IDE, tends
 to remove the properties file from my classpath, as soon as I do a build,
 which is not nice.
 
 In the particular case i have now, I don't want to specify the parameters
 in my web.xml, because the utility that requires a properties file, is not
 actually a web-app, rather a bunch of utility classes used by my webapp.
 Im not keen to implement a setProperties() method, as this would mean
 changing stuff, so im just re-copying the properties into my classes folder
 after each build.. (unless someone can tell me how to tell WSAD to stop
 deleting my properties file... but .. *ahem* thats not a Tomcat question :)
 
 Cheers,
 
 Mehdi
 
 
 
 
  

   Justin Ruthenbeck  

   justinr@nextengiTo:   Tomcat Users List 
[EMAIL PROTECTED]
   ne.com  cc:   

Subject:  Re: How to specify the 
location of a properties file.   
   07/10/2002 22:20   

   Please respond to  

   Tomcat Users  

   List  

  

  

 
 
 
 
 
 Niaz ...
 
 The idea is to load the properties file like you would any other java
 resource at runtime ... this is (almost) always better, IMHO, than using
 something J2EE-specific like initialization parameters to a servlet.
 
 The relevant code would look something like this:
 
 InputStream inStream = this.getClass().getResourceAsStream(/my.props);
 Properties props = new Properties(inStream);
 
 or
 
 Properties prop = new Properties();
 prop.load(this.getClass().getResourceAsStream(/MyProperties.properties));
 
 There was a thread some time ago that went over this.  You can see the
 details at:
 http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg63518.html
 
 Hope this helps...
 justin
 
 
 At 01:40 PM 10/7/2002, you wrote:
 Justin,
 
 I am facing the same problem. Your approach seems to be an elegent one.
 Would you mind eleborating on the idea a little bit more. Some code
 snippet
 would definitely be helpful.
 
 I thank you in advance.
 
 niaz.
 - Original Message -
 From: Justin Ruthenbeck [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Sent: Monday, October 07, 2002 4:06 PM
 Subject: Re: How to specify the location of a properties file.
 
 
  
   Shaun --
  
   Consider dynamically loading the properties file from your classpath
 using
   a class loader.  This way, you can put the files anywhere you please
 and
   just include that directory in your classpath (or put them someplace
   already in your classpath).  If you need more specifics, let me know
 and
   I'd be happy to help...
  
   justin
  
   At 01:00 PM 10/7/2002, you wrote:
   I've got a servlet running under Tomcat and I need to read in the
 contents
   of a properties file.  There will be different properties files for
 each
   system specified using an init parameter.
   
   I'm having problems reading this property file at the moment in my
 java
   class as the way I am doing it at the moment always looks where I
 started
   Tomcat from i.e the /bin directory.  I can specify a full path to the
 file
   but this is not very system independent and limits me to either
 Windows
 or
   Unix.
   
   What I need is to specify the location of the file relative to the
 webapp
   directory.  I have tried the url class but it doesn't seem to work, or
   maybe it is working but looking in a different place to where my
   properties file is.
   
   Can anyone suggest what I am doing wrong or provide any help on 

Re: How to specify the location of a properties file.

2002-10-08 Thread Andreas Probst

Hi Mehdi,

you could get the resource stream from within a servlet's init() 
method (where you have a ServletContext) and pass it to the 
other object that needs it.

I do it pretty similar. But instead of passing the stream I pass 
the servletContext.

Andreas


On 8 Oct 2002 at 15:40, [EMAIL PROTECTED] wrote:

 
 Hi,
 
 There was no ServletContext.getResourceAsStream () ... maybe this is
 because the whole project is a bunch of utilities for my web-app, and is
 not a webapp itself ? The class that needs the properties file, is not part
 of the webapp. So anyway, i tried the closest available method.. (or so i
 thought);
 
 p.load( javax.servlet.ServletContext.class.getResourceAsStream(
 /WEB-INF/myprops.properties) );
 
 which also did not work.
 
 Cheers,
 
 Mehdi
 
 Mehdi Nejad - Senior Developer
 [EMAIL PROTECTED]
 ~~
 Bluewave Ltd - Online Creations
 http://www.bluewave.com
 Tel. +44 (0)20 7479 8394
 ~~
 
 
  

   Andreas Probst   

   [EMAIL PROTECTED]To:   Tomcat Users List 
[EMAIL PROTECTED]
   cc:   

Subject:  Re: How to specify the 
location of a properties file.   
   08/10/2002 13:57   

   Please respond to  

   Tomcat Users  

   List  

  

  

 
 
 
 
 Hi Mehdi,
 
 I have my properties file in /WEB-INF. Eclipse doesn't delete it
 there. I access it with
 
 InputStream propsIn  = servletContext.getResourceAsStream(/WEB-
 INF/dms.properties);
 props.load(propsIn);
 
 As far as I know this also works when the web-app ist deployed
 as a war without expansion.
 
 Hope that helps.
 
 Andreas
 
 
 
 On 8 Oct 2002 at 12:48, [EMAIL PROTECTED] wrote:
 
 
  I use the getResourceAsStram() method also, but i find that my IDE, tends
  to remove the properties file from my classpath, as soon as I do a build,
  which is not nice.
 
  In the particular case i have now, I don't want to specify the parameters
  in my web.xml, because the utility that requires a properties file, is
 not
  actually a web-app, rather a bunch of utility classes used by my webapp.
  Im not keen to implement a setProperties() method, as this would mean
  changing stuff, so im just re-copying the properties into my classes
 folder
  after each build.. (unless someone can tell me how to tell WSAD to stop
  deleting my properties file... but .. *ahem* thats not a Tomcat question
 :)
 
  Cheers,
 
  Mehdi
 
 
 
 
 
 
Justin Ruthenbeck
 
justinr@nextengiTo:   Tomcat Users
 List [EMAIL PROTECTED]
ne.com  cc:
 
 Subject:  Re: How to
 specify the location of a properties file.
07/10/2002 22:20
 
Please respond to
 
Tomcat Users
 
List
 
 
 
 
 
 
 
 
 
 
  Niaz ...
 
  The idea is to load the properties file like you would any other java
  resource at runtime ... this is (almost) always better, IMHO, than using
  something J2EE-specific like initialization parameters to a servlet.
 
  The relevant code would look something like this:
 
  InputStream inStream = this.getClass().getResourceAsStream(/my.props);
  Properties props = new Properties(inStream);
 
  or
 
  Properties prop = new Properties();
  prop.load(this.getClass().getResourceAsStream
 (/MyProperties.properties));
 
  There was a thread some time ago that went over this.  You can see the
  details at:
  http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg63518.html
 
  Hope this helps...
  justin
 
 
  At 01:40 PM 10/7/2002, you wrote:
  Justin,
  
  I am facing the same problem. Your approach seems to be an elegent one.
  Would you mind eleborating on the idea a little bit more. Some code
  snippet
  would

RE: How to specify the location of a properties file.

2002-10-08 Thread Andreas Probst

Yes Donie,

but this won't work if the webapp is deployed as a war without 
expansion.

Andreas


On 8 Oct 2002 at 17:06, Donie Kelly wrote:

 Here is the simple solution
 
 ServletContext sc;
 String RootPath=null;
   
sc = getServletContext();
 RootPath = sc.getRealPath(/);
  
 Donie   
  
 -Original Message-
 From: Andreas Probst [mailto:[EMAIL PROTECTED]]
 Sent: 08 October 2002 16:31
 To: Tomcat Users List
 Subject: Re: How to specify the location of a properties file.
 
 Hi Mehdi,
 
 you could get the resource stream from within a servlet's init()
 method (where you have a ServletContext) and pass it to the
 other object that needs it.
 
 I do it pretty similar. But instead of passing the stream I pass
 the servletContext.
 
 Andreas
 
 
 On 8 Oct 2002 at 15:40, [EMAIL PROTECTED] wrote:
 
 
  Hi,
 
  There was no ServletContext.getResourceAsStream () ... maybe this is
  because the whole project is a bunch of utilities for my web-app, and is
  not a webapp itself ? The class that needs the properties file, is not
 part
  of the webapp. So anyway, i tried the closest available method.. (or so i
  thought);
 
  p.load( javax.servlet.ServletContext.class.getResourceAsStream(
  /WEB-INF/myprops.properties) );
 
  which also did not work.
 
  Cheers,
 
  Mehdi
 
  Mehdi Nejad - Senior Developer
  [EMAIL PROTECTED]
  ~~
  Bluewave Ltd - Online Creations
  http://www.bluewave.com
  Tel. +44 (0)20 7479 8394
  ~~
 
 
 
 
Andreas Probst
 
[EMAIL PROTECTED]To:   Tomcat Users
 List [EMAIL PROTECTED]   
cc:
 
 Subject:  Re: How to
 specify the location of a properties file.  
08/10/2002 13:57
 
Please respond to
 
Tomcat Users
 
List
 
 
 
 
 
 
 
 
 
  Hi Mehdi,
 
  I have my properties file in /WEB-INF. Eclipse doesn't delete it
  there. I access it with
 
  InputStream propsIn  = servletContext.getResourceAsStream(/WEB-
  INF/dms.properties);
  props.load(propsIn);
 
  As far as I know this also works when the web-app ist deployed
  as a war without expansion.
 
  Hope that helps.
 
  Andreas
 
 
 
  On 8 Oct 2002 at 12:48, [EMAIL PROTECTED] wrote:
 
  
   I use the getResourceAsStram() method also, but i find that my IDE,
 tends
   to remove the properties file from my classpath, as soon as I do a
 build,
   which is not nice.
  
   In the particular case i have now, I don't want to specify the
 parameters
   in my web.xml, because the utility that requires a properties file, is
  not
   actually a web-app, rather a bunch of utility classes used by my webapp.
   Im not keen to implement a setProperties() method, as this would mean
   changing stuff, so im just re-copying the properties into my classes
  folder
   after each build.. (unless someone can tell me how to tell WSAD to stop
   deleting my properties file... but .. *ahem* thats not a Tomcat question
  :)
  
   Cheers,
  
   Mehdi
  
  
  
  
  
 
 Justin Ruthenbeck
 
 justinr@nextengiTo:   Tomcat Users
  List [EMAIL PROTECTED]
 ne.com  cc:
 
  Subject:  Re: How to
  specify the location of a properties file.
 07/10/2002 22:20
 
 Please respond to
 
 Tomcat Users
 
 List
 
  
 
  
 
  
  
  
  
  
   Niaz ...
  
   The idea is to load the properties file like you would any other java
   resource at runtime ... this is (almost) always better, IMHO, than using
   something J2EE-specific like initialization parameters to a servlet.
  
   The relevant code would look something like this:
  
   InputStream inStream = this.getClass().getResourceAsStream(/my.props);
   Properties props = new Properties(inStream);
  
   or
  
   Properties prop = new Properties();
   prop.load(this.getClass().getResourceAsStream
  (/MyProperties.properties));
  
   There was a thread some time ago that went over this.  You can see the
   details at:
   http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg63518.html
  
   Hope this helps...
   justin
  
  
   At 01:40 PM 10/7/2002, you wrote:
   Justin,
   
   I am facing the same problem. Your approach seems to be an elegent one.
   Would you mind eleborating on the idea a little bit more. Some code
   snippet
   would definitely be helpful.
   
   I thank you in advance.
   
   niaz.
   - Original Message -
   From: Justin Ruthenbeck [EMAIL PROTECTED]
   To: Tomcat Users List [EMAIL PROTECTED]
   Sent: Monday, October 07, 2002 4:06 PM
   Subject: Re: How to specify the location

Re: Configuring Tomcat to start with different verisons of a Web App

2002-10-07 Thread Andreas Probst

Hi Scott,

you could simply have 3 Tomcats, e.g. .../tomcat1, .../tomcat2, 
.../tomcat3. All you need is to have 3 icons linked to the right 
startup script. If you run only one at a time it will work fine.

Andreas


On 7 Oct 2002 at 14:51, Scott Goldstein wrote:

 At any one time, I have multiple versions of a product that I'm working on on 
 my development box.  In other words, I'm usually fixing bugs in the previos 
 one or two releases while moving forward on the next release.
 
 This leaves me with three web applications in three seperate directory 
 structures.  I would like to start Tomcat through an icon on my desktop.  To 
 be able to handle all three versions of the web app that I'm working on, I 
 would like to have three seperate icons, one for each web app version.  
 Unfortunately, I haven't figured out how to do this with Tomcat.  It seems 
 that I have to manually edit conf/server.xml in order to start and stop with 
 different web apps installed.
 
 Can anyone provide suggestions on how to start and stop Tomcat with different 
 web apps installed without having to edit conf/server.xml?
 
 Thanks.
 
 Scott
 
 
 Just a mirror for the sun...
  My smiling eyes are just a mirror for the sun.
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



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




Re: Tomcat Problem

2002-10-05 Thread Andreas Probst

Hi Uma,

it seems you installed Tomcat as a service. You could deinstall 
this service or set it to manual start. Then you should be able 
to start Tomcat manually from the script.

On Sun, 29 Sep 2002 19:30:50 -0500 there was a message from 
Jacob Kjome (Subject: Re: Need Help ASAP w. Tomcat install!), 
where he also explained, how to install or deinstall the service 
from the command line.

Andreas


On 5 Oct 2002 at 7:54, Uma Maheswar wrote:

 Hello,
 I cannot view the Tomcat Console. I am using Tomcat 4.0 on Win XP. Also, I
 cannot start the Tomcat from
 Start - Programmes - Apache Tomcat. I need to go to the Control Panel -
 Admin Tools - Services and then start the Tomcat over there.
 
 Can any one tell me what is wrong? I am also using JDK1.4.0
 
 Thanks
 Uma
 Java Developer
 http://www.javagalaxy.com
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



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




Re: JAVA SOAP Discussion List

2002-10-03 Thread Andreas Probst

Hi Alphonsus,

if you prefer reading old messages in your email client, you can 
get old threads be sending a message to

[EMAIL PROTECTED]

This will give you all messages with the same subject as message 
12345. The difficulty here is to obtain the right message 
number. I observed that the message numbers inside the urls of 
the web mail archive are NOT the same as the ones you need for 
the command above, at least for Slide user list.

To get to know the numbers you will need to send a message to

[EMAIL PROTECTED]

This will list authors, subjects, dates and numbers.

mailto:[EMAIL PROTECTED]

will give you more help on this.

Andreas


On 2 Oct 2002 at 11:29, Alphonsus wrote:

 Hi all,
 could anyone please tell where I can find a Java Soap List? Also where
 can I find the old threads of this list (Tomcat)?
 
 TIA,
 Alphonsus.
 


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




Re: The right path; in more way than one.

2002-09-30 Thread Andreas Probst

Hi Ed,

I'm not sure, what your question is. Let me try to answer like 
this: Tomcat will look for class files and jars in the various 
classes and libs directories. Read pathto/tomcat-doc/class-
loader-howto.html to know exactly.

You can have your application's directory anywhere, if you 
configure a context in server.xml. If you put it under webapps 
you don't have to configure a context.

For deploying your app it's probably the best to use Ant. Read 
the app developer's guide (pathto/tomcat-doc/appdev/index.html) 
to get to know best practices of the development process.

In case Tomcat complains about JAVA_HOME: In autoexec.bat it 
might be better to set the DOS 8.3 pathname. Go to e: and type 
dir to get to know the 8.3 name of jsdk1.4.0. (Something with ~)

Hope this helps.

Andreas

 
 
 Hello and Help
 
 I need to have Tomcat working on my machine but I can't getting get the
 right path in my browser.
 So here Goes
 
 My System is Windows 98
 Tomcat version is 4.0.4
 My Java editor is JCreator 2.5
 jdk is 1.4
 
 The install directory is D:\ApacheTomcat4\
 My system directory is D:\windows
 
 autoexec.bat settings
 set JAVA_HOME=E:\j2sdk1.4.0
 set $CATALINA_HOME=D:\ApacheTomcat4
 set  CATALINA_HOME=D:\ApacheTomcat4
 
 
 I set the port to 8088 so; http:// localhost:8088/index.html pulls up the
 splash screen, and in fact is where I got the addresses.
 
 Questions:
Is there a command or port that will get Tomcat to tell me where it
 thinks the class files will be?
What setting can I change to get Tomcat to look in a specific
 directory so I can tell the compiler to put the output the class file?
 Are there any advanced tip sheets for install and configuration?
 Please respond with all revenant information. The need is urgent.
 
 
 You have my personal Regards,
 Ed
 
 They that can give up essential liberty to obtain a little temporary safety
 deserve neither liberty nor safety.
 ...Benjamin Franklin, Historical Review of Pennsylvania, 1759
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



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




Re: URGENT sign java applet

2002-09-26 Thread Andreas Probst

 how to sign java applet

read 
pathTo/j2sdk1.4.0/docs/guide/security/SecurityToolsSummary.html

Summary:

- Put classes into jar
- sign jar

Andreas


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




Re: How to write a servlet that handle request for .xml documents

2002-09-26 Thread Andreas Probst

 Hi, I have setup the web.xml to direct request to .xml to my servlet
 
 However, I do not know how to write the servlet inorder to have it
 perform jobs I want it to do. Anyone know of any guides on writing it or
 know how to write it? Thanks in advance.

The sun site has a tutorial. Search www.javasoft.com.

O'Reilly's Java Servlet Programming is a good book on Java 
servlets.

Andreas


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




Re: Security question

2002-09-23 Thread Andreas Probst

Hi David,

if it weren't Apache I would say: try 
HttpServletRequest.getUserPrincipal().getName(). Maybe it could 
be that this also works with Apache...

Andreas


 I'm trying to retrieve the userid that logged into apache and accessed 
 the current JSP page.  How can I get this info?
 
 Explanation: I'm implementing a very crude security system on my site 
 for right now (mainly to just keep people from accessing the email 
 addresses and photos on the site), but I need to implement a password 
 change page.  So what I did (and yes I know it's a hack 8), I 
 implemented a JNI interface to call htpasswd in the background.  I'm 
 trying to have an html page (that's in a secured area of course) post 
 the new password to a jsp page which will in turn retrieve the logged in 
 userID and call the interface class.
 
 Any help would be appreciated,
 David J
 -- 
 If you only compete with yourself,
  you can always be a winner. - David Jenkins
 Of course, you could always be a loser too. - Miles Thornton
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



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




Getting Login name and password

2002-09-22 Thread Andreas Probst

Hi all,

I know there is a way to get the user name by calling 
HttpServletRequest.getUserPrincipal().getName(). I also need the 
password. How can this be achieved?

Thanks in advance.

Andreas


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




Context path

2002-09-19 Thread Andreas Probst

Hi all,

I need to know the context path of my web app. If I have a 

HttpServletRequest req, I can get 
String contextPath = req.getContextPath();

Now, what can I do within init()? I havn't got a 
HttpServletRequest there. How do I get the context path?

Thanks in advance.

Andreas


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




Re: basic question

2002-09-17 Thread Andreas Probst

Hi all!

If you have a HttpServletRequest req,

you can get 

String contextPath = req.getContextPath();

This would give you /myapp.

My question is: How can I get to know the context path in 
init(), where I don't have a HttpServletRequest?

 have you tried using getServletContext() or
 getServletContextName()
 
I have the impression this works only if you have a context 
specified in server.xml.

Andreas

 Regards
 Prashanth
 
 
 --- Ashish Kulkarni [EMAIL PROTECTED] wrote:
  Hi,
  Sorry for asking a very basic question, but i need
  to
  know the answer
  Suppose i have a URL like below
  http://localhost:8080/myapp/index.jsp
  
  how can i find in servlet or jsp what is the
  application name
  like in the above case it is myapp, 
  suppose there is other URL 
  http://localhost:8080/myapp1/index.jsp
  how can i get value of myapp1 (it can be any
  thing)in
  my jsp or servlet
  Ashish
  
  __
  Do you Yahoo!?
  Yahoo! News - Today's headlines
  http://news.yahoo.com
  
  --
  To unsubscribe, e-mail:  
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 Yahoo! News - Today's headlines
 http://news.yahoo.com
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED] For
 additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 



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




RE: Tomcat 'out of environment space' message

2002-09-11 Thread Andreas Probst

Hi Samantha,

up to Win98 Windows loads c:\autoexec.bat during startup. No 
other autexec.bat is read. You can have more than one, but only 
the one in c:\ is processed.  

To run Tomcat you don't need the classpath variable as far as I 
know. As long as you don't need it for other purposes don't set 
it. In case you need it: I experienced that including . (dot - 
the current directory) makes life much easier, like for instance 

 set classpath=.;d:\java 

For compiling webapps better use Ant or the facilities in your 
IDE (I like Eclipse very much). In both cases you don't need to 
set the classpath variable.  

Andreas


 Hi everyone 
 
  Thanks to those who offered assistance for the 'out of
  environment space'
 mesg... it works ! :-)
 
  Would I have to set classpaths or is this done automatically on
 installation ? I reason I ask is because I see I have 2 autoexec.bat
 files on my machine.. one on c:\autoexec.bat and the other under
 c:\tomcat\autoexec.bat ... presumably one should only have one
 autoexec.bat file! I think I have 2 separate versions because I
 installed a different version of Tomcat on my machine and the
 autoexec.bat file was on that cd when I copied it across . I viewed the
 c:\tomcat\autoexec.bat file and decided to move the 'SET classpath'
 settings to the c:\autoexec.bat file , and it had disasterous
 consequences ...couldn't load Win98 ! 
 
  I managed to salvage my machine , and restored the autoexec.bat
  files to
 their original format .
  The question is one supposed to have more than one autoexec.bat
  file and
 can I put all the 
  settings in one file (I noticed that both files differ quite
  drastically) .
 
  Thanks
  Samantha

 
 ##
 Attention:
 This e-mail message is privileged and confidential. If you are
 not the intended recipient please delete the message and notify
 the sender. Any views or opinions presented are solely those of
 the author.
 


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




RE: Tomcat 3.1.* config problem

2002-09-09 Thread Andreas Probst

 Thanks Tony ...
 
 I'll try this later as I haven't got it installed at my machine at work 
 more worrying I think is how to set up the JAVA_HOME variable 
 any ideas as to where I can locate more detailed info would be much
 appreciated ...

For the out-of-memory you can simply add the following line to 
your c:\config.sys:

shell=c:\windows\command.com /e:4096

This will then work for every DOS box.

For setting the JAVA_HOME, add a line similar to the  following 
line to your c:\autoexec.bat:

SET JAVA_HOME=c:\java\jdk13~1.1_0

Make sure you use the DOS 8.3 filename format when setting the 
variable in autoexec.bat. To get to know the 8.3 filename open a 
DOS box, navigate to the parent of your java home and type dir. 
Then the filename will be shown in long and 8.3 format.

To make it easier you could copy your existing jdk to a path 
like c:\java\jsdk131 and use this one for your JAVA_HOME 
setting.

After all restart the computer.

Andreas

 
 Thanks
 Samantha
 
 -Original Message-
 From: Tony McNicholas [mailto:[EMAIL PROTECTED]]
 Sent: Monday, September 09, 2002 1:16 PM
 To: Tomcat Users List
 Subject: RE: Tomcat 3.1.* config problem
 
 
 Samantha, 
 
 I think this might help resovle your problem 
 
 http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q230205;
 
 Out of Environment Space Error Message in MS-DOS Programs
 The information in this article applies to:
 Microsoft Windows 95
 Microsoft Windows 95 OEM Service Release 1, 2, 2.1, 2.5
 Microsoft Windows 98
 
 -Original Message-
 From: Hoy, Samantha SSA-CORAR11 [mailto:[EMAIL PROTECTED]]
 Sent: 09 September 2002 12:04
 To: 'Tomcat Users List'
 Subject: Tomcat 3.1.* config problem
 
 
 Hi 
 
 I have been trying to install Tomcat v3.1.2 (I think which by the looks of
 it is a really old version) - my problem is 
 that I have installed 2 different versions of Tomcat in 2 different places -
 one in its own root directory and 
 the other in a sub-directory of JBuilder4. I seem to get an 'out of
 environment space' (I am running of Windows 98)
 issue when trying to run from within JBuilder and I get a set up JAVA_HOME
 variable error message when trying to run/start Tomcat in the one
 off the root directory . How do I set this up correctly ?
 I have fiddled around in the classpath of my autoexec.bat file but don't
 think that I have got it right .
 
 I have to code an entire Java/JSP project and have a week to do it and am
 suitably freaked out that I cannot
 even get the configs correct ..lol ...
 
 Any takers ?
 
 Thanks
 Samantha
 
 
 ##
 Attention:
 This e-mail message is privileged and confidential. If you are not the 
 intended recipient please delete the message and notify the sender. 
 Any views or opinions presented are solely those of the author.
 


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




Re: web-inf/classes and eclipse

2002-08-20 Thread Andreas Probst

Hi Michenaud,

using Ant together with Eclipse might be an option. You can
run Ant from inside Eclipse by right-clicking the build.xml
file and choosing the right operation (I now don't know how it
is called).

Andreas


 Hi,

 I use the editor Eclipse but when i launch
 Rebuild all, it deletes all the content of
 the WEB-INF/classes directory.

 Inside, there is all my *.properties file.

 The idea is to create a WEB-INF/config where i
 could put the properties files but i don't know how
 to add this directory into the classpath. It would be better
 too if the path was a relative path.

 Or maybe u have others ideas ?

 Michenaud Laurent
 - Adeuza -
 [ Développeur Web - Administrateur Réseau ]


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




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




RE: web-inf/classes and eclipse

2002-08-20 Thread Andreas Probst

As far as I know, there is no classpath in Tomcat, but a
classloader hierarchy.

In a few threads about how to write files into the file system
I read about passing a parameter to the webapp. This parameter
could be the path to the config file somewhere on your system.

 thanks for this idea. I think i will use ant..

 But what about adding WEB-INF/config to the CLASSPATH ?
 How can i do that automatically for all tomcat projects ?

  -Message d'origine-
  De : Andreas Probst [mailto:[EMAIL PROTECTED]]
  Envoyé : mardi 20 août 2002 09:37
  À : Tomcat Users List
  Objet : Re: web-inf/classes and eclipse
 
 
  Hi Michenaud,
 
  using Ant together with Eclipse might be an option. You can
  run Ant from inside Eclipse by right-clicking the build.xml
  file and choosing the right operation (I now don't know how it
  is called).
 
  Andreas
 
 
   Hi,
  
   I use the editor Eclipse but when i launch
   Rebuild all, it deletes all the content of
   the WEB-INF/classes directory.
  
   Inside, there is all my *.properties file.
  
   The idea is to create a WEB-INF/config where i
   could put the properties files but i don't know how
   to add this directory into the classpath. It would be better
   too if the path was a relative path.
  
   Or maybe u have others ideas ?
  
   Michenaud Laurent
   - Adeuza -
   [ Développeur Web - Administrateur Réseau ]
  
  
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
 
 
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 

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




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




Re: NotSerializableException

2002-08-20 Thread Andreas Probst

Obviously it does serialization. It loads a session from 
persistent storage. Serialization is a means to make objects 
persistent. Having written that I must confess I don't know 
about sessions in Tomcat...

 I am not asking tomcat to serialize my app, nor do I
 have any serialization in this application.  Why am I
 getting this new exception?
 
 2002-08-19 21:06:27 StandardManager[/NoPassApp]
 Exception loading sessions from persistent storage
 java.io.WriteAbortedException: writing aborted;
 java.io.NotSerializableException:
 com.sun.mail.imap.IMAPFolder
 at
 java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278)
 at
 java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
 at
 java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
 at
 java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
 at
 java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
 at
 java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
 at
 org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1268)
 at
 org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:810)
 at
 org.apache.catalina.session.StandardManager.load(StandardManager.java:411)
 at
 org.apache.catalina.session.StandardManager.start(StandardManager.java:617)
 at
 org.apache.catalina.core.StandardContext.reload(StandardContext.java:2497)
 at
 org.apache.catalina.loader.WebappContextNotifier.run(WebappLoader.java:1332)
 at java.lang.Thread.run(Thread.java:536)
 Caused by: java.io.NotSerializableException:
 com.sun.mail.imap.IMAPFolder
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
 at
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1330)
 at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1302)
 at
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1245)
 at
 java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
 at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
 at
 org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1338)
 at
 org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:827)
 at
 org.apache.catalina.session.StandardManager.unload(StandardManager.java:507)
 at
 org.apache.catalina.session.StandardManager.stop(StandardManager.java:654)
 at
 org.apache.catalina.core.StandardContext.reload(StandardContext.java:2409)
 ... 2 more
 
 
 __
 Do You Yahoo!?
 HotJobs - Search Thousands of New Jobs
 http://www.hotjobs.com
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



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




Re: Login-Password http://localhost/manager ????? Please help me....

2002-07-25 Thread Andreas Probst

Hi,

look at http://localhost:8080/tomcat-docs/manager-howto.html.

There it says You can add the manager role to the comma-delimited roles attriute for 
one or more existing users, and/or create new users with that assigned role.

So just add ,manager to one of those users. Then you can use this user for the 
manager app. For safety reason you should not use one of the predefined users but 
define a new user with role manager.

After that you have to restart Tomcat.

Hope that's what's needed by you.

Andreas

 hi,
 
 I have installed TomCat 4.0.4 on W2K.
 Everything seems OK. I can access the
 examples and run them thru http://localhost:8080
 
 Now when I access http://localhost:8080/manager
 I enter tomcat/tomcat it doesn't run this way.
 
 I have also gone thru the user configuration file
 where I found 3 default users. I've tried all those.
 
 So far  I haven't done anything with the configuration
 files. Could anyone tell me the default login/password
 of http://localhost:8080/manager   ???
 
 
 best regards,
 
 Sameer Arora
 [EMAIL PROTECTED]
 
 
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 



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




RE: newbie - finding class files

2002-07-16 Thread Andreas Probst


 On Mon, 15 Jul 2002, Andreas Probst wrote:
 
 
  Hi all,
 
  does Tomcat really look into tomcatdir/server/lib? For me it seems
  Tomcat doesn't.
 
 
 This directory is only visible to the classloader for Tomcat itself, not
 for webapps.  There is a special rule that makes servlet classes in
 package org.apache.catalina available to webapps anyway, however, which
 is why the standard WebdavServlet (as well as the other Tomcat features
 that are available via servlets) can be loaded.
 
 Craig

Thank you Craig.

Could you please tell more about the rule or give a pointer. The class-loader-info of 
the Tomcat-Docu says nothing about the rule, but says, that These classes and 
resources are TOTALLY invisible to web applications.

Bye.

Andreas

 
 
  On the one hand the original webapp /webdav runs without errors. On
  the other hand, when I deploy a class that extends the original
  webdav-class org.apache.catalina.servlets.WebdavServlet (located in
  catalinahome\server\lib\servlets-webdav.jar) I get an
  java.lang.NoClassDefFoundError:
  org/apache/catalina/servlets/WebdavServlet.
 
  When I then copy catalinahome\server\lib\servlets-webdav.jar into
  catalinahome\webapps\mywebdav\WEB-INF\lib I get a different
  java.lang.NoClassDefFoundError:
  org/apache/catalina/servlets/DefaultServlet. DefaultServlet is
  located in catalinahome\server\lib\servlets-default.jar. So it seems
  Tomcat doesn't look into the catalinahome\server\lib\ directory. But
  why then runs the original /webdav app?
 
  What do I do wrong? Do I have to tell Tomcat somehow to look into the
  catalinahome\server\lib\ directory when running my webapp? Or do I
  have to copy all needed files from catalinahome\server\lib\ to my
  webapp's lib-directory? I suppose this shouldn't be the solution.
 
  By the way: I'm running Tomcat 4.0.4 on Windows 2000.
 
  Thanks a lot in advance.
 
  Andreas 


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




RE: newbie - finding class files

2002-07-15 Thread Andreas Probst

Hi all,

does Tomcat really look into tomcatdir/server/lib? For me it seems 
Tomcat doesn't. 

On the one hand the original webapp /webdav runs without errors. On 
the other hand, when I deploy a class that extends the original 
webdav-class org.apache.catalina.servlets.WebdavServlet (located in 
catalinahome\server\lib\servlets-webdav.jar) I get an 
java.lang.NoClassDefFoundError: 
org/apache/catalina/servlets/WebdavServlet.

When I then copy catalinahome\server\lib\servlets-webdav.jar into 
catalinahome\webapps\mywebdav\WEB-INF\lib I get a different 
java.lang.NoClassDefFoundError: 
org/apache/catalina/servlets/DefaultServlet. DefaultServlet is 
located in catalinahome\server\lib\servlets-default.jar. So it seems 
Tomcat doesn't look into the catalinahome\server\lib\ directory. But 
why then runs the original /webdav app?

What do I do wrong? Do I have to tell Tomcat somehow to look into the 
catalinahome\server\lib\ directory when running my webapp? Or do I 
have to copy all needed files from catalinahome\server\lib\ to my 
webapp's lib-directory? I suppose this shouldn't be the solution.

By the way: I'm running Tomcat 4.0.4 on Windows 2000.

Thanks a lot in advance.

Andreas Probst

 Brian,
 
 Tomcat looks for your classes under
 Tomcatdir/webapps/yourapp/WEB-INF/classes and Tomcatdir/common/classes and
 looks for your jars in Tomcatdir/webapps/yourapp/WEB-INF/lib ,
 Tomcatdir/common/lib (and Tomcatdir/server/lib but you shouldn't put your
 stuff in here)
 
 Andy
 
  -Original Message-
  From: Brian Wolf [mailto:[EMAIL PROTECTED]]
  Sent: 11 July 2002 22:12
  To: Tomcat Users List
  Subject: newbie - finding class files
 
 
  Hi
 
  I am having problems with  servlets finding class files. On Windows 98
  I have the classpath and path environmental variables set to
  c:\jdk1.4\bin
  and c:\jdk1.4 respectively. The Servlet works fine when converted to a
  command line application.
 
  -Brian
 
  ---
 
 
  Error: 500
  Location: /examples/servlet/processOptions
  Internal Servlet Error:
 
  java.lang.NoClassDefFoundError:
  com/sun/java/util/collections/AbstractSequentialList
   at org.jdom.input.SAXBuilder.createContentHandler(SAXBuilder.java)
   at org.jdom.input.SAXBuilder.build(SAXBuilder.java)
 
 
 
 
 
 



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