RE: Tomcat and PHP

2004-07-16 Thread Patrick Willart
The WIKI page is nice and all, but is geared for compiling PHP yourself.

What I would like to know is how to set it up using a binary distribution.

I've tried fiddling around a little, and did get it to work, but it would
crash on me after every page request. It did get the PHP out put though

grts,

Patrick

-Original Message-
From: QM [mailto:[EMAIL PROTECTED]
Sent: Friday, July 16, 2004 9:26 AM
To: Tomcat Users List
Subject: Re: Tomcat and PHP


On Fri, Jul 16, 2004 at 11:15:58AM -0500, Ryan McCain wrote:
: I have PHP 3.x and Tomcat 4.x installed on a SLES box.  What do I need
: to configure in Tomcat so that it knows what to do w/ .php files?
: Tomcat is acting as the webserver and not apache.

These instructions imply PHP v4:

http://wiki.apache.org/jakarta-tomcat/UsingPhp
[1]

but it's worth a shot, as a quick glance didn't reveal anything
PHP4-specific.

-QM

[1] aka
http://www.google.com/search?hl=enie=UTF-8q=site%3Aapache.org+tomcat+php;
btnG=Google+Search

--

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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


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



RE: How do I associate a web app with a specific IP (connector)?

2004-06-08 Thread Patrick Willart
Nope, you don't. There are different ways to do this, but with this
technique you don't need extra connectors.

grts,

Patrick

-Original Message-
From: Barnet Wagman [mailto:[EMAIL PROTECTED]
Sent: Monday, June 07, 2004 9:30 PM
To: Tomcat Users List
Subject: Re: How do I associate a web app with a specific IP
(connector)?


Thanks. That looks simple enough.  Does this mean that I don't need an
extra connector for the IP?

Patrick Willart wrote:

There is probably more than one way to do this, but one is by defining
multiple hosts and using an alias to bind the host to an IP.

You could end up with something like this:

Host name=yourdomain1 debug=0 appBase=webapps1 unpackWARs=true
autoDeploy=true xmlValidation=true xmlNamespaceAware=true

 Alias127.0.0.1/Alias
 Aliasyourdomain1.com/Alias

 
/Host

Host name=yourdomain2 debug=0 appBase=webapps2 unpackWARs=true
autoDeploy=true xmlValidation=true xmlNamespaceAware=true

 Alias127.0.0.2/Alias
 Aliasyourdomain2.com/Alias

 
/Host

grts,

Patrick

-Original Message-
From: Barnet Wagman [mailto:[EMAIL PROTECTED]
Sent: Monday, June 07, 2004 5:27 PM
To: Tomcat Users List
Subject: How do I associate a web app with a specific IP (connector)?


I'm going to be running Tomcat with two IP addresses (each has its own
domain name).  How do I associate some web apps with one and some with
the other?

 From my reading of the /Server Configuration Reference/ (but no
experience yet), I gather that I should create a connector for each IP
address.  But I don't see how to associate a web app with a particular
connector.  Do I need to create separate Host elements and use separate
appBases? Or is there another way altogether?

Thanks,

bw


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






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


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



RE: How do I associate a web app with a specific IP (connector)?

2004-06-07 Thread Patrick Willart
There is probably more than one way to do this, but one is by defining
multiple hosts and using an alias to bind the host to an IP.

You could end up with something like this:

Host name=yourdomain1 debug=0 appBase=webapps1 unpackWARs=true
autoDeploy=true xmlValidation=true xmlNamespaceAware=true

 Alias127.0.0.1/Alias
 Aliasyourdomain1.com/Alias

 
/Host

Host name=yourdomain2 debug=0 appBase=webapps2 unpackWARs=true
autoDeploy=true xmlValidation=true xmlNamespaceAware=true

 Alias127.0.0.2/Alias
 Aliasyourdomain2.com/Alias

 
/Host

grts,

Patrick

-Original Message-
From: Barnet Wagman [mailto:[EMAIL PROTECTED]
Sent: Monday, June 07, 2004 5:27 PM
To: Tomcat Users List
Subject: How do I associate a web app with a specific IP (connector)?


I'm going to be running Tomcat with two IP addresses (each has its own
domain name).  How do I associate some web apps with one and some with
the other?

 From my reading of the /Server Configuration Reference/ (but no
experience yet), I gather that I should create a connector for each IP
address.  But I don't see how to associate a web app with a particular
connector.  Do I need to create separate Host elements and use separate
appBases? Or is there another way altogether?

Thanks,

bw


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



video/x-ms-wmv mime-type added for wmv files, but doesn't seem to work

2004-05-26 Thread Patrick Willart
Hello,

I've added the following to my conf/web.xml but it looks like Tomcat
(5.0.18) isn't picking this up. It's serving the file as a plain text file.
I've tried adding the mime-mapping to my applications web.xml but also
without result.

mime-mapping
extensionwmv/extension
mime-typevideo/x-ms-wmv/mime-type
/mime-mapping

I have added mime-mappings before and those seem to work. Does anybody have
an idea what's wrong?

Thanks,

Patrick


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



RE: video/x-ms-wmv mime-type added for wmv files, but doesn't seem to work

2004-05-26 Thread Patrick Willart
Thanks for your response Jeanfrancois,

It appeared just to be my now version of Internet Explorer acting up.

My manager actually changed his mind a few minutes later and wanted that our
users always download the file before viewing it. It makes some sense
because the videos are over an hour long.

To do this I change the mime-type to application/octet-stream. This works
fine for Netscape (i.e. Save As dialog appears), but Internet Explorer just
doesn't care and opens media player (grrr). I know this is an IE issue
and this also happens with some other mime-types.

I guess I develop a servlet and serve the file to the user via that servlet.
Then I can add the Content-disposition header so that it downloads as a
file.

i.e. response.setHeader(Content-disposition, attachment;
filename=mediafile.wmv);


Thanks,

Patrick

-Original Message-
From: Jeanfrancois Arcand [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 26, 2004 12:23 PM
To: Tomcat Users List
Subject: Re: video/x-ms-wmv mime-type added for wmv files, but doesn't
seem to work




Patrick Willart wrote:

Hello,

I've added the following to my conf/web.xml but it looks like Tomcat
(5.0.18) isn't picking this up. It's serving the file as a plain text file.
I've tried adding the mime-mapping to my applications web.xml but also
without result.

mime-mapping
extensionwmv/extension
mime-typevideo/x-ms-wmv/mime-type
/mime-mapping

I have added mime-mappings before and those seem to work. Does anybody have
an idea what's wrong?


Any exceptions visible? Open server.xml, search for xmlValidation and
xmlNamespaceAware. But both value set to true. Restart Tomcat. Is the
web.xml well parsed?

-- Jeanfrancois


Thanks,

Patrick


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






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


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



RE: API for authenticating user

2004-05-25 Thread Patrick Willart
I believe Koji wants to authenticate users as soon as they register. I agree
with him that it's kind of silly to have the user first fill out all his
user profile information to register as a new user to the site, and then ask
him to log on. It would be nice if one is able to log on the user
automatically after registration.

grts.

Patrick

-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 25, 2004 1:15 PM
To: 'Tomcat Users List'
Subject: RE: API for authenticating user


Hi,

Sorry, I might've misunderstood you.  Are you saying that even after a user
has loged in, they will still be prompted for log in information if they try
to go to another page during the same sessions?   That's weird..., because
if you have your session set up right, tomcat will remember the subsequent
requests from the same user.

Or are you trying to remember the user for the following sessions as well?
That would be platform-dependent since you will have to store user's
information locally on the client side.

Can you clarify your question?

Thanks

Yan

-Original Message-
From: Koji Sekiguchi [mailto:[EMAIL PROTECTED]
Sent: May 23, 2004 21:14
To: [EMAIL PROTECTED]
Subject: API for authenticating user


Hi,

I'd like to know how to authenticate a new user when
he/she subscribe his/herself so that he/she can
avoid login procedure.

I've successfully set up Form Authentication
and JDBC Realm on Tomcat 5.0.24. But now, new users
must visit login page to authenticate themselves
after subscribing. I'd like to reduce the login step
for subscribers if session continues.

I think I have to use a couple of Tomcat API
and save principal information into the user session, right?

regards,

Koji


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


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


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



RE: access log format

2004-05-20 Thread Patrick Willart
You can define a custom pattern.

Below is the one I use. In there you can use ascii codes like #34; to
insert a quote. I haven't tried it so I am not sure if it works but you
could try #9; to insert a tab character

Valve className=org.apache.catalina.valves.AccessLogValve
   directory=logs prefix=aptitudexchange_access_log. suffix=.log
   pattern=%h %l %u %t #34;%r#34; %s %b #34;%{Referer}i#34;
#34;%{User-Agent}i#34; #34;WEBTRENDS_ID=%{WEBTRENDS_ID}c#34;
   resolveHosts=false/

grts,

Patrick

-Original Message-
From: Nanda [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 20, 2004 3:48 PM
To: [EMAIL PROTECTED]
Subject: access log format



Is there a way to configure access log to have TAB as delimiter?
I am using Tomcat 4.1.29.
Thanks
Nanda
---
[EMAIL PROTECTED]

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


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



RE: Bad Cookie Name when NOT using cookies?

2004-05-11 Thread Patrick Willart
Too bad you didn't get a reply on this. My log file is full with similar
messages and had hoped to learn what was causing them.

Anyone?

Patrick

-Original Message-
From: Evgeny Gesin [mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 1:49 PM
To: Tomcat Users List
Subject: Bad Cookie Name when NOT using cookies?


I not remember, if I asked this before, but it
happened again.

I DON'T USE cookies in my application. But sometimes I
see the following error messages in catalina log
files.
Can you comment and how to solve that?

Evgeny
Javadesk

2004-05-09 23:57:53 CoyoteAdapter Bad Cookie Name:
Path /Value: /myapplName
java.lang.IllegalArgumentException: Cookie name Path
is a reserved token
at
javax.servlet.http.Cookie.init(Cookie.java:185)
at
org.apache.coyote.tomcat4.CoyoteAdapter.parseCookies(CoyoteAdapter.java:413)
at
org.apache.coyote.tomcat4.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:
304)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:324)
at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:395)
at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615)
at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:683)
at java.lang.Thread.run(Thread.java:534)




__
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover

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


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



RE: Starting Tomcat from Apache...

2004-05-06 Thread Patrick Willart
I am eager to upgrade to the new version as I really like to use it.

Is a new release build expected anytime soon?

grts,

Pat

-Original Message-
From: Peter Rossbach [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 06, 2004 11:31 AM
To: Tomcat Users List
Subject: Re: Starting Tomcat from Apache...


Hello Daniel,

Yes, with 5.0.19 and before you have no chance to get it working. Save you
time and wait for the next offiziel release.

Regards
Peter

Daniel Gibby schrieb:

 Ummm... tomcat greater than 5.0.20? Are you saying that in the next
 release that things will be fixed, but as of now the latest 5.0.19
 still has problems?

 Daniel

 Peter Rossbach wrote:

 Hello,

 the JNI working very well, but you must use a mod_jk2 2.0.4 and
 Tomcat Release greater than 5.0.20

 Regards
 Peter


 JimmiSeven Productions Inc. schrieb:

 That's what I think as well... that inProcess option is just
 a waste of time! I hope someone can prove me wrong
 though! Has anyone actually gotten that to work?

 - Original Message - From: Dale, Matt
 [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]; JimmiSeven
 Productions Inc. [EMAIL PROTECTED]
 Sent: Thursday, May 06, 2004 11:48 AM
 Subject: RE: Starting Tomcat from Apache...



 In theory you should be able to do this with JK2 in inprocess mode.
 But I'm
 fairly confident that this doesnt work at all so you'd have to do it
 with
 your rc startup scripts.

 -Original Message-
 From: JimmiSeven Productions Inc. [mailto:[EMAIL PROTECTED]
 Sent: 06 May 2004 16:33
 To: [EMAIL PROTECTED]
 Subject: Starting Tomcat from Apache...


 Looking to find out how to start up Tomcat automatically
 when I start up Apache?

 TIA

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




 


 




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





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









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





--
J2EE Systemarchitekt und Tomcat Experte

http://objektpark.de/
http://www.webapp.de/

Am Josephsschacht 72, 44879 Bochum, Deutschland
Telefon:  (49) 234 9413228
Mobil:(49) 175 1660884
E-Mail:  [EMAIL PROTECTED]




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


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



RE: DB connection pool problem

2004-05-03 Thread Patrick Willart
You are missing the Resource/ part (needs to be just above
ResourceParams/

Resource name=jdbc/conversion auth=Container scope=Sharable
type=javax.sql.DataSource/

grts,

Pat

-Original Message-
From: Arora, Avinash [mailto:[EMAIL PROTECTED]
Sent: Monday, May 03, 2004 3:10 PM
To: Tomcat Users List
Subject: DB connection pool problem


Hi,
   I am also having the problem with the connection pools. Since I am
writing an application first time by using connection pools, I created a
test application DBTest. I edited my server.xml and web.xml (of my
application in following way--
#added to server.xml
Context path=/DBTest docBase=DBTest debug=0
reloadable=true
ResourceParams name=jdbc/conversion
parameter
nameusername/name
valueROOT/value
/parameter
parameter
namepassword/name
valuePASSWORD/value
/parameter
parameter
namedriverClassName/name
valuecom.mysql.jdbc.Driver/value
 /parameter
 parameter
nameurl/name
valuejdbc:mysql://localhost/DB/value
  /parameter
  /ResourceParams
   /Context

#web.xml
web-app
descriptionMySQL Test App/description
  resource-ref
res-ref-namejdbc/conversion/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
  /resource-ref
/web-app
And I added the following statements to my Java class, (which works
fine, when I use the connection objects by hardcoding the username and
db).--

Context init = new InitialContext();
 Context ctx = (Context) init.lookup(java:comp/env);
 DataSource dataSource = (DataSource)ctx.lookup(jdbc/conversion);

But even after, making these changes, I cannot read any thing from
database. I was wondering what more changes I need to made. I also tried
to run my JAVA class (DAO) from command line, but I get the following
exception--

Need to specify class name in environment or system property, or as an
applet parameter, or in an application resource file:
java.naming.factory.initial

I tried to print outs the place where exception occurs in my code and
found that exception occurs at
dataSource = (DataSource)ctx.lookup(jdbc/conversion);

Can any body please comment on whats going on wrong? When I run from
command line, is tomcat used, I don't think so? So where is the problem?
Any ideas??
Avinash Arora



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


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



RE: Tomcat 5 and LDAP

2004-04-14 Thread Patrick Willart
Hi Kumar,

There is no code anywhere. It's all configuration.

The realm goes in the server.xml

In your application's web.xml you define your login form and security
constraints.

  security-constraint
web-resource-collection
  web-resource-nameyour-resource-name/web-resource-name
  !-- Define the context-relative URL(s) to be protected --
  url-pattern/your-url-pattern/url-pattern
/web-resource-collection
auth-constraint
  !-- Anyone with one of the listed roles may access this area --
  role-nameyour-userrole/role-name
/auth-constraint
  /security-constraint

  login-config
!-- Default login configuration uses form-based authentication --
auth-methodFORM/auth-method
realm-nameyour-realm-name/realm-name
form-login-config
  form-login-page/your-login.jsp/form-login-page
  form-error-page/your-error.jsp/form-error-page
/form-login-config
  /login-config

The login form it self looks something like this:

 form action=j_security_check method=post name=loginForm
 table border=0 cellspacing=2 cellpadding=2
  tr
td align=leftUsername:/tdtdinput name=j_username
type=text/td
  /tr
  tr
td align=leftPassword:/tdtdinput name=j_password
type=password/td
  /tr
  tr
td colspan=2input type=submit value=Log in/td
  /tr
  /table
  /form

grts,

Patrick

-Original Message-
From: Kumar Abhay-CAK203C [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 13, 2004 3:44 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat 5 and LDAP
Importance: High


Thanks Patric for the information,

After doing this setting, what code you have written in the Login Screen,
Can you share with me?
What all JAR files are needed?

Best Regards
Abhay Kumar

-Original Message-
From: Patrick Willart [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 13, 2004 5:21 PM
To: Tomcat Users List
Subject: FW: Tomcat 5 and LDAP


This is how I have had it configured once. It worked against an iPlanet LDAP
server.

  Realm className=org.apache.catalina.realm.JNDIRealm debug=99
 connectionURL=ldap://127.0.0.1:389;
 roleBase=ou=groups,dc=aptitudexchange,dc=com
 roleName=cn
 roleSearch=(uniqueMember={0})
 userPattern=uid={0},ou=people,dc=aptitudexchange,dc=com /

grts,

Patrick

-Original Message-
From: Kumar Abhay-CAK203C [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 13, 2004 1:40 PM
To: Tomcat Users List
Subject: Tomcat 5 and LDAP
Importance: High


Hello,

I need to implement LDAP Authorization using T5 running on SunOS 5.9 I have
no idea how to set up the stuff. Any help, documentation suggestions will be
appreciated

Thanks in advance
Best Regards
Abhay Kumar



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

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


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



FW: Tomcat 5 and LDAP

2004-04-13 Thread Patrick Willart
This is how I have had it configured once. It worked against an iPlanet LDAP
server.

  Realm className=org.apache.catalina.realm.JNDIRealm debug=99
 connectionURL=ldap://127.0.0.1:389;
 roleBase=ou=groups,dc=aptitudexchange,dc=com
 roleName=cn
 roleSearch=(uniqueMember={0})
 userPattern=uid={0},ou=people,dc=aptitudexchange,dc=com /

grts,

Patrick

-Original Message-
From: Kumar Abhay-CAK203C [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 13, 2004 1:40 PM
To: Tomcat Users List
Subject: Tomcat 5 and LDAP
Importance: High


Hello,

I need to implement LDAP Authorization using T5 running on SunOS 5.9
I have no idea how to set up the stuff.
Any help, documentation suggestions will be appreciated

Thanks in advance
Best Regards
Abhay Kumar



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



RE: Javamail not working with non-Outlook Express users.

2004-01-14 Thread Patrick Willart
When I read your problem description, the first thing I think of is that the
format of your mail message is not correct. Outlook Express might not be so
strict and render your mail message without any problems while other email
clients require a proper formatted email.

grts,

Patrick

-Original Message-
From: charles doweary [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 14, 2004 3:59 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Javamail not working with non-Outlook Express users.


System setup:  Windows Server 2003, Tomcat5.0.16, and IIS6.0.

My mail server sends email messages successfully when the user has Outlook
Express set up on their desktop, but non-Outlook Express users get the
following servlet error messages:

HTTP Status 500 - type Exception report

message description:  The server encountered an internal error () that
prevented it from fulfilling this request.

exception javax.servlet.ServletException

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
mpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:800)
org.apache.jsp.jsp.authorizePurchase_jsp._jspService(authorizePurchase_jsp.j
ava:204)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
11)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause
com.generic.exceptions.CustomerActivityException
 com.generic.product.Order.recordOrder(Unknown Source)

org.apache.jsp.jsp.authorizePurchase_jsp._jspService(authorizePurchase_jsp.j
ava:151)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
11)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

note The full stack trace of the root cause is available in the Tomcat logs.

Apache Tomcat/5.0.16

Here is a copy of the source code that is used to send the email message:

package com.generic.product;

import java.util.Vector;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Properties;
import java.text.NumberFormat;
import java.sql.*;
import org.apache.log4j.Category;
import org.apache.turbine.services.db.TurbineDB;
import org.apache.turbine.util.db.pool.DBConnection;
import com.generic.product.Product;
import java.util.ResourceBundle;
import com.generic.customer.*;
import com.generic.product.*;
import com.generic.exceptions.*;
import com.generic.cart.*;
import javax.naming.NamingException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingEnumeration;
import javax.naming.directory.InitialDirContext;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.AddressException;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.MessagingException;
import javax.mail.Transport;
import javax.servlet.http.*;
import com.braju.format.*;

public class Order {
private static ResourceBundle sql_bundle =
ResourceBundle.getBundle(com.generic.product.SQLQueries);

private static ResourceBundle email_bundle =
ResourceBundle.getBundle(com.generic.emailProperties);

/**
 * Mails a receipt for the order to the customer.
 *
 * @param email The address to mail the receipt to.
 **/

public void emailReceipt(String email)
throws NamingException, AddressException, MessagingException {
Properties props = new Properties();
props.put(smtp.covad.net, XX-YY1);
Session session = Session.getDefaultInstance(props, null);

Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(email_bundle.getString(fromAddr)));
InternetAddress to[] = new InternetAddress[1];
to[0] = new InternetAddress(email);
message.setRecipients(Message.RecipientType.TO, to);
message.setSubject(Receipt for order  + getOrderNumber());
StringBuffer contents = new StringBuffer();
contents.append(Thank you for shopping at Generic Books.\n\n);
contents.append(Here is the receipt for your order  + getOrderNumber() +
 placed on  + getOrderDate() + \n\n);
contents.append(CODETITLE   QUANT  PRICE
TOTAL\n);

contents.append(===
=\n);
Iterator items = 

RE: Problems after creating new hosts / contexts

2004-01-08 Thread Patrick Willart
is your WEB-INF directory fully in uppercase?

Patrick

-Original Message-
From: Pronet Mailinglist [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 08, 2004 1:30 PM
To: [EMAIL PROTECTED]
Subject: Problems after creating new hosts / contexts


Hi all,

my environmemt:

OS: Redhat Linux
Platform: Intel x86

TC version: 4.1

tomcat4.conf:
--- cut -
CATALINA_HOME=/var/tomcat4
JASPER_HOME=/var/tomcat4
CATALINA_TMPDIR=/var/tomcat4/temp
 cut -

First: There are a few of hosts and contexts running withouts problems
.. but when I'm setting up contexts in new hosts, I've problems whith
this new ones:

1. I create a hosts AppBase directory like

$HOME/html/servlet/

for the domain diving.co.at

and a DocBase directory for the context

$HOME/html/servlet/myapp

and context path: /myapp

I put a test.jsp[1] file in DocBase.

2. I configure the new host and context in the TC Admininstration Tool
with the settings from 1.

TC is deploying[2] but http://www.diving.co.at:8080/myapp/test.jsp
always returns the error:

HTTP Status 500 ..

javax.servlet.ServletException: org/apache/jasper/runtime/HttpJspBase
...

but an older host http://pronet.at:8080/tomcat/test.jsp with the same
test-file and the same TC engine works fine!?

When I'm looking in the TC-wrok-dir .. there are also the files:

test_jsp.class  test_jsp.java

TC is compiling test.jsp .. but returns the error shown above .. why?
What's going wrong there?

THX 4 Help Robert


[1]:
% for (int i=0; i  10; i++) { %
zeile %= i % br
% } %

[2]:
 log ###
2004-01-08 17:05:47 WebappLoader[/myapp]: Deploying class repositories
to work directory /var/tomcat4/work/Standalone/diving.co.at/myapp
2004-01-08 17:05:47 ContextConfig[/myapp]: Missing application
web.xml, using defaults only
2004-01-08 17:05:47 StandardManager[/myapp]: Seeding random number
generator class java.security.SecureRandom
2004-01-08 17:05:47 StandardManager[/myapp]: Seeding of random number
generator has been completed
2004-01-08 17:05:47 StandardWrapper[/myapp:default]: Loading container
servlet default
2004-01-08 17:05:47 default: init
2004-01-08 17:05:47 StandardWrapper[/myapp:invoker]: Loading container
servlet invoker
2004-01-08 17:05:47 invoker: init
2004-01-08 17:05:47 jsp: init
2004-01-08 17:05:47 WebappLoader[/myapp]: Deploying class repositories
to work directory /var/tomcat4/work/Standalone/diving.co.at/myapp
2004-01-08 17:05:47 StandardManager[/myapp]: Seeding random number
generator class java.security.SecureRandom
2004-01-08 17:05:47 StandardManager[/myapp]: Seeding of random number
generator has been completed
##



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


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



RE: Off-topic - Java and X11 Window Server

2004-01-07 Thread Patrick Willart
I am not an expert on any *nix system, but faced the same problem once.

I had to set to DISPLAY varirable to :1.0 (export DISPLAY=:1.0). It is
important that this is set for the same user that is running Tomcat.

grts,

Patrick

-Original Message-
From: Jose Euclides da Silva Junior - DATAPREVRJ
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004 10:55 AM
To: '[EMAIL PROTECTED]'
Subject: Off-topic - Java and X11 Window Server


Hi guys,
Have anybody ever seen this error before? The X11 seems to be alive at my
environment -- Conectiva Linux. The target Java app,GraficoBig, works with
a free package, called org.jfree.char and org.jfree.gui.

500 Internal Server Error
java.lang.InternalError: Can't connect to X11 window server using ':0.0' as
the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at
sun.awt.X11GraphicsEnvironment.clinit(X11GraphicsEnvironment.java:54)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:115)
at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment
.java:53)
at java.awt.Window.init(Window.java:183)
at java.awt.Frame.init(Frame.java:310)
at java.awt.Frame.init(Frame.java:289)
at javax.swing.JFrame.init(JFrame.java:167)
at org.jfree.ui.ApplicationFrame.init(Unknown Source)
at mypackage2.GraficoBig.init(GraficoBig.java:26)
at _Jspbig._jspService(_Jspbig.java:128)
[SRC:Jspbig.jsp:118]
regards,
José Euclides Junior
Projeto DOP201
Infra-estrutura J2EE para as aplicações corporativas da Previdência Social



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


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



RE: Off-topic - Java and X11 Window Server

2004-01-07 Thread Patrick Willart
Dear Jose,

This is the document that put me on the right track. Set the DISPLAY
variable as an environment variable for the user that start Tomcat. The
variable has to be set before Tomcat is started

snippet of document
To run Xvfb in a manner that pleases Java, try:

/usr/X11R6/bin/Xvfb :1 -screen 0 800x600x24

This will create a virtual display at :1.0 with a size of 800 by 600 pixels
and a color depth of 24 bits. To ensure that Java draws to this display, you
must set the DISPLAY environment variable to :1.0 before invoking Java.  If
Java throws any X11Environment exceptions, try changing the color  depth or
screen size. In my experience 16 or 24 bits has always worked.
/snippet of document

grts,

Patrick

-Original Message-
From: Jose Euclides da Silva Junior - DATAPREVRJ
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004 11:51 AM
To: 'Tomcat Users List'; '[EMAIL PROTECTED]'
Subject: RES: Off-topic - Java and X11 Window Server


Dear Patrick,
Where (and HOW ) should i set it?
Thanks in advance,
José Euclides Junior
Projeto DOP201
Infra-estrutura J2EE para as aplicações corporativas da Previdência Social


-Mensagem original-
De: Patrick Willart [mailto:[EMAIL PROTECTED]
Enviada em: quarta-feira, 7 de janeiro de 2004 16:51
Para: Tomcat Users List
Assunto: RE: Off-topic - Java and X11 Window Server


I am not an expert on any *nix system, but faced the same problem once.

I had to set to DISPLAY varirable to :1.0 (export DISPLAY=:1.0). It is
important that this is set for the same user that is running Tomcat.

grts,

Patrick

-Original Message-
From: Jose Euclides da Silva Junior - DATAPREVRJ
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004 10:55 AM
To: '[EMAIL PROTECTED]'
Subject: Off-topic - Java and X11 Window Server


Hi guys,
Have anybody ever seen this error before? The X11 seems to be alive at my
environment -- Conectiva Linux. The target Java app,GraficoBig, works with
a free package, called org.jfree.char and org.jfree.gui.

500 Internal Server Error
java.lang.InternalError: Can't connect to X11 window server using ':0.0' as
the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at
sun.awt.X11GraphicsEnvironment.clinit(X11GraphicsEnvironment.java:54)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:115)
at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment
.java:53)
at java.awt.Window.init(Window.java:183)
at java.awt.Frame.init(Frame.java:310)
at java.awt.Frame.init(Frame.java:289)
at javax.swing.JFrame.init(JFrame.java:167)
at org.jfree.ui.ApplicationFrame.init(Unknown Source)
at mypackage2.GraficoBig.init(GraficoBig.java:26)
at _Jspbig._jspService(_Jspbig.java:128)
[SRC:Jspbig.jsp:118]
regards,
José Euclides Junior
Projeto DOP201
Infra-estrutura J2EE para as aplicações corporativas da Previdência Social



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


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



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



EJP-Tracer - How to do it?

2004-01-07 Thread Patrick Willart
I am trying to find a performance problem using the EJP. I have not used
such a tool before and I am struggling a bit.

I manage to run tracer on a simple java program without any problems. After
playing around for a few hours I also managed to configure it to trace
Tomcat (main class: org.apache.catalina.startup.Bootstrap), but
unfortunately it fails with: 'An unexpected exception has been detected in
native code outside the VM.

Is it maybe possible to just run a trace on a single web-app and if so how
can one do this?

Any tips or direction to more information is highly appreciated.

grts,

Patrick


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



Using Jikes as compiler for Tomcat 4.1 on Windows systems

2003-12-19 Thread Patrick Willart
Simple question. Is it possible or not? I use Jikes 1.18 and Tomcat 4.1.24.

Based from other posts I figured out that it's not possible to configure
Tomcat to use Jikes as JSP compiler because -encoding is not supported in
the Windows version of Jikes.

However out of different posts I get the idea that some people are able to
get it to work.

This is my error message:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null


Generated servlet error:

[javac] Compiling 1 source file
[javac] use: jikes [options] [EMAIL PROTECTED] file.java...
[javac] For more help, try -help or -version
[javac] Error: The option -encoding is unsupported in this build.

Note: 'jikes -help' doesn't show any help information on -encoding, but when
I give the command 'jikes -encoding' an error message is returned that
-encoding requires an argument.


This is how I have it configured in my conf/web.xml:

servlet
servlet-namejsp/servlet-name
servlet-classorg.apache.jasper.servlet.JspServlet/servlet-class
init-param
param-namelogVerbosityLevel/param-name
param-valueWARNING/param-value
/init-param
init-param
param-namecompiler/param-name
param-valuejikes/param-value
/init-param
init-param
param-namefork/param-name
param-valuefalse/param-value
/init-param
load-on-startup3/load-on-startup
/servlet


Did I forget anything?

Patrick


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



RE: Using Jikes as compiler for Tomcat 4.1 on Windows systems

2003-12-19 Thread Patrick Willart
I got a bit confused, but the problem is that the version of jikes I
downloaded doesn't support -encoding.

On javaroom.de I found a version of jikes1.18 with -encoding support.
http://www.javaroom.de/index.html

I installed it and it worked right away.

grts,

Patrick

-Original Message-
From: Patrick Willart [mailto:[EMAIL PROTECTED]
Sent: Friday, December 19, 2003 1:41 PM
To: Tomcat Users List
Subject: Using Jikes as compiler for Tomcat 4.1 on Windows systems


Simple question. Is it possible or not? I use Jikes 1.18 and Tomcat 4.1.24.

Based from other posts I figured out that it's not possible to configure
Tomcat to use Jikes as JSP compiler because -encoding is not supported in
the Windows version of Jikes.

However out of different posts I get the idea that some people are able to
get it to work.

This is my error message:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null


Generated servlet error:

[javac] Compiling 1 source file
[javac] use: jikes [options] [EMAIL PROTECTED] file.java...
[javac] For more help, try -help or -version
[javac] Error: The option -encoding is unsupported in this build.

Note: 'jikes -help' doesn't show any help information on -encoding, but when
I give the command 'jikes -encoding' an error message is returned that
-encoding requires an argument.


This is how I have it configured in my conf/web.xml:

servlet
servlet-namejsp/servlet-name
servlet-classorg.apache.jasper.servlet.JspServlet/servlet-class
init-param
param-namelogVerbosityLevel/param-name
param-valueWARNING/param-value
/init-param
init-param
param-namecompiler/param-name
param-valuejikes/param-value
/init-param
init-param
param-namefork/param-name
param-valuefalse/param-value
/init-param
load-on-startup3/load-on-startup
/servlet


Did I forget anything?

Patrick


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


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



RE: Form based authentication

2003-11-28 Thread Patrick Willart
Hello Atreya,

Your stylesheet is returned after authentication because it is access
restricted. If you make your stylesheet freely accessible it will work.

grts,

Patrick

-Original Message-
From: Atreya Basu [mailto:[EMAIL PROTECTED]
Sent: Friday, November 28, 2003 8:01 AM
To: Tomcat Users List
Subject: Form based authentication


Hi all,

I thought I would share some of my experiences with JDBCRealm
authentication.

First what I wanted to do was see if JDBCRealm based authentication even
worked.  All I got was Tomcat quitting.  My first problem was that my
web.xml file wasn't in the right order.  I went to BEA's website and
used their web.xml file explanation page to get all of the spelling and
order of the elements right.
But Tomcat still wasn't running.  It turned out my second problem was
that for some reason the MySQL JDBC driver wasn't being found, even
though I had placed it in the common\lib directory.  So I edited the
catalina file manually and added in the jar file.

Next whenever I would authenticate I would get a stylesheet instead of
my intended destination.  Then one time I authenticated and accidentally
hit the login page.  It showed me a different styled login page.

That happened because my stylesheet was kept inside the context
directory it wasn't being retrieved till I authenticated.  So instead of
pulling up index.html after I authenticate it pulled up the stylesheet
because my browser was waiting to load that file.  Solution of course
was to place the stylesheet in an unsecure directory.

I hope that someone finds this useful.

Cheers,

--
_
Atreya Basu
Developer,
Greenfield Research Inc.
e-mail: atreya (at) greenfieldresearch (dot) ca




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


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



RE: alias directive/Virtual host problem

2003-11-24 Thread Patrick Willart
Hi JP,

You don't need to do that. The Alias directive is able to do this.

Alias111.111.111.111/Alias
Aliasmydomain.com/Alias
Aliaswww.mydomain.com/Alias

grts,

Patrick

---

From: john-paul delaney [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 8:44 AM
To: Tomcat Users List
Subject: alias directive/Virtual host problem


Hello List...

In order that a virtual host respond correctly to urls:

http://mydomain.com

http://www.mydomain.com

I've had to add two host entries in server.xml (one for mydomain.com, the
other for www.mydomain.com).

I thought it would have been enough to add the alias directive for the
www.mydomain.com in the mydomain.com host, thereby avoiding duplication
within server.xml?

Are there problems with the alias directive - or am I misinterpreting it's
function?  Is it just that my configuration is probably bad?

Versions: Tomcat 4.1.24 standalone on redhat 9


Thanks for any suggestions,
/j-p.


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


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



RE: alias directive/Virtual host problem

2003-11-24 Thread Patrick Willart
You might want to try placing you alias directives as the first thing inside
the host directive. That's how I have it and if I am right the order of this
is important (although I would expect you to see an error message in such
case).

Patrick

-Original Message-
From: john-paul delaney [mailto:[EMAIL PROTECTED]
Sent: Monday, November 24, 2003 9:33 AM
To: Tomcat Users List
Subject: RE: alias directive/Virtual host problem


Thanks Patrick... then as suspected, I must have a misconfiguration:

  Host name=mydomain.com debug=0 appBase=webapps/mdom
   unpackWARs=true autoDeploy=true

  Context path= docBase= debug=0
  reloadable=true crossContext=true

  Aliaswww.mydomain.com/Alias
  ...

Now the index.jsp in mydomain.com (forwards to a servlet) works ok, but when
I try www.mydomain.com, I get a 404 requested resource (/index.jsp) is not
available.

Any suggestions why this is occurring are much appreciated,

/j-p.



On Mon, 24 Nov 2003, Patrick Willart wrote:

 Hi JP,

 You don't need to do that. The Alias directive is able to do this.

   Alias111.111.111.111/Alias
   Aliasmydomain.com/Alias
   Aliaswww.mydomain.com/Alias


 In order that a virtual host respond correctly to urls:

 http://mydomain.com

 http://www.mydomain.com

 I've had to add two host entries in server.xml (one for mydomain.com, the
 other for www.mydomain.com).

 I thought it would have been enough to add the alias directive for the
 www.mydomain.com in the mydomain.com host, thereby avoiding duplication
 within server.xml?

 Are there problems with the alias directive - or am I misinterpreting it's
 function?  Is it just that my configuration is probably bad?

 Versions: Tomcat 4.1.24 standalone on redhat 9


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


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



RE: invalid direct reference..--problem with solution..

2003-11-20 Thread Patrick Willart
Hi Claus,

According to the official servlet specification one cannot directly link to
the login form. The user must always be redirected (because he entered a
protected URL) to the login form for it to work. This behavior prohibits one
to have a log in form an every page. It's like this in the servlet spec and
there is no way around.

However, there is an open source project called SecurityFilter, that
provides a different authentication mechanism. I can't use it because it
doesn't support single sign-on (they are still working on that), but may be
it's good for you. have a look at http://securityfilter.sourceforge.net/ for
the details.

grts,

Patrick

-Original Message-
From: Claus Weng Madsen - TELMORE [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 2:02 AM
To: [EMAIL PROTECTED]
Subject: RE: invalid direct reference..--problem with solution..


Hi Patrick

Did you ever find a solution to your problem?
I have the same problem as you mentioned previous. So if you have found
a solution please write back to me :-)

Med venlig hilsen

Claus Weng Madsen, Teamleder
TELMORE A/S
Carl Gustavsgade 3, 2630 Taastrup
Telefon 70218700, Mobil 30242875
www.telmore.dk


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



RE: Cookies

2003-11-20 Thread Patrick Willart
Since you don't specify the path when you write the cookie it's in
/app/servlet. This means that this cookie can only be read by pages/servlets
in this directory or subdirectories.

Your JSP is in a different directory structure and is not allowed to read
the cookie you wrote.

add cookie.setPath(/) to your servlet to set the cookie path to the root.
Then your JSP (as it is a subdirectory of the root) can read your cookie.

grts,

Patrick

-Original Message-
From: Mark Tebong [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 2:10 PM
To: Tomcat Users List
Subject: Cookies


I set a cookie like this from a servlet (URI=
/app/servlet/myPackage.CookieTest):

Cookie userCookie = new Cookie(someName, someValue);
userCookie.setMaxAge(60*60*24*365);
response.addCookie(userCookie);

I later try to read the cookies using a JSP page like this (URI=
/app/getCookieValue.jsp):

Cookie[] cookies = request.getCookies();
Cookie cookie;
for(int i=0; icookies.length; i++)
{
cookie = cookies[i];
out.print(cookie.getName() + =);
out.print(cookie.getValue() + \n);
}

I get nothing in the results, however, if I try to get and print the
cookie values from the same servlet, I get all cookies that were set and
the sessionid cookie as well. What is going on? How can I set cookies in
a servlet and get their values from a jsp file (btw, the jsp file is in
the same package).

PS Is this the right forum for this question?

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


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



RE: Resolving an object for a jsp?

2003-11-13 Thread Patrick Willart
An easy way to figure out the java equivalent for this is too look at the
compiled jsp (.java).

Patrick

-Original Message-
From: Josh G [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 12, 2003 4:20 PM
To: Tomcat Users List
Subject: Re: Resolving an object for a jsp?


Tim Funk wrote:

 jsp:include ...
  jsp:param name=p1 value=val1 /
  jsp:param name=p2 value=val2 /
 /jsp:include

 -Tim

The code will be in a taglib, so I can't do that, i'm trying to find the
java equivalent of that jsp code.

--

I'm sick of the Internet. I want a yabby net.

[ Josh 'G' McDonald ][ 0415 784 825 ][ http://www.gfunk007.com/ ]



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


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



RE: Start Tomcat

2003-11-12 Thread Patrick Willart
Simon,

If you add 'pause' as last line in you startup.bat you can see what (error)
messages Tomcat outputs.

Patrick

-Original Message-
From: Simon Allen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 12, 2003 2:31 PM
To: '[EMAIL PROTECTED]'
Subject: Start Tomcat


Hi

I am able to start Tomcat from startup.bat but when I try to do so using
the Start Tomcat in the Windows Start Menu the banner appears, disappears
after a few seconds with no further action.

Any advice?

Thanks

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


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



RE: Strange behavior of runtime.exec(...)

2003-11-10 Thread Patrick Willart
Stefan,

The security manager is disabled per default. In your specific case it has
nothing to do with the security manager either. The problem is that the
program/script you started with runtime.exec() doesn't have permission to
open a socket. The security manager, if enabled, could control the
permission to use .exec() and .exit() methods in your java code. Not in
external scripts/programs you execute.

As I told you, I worked around this by rewriting the program in as a
servlet. I never got the original CGI program to open a socket. I think
external programs launched by Tomcat always have this restriction. Maybe one
of developers can confirm this behavior?

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/security-manager-howto.html

grts,

Patrick

-Original Message-
From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 12:26 AM
To: Tomcat Users List
Subject: Re: Strange behavior of runtime.exec(...)


If I'm not mistaken, the security manager is turned off by default.


Stefan Frank wrote:

 I tried to tweak the security manager of tomcat(using no restrictions
 at all) - with no effect. And I have absolutely no idea how to set the
 security-settings for the Webapp: And if i knew, does anyone know if
 there is a level of control below the reight to call runtime.exec()?!
 I mean, if the webapp is allowed to spawn a process, can i restrict
 the abilities of this spawned process?! And in a platform independent
 matter?! Or is there a bug somwehere else?!
 Patrick Willart wrote:

 I suspect the problem to be that no external task that is started by
 Tomcat
 is allowed to open any connections.

 I had a similar problem with cgi and a windows executable. The
 executable
 tried to open a socket connection. The same setup had worked on a
 different
 server but not on Tomcat. I ended up rewritting the program as a java
 servlet. This worked.

 If you setup a Security Manager for Tomcat then you can control what the
 java code of your applications is allowed to do.

 Grts,

 Patrick
 -Original Message-
 From: Stefan Frank [mailto:[EMAIL PROTECTED]
 Sent: Saturday, November 08, 2003 6:52 AM
 To: [EMAIL PROTECTED]
 Subject: Strange behaviour of runtime.exec(...)


 Hi,

 we are trying to make some calls to scripts from within tomcat, so we
 are using runtime.exec() inside a Servlet: The script (it submits a Job
 to teh Sun Grid Engine, http://gridengine.sunsource.net/) runs fine from
 the command line, and also the java-class, which is called from the
 servlet for the submit, runs fine outside of tomcat: When the Class is
 called from inside tomcat, the job is submitted, but never reaches the
 scheduler:  It looks like the spawned process is not allowed to make up
 sockets to the outside world - are there any restrictions on using
 Runtime.exec() from within tomcat?! And if there is, is there a way
 around these restrictions?!

 Greetingsthx in advance for any help
 Stefan


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


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







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





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


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



RE: Strange behavior of runtime.exec(...)

2003-11-08 Thread Patrick Willart
I suspect the problem to be that no external task that is started by Tomcat
is allowed to open any connections.

I had a similar problem with cgi and a windows executable. The executable
tried to open a socket connection. The same setup had worked on a different
server but not on Tomcat. I ended up rewritting the program as a java
servlet. This worked.

If you setup a Security Manager for Tomcat then you can control what the
java code of your applications is allowed to do.

Grts,

Patrick
-Original Message-
From: Stefan Frank [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 08, 2003 6:52 AM
To: [EMAIL PROTECTED]
Subject: Strange behaviour of runtime.exec(...)


Hi,

we are trying to make some calls to scripts from within tomcat, so we
are using runtime.exec() inside a Servlet: The script (it submits a Job
to teh Sun Grid Engine, http://gridengine.sunsource.net/) runs fine from
the command line, and also the java-class, which is called from the
servlet for the submit, runs fine outside of tomcat: When the Class is
called from inside tomcat, the job is submitted, but never reaches the
scheduler:  It looks like the spawned process is not allowed to make up
sockets to the outside world - are there any restrictions on using
Runtime.exec() from within tomcat?! And if there is, is there a way
around these restrictions?!

Greetingsthx in advance for any help
Stefan


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


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



RE: Tomcat crash

2003-11-07 Thread Patrick Willart
Add pause as last command in you catalina.bat file. This will keep the
console open so that you can read the error message.

Patrick

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, November 07, 2003 9:33 AM
To: Tomcat Users List
Subject: Re: Tomcat crash


That's a good Idea but the console window close when tomcat crash so nothing
can be read.
Can I redirect the console output to a file ?

Scrive Ben Souther [EMAIL PROTECTED]:

 There is no stack trace in the console window when the server crashes?

 Try putting a 'System.out.println(page/servlet name);' at the top of
all

 of your pages. Then you can see which page was the last one hit before the
 server crashed.



 On Friday 07 November 2003 11:06 am, [EMAIL PROTECTED] wrote:
  Thanks for your ideas.
 
  I can see the console window but because the crash happens casually I
 can't
  see everytime the server screen and also reproduce the circumstances
  because I can't understand which are.
 
  The server crash only with my own app. and I don't have System.exit
 
  For the same reason I can't understand which code create the problem.
 
  Thanks again
 
  Scrive Ben Souther [EMAIL PROTECTED]:
   There is no console window, even when you start Tomcat with the
   catalina.bat
  
   file?
  
   Can you reproduce the circumstances that caused it to crash?  Does it
   crash when you are hitting the exaple apps or only when you are
hitting
   your own app?  If it's your own app, or a third party app, can you
post
   the code to the JSP/Servlet that was being hit when the server
crashes?
   Do you have any
  
   calls to System.exit(0) in your code?
  
   On Friday 07 November 2003 10:48 am, [EMAIL PROTECTED] wrote:
Unfortunately when tomcat crash I can't see the console window
so
 I
don't have any message useful to start the debugging...
   
Scrive Anton Modaresi [EMAIL PROTECTED]:
 do you get an exception in the console window? If the tomcat
window
 vanishes, you can try starting with the catalina batch file
instead
 of the startup batch file.

 regards, anton

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: den 7 november 2003 16:34
 To: [EMAIL PROTECTED]
 Subject: Tomcat crash




 Hello, I'm new to Tomcat and Apache so I'm wasting a lot of time
 trying to understand why Tomcat sometimes shutdown by itself or
 better it crash This
 happen without messages in the log file .

 can someone have some experience in that solved the problem ?


 Thanks to all.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:
[EMAIL PROTECTED]
   
  
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
   --
   Ben Souther
   F.W. Davison  Company, Inc.
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

 --
 Ben Souther
 F.W. Davison  Company, Inc.



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






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


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



RE: Tomcat and PHP - It's possible

2003-11-03 Thread Patrick Willart
Hello Joao,

I have read an article on http://www.3plus4software.de/ in which Tomcat's
cgi servlet was configured to serve PHP.

I haven't tested it myself and the information is in German, but it didn't
look very complicated.

Unfortunately I couldn't find the article anymore on their site. Luckily I
saved the article to my harddisk as an .mht (Internet Explorer web archive
file). Let me know if you want me to mail that file.

Best regards,

Patrick

-Original Message-
From: Joao Medeiros [mailto:[EMAIL PROTECTED]
Sent: Monday, November 03, 2003 9:08 AM
To: Tomcat Users List
Subject: Tomcat and PHP


Hi folks,

I was wondering if anyone has any experience  with Tomcat serving PHP...
I've looked in a lot of places so far but all I can get is pieces of
information that I can't put together. Sure someone somewhere must have
a 'How-To' that explains how to do this but I just can't find it...

TIA,
--Jo


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



RE: Socket permission in a CGI Script

2003-10-27 Thread Patrick Willart
Hmmm I don't know. Even without the security manager running the CGI
program isn't allowed to open a socket connection. To my understanding the
security manager just adds protection and doesn't allow you to do more
things then normally would be allowed.

patrick

-Original Message-
From: Jean-Francois Arcand [mailto:[EMAIL PROTECTED]
Sent: Saturday, October 25, 2003 12:05 PM
To: Tomcat Users List
Subject: Re: Socket permission in a CGI Script


I'm not a servlets-cgi expert (never used), but I think, if Tomcat runs
with a Security Manager, you can fix the problem by adding the following
in server.policy:

// Give all permission to servlets-cgi.jar
grant codeBase file:${catalina.home}/server/lib/servlets-cgi.jar {
permission java.security.AllPermission;
};

If it works then try to only give the socket permission. If you are not
running with a Security Manager, then it's a permission/group OS setting.

--Jeanfrancois

Joao Machado wrote:

Hi all,

  I'm trying to execute a CGI script and this Script tries to connect
with a database opening a socket to it. This raises a problem that this
script can't do this (permission?). I found in the mail archive someone
with the same problem but I didn't found an answer. Anyone has solved
this issue ?

Thanks in advance,

Joao Machado

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003



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






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


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



RE: IIS log files

2003-10-27 Thread Patrick Willart
You can log about anything you want, including cookies and specific HTTP
headers.

It is not in the 4.1 documentation but %{Referer}i, %{User-Agent}i, etc.
work.

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/valve.html#Access%20L
og%20Valve

You can do the same with %{cookiename}c; and if you write it into this
format you can filter in WebTrends on certain cookies:

#34;cookiename=%{cookiename}c#34;

#34; adds a  around the thing so that you can include spaces.

%a - Remote IP address
%A - Local IP address
%b - Bytes sent, excluding HTTP headers, or '-' if zero
%B - Bytes sent, excluding HTTP headers
%h - Remote host name (or IP address if resolveHosts is false)
%H - Request protocol
%l - Remote logical username from identd (always returns '-')
%m - Request method (GET, POST, etc.)
%p - Local port on which this request was received
%q - Query string (prepended with a '?' if it exists)
%r - First line of the request (method and request URI)
%s - HTTP status code of the response
%S - User session ID
%t - Date and time, in Common Log Format
%u - Remote user that was authenticated (if any), else '-'
%U - Requested URL path
%v - Local server name

Patrick

-Original Message-
From: Chanan Braunstein [mailto:[EMAIL PROTECTED]
Sent: Monday, October 27, 2003 7:36 AM
To: 'Tomcat Users List'
Subject: RE: IIS log files


Might have to do it from the access logs from within Tomcat - Did you try
doing that yet? I haven't yet.

We were using Web Trends - we are now using Live Stats - Same idea as Web
Trends.

Chanan Braunstein
Knovel Corp.
Web Development Manager
607-773-1840 x672
http://www.knovel.com



-Original Message-
From: Bui, Bao-Ha D [mailto:[EMAIL PROTECTED]
Sent: Monday, October 27, 2003 10:09 AM
To: 'Tomcat Users List'
Subject: RE: IIS log files


I have been looking for a way to do that for a long time.  So far, the
answer is no.  If you do find out anything, please post and let me know too.



Thanks.

Bao-Ha Dam Bui
[EMAIL PROTECTED]
St. Jude Medical, Inc
651.765.1018

PS:  just curious, are you looking at this to use the log for WebTrend?

-Original Message-
From: Chanan Braunstein [mailto:[EMAIL PROTECTED]
Sent: Monday, October 27, 2003 9:06 AM
To: 'Tomcat Users List'
Subject: IIS log files

Good Morning,
I am using Tomcat 4 with the IIS redirector dll (version 1 I think).
The URI being written to the IIS log files is always:
/jakarta/isapi_redirect.dll instead of the JSP file name. Is there a way to
fix that?

Chanan Braunstein
Knovel Corp.
Web Development Manager
607-773-1840 x672
http://www.knovel.com



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


*
This communication may contain information that is proprietary, privileged,
confidential or legally exempt from disclosure.  If you are not a named
addressee, you are notified that you are not authorized to read, print,
retain, copy or disseminate this communication without the consent of the
sender and that doing so may be unlawful. If you have received this
communication in error, please notify the sender via return e-mail and
delete it from your computer. Thank you. St. Jude Medical, Inc.
*



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


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



RE: Problem receiving huge text in IE

2003-10-27 Thread Patrick Willart
Do you have to output your data in a table. Maybe better format it with
spaces within pre tags. That way the browser can render it right away. If
it is in a table all the data has to be received before it can get rendered.

Patrick
-Original Message-
From: Mufaddal Khumri [mailto:[EMAIL PROTECTED]
Sent: Monday, October 27, 2003 1:17 AM
To: Tomcat Users List
Subject: Problem receiving huge text in IE


Hi,

Am using Tomcat 4.1.18. I have this  problem on IE on Windows and Mac.
I am trying to get a huge amount of text from the database and want to
stream it to the user/s browser. Netscape and Safari work fine and
start displaying the text as soon as they start receiving it. IE waits
for the full text to reach it and then displays the complete text at
once. How do I get it to behave like netscape and safari where it
starts displaying what it has already received ?. My code for doing
this is below:


response.setContentType(text/html);
response.setHeader(Cache-Control, no-cache);
response.setHeader(Expires, 0);
response.flushBuffer();

PrintWriter out = response.getWriter();

out.println(htmlHead/Head);
out.println(body);
out.println(table width='100%');

for(...)
{
out.println(BIG lump of text);
out.flush();
response.flushBuffer();
}

out.flush();
response.flushBuffer();



Does anyone know why i am getting this problem with IE ? Have I to
tweak something in my code or tomcat webapp settings ?

Thanks.


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


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



RE: Socket permission in a CGI Script

2003-10-27 Thread Patrick Willart
I had the same problem and ended up rewriting the cgi program in java. It
helped me get rid of an operation system dependency too, so it was a good
thing to do.

Patrick

-Original Message-
From: Jean-Francois Arcand [mailto:[EMAIL PROTECTED]
Sent: Monday, October 27, 2003 5:56 PM
To: Tomcat Users List
Subject: Re: Socket permission in a CGI Script


Try something like

chmod a+x your_cgi
or chmod 777 .

If that doesn't work, then I have no idea :-(

-- Jeanfrancois

Patrick Willart wrote:

Hmmm I don't know. Even without the security manager running the CGI
program isn't allowed to open a socket connection. To my understanding the
security manager just adds protection and doesn't allow you to do more
things then normally would be allowed.

patrick

-Original Message-
From: Jean-Francois Arcand [mailto:[EMAIL PROTECTED]
Sent: Saturday, October 25, 2003 12:05 PM
To: Tomcat Users List
Subject: Re: Socket permission in a CGI Script


I'm not a servlets-cgi expert (never used), but I think, if Tomcat runs
with a Security Manager, you can fix the problem by adding the following
in server.policy:

// Give all permission to servlets-cgi.jar
grant codeBase file:${catalina.home}/server/lib/servlets-cgi.jar {
permission java.security.AllPermission;
};

If it works then try to only give the socket permission. If you are not
running with a Security Manager, then it's a permission/group OS setting.

--Jeanfrancois

Joao Machado wrote:



Hi all,

 I'm trying to execute a CGI script and this Script tries to connect
with a database opening a socket to it. This raises a problem that this
script can't do this (permission?). I found in the mail archive someone
with the same problem but I didn't found an answer. Anyone has solved
this issue ?

Thanks in advance,

Joao Machado

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/08/2003



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








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


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






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


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



RE: Tomcat problem !

2003-10-17 Thread Patrick Willart
Come on Hassan... How can you ever expect to get an answer on this?

Your question doesn't have any specifics at all and this kind of stuff is
documented well on http://jakarta.apache.org/tomcat.


-Original Message-
From: hassan [mailto:[EMAIL PROTECTED]
Sent: Saturday, October 11, 2003 3:38 AM
To: [EMAIL PROTECTED]
Subject: Tomcat problem !


Sir plz let me know how can i configuree Tomcat 4.1 or 3.1 at my machine ..

Regards !

Hassan



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



RE: [RePost] webapp/path

2003-10-04 Thread Patrick Willart
Roland, you don't. Struts prepends the webapp-root for it.

-Original Message-
From: Roland Carlsson [mailto:[EMAIL PROTECTED]
Sent: Saturday, October 04, 2003 12:30 AM
To: Tomcat Users List
Subject: [RePost] webapp/path


Hi!
 In my struts-config.xml i have the following in an action:

forward
  name=error
  path=/mywebapp/jsp/error.jsp/

Is there any way of telling struts to use the webapp-root instead of the
server-root so that I don't have to tell the name of the web-app... a
deployer might wanna deploy several instances of the web-app with different
names so i don't think it is a good idea to have to hard-code the path to
the webapp.

Thanks in advance
Roland Carlsson



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


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



RE: Send mail cgi script doesn't work under tomcat?

2003-10-03 Thread Patrick Willart
Laurence,

I have the same problem and could not figure it out. It seems that the CGI
program isn't allowed to open a new socket.

You could try to enable the Security Manager and set it up so it allows for
opening sockets. However, I don't believe CGI scripts/programs are affected
by the Security Manager. Also my CGI program isn't allowed to open a new
socket with the Security Manager disabled, so I don't think it will help.

I posted the problem on this list yesterday but didn't get back any
response. If you figure out a way to get it working please let me know. I
wasted a couple of days on it and am currently working on porting the CGI
app to Java.

grts,

Patrick

-Original Message-
From: Lawence [mailto:[EMAIL PROTECTED]
Sent: Friday, October 03, 2003 12:56 PM
To: [EMAIL PROTECTED]
Subject: Send mail cgi script doesn't work under tomcat?


Dear all,

I know not too many did this before. I enabled cgi support of Tomcat instead
of integrating it to apache. Everything worked fine for the old cgi scripts
except one fatal thing: the email script failed.  Seemed to me Tomcat has
some security restriction on openning socket to communicate with a smtp
server. Hence all the sendmail perl modules I tried failed at the very first
step, trying to connect to the smtp server. I tried those modules as perl
scripts instead of cgis under tomcat on the same machie, they all worked
perfectly. Anyone knows how to get around this in tomcat?

Thanks in advance!




-
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search


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



RE: invalid direct reference..--problem with solution..

2003-10-03 Thread Patrick Willart
Here are two fixes for the problem.

http://forum.java.sun.com/thread.jsp?thread=330109forum=45message=1344266
http://raibledesigns.com/page/rd/20020828

However, they don't work for me. My problem isn't that the user goes
directly to the login page, but that a login form is available on every page
on the site via an include.

I want the user to be able to login whenever he wants and not only from
protected pages. What would be the best strategy to implement this?

Patrick

-Original Message-
From: George Payne [mailto:[EMAIL PROTECTED]
Sent: Friday, October 03, 2003 2:38 PM
To: Tomcat Users List
Cc: [EMAIL PROTECTED]
Subject: RE: invalid direct reference..--problem with solution..


I would like to implement a fix to this.  I think having users bookmark the
login page is a very likely frequent problem.

But..

What happens if you implement this solution and the user has disallowed
cookies?  Don't you get an ugly loop?

If the referer header was set, you could use that, but it does not appear
to be.  Anyone have a bright idea?


At 08:13 PM 6/28/2003, Stefan Radzom wrote:
Your problem has just recently been discussed on this list. Ben Jessel
proposed a workaround which I attached below. Hopefully, this might work
for
you.

Stefan


  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Friday, June 27, 2003 1:42 PM
  To: [EMAIL PROTECTED]
  Subject: Possible workaround for invalid direct reference to
  login page
 
 
  Java Authentication with tomcat relies on realms. If you
  access a page
  protected by that realm you get directed to the login page.
  However, it is possible to go directly to the login page (
  this can happen
  when users bookmark the login page inadvertantly ).
 
  This happens in two scenarios:
 
  1) The user is already logged in.
  2) The user is not logged in.
 
  If you authenticate yourself once you have gone directly to the login
  page, you get a invalid direct reference error. Fair
  enough, the login
  page is trying to redirect to itself. Now, I tried to
  workaround this by
  checking if the session is null, and if it is, redirecting to some
  protected page, eg. protected/index.jsp. No luck. It seems
  that a session
  is implicitly created, and a new session id gets created.
 
  So I've tried a cookie strategy:
 
  %
  if ( request.getCookies()==null ) {
  response.sendRedirect(//jsp/protected/index.jsp);
  }
  if ( request.getRemoteUser()!=null )
  {
  response.sendRedirect(/x/jsp/protected/index.jsp);
  }
  %
 
  i.e, we wont have a cookie if we've gone directly to the
  login page. But
  we will have if we've tried to access a protected page and
  then we've been
  forwarded to a login page, tomcat will give us a cookie.
 
  Now if we're already logged in ( which we check with
  getRemoteUser() ,
  then we just forward to user to an index page.
 
  This seems o.k. However my index page actually includes my
  login page! I'm
  planning to get around this with some logic that only
  includes the login
  page excerpt if we are not logged in..
 
  Ben
 
 

  -Original Message-
  From: Brian Kuhn [mailto:[EMAIL PROTECTED]
  Sent: Sunday, June 29, 2003 1:16 AM
  To: [EMAIL PROTECTED]
  Subject: invalid direct reference to form login page...
 
 
  Hi all,
 
  I've set up Tomcat (4.1.24) to do form based authentication.
  Everything
  works great, except I've had to deal with a lot of users that
  type in the
  url I've given them, get redirected to the login page, and
  bookmark the
  login page before logging in.  Later, when they use the
  bookmark, they get
  sent to the login page, but get a Invalid direct reference
  to form login
  page... message once they log in.
 
  I understand why this happens, but don't know what to do
  about it.  Is there
  a way to specify a default page to go to when the login page
  is requested
  directly?
 
  Thanks,
Brian Kuhn
Telscape Communications
 
 
 
 
  
  Brian Kuhn
  [EMAIL PROTECTED]
  
 
  _
  The new MSN 8: smart spam protection and 2 months FREE*
  http://join.msn.com/?page=features/junkmail
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



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



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


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



cgi program cannot open a new socket - security issue ?

2003-10-02 Thread Patrick Willart
I have a (legacy) cgi program that tries to open a TCP IP socket to a
certain address port for communication. On Apache and iPlanet the CGI
program works fine. On Tomcat however the CGI program isn't able to open the
socket and returns an error.

This call fails with error 10106 (WSAEPROVIDERFAILEDINIT):
SOCKET sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

I am running Tomcat 4.1.18 on Windows 2000 without the security manager
enabled. On the same machine it works fine with the other servers.

Could this be a security issue or has anybody an idea of what is going
wrong?

Below is the complete method:


SOCKET SocketConnect(const char* hostname, unsigned short port) {

struct sockaddr_in  dest;

if (!bInitialised) {
if (WSAStartup(MAKEWORD(2,1), wsaData) != 0)
return INVALID_SOCKET;
}

if (!translateIpAdress(dest, hostname, port))
return INVALID_SOCKET;

SOCKET sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

if(::connect(sock, (SOCKADDR*)dest, sizeof(dest)) == SOCKET_ERROR)
return INVALID_SOCKET;

return sock;
}


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