Re: Unable to work with Tomcat 4.0

2007-02-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rahul,

Rahul Choubey wrote:
 I have installed Apache Tomcat version 4.0 in my system.

Wow. Any particular reason to use 4.0? If you really are starting from
scratch, you ought to start out with at least Tomcat 5.5.

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

iD8DBQFFzyde9CaO5/Lv0PARAiqVAJ0Y9J/bBLZtvDQMA09O8X8Vj0IZ2gCeLxJf
B3oUhiWEzTCiN29eQiPKoHo=
=6nUU
-END PGP SIGNATURE-

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



Re: Unable to work with Tomcat 4.0

2007-02-11 Thread Mr. Steve Burrus
Yes yes I heartily echo Chris's comment, that version 4.0 of the tomcat 
aplication server is way too old by now!!! Frankly nobody/ no one is 
going to help you with *any* problem with tomcat 4.


Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rahul,

Rahul Choubey wrote:
 


I have installed Apache Tomcat version 4.0 in my system.
   



Wow. Any particular reason to use 4.0? If you really are starting from
scratch, you ought to start out with at least Tomcat 5.5.

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

iD8DBQFFzyde9CaO5/Lv0PARAiqVAJ0Y9J/bBLZtvDQMA09O8X8Vj0IZ2gCeLxJf
B3oUhiWEzTCiN29eQiPKoHo=
=6nUU
-END PGP SIGNATURE-

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


 





Re: Unable to work with Tomcat 4.0

2007-02-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Steve,

Mr. Steve Burrus wrote:
 Yes yes I heartily echo Chris's comment, that version 4.0 of the tomcat
 aplication server is way too old by now!!! Frankly nobody/ no one is
 going to help you with *any* problem with tomcat 4.

Actually, I still have some apps running under 4.1, which is at least
better than 4.0 ;)

I am slowly moving everything to 5.5, but testing for a mission-critical
application takes a long time.

- -chris

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

iD8DBQFFz2Ri9CaO5/Lv0PARAlevAJ4yKabWCKB5+R4r+2gCMeqSv5NOWgCdF0W9
19HNZg8ekXKTd/gSpHjGHpM=
=0F8f
-END PGP SIGNATURE-

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



Re: Servlet/JSP source code to save data in a file

2007-02-11 Thread Rashmi Rubdi
Not sure what you're looking for:

%@ page contentType=text/html;charset=UTF-8 language=java 
errorPage=error.jsp %
html
  headtitle/title/head
  body
  %
  int test = 5;
  %
  /body
/html

- Original Message 
From: Teh Noranis Mohd Aris [EMAIL PROTECTED]
To: users@tomcat.apache.org
Sent: Saturday, February 10, 2007 11:35:27 PM
Subject: Servlet/JSP source code to save data in a file


Dear all,
   
  Does anyone have the Servlet/JSP source code to save data in a file that will 
be located in the server? I need the source code very urgently. I have my own 
version but it is not working. Please help me! Thank you.
   
   
  Yours Sincerely,
  TEH NORANIS 


-
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.


 

TV dinner still cooling? 
Check out Tonight's Picks on Yahoo! TV.
http://tv.yahoo.com/

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



Re: Unable to work with Tomcat 4.0

2007-02-11 Thread David Kerber

Rahul Choubey wrote:

Dear Friends,

I have installed Apache Tomcat version 4.0 in my system.
I am getting the homepage correctly on writing
http://localhost:8080 on the browser's address bar but
when I go to servlets example page I am unable to execute
the servlets,the same is the problem with JSP too.I am getting
the following error:

Apache Tomcat/4.0.4- HTTP Status 404 - /examples/servlet/HelloWorldExample
type Status report
 message /examples/servlet/HelloWorldExample
 description The requested resource  (/examples/servlet/HelloWorldExample) is 
not available.


I have correctly set the environment variables.I have tried on both Win98
and XP and on both IE and Mozilla.Please help.

Regards,
Rahul
  

Do you have the servlets configured in your web.xml or server.xml?




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



get a strange cast error with using the tomcat mail ressource

2007-02-11 Thread albrecht andrzejewski


Hello all,

I hope i will not pollute the list, but i'm affraid of being faced  
with a bug :-(


I have to send a mail with tomcat.
I followed the instructions of the tomcat documentation, corresponding  
my version (5.5).


Using this code:

 public static String sendMail(String destinataire, String login){

Session session = null;
try {
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env);
line 36 session = (Session) envCtx.lookup(mail/MonMail);
//session = envCtx.lookup(mail/MonMail);
} catch (NamingException ex) {
  System.out.println(erreur au lookup);
   return ex.getMessage();
}

I have the following error that i really dislike :

java.lang.ClassCastException: javax.mail.Session cannot be cast to  
javax.mail.Session

at utils.MailHelper.sendMail(MailHelper.java:36)

I use the netbeans 5.5 bundled tomcat server (v 5.5.17) on the 1.6  
java version (but source level set to 1.5).


Do you think it's me ? Or a bug of the IDE ? or a bug of tomcat ?

I previously used this code with the same config in a successful way  
with another tomcat 5.5 server.


I'm getting crazy with this awful and strange cast error :-(
If only someone could help...

I join the web.xml tag:

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

and my server.xml

 Resource
  name=mail/MonMail
  type=javax.mail.Session
  mail.smtp.host=smtp.free.fr/

and my context.xml

 Resource name=mail/MonMail auth=Container
type=javax.mail.Session
mail.smtp.host=smtp.free.fr/

Hope to hear soon from the list about this problem :-(
Best regards.


Ce message a ete envoye par le serveur IMP de l'EMA.



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



Re: get a strange cast error with using the tomcat mail ressource

2007-02-11 Thread Martin Gainty
this is what I currently use in web.xml

/**/
  resource-ref
res-ref-nameMySession/res-ref-name
res-typejavax.mail.Session/res-type
res-authContainer/res-auth
  /resource-ref

/CODE***/
import java.util.*;
import javax.mail.*;
import javax.naming.*;

/**
 * Method used to login to the mail host.
 */
public void login() throws Exception {
url = new URLName(protocol, getHostname(), -1, mbox, 
  getUsername(), getPassword());
 /*
  * First, try to get the session from JNDI,
  * as would be done under J2EE.
  */
 try {
 InitialContext ic = new InitialContext();
 Context ctx = (Context)ic.lookup(java:comp/env);
 session = (Session)ctx.lookup(MySession);
 } catch (Exception ex) {
 // ignore it
 }

 // if JNDI fails, try the old way that should work everywhere
 if (session == null) {
 Properties props = null;
 try {
  props = System.getProperties();
 } catch (SecurityException sex) {
  props = new Properties();
 }
 session = Session.getInstance(props, null);
 }
store = session.getStore(url);
store.connect();
folder = store.getFolder(url);

folder.open(Folder.READ_WRITE);
}

(you will notice I didnt use lookup on 
mail/MonMail 
)

Martin--
--- 
This e-mail message (including attachments, if any) is intended for the use of 
the individual or entity to which it is addressed and may contain information 
that is privileged, proprietary , confidential and exempt from disclosure. If 
you are not the intended recipient, you are notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.
--- 
Le présent message électronique (y compris les pièces qui y sont annexées, le 
cas échéant) s'adresse au destinataire indiqué et peut contenir des 
renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le 
destinataire de ce document, nous vous signalons qu'il est strictement interdit 
de le diffuser, de le distribuer ou de le reproduire.
- Original Message - 
From: albrecht andrzejewski [EMAIL PROTECTED]
To: users@tomcat.apache.org
Sent: Sunday, February 11, 2007 5:24 PM
Subject: get a strange cast error with using the tomcat mail ressource



Hello all,

I hope i will not pollute the list, but i'm affraid of being faced  
with a bug :-(

I have to send a mail with tomcat.
I followed the instructions of the tomcat documentation, corresponding  
my version (5.5).

Using this code:

  public static String sendMail(String destinataire, String login){

 Session session = null;
 try {
 Context initCtx = new InitialContext();
 Context envCtx = (Context) initCtx.lookup(java:comp/env);
line 36 session = (Session) envCtx.lookup(mail/MonMail);
 //session = envCtx.lookup(mail/MonMail);
 } catch (NamingException ex) {
   System.out.println(erreur au lookup);
return ex.getMessage();
 }

I have the following error that i really dislike :

java.lang.ClassCastException: javax.mail.Session cannot be cast to  
javax.mail.Session
 at utils.MailHelper.sendMail(MailHelper.java:36)

I use the netbeans 5.5 bundled tomcat server (v 5.5.17) on the 1.6  
java version (but source level set to 1.5).

Do you think it's me ? Or a bug of the IDE ? or a bug of tomcat ?

I previously used this code with the same config in a successful way  
with another tomcat 5.5 server.

I'm getting crazy with this awful and strange cast error :-(
If only someone could help...

I join the web.xml tag:

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

and my server.xml

  Resource
   name=mail/MonMail
   type=javax.mail.Session
   mail.smtp.host=smtp.free.fr/

and my context.xml

  Resource name=mail/MonMail auth=Container
 type=javax.mail.Session
 mail.smtp.host=smtp.free.fr/

Hope to hear soon from the list about this problem :-(
Best regards.


Ce message a ete envoye par le serveur IMP de l'EMA.



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



RE: get a strange cast error with using the tomcat mail ressource

2007-02-11 Thread Caldarale, Charles R
 From: albrecht andrzejewski [mailto:[EMAIL PROTECTED] 
 Subject: get a strange cast error with using the tomcat mail ressource
 
 I have the following error that i really dislike :
 
 java.lang.ClassCastException: javax.mail.Session cannot be cast to  
 javax.mail.Session
  at utils.MailHelper.sendMail(MailHelper.java:36)

This would indicate you've got the javax.mail.Session class in multiple
places.  The activation.jar and mail.jar files should go into common/lib
only, not in the app's WEB-INF/lib.  Check the docs for configuring
mail:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html#JavaMa
il%20Sessions

See the note in item 4.

 - Chuck


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

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



Re: Unable to work with Tomcat 4.0

2007-02-11 Thread Martin Gainty
That said What is  the problem you are experiencing?
M-
--- 
This e-mail message (including attachments, if any) is intended for the use of 
the individual or entity to which it is addressed and may contain information 
that is privileged, proprietary , confidential and exempt from disclosure. If 
you are not the intended recipient, you are notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.
--- 
Le présent message électronique (y compris les pièces qui y sont annexées, le 
cas échéant) s'adresse au destinataire indiqué et peut contenir des 
renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le 
destinataire de ce document, nous vous signalons qu'il est strictement interdit 
de le diffuser, de le distribuer ou de le reproduire.
- Original Message - 
From: Mr. Steve Burrus [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Sunday, February 11, 2007 1:36 PM
Subject: Re: Unable to work with Tomcat 4.0


 Yes yes I heartily echo Chris's comment, that version 4.0 of the tomcat 
 aplication server is way too old by now!!! Frankly nobody/ no one is 
 going to help you with *any* problem with tomcat 4.
 
 Christopher Schultz wrote:
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rahul,

Rahul Choubey wrote:
  

I have installed Apache Tomcat version 4.0 in my system.



Wow. Any particular reason to use 4.0? If you really are starting from
scratch, you ought to start out with at least Tomcat 5.5.

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

iD8DBQFFzyde9CaO5/Lv0PARAiqVAJ0Y9J/bBLZtvDQMA09O8X8Vj0IZ2gCeLxJf
B3oUhiWEzTCiN29eQiPKoHo=
=6nUU
-END PGP SIGNATURE-

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


  

 


Re: Servlet/JSP source code to save data in a file

2007-02-11 Thread Rashmi Rubdi
Not the best code, but I guess this is close to what you're looking for:

~
index.jsp
~
%@ page contentType=text/html;charset=UTF-8 language=java %
html
  headtitle/title/head
  body
  jsp:useBean id=writeFile class=test27.WriteFile/
  jsp:setProperty name=writeFile property=fileText value=Some Text/
  The file was written : jsp:getProperty name=writeFile 
property=writeToFile/
  /body
/html

~
WriteFile.java
~
package test27;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class WriteFile {
String fileText;
boolean writeToFile;
public WriteFile() {
}
public String getFileText() {
return fileText;
}
public void setFileText(String fileText) {
this.fileText = fileText;
}
public boolean getWriteToFile() {
try {
BufferedWriter out = new BufferedWriter(new 
FileWriter(C://test.txt));
out.write(this.fileText);
out.close();
writeToFile = true;
} catch (IOException e) {
writeToFile = false;
//Log the exception here
e.printStackTrace();
}
return writeToFile;
}
public void setWriteToFile(boolean writeToFile) {
this.writeToFile = writeToFile;
}
}


-Rashmi


- Original Message 
From: Teh Noranis Mohd Aris [EMAIL PROTECTED]
To: users@tomcat.apache.org
Sent: Saturday, February 10, 2007 11:35:27 PM
Subject: Servlet/JSP source code to save data in a file


Dear all,
   
  Does anyone have the Servlet/JSP source code to save data in a file that will 
be located in the server? I need the source code very urgently. I have my own 
version but it is not working. Please help me! Thank you.
   
   
  Yours Sincerely,
  TEH NORANIS 


-
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.




TV dinner still cooling? 
Check out Tonight's Picks on Yahoo! TV.
http://tv.yahoo.com/

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


 

TV dinner still cooling? 
Check out Tonight's Picks on Yahoo! TV.
http://tv.yahoo.com/

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



Re: Servlet/JSP source code to save data in a file

2007-02-11 Thread Martin Gainty
also..make sure your container identifies write permissions in 
$TOMCAT_HOME/conf/catalina.policy

grant { permission java.io.FilePermission /test.txt, write; };

HTH
Martin--
--- 
This e-mail message (including attachments, if any) is intended for the use of 
the individual or entity to which it is addressed and may contain information 
that is privileged, proprietary , confidential and exempt from disclosure. If 
you are not the intended recipient, you are notified that any dissemination, 
distribution or copying of this communication is strictly prohibited.
--- 
Le présent message électronique (y compris les pièces qui y sont annexées, le 
cas échéant) s'adresse au destinataire indiqué et peut contenir des 
renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le 
destinataire de ce document, nous vous signalons qu'il est strictement interdit 
de le diffuser, de le distribuer ou de le reproduire.
- Original Message - 
From: Rashmi Rubdi [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Sunday, February 11, 2007 8:50 PM
Subject: Re: Servlet/JSP source code to save data in a file


Not the best code, but I guess this is close to what you're looking for:

~
index.jsp
~
%@ page contentType=text/html;charset=UTF-8 language=java %
html
  headtitle/title/head
  body
  jsp:useBean id=writeFile class=test27.WriteFile/
  jsp:setProperty name=writeFile property=fileText value=Some Text/
  The file was written : jsp:getProperty name=writeFile 
property=writeToFile/
  /body
/html

~
WriteFile.java
~
package test27;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class WriteFile {
String fileText;
boolean writeToFile;
public WriteFile() {
}
public String getFileText() {
return fileText;
}
public void setFileText(String fileText) {
this.fileText = fileText;
}
public boolean getWriteToFile() {
try {
BufferedWriter out = new BufferedWriter(new 
FileWriter(C://test.txt));
out.write(this.fileText);
out.close();
writeToFile = true;
} catch (IOException e) {
writeToFile = false;
//Log the exception here
e.printStackTrace();
}
return writeToFile;
}
public void setWriteToFile(boolean writeToFile) {
this.writeToFile = writeToFile;
}
}


-Rashmi


- Original Message 
From: Teh Noranis Mohd Aris [EMAIL PROTECTED]
To: users@tomcat.apache.org
Sent: Saturday, February 10, 2007 11:35:27 PM
Subject: Servlet/JSP source code to save data in a file


Dear all,
   
  Does anyone have the Servlet/JSP source code to save data in a file that will 
be located in the server? I need the source code very urgently. I have my own 
version but it is not working. Please help me! Thank you.
   
   
  Yours Sincerely,
  TEH NORANIS 


-
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.




TV dinner still cooling? 
Check out Tonight's Picks on Yahoo! TV.
http://tv.yahoo.com/

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


 

TV dinner still cooling? 
Check out Tonight's Picks on Yahoo! TV.
http://tv.yahoo.com/

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



Re: Unable to work with Tomcat 4.0

2007-02-11 Thread Mark Thomas
Mr. Steve Burrus wrote:
 Frankly nobody/ no one is
 going to help you with *any* problem with tomcat 4.
Yes 4.1.x is old but this is simply not the case. Bugs are being
fixed, questions are being answered and releases are happening.
Granted releases aren't that frequent, but there aren't that many bugs
being reported.

What isn't happening is active development of new features for 4.1.x.
The effort for new features is mainly focussed on the 6.0.x branch
with some still on 5.5.x

Mark



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



Re: Windows Authentication against multiple domains

2007-02-11 Thread Pulkit Singhal

I can't suggest any open-source/free products but allow me to suggest
reading the following article if you want to roll your own solution one of
these days in the windows world:
http://www.microsoft.com/msj/0899/kerberos/kerberos.aspx

Once you read it, I hope you will be able to see how you can put some amount
of work in from your side and leverage Kerberos as a solution across Windows
domains.

But may be I misunderstood your problem, may be you don't want SSO across
multiple domains. Maybe you simply want a piece of code that can connect to
multiple ADs instead of just one? I suggest a bit more clarification so that
the list readers may understand your use-case.

Cheers!

On 2/9/07, Suneet Shah [EMAIL PROTECTED] wrote:


Hello,
We have this capability in our open source identity and access management
solution where you can use more then one use more then one repository for
authentication. You may be able to use just the authentication service as
taking on the rest of it may be more then what you need.  The project is
OpenIAM on sourceforge. We will be putting a new release this weekend. If
you are interested in taking a look, let me know and I can send you a
link.

Regards
Suneet



On 2/9/07, Uwe_77 [EMAIL PROTECTED] wrote:


 Sure, I will let you know. Perhaps we need third party tools. Doese
 someone
 knows a solution?
 --
 View this message in context:

http://www.nabble.com/RE%3A-Windows-Authentication-against-multiple-domains-tf3203321.html#a8895171
 Sent from the Tomcat - User mailing list archive at Nabble.com.


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





Apache2.x + Tomcat 5.5 (Load Balance and Cluster)

2007-02-11 Thread Eric Chow

Hello,

Is there any complete configuration for Apache2.x + Tomcat 5.5 (Load
Balance and Cluster, Session Replication) ?


I tested some many times and found some many reference but also
failed. Would you please to show me a more completed and worked
configuration sample ?

Best regards,
Eric

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