RE: Help on setup https on Tomcat in linux

2007-07-03 Thread Yifan (Eric) Jiang
Perhaps the firewall setting for your Linux if your Linux is on a remote
server?

Thanks

Eric

-Original Message-
From: Jack Wang [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 4 July 2007 3:48 p.m.
To: users@tomcat.apache.org
Subject: Help on setup https on Tomcat in linux

I try to setup tomcat https connection on port 8443 in redhat linux. I
followed the instruction and get no error when start tomcat. But I could
NOT
connect to it from browser by https://:8443/xxx.html .  I setup the
same
tomcat in Window. It works.

Could someone help me to sovle it?



Thanks,


Jack

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



RE: How to find Tomcat config and log path?

2007-07-03 Thread Yifan (Eric) Jiang
Setup your environment variable CATALINA_HOME (if you are using
Windows, make sure it is a system environment rather than a user
environment variable), and then use 

System.getenv(CATALINA_HOME);

to get the tomcat path.

Hope this can help

Cheers

Eric 

-Original Message-
From: Joe Kramer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 4 July 2007 4:57 p.m.
To: users@tomcat.apache.org
Subject: How to find Tomcat config and log path?

Hello,

I've been googling and searching Tomcat website and couldn't find an
answer to this problem.

I need to find a path to tomcat conf (and log) folders from within my
servlet.

I imagine there should be something like:
SomeCatalinaClass.getHomePath()+File.separatorChar+SomeCatalinaClass.CON
F_DIR_CONSTANT

Can anyone help me please?

Thanks.

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


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



How to add -Djava.library.path to tomcat

2007-06-25 Thread Yifan (Eric) Jiang
Hi,

 

I would like to load a library (.dll in windows and .so in linux) in a
Java application, so I have to add the path of the library to
LD_LIBRARY_PATH (Linux) or PATH (Windows). In addition, I also need to
add -Djava.library.path=. However this is only for a standalone java
application. But I'd like to deploy these applications as Axis web
services, so how can I do the similar thing in Tomcat? i.e. how can I
add -Djava.library.path in tomcat (in both Windows and Linux).

 

Thanks

 

Eric



Java Axis and R

2007-06-24 Thread Yifan (Eric) Jiang
Hi all,

 

I've been asked to develop a Java Axis web service to call R program
(http://www.r-project.org/). There is a Java/R interface
(http://www.rforge.net/rJava/) has been developed and allows to call
methods and access R object from Java. So my application is running fine
as a normal Java application. However, it fails to run the R program
when it is running as web service. 

 

Well from my experience, I guess the only reason to cause it was because
Tomcat doesn't allow its own web applications to consume other programs
that are not inside Tomcat. Similar situation happen before when I was
trying to use System.getenv(CATALINA_HOME). It was running fine as a
normal Java application, but doesn't work when it is running inside
Tomcat.

 

So does anyone know how to configure Tomcat to use other programs that
are not inside Tomcat?

 

By the way, the version of my tomcat is 5.5.23.

 

Thanks in advance

 

Kind Regards

 

Eric Jiang

 

 



RE: Java Axis and R

2007-06-24 Thread Yifan (Eric) Jiang
Hi Kaustubh,

Thanks for your information. But I am looking for something that can be
use in Java program.

Thanks

Eric

-Original Message-
From: kaustubh shinde [mailto:[EMAIL PROTECTED] 
Sent: Monday, 25 June 2007 2:02 p.m.
To: Tomcat Users List
Subject: Re: Java Axis and R

Hi there,
Check out CGIwithR package.
http://www.omegahat.org/CGIwithR/
I have been using it for a while. You can execute R scripts and post the
output to using RHTML package
or using simple print.
hope it helps,
Kaustubh

On 6/24/07, Yifan (Eric) Jiang [EMAIL PROTECTED] wrote:

 Hi all,



 I've been asked to develop a Java Axis web service to call R program
 (http://www.r-project.org/). There is a Java/R interface
 (http://www.rforge.net/rJava/) has been developed and allows to call
 methods and access R object from Java. So my application is running
fine
 as a normal Java application. However, it fails to run the R program
 when it is running as web service.



 Well from my experience, I guess the only reason to cause it was
because
 Tomcat doesn't allow its own web applications to consume other
programs
 that are not inside Tomcat. Similar situation happen before when I was
 trying to use System.getenv(CATALINA_HOME). It was running fine as a
 normal Java application, but doesn't work when it is running inside
 Tomcat.



 So does anyone know how to configure Tomcat to use other programs that
 are not inside Tomcat?



 By the way, the version of my tomcat is 5.5.23.



 Thanks in advance



 Kind Regards



 Eric Jiang







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



Tomcat pausing by some strange error

2007-05-31 Thread Yifan (Eric) Jiang
Hi all,

 

I've installed Tomcat 5.5.23 on a RedHat AS 4. Tomcat is communicating
Apache by mod_jk.

It just stop running last night and I have to run it again today's
morning.

 

I've found some messages from Tomcat log file, catalina.out.

 

31/05/2007 20:22:40 org.apache.coyote.http11.Http11BaseProtocol pause

INFO: Pausing Coyote HTTP/1.1 on http-8080

31/05/2007 20:22:40 org.apache.catalina.connector.Connector pause

SEVERE: Protocol handler pause failed

java.net.UnknownHostException: osiris1.auckland.ac.nz:
osiris1.auckland.ac.nz

at java.net.InetAddress.getLocalHost(InetAddress.java:1308)

at
org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:490)

at
org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:289)

at org.apache.jk.server.JkMain.pause(JkMain.java:681)

at
org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:163)

at
org.apache.catalina.connector.Connector.pause(Connector.java:1032)

at
org.apache.catalina.core.StandardService.stop(StandardService.java:489)

at
org.apache.catalina.core.StandardServer.stop(StandardServer.java:734)

at org.apache.catalina.startup.Catalina.stop(Catalina.java:602)

at
org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.j
ava:645)

31/05/2007 20:22:41 org.apache.catalina.core.StandardService stop

INFO: Stopping service Catalina

31/05/2007 20:22:42 org.apache.coyote.http11.Http11BaseProtocol destroy

INFO: Stopping Coyote HTTP/1.1 on http-8080

31/05/2007 20:22:42 org.apache.catalina.core.AprLifecycleListener
lifecycleEvent

INFO: Failed shutdown of Apache Portable Runtime

 

When I start up the tomcat and shutdown again this morning, I have found
Tomcat failed to shutdown of Apache Portable Run Time:

 

1/06/2007 09:43:06 org.apache.catalina.core.AprLifecycleListener
lifecycleEvent

INFO: The Apache Tomcat Native library which allows optimal performance
in production environments was not found on the java.library.path:
/usr/java/jdk1.5.0

_11/jre/lib/i386/client:/usr/java/jdk1.5.0_11/jre/lib/i386:/usr/java/jdk
1.5.0_11/jre/../lib/i386

1/06/2007 09:43:06 org.apache.coyote.http11.Http11BaseProtocol init

INFO: Initializing Coyote HTTP/1.1 on http-8080

1/06/2007 09:43:06 org.apache.catalina.startup.Catalina load

INFO: Initialization processed in 1365 ms

1/06/2007 09:43:07 org.apache.catalina.core.StandardService start

INFO: Starting service Catalina

1/06/2007 09:43:07 org.apache.catalina.core.StandardEngine start

INFO: Starting Servlet Engine: Apache Tomcat/5.5.23

1/06/2007 09:43:07 org.apache.catalina.core.StandardHost start

INFO: XML validation disabled

1/06/2007 09:43:08 org.apache.catalina.startup.HostConfig deployWAR

INFO: Deploying web application archive shibboleth-idp.war

log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.Digester.sax).

log4j:WARN Please initialize the log4j system properly.

1/06/2007 09:43:09 org.apache.coyote.http11.Http11BaseProtocol start

INFO: Starting Coyote HTTP/1.1 on http-8080

1/06/2007 09:43:10 org.apache.jk.common.ChannelSocket init

INFO: JK: ajp13 listening on /0.0.0.0:8009

1/06/2007 09:43:10 org.apache.jk.server.JkMain start

INFO: Jk running ID=0 time=0/42  config=null

1/06/2007 09:43:10 org.apache.catalina.storeconfig.StoreLoader load

INFO: Find registry server-registry.xml at classpath resource

1/06/2007 09:43:10 org.apache.catalina.startup.Catalina start

INFO: Server startup in 3257 ms

1/06/2007 09:59:18 org.apache.coyote.http11.Http11BaseProtocol pause

INFO: Pausing Coyote HTTP/1.1 on http-8080

1/06/2007 09:59:19 org.apache.catalina.core.StandardService stop

INFO: Stopping service Catalina

1/06/2007 09:59:19 org.apache.coyote.http11.Http11BaseProtocol destroy

INFO: Stopping Coyote HTTP/1.1 on http-8080

1/06/2007 09:59:19 org.apache.catalina.core.AprLifecycleListener
lifecycleEvent

INFO: Failed shutdown of Apache Portable Runtime

 

Any one knows what is wrong?

 

Thanks in advance.

 

Eric

 

 

 

 



RE: mod_jk problem

2007-05-21 Thread Yifan (Eric) Jiang
Hi Rainer,

Thanks for all your helps. I know that is a very outdated version of
httpd,
But since it is in a production server, and the server for the
authentication of the whole university, so it is unlikely, or it is
impossible for me to do any big change on it. And it is weird, because
it is running completely fine in the test server which is the
replication for the production server. 

So we are trying to reproduce the same error/bug that occurred in the
production server, but unfortunately we still can't reproduce it. Any
idea why?


Thanks

Regards

Eric

-Original Message-
From: Rainer Jung [mailto:[EMAIL PROTECTED] 
Sent: Monday, 21 May 2007 7:26 p.m.
To: Tomcat Users List
Subject: Re: mod_jk problem

Rotating an open log file from outside the using processes is a very bad

idea. The processes in most cases will simply try to use the old log 
file further on (and will run into trouble, after you compressed them
etc.).

Rotating log files for apache can be easily done using the bundles 
rotatelogs (see the Apache httpd documentation).

mod_jk is able to use rotatelogs with JkLogFile as well, and the syntax 
is the same as for the other Apache httpd log files 
(|/pathtorotatelogs/rotatelogs /pathtologfile/logfile OPTIONS).

Since I'm interested in the root of your problem nevertheless, if you 
can reproduce it, try to get a pstack (solaris) or gstack[?] (linux) of 
your running httpd processes, once the problem occurs. In case threads 
are hanging, this will tel us, where they are.

By the way: your httpd is a pretty outdated version. The 2.0 branch is 
at 2.0.59 and there is 2.2.x around for 1.5 years now. (I'm not saying 
such an update will solve your problem, but the other two components are

pretty up to date, so updating your apache would make a good fit).

Regards,

Rainer

Yifan (Eric) Jiang wrote:
 Hi all,
 
  
 
 Not quite sure if this list is the best place to send this question.
But
 I can't find anywhere else to send it to...
 
  
 
 I am trying to install Shibboleth (http://shibboleth.internet2.edu/)
 Identity Provider with Cosign protection on a RedHat Linux production
 server. 
 
 Well, Shibboleth Identity Provider is a Java Application and is using
 Tomcat as a Java container. Therefore for the user conveniences, I
have
 to load a mod_jk module into Apache in order to build a connection
 between Apache and Tomcat. 
 
  
 
 I am using Apahce2.0.46, mod_jk 1.2.22 and Tomcat 5.5.23. After the
 Shibboleth Identity Provider installation, everything is running
 perfectly fine until the log rotation has been triggered by the cron
job
 at mid-night.
 
  
 
 The cron job has the following configuration:
 
 59  23  *   *   *   /usr/local/etc/rotate.log
--move
 --after=/usr/local/etc/rotate.log-after.std /var/log
 
 59  23  *   *   *   /usr/local/etc/rotate.log
--move
 --after=/usr/local/etc/rotate.log-apache /var/log/httpd
 
  
 
 So after the log rotation, Apache appears to have some problems to
 restart. It returns a HTTP 500 error to users, and the ssl_error_log
 file has logged a Premature end of script headers: cosign.cgi error.
 Therefore it requires the administrator to restart the Apache
manually.
 
  
 
 Before I thought it was caused by Shibboleth and Cosign, so I just
 disable the Cosign module for Apache. However, the error still happens
 on the next day after the log rotation. Then I realised it may be
cause
 by the mod_jk, so I disable the mod_jk module and the Apache is back
to
 normal, even after the log rotation.
 
  
 
 I have not idea what exactly caused this problem, and the log for
 mod_jk, Apache doesn't give me much help. So does anyone know this
 issue? 
 
  
 
 Any information in regards of this would be much appreciated.
 
  
 
 Thanks
 
  
 
 Eric

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


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



RE: mod_jk problem

2007-05-21 Thread Yifan (Eric) Jiang
Hi Rainer,

Yeah, I've look at the link that you sent to me in the last post.

But again, it is in a production server; I don't really have the
authority to make this change. According to your email, I've realized it
is a very bad idea to this kind of log rotating, so I will suggest the
system administrator to make some changes. But thanks again for all your
helps. However we maybe end up to buying another server to host it.

Thank you very much.

Sincerely

Eric 

-Original Message-
From: Rainer Jung [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 22 May 2007 9:48 a.m.
To: Tomcat Users List
Subject: Re: mod_jk problem

You really should totally drop the idea of rotating an open logfile from

the outside. The file descriptor is open in the writing process and it 
will proceed to use the file descriptor, which will point to the rotated

file and after compression will be deleted. Really a very bad idea.

Usually if you need to rotate a log file from the outside, you need to 
take down the process during the rotation. If a process implements a 
signal or restart procedure, you can also send a signal or restart 
command after rotatting and before further manipulation on the file.

Why aren't you simply using apache httpd rotatelogs, as suggested in my 
last post?

http://httpd.apache.org/docs/2.0/programs/rotatelogs.html

Regards,

Rainer

Yifan (Eric) Jiang wrote:
 Hi Rainer,
 
 Thanks for all your helps. I know that is a very outdated version of
 httpd,
 But since it is in a production server, and the server for the
 authentication of the whole university, so it is unlikely, or it is
 impossible for me to do any big change on it. And it is weird, because
 it is running completely fine in the test server which is the
 replication for the production server. 
 
 So we are trying to reproduce the same error/bug that occurred in the
 production server, but unfortunately we still can't reproduce it. Any
 idea why?
 
 
 Thanks
 
 Regards
 
 Eric
 
 -Original Message-
 From: Rainer Jung [mailto:[EMAIL PROTECTED] 
 Sent: Monday, 21 May 2007 7:26 p.m.
 To: Tomcat Users List
 Subject: Re: mod_jk problem
 
 Rotating an open log file from outside the using processes is a very
bad
 
 idea. The processes in most cases will simply try to use the old log 
 file further on (and will run into trouble, after you compressed them
 etc.).
 
 Rotating log files for apache can be easily done using the bundles 
 rotatelogs (see the Apache httpd documentation).
 
 mod_jk is able to use rotatelogs with JkLogFile as well, and the
syntax 
 is the same as for the other Apache httpd log files 
 (|/pathtorotatelogs/rotatelogs /pathtologfile/logfile OPTIONS).
 
 Since I'm interested in the root of your problem nevertheless, if you 
 can reproduce it, try to get a pstack (solaris) or gstack[?] (linux)
of 
 your running httpd processes, once the problem occurs. In case threads

 are hanging, this will tel us, where they are.
 
 By the way: your httpd is a pretty outdated version. The 2.0 branch is

 at 2.0.59 and there is 2.2.x around for 1.5 years now. (I'm not saying

 such an update will solve your problem, but the other two components
are
 
 pretty up to date, so updating your apache would make a good fit).
 
 Regards,
 
 Rainer
 
 Yifan (Eric) Jiang wrote:
 Hi all,

  

 Not quite sure if this list is the best place to send this question.
 But
 I can't find anywhere else to send it to...

  

 I am trying to install Shibboleth (http://shibboleth.internet2.edu/)
 Identity Provider with Cosign protection on a RedHat Linux production
 server. 

 Well, Shibboleth Identity Provider is a Java Application and is using
 Tomcat as a Java container. Therefore for the user conveniences, I
 have
 to load a mod_jk module into Apache in order to build a connection
 between Apache and Tomcat. 

  

 I am using Apahce2.0.46, mod_jk 1.2.22 and Tomcat 5.5.23. After the
 Shibboleth Identity Provider installation, everything is running
 perfectly fine until the log rotation has been triggered by the cron
 job
 at mid-night.

  

 The cron job has the following configuration:

 59  23  *   *   *   /usr/local/etc/rotate.log
 --move
 --after=/usr/local/etc/rotate.log-after.std /var/log

 59  23  *   *   *   /usr/local/etc/rotate.log
 --move
 --after=/usr/local/etc/rotate.log-apache /var/log/httpd

  

 So after the log rotation, Apache appears to have some problems to
 restart. It returns a HTTP 500 error to users, and the ssl_error_log
 file has logged a Premature end of script headers: cosign.cgi
error.
 Therefore it requires the administrator to restart the Apache
 manually.
  

 Before I thought it was caused by Shibboleth and Cosign, so I just
 disable the Cosign module for Apache. However, the error still
happens
 on the next day after the log rotation. Then I realised it may be
 cause
 by the mod_jk, so I disable the mod_jk module and the Apache is back
 to
 normal, even after the log rotation.

  

 I

mod_jk problem

2007-05-20 Thread Yifan (Eric) Jiang
Hi all,

 

Not quite sure if this list is the best place to send this question. But
I can't find anywhere else to send it to...

 

I am trying to install Shibboleth (http://shibboleth.internet2.edu/)
Identity Provider with Cosign protection on a RedHat Linux production
server. 

Well, Shibboleth Identity Provider is a Java Application and is using
Tomcat as a Java container. Therefore for the user conveniences, I have
to load a mod_jk module into Apache in order to build a connection
between Apache and Tomcat. 

 

I am using Apahce2.0.46, mod_jk 1.2.22 and Tomcat 5.5.23. After the
Shibboleth Identity Provider installation, everything is running
perfectly fine until the log rotation has been triggered by the cron job
at mid-night.

 

The cron job has the following configuration:

59  23  *   *   *   /usr/local/etc/rotate.log --move
--after=/usr/local/etc/rotate.log-after.std /var/log

59  23  *   *   *   /usr/local/etc/rotate.log --move
--after=/usr/local/etc/rotate.log-apache /var/log/httpd

 

So after the log rotation, Apache appears to have some problems to
restart. It returns a HTTP 500 error to users, and the ssl_error_log
file has logged a Premature end of script headers: cosign.cgi error.
Therefore it requires the administrator to restart the Apache manually.

 

Before I thought it was caused by Shibboleth and Cosign, so I just
disable the Cosign module for Apache. However, the error still happens
on the next day after the log rotation. Then I realised it may be cause
by the mod_jk, so I disable the mod_jk module and the Apache is back to
normal, even after the log rotation.

 

I have not idea what exactly caused this problem, and the log for
mod_jk, Apache doesn't give me much help. So does anyone know this
issue? 

 

Any information in regards of this would be much appreciated.

 

Thanks

 

Eric