Re: Problem reading the Accept-Encoding header from a request

2007-04-14 Thread Christian Hvitved

Hi

And thanks for all the quick help.

It turned out to be a really rookie mistake. It was my firewall, that was
changing my request.

I have to try to defend myself for being so stupid. I am using a coorparate
machine where I cant see the firewall in the tray, so I thought no firewall
was running.

Another thing is, that I think this is a big problem if many firewalls make
it impossible to compress responses using the accept-encoding header.

again thanks to all the people here helping tomcat users.

regards
Christian

On 4/14/07, Martin Gainty [EMAIL PROTECTED] wrote:


Good Morning Kristian-

if by weird you mean you dont understand  then take a look at
http://www.xml.com/pub/a/2005/06/22/sparklines.html?page=last
According to this link a response of dashes is interpreted as 0 bytes
returned

A few basic questions:
Is the server xmitting using HTTP 1.0? In other words are you running
tomcat
3.x?
If so can you transmit a default value in other words transmit something
other than 0 bytes?

Transmit via HTTP POST (instead of GET to ensure you are not causing an
length overrun scenario with HTTP GET)
Enable HTTPMonitor and trace every response
What is the Content-Type for this response?
What is the Content-Length for this reponse?

I found this link quite instructive
http://www.samspublishing.com/articles/article.asp?p=31443seqNum=6rl=1

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

- Original Message -
From: Christian Hvitved [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, April 14, 2007 3:13 AM
Subject: Re: Problem reading the Accept-Encoding header from a request


 Thank you very much for the comments.

 But I'm still not sure why I have problems reading the Accept-Encoding
 header on the server.

 My problem is when I recieve the request on the server (And I know by
 using
 a proxy that the request contains an Accept-Encoding header). At the
 server
 I cannot read the accept-encoding header, instead I get a header
 consisting
 of dashes.

 It doesn't matter if I try to read the headers of the request in a
filter
 or
 servlet/jsp - I have the same problem.

 When I generate the html response to the client I use this in the head
tag
 of the html page:
 meta content=text/html; charset=UTF-8 http-equiv=content-type /
 But I cannot see why this should have anything to do with reading
headers
 from the request.

 I'm really stuck in this weird problem

 regards, and thanks again.
 Christian


 On 4/13/07, Rashmi Rubdi [EMAIL PROTECTED] wrote:

  The problem arose when I was writing a special compression filter

 I tried your code in a JSP directly (without using any other custom
 compression filter)
 and it prints as follows:

 Accept-Encoding gzip,deflate

 some other headers..


 accept
 text/xml,application/xml,application/xhtml+xml,text/html;q=
 0.9,text/plain;q=0.8 ,image/png,*/*;q=0.5

 accept-language en-us,en;q=0.5

 accept-encoding gzip,deflate

 accept-charset  UTF-8,*

 some more headers..

 The description of Accept-Encoding may give you additional clues as to
 why you're getting dashes instead (when you use a custom compression):
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html


 -Rashmi

 On 4/13/07, Christian Hvitved [EMAIL PROTECTED] wrote:

  The code in my filter looks like this:
 
   HttpServletRequest req = (HttpServletRequest)request;
 
  String headerValue = req.getHeader(Accept-Encoding);
  System.out.println(encoding:  + headerValue);
 
  Enumeration e = req.getHeaderNames ();
  System.out.println(new request);
  while (e.hasMoreElements()) {
  String header = (String) e.nextElement();
  System.out.println(header);
  System.out.println(Value:  + req.getHeader(header));
 
  }
 

 -
 To start a new topic, e-mail: [EMAIL PROTECTED]
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Problem reading the Accept-Encoding header from a request

2007-04-14 Thread Christian Hvitved

Hi

The firewall on my laptop pc used is norton internet security 2005. It is
running on a danish windows xp. It is possible it has some customized
settings controlled by the administrators.

regards Christian

On 4/14/07, Hassan Schroeder [EMAIL PROTECTED] wrote:


On 4/14/07, Christian Hvitved [EMAIL PROTECTED] wrote:

 It was my firewall. It is

 Another thing is, that I think this is a big problem if many firewalls
make
 it impossible to compress responses using the accept-encoding header.

Can you clarify what kind of firewall you're talking about? Desktop
software on your Windows PC, dedicated hardware firewall, other?

And in any case, who is the vendor?

--
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: manager and host manager not available problem

2007-04-14 Thread Zhenja
I also noted that file Tomcat6.0\webapps\manager\manager.xml has following
contents:
Context docBase=${catalina.home}/server/webapps/manager
 privileged=true antiResourceLocking=false
antiJARLocking=false

  !-- Link to the user database we will get roles from --
  ResourceLink name=users global=UserDatabase
type=org.apache.catalina.UserDatabase/

/Context
However there is no such path existing
${catalina.home}/server/webapps/manager. Neither I cound find it from
installation files. Can somebody explain - what is happening here?

Regards,
Zhenja

Zhenja [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
 I am able to go to http://localhost:8080/manager/html. On this page I have
4
 applications listed: docs, examples, manager and host-manager. I can
browse
 to docs and examples. But when I try to browse to manager or host-manager,
I
 get error 404.
 I had in my tomcat-users.xml already entry
   user username=admin password=lala roles=admin,manager/
 I've added another one, and logged in under this different account, but
 result is the same.

 Zhenja

 Rashmi Rubdi [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  The correct default URL for the manager app on Tomcat 6.0.10 is
  http://localhost:8080/manager/html , I'm able to access it after a
  fresh install of Tomcat.
 
  You also need to add an entry into tomcat-users.xml located under
  ...\apache-tomcat-6.0.10\conf\
 
  Something like:
 
  ?xml version='1.0' encoding='utf-8'?
  tomcat-users
role rolename=manager/
role rolename=admin/
user username=someusername password=somepassword
 roles=admin,manager/
  /tomcat-users
 
  -Rashmi
  On 4/14/07, Zhenja [EMAIL PROTECTED] wrote:
   Hi all!
  
   I have installed Tomcat 6.0.10 on Windows XP as windows service. I can
   browse to examples and they are running.
   But when I browse to /manager or /host-manager I get error 404 - The
   requested resource is not available.
   Please help.
  
   Regards
  
  
  
  
   -
   To start a new topic, e-mail: [EMAIL PROTECTED]
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  To start a new topic, e-mail: [EMAIL PROTECTED]
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




 -
 To start a new topic, e-mail: [EMAIL PROTECTED]
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]






-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: manager and host manager not available problem

2007-04-14 Thread Rashmi Rubdi

Look in Manager's app's web.xml there's a URL pattern /html/* , that
URL is reletive to the /manager context, that's why you can access the
HTML manager at /manager/html

You should easily be able to find the manager app from the default
Tomcat page at
http://localhost:8080/ by clicking on Tomcat Manager on the top left
section of the left navigation.

-Rashmi

On 4/14/07, Zhenja [EMAIL PROTECTED] wrote:

However there is no such path existing
${catalina.home}/server/webapps/manager. Neither I cound find it from
installation files. Can somebody explain - what is happening here?

Regards,
Zhenja


-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Stuck in SYN_RECV when binding to ip

2007-04-14 Thread robert lazarski

On 4/13/07, robert lazarski [EMAIL PROTECTED] wrote:



tcp0  0 192.168.3.53:8080   xxx.xxx.118.243:8368
SYN_RECV-



This turned out to be a routing issue. I had to add a second default
gw , which created other problems but at least the mystery is solved.

Robert


Re: Error message

2007-04-14 Thread dfarris

Thanks for responding; I am using 1.4.2 with TOMCAT 5.0.28
Dwight

Quoting Martin Gainty [EMAIL PROTECTED]:


Dwight-

Must be too much heat because I havent seen this since IBM J2RE 1.4.2
Which JDK are you using?
Which version Tomcat?

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

- Original Message -
From: Dwight Farris [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Friday, April 13, 2007 7:45 PM
Subject: Error message



Has anyone seen an error message similar to the following?

java.lang.ClassFormatError: Illegal exception table range in class
file org/apache/tomcat/util/buf/ByteChunk

Dwight (520) 626-9913
(520) 626-6345 (fax)
(952) 237-0606 (cell)


-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: sending smtp mail failure

2007-04-14 Thread Mighty Tornado

Thanks for responding,

there something wrong with my code?
This is my code:

import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;




public class TimeTravelMailer
{
   public void sendMessage()
   {
   String to = [EMAIL PROTECTED];
   String from = [EMAIL PROTECTED];
   String host = smtp.google.com;
   String message = This is a test;

   Properties props = new Properties();

   props.put(mail.smtp.host, host);

   Session session = Session.getInstance(props);

   try
   {
   Transport bus = session.getTransport(smtp);

   bus.connect(host, [EMAIL PROTECTED], [EMAIL PROTECTED]);

   Message msg = new MimeMessage(session);

   msg.setFrom(new InternetAddress(from));

   InternetAddress[] address = {new InternetAddress(to)};

   msg.setRecipients(Message.RecipientType.TO, address);

   msg.setRecipients(Message.RecipientType.CC,
InternetAddress.parse(to, true));

   msg.setRecipients(Message.RecipientType.BCC,
InternetAddress.parse(to, false));

   msg.setSubject(Test E-Mail through Java);

   msg.setSentDate(new Date());

   msg.setText(message);

   msg.saveChanges();

 bus.sendMessage(msg, address);

 bus.close();
   }
   catch(Exception ex)
   {
   ex.printStackTrace();
   }
   }
}

On 4/7/07, Johnny Kewl [EMAIL PROTECTED] wrote:



Easiest way is to setup a normal email program and see what the error
messages are.
If the machine doesnt have core mailing engines installed, it will
probably
tell you.
If you on windows, try Outlook express, detailed messages will probably
point you in right direction.

Code should look something like this


public boolean prepareConnection(String smtpHost){
this.smtpHost = smtpHost;
fSessionInited = true;

try{
java.util.Properties properties = System.getProperties();
properties.put(mail.smtp.host, smtpHost);
session = Session.getInstance(properties,null);
} catch(Exception e) {
   fSessionInited = false;
}

return fSessionInited;
}




- Original Message -
From: Mighty Tornado [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 06, 2007 7:30 AM
Subject: sending smtp mail failure


 Hi,

 I set up a small web app and the servlet is supposed to send an email
 using
 JavaMail. But I am getting exceptions - Connection Timed out every time.
I
 am using Gmail as an smtp server to bounce emails off. How can I avoid
the
 Connection Timed out exception? Could it be because of my firewall? If
so,
 which process should I permission?

 Thank you,

 MT



-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: sending smtp mail failure

2007-04-14 Thread Johnny Kewl


Here is a little framework that u can play with

   MimeMessage msg = new MimeMessage(session);
   msg.setFrom(new InternetAddress(from));
   msg.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
   msg.setSubject(subject);
   msg.setSentDate(new Date());

// ADD TEXT
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText(sMessage);

   //ADD ATTACHEMENT
   MimeBodyPart mbp2 = new MimeBodyPart();
   if (sFilename.length()  0){
   mbp2.setFileName(sFilename);
   mbp2.setText(sAttachment, us-ascii);
   }

// JOIN THEM
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
if (sFilename.length()  0) mp.addBodyPart(mbp2);

// ADD and SEND
   msg.setContent(mp);
   Transport.send(msg);


Have fun

- Original Message - 
From: Mighty Tornado [EMAIL PROTECTED]

To: Tomcat Users List [EMAIL PROTECTED]
Sent: Sunday, April 15, 2007 2:32 AM
Subject: Re: sending smtp mail failure



Thanks for responding,

there something wrong with my code?
This is my code:

import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;




public class TimeTravelMailer
{
   public void sendMessage()
   {
   String to = [EMAIL PROTECTED];
   String from = [EMAIL PROTECTED];
   String host = smtp.google.com;
   String message = This is a test;

   Properties props = new Properties();

   props.put(mail.smtp.host, host);

   Session session = Session.getInstance(props);

   try
   {
   Transport bus = session.getTransport(smtp);

   bus.connect(host, [EMAIL PROTECTED], [EMAIL PROTECTED]);

   Message msg = new MimeMessage(session);

   msg.setFrom(new InternetAddress(from));

   InternetAddress[] address = {new InternetAddress(to)};

   msg.setRecipients(Message.RecipientType.TO, address);

   msg.setRecipients(Message.RecipientType.CC,
InternetAddress.parse(to, true));

   msg.setRecipients(Message.RecipientType.BCC,
InternetAddress.parse(to, false));

   msg.setSubject(Test E-Mail through Java);

   msg.setSentDate(new Date());

   msg.setText(message);

   msg.saveChanges();

 bus.sendMessage(msg, address);

 bus.close();
   }
   catch(Exception ex)
   {
   ex.printStackTrace();
   }
   }
}

On 4/7/07, Johnny Kewl [EMAIL PROTECTED] wrote:



Easiest way is to setup a normal email program and see what the error
messages are.
If the machine doesnt have core mailing engines installed, it will
probably
tell you.
If you on windows, try Outlook express, detailed messages will probably
point you in right direction.

Code should look something like this


public boolean prepareConnection(String smtpHost){
this.smtpHost = smtpHost;
fSessionInited = true;

try{
java.util.Properties properties = System.getProperties();
properties.put(mail.smtp.host, smtpHost);
session = Session.getInstance(properties,null);
} catch(Exception e) {
   fSessionInited = false;
}

return fSessionInited;
}




- Original Message -
From: Mighty Tornado [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 06, 2007 7:30 AM
Subject: sending smtp mail failure


 Hi,

 I set up a small web app and the servlet is supposed to send an email
 using
 JavaMail. But I am getting exceptions - Connection Timed out every 
 time.

I
 am using Gmail as an smtp server to bounce emails off. How can I avoid
the
 Connection Timed out exception? Could it be because of my firewall? If
so,
 which process should I permission?

 Thank you,

 MT



-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: manager and host manager not available problem

2007-04-14 Thread Johnny Kewl

try
http://localhost:8080/manager/html

Should be able to see the links used if you
http://localhost:8080/
and look at what they have use on default helper page

have fun


- Original Message - 
From: Zhenja [EMAIL PROTECTED]

To: [EMAIL PROTECTED]
Sent: Saturday, April 14, 2007 6:17 PM
Subject: manager and host manager not available problem



Hi all!

I have installed Tomcat 6.0.10 on Windows XP as windows service. I can
browse to examples and they are running.
But when I browse to /manager or /host-manager I get error 404 - The
requested resource is not available.
Please help.

Regards




-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]