Re: Help: Connecting Tomcat to CA-IDMS using JDBC Type 4 Drivers (JNDI / IDMSDataSource)

2009-01-14 Thread jpmad4it

Filip, here is my configuration so far:

I have created a test application under the tomcat webapps folder with the
following structure:

IDMSTest/
IDMSTest/WEB-INF/
IDMSTest/WEB-INF/classes/
IDMSTest/WEB-INF/lib/
IDMSTest/WEB-INF/web.xml
IDMSTest/WEB-INF/test.jsp

Here is my IDMSTest/WEB-INF/web.xml file:

?xml version=1.0 encoding=UTF-8?
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 version=2.4
  descriptionIDMS Test App/description
  resource-ref
  descriptionDB Connection/description
  res-ref-namejdbc/TestIDMS/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
  /resource-ref
/web-app
 
I also added the following to tomcat/conf/server.xml:
 
!-- Tomcat JDBC to IDMS Test Context --
Context path=/IDMSTest docBase=IDMSTest reloadable=true
crossContext=true

   Resource name=jdbc/TestIDMS auth=Container
type=javax.sql.DataSource
   maxActive=100 maxIdle=30 maxWait=1
   username=MY_USER password=MY_PASS
driverClassName=ca.idms.jdbc.IdmsJdbcDriver
   url=jdbc:idms://MY.IP.ADDRESS:MY.PORT/MY_DATABASE /
/Context
 
Then I have a test.jsp in the IDMSTest/ folder with the following code:

%@ taglib uri=http://java.sun.com/jsp/jstl/sql; prefix=sql %
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %

sql:query var=rs dataSource=jdbc/testIDMS
  select text_message from messages
/sql:query

html
  head
titleIDMS DB Test/title
  /head
  body
h2Results/h2
c:forEach var=i items=${rs.rows}
  Text Message: c:out value=${i.text_message}/br
/c:forEach
  /body
/html 
 
However, I can't actually test anything yet, as the IDMS is not setup to
listen to JDBC requests. I just wanted to be clear that my configuration and
syntax on the Linux / Tomcat side are correct for when I do come to test a
connection. The SQL query and query handling code in the JSP file would
differ depending upon the database structure, obviously.but does
everything look like its setup OK? Where would the
javax.naming.spi.ObjectFactory implementation come into it?

There are some remaining issues I have about how to setup and use the
caidms.properties file and the caidms.cfg file. I've uploaded the 2 files as
they contain quite a lot of code:

http://www.nabble.com/file/p21451684/caidms.cfg caidms.cfg 
http://www.nabble.com/file/p21451684/caidms.properties caidms.properties 

regards
Jp


Filip Hanik - Dev Lists wrote:
 
 If your JDBC driver has a DataSource, then check to see if it has a
 
 javax.naming.spi.ObjectFactory implementation, this is the one you would 
 specify in the factory=some.impl.DataSourceFactory attribute, for
 example.
 Some drivers don't have factories, and then you simply use Tomcat's own 
 factory by omitting the factory attribute.
 In this case, Tomcat will provide the DataSource that is a wrapper 
 around your driver.
 
 Provide
 1. the configuration (only relevant parts)
 2. the error you get
 
 
 Filip
 
 jpmad4it wrote:
 Hi there,

 I have a rather interesting / complex problem..creating a connection
 to
 CA-IDMS from Tomcat using JDBC type 4 drivers (CA provide the type 4
 driver).

 We have a zSeries 9 IBM mainframe running CA-IDMS r16.1, and I need to
 connect to the IDMS from Tomcat (running on Linux) using the JDBC Type 4
 drivers provided by CA.

 At this stage I am struggling with the actual setup and configuration of
 Tomcat’s server.xml and web.xml files. These are the files where the JDBC
 configuration is set (I think). I have to setup the CA-IDMS part of the
 configuration, but that is a different problem. Basically there is a
 TCP/IP
 listener on the IDMS, waiting for incoming connections from the JDBC type
 4
 driver.

 I set up a Tomcat to MySQL connection using MySQL Connector / J, which is
 a
 similar kind of process to what I am trying to achieve with IDMS. MySQL
 connector / J came with a jar file which is placed in Tomcat’s lib
 folder,
 and then the JDBC setup for the web application is created in Tomcat's
 server.xml and web.xml files. You can then connect to the MySQL database
 using JSP and the configured JDBC driver / connection. The CA-IDMS Server
 comes with an idmsjdbc.jar file, which I think is the JDBC typr 4 driver.
 I
 think it needs to be placed in the Tomcat /lib folder, but I don’t know
 how
 to set up the configuration.

 There is a JDBC DriverManager which allows JDBC drivers to connect to
 CA-IDMS. The DriverManager recognises the following syntax:

 jdbc:idms://hostname:port/database

 This allows the JDBC driver running within Tomcat to connect to the IDMS
 which is running on the IDM mainframe. CA IDMS r16 supports direct
 connections from the Type 4 JDBC driver to the Central Version on IDMS.
 hostname is the DNS name or IP address of the machine where the CV is
 running, and port is 

Re: Tomcat 6.x security-constraint redirection problem... please help!

2009-01-14 Thread Pid
Martin Gainty wrote:
 please display non-proprietary attributes of HTTPS (Port 8443 or 443) 
 Connector element values from %TOMCAT_HOME%/conf/server.xml

OP: Don't attempt to decipher or respond to the above, it's a red
herring.  You could instead tell us exactly which 6.x you are using and
on which OS.


There's a couple of things that may be confusing the config below, which
have some simple corrections.

I usually place login.jsp and error.jsp in WEB-INF/login/, where
they are protected from unwanted attention by default - this avoids the
need to protect them with a security-contstraint.

You are also protecting index.jsp - which will force a login when the
apps homepage is accessed, is this what you intended?


Are you logging out programmatically, using the servlet method
request.getSession().invalidate(), or are you just clearing cookies?


Your primary problem sounds like you have placed some CSS or script
files somewhere in a protected directory and the browser is requesting
them without providing the correct authentication credentials.

Tomcat returns the *first* file you requested inside the secured area
after authentication is completed.  So for some reason your browser is
requesting a script or CSS file before the JSP page.

Are the script and CSS files in an unprotected directory?


p




 Disclaimer and confidentiality note 
 Everything in this e-mail and any attachments relates to the official 
 business of Sender. This transmission is of a confidential nature and Sender 
 does not endorse distribution to any party other than intended recipient. 
 Sender does not necessarily endorse content contained within this 
 transmission. 
 
 
 
 
 Date: Tue, 13 Jan 2009 17:03:08 -0800
 From: sams...@gmail.com
 To: users@tomcat.apache.org
 Subject: Tomcat 6.x security-constraint redirection problem... please help!


 I have defined two roles (admin, user)

 security-role
 role-nameuser/role-name
 /security-role
  security-role
 role-nameadministrator/role-name
 /security-role

 each of these roles needs to access into separate modules in my webapp. For
 achieving this, I have the following security-constraint in tomcat web.xml:

   security-constraint
 web-resource-collection
 web-resource-nameAuthorized Access Area/web-resource-name
 url-pattern/index.jsp/url-pattern
 url-pattern/login.jsp/url-pattern
 url-pattern/error.jsp/url-pattern
 url-pattern/app1/*/url-pattern
 url-pattern*.jsp/url-pattern
 /web-resource-collection
 auth-constraint
 role-nameuser/role-name
 /auth-constraint
 /security-constraint

 security-constraint
 web-resource-collection
 web-resource-nameAuthorized Access Area/web-resource-name
 url-pattern/index.jsp/url-pattern
 url-pattern/login.jsp/url-pattern
 url-pattern/error.jsp/url-pattern
 url-pattern/app2/*/url-pattern
 /web-resource-collection
 auth-constraint
 role-nameadministrator/role-name
 /auth-constraint
 /security-constraint

 consider the following steps:

 1. Access context/app1/app1action.jsp URL 
 2. I get prompted for credentials
 3. I login as normal user, and on successful login I get redirected to
 app1action.jsp page (desired behavior)
 4. Now, I clear my cache  sessions authentication from browser (firefox)
 4. Browse into some link in app1action.jsp page pointing to some other page
 eg. context/app1/anotherpage.jsp
 5. Now I get prompted to relogin
 6. On successful login, I expect myself to get redirected to
 'anotherpage.jsp'. But instead it redirects me to the resources ( JS / img /
 css ) that are included with in 'anotherpage.jsp' . eg.
 context/resources/sample.js or sample.css or sample.gif 

 I spent googling on this issue for couple of  days with no luck. 

 Can you please advise how to get properly redirected ?

 ~ Many Thanks


 -- 
 View this message in context: 
 http://www.nabble.com/Tomcat-6.x-security-constraint-redirection-problem...-please-help%21-tp21448079p21448079.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

 
 _
 Windows Live™: Keep your life in sync.
 http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Does Tomcat send content-type using a strange format in header? (Can I change this?)

2009-01-14 Thread Tetsuya

Hello, 

First, I'm sorry for my poor English... 


My Tomcat send content-type like this: 

   Content-Type: text/xml;charset=UTF-8


The separator is ; now. 
But Apache's separator is ; . 

So I want to change it from ; to ; , because some of clients which is
made very strictly don't understand the content-type and don't work well. 


In order to change, which file should I edit? 

Please tell me the way. 


Thank you. 
Tetsuya 
-- 
View this message in context: 
http://www.nabble.com/Does-Tomcat-send-content-type-using-a-strange-format-in-header---%28Can-I-change-this-%29-tp21454890p21454890.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Does Tomcat send content-type using a strange format in header? (Can I change this?)

2009-01-14 Thread Mikolaj Rydzewski

Tetsuya wrote:
My Tomcat send content-type like this: 


   Content-Type: text/xml;charset=UTF-8


The separator is ; now. 
But Apache's separator is ; . 


So I want to change it from ; to ; , because some of clients which is
made very strictly don't understand the content-type and don't work well. 



In order to change, which file should I edit? 
  

There's no simple answer.

Depending on your webapp you can change response content type directly 
in JSP files. You can also implement trivial filter to set appropiate 
content type (or better, to change 'text/xml;charset=UTF-8' into  
'text/xml; charset=UTF-8'.

Google for setcharacterencodingfilter.

--
Mikolaj Rydzewski m...@ceti.pl


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Help: Connecting Tomcat to CA-IDMS using JDBC Type 4 Drivers (JNDI / IDMSDataSource)

2009-01-14 Thread jpmad4it


David Smith-2 wrote:
 
 Case matters.  Make sure you match case in all places where you refer to
 the jndi name of your datasource.  Off the top, I see you configured
 jdbc/TestIDMS, but then try to use jdbc/testIDMS in the test jsp.
 
 --David
 
 

Ah thanks for spotting that.

I am now getting the error:

Error: java.lang.UnsupportedOperationException: Not supported by
BasicDataSource Not supported by BasicDataSource

Is this to do with the JNDI not recognising the IDMS driver??
-- 
View this message in context: 
http://www.nabble.com/Help%3A-Connecting-Tomcat-to-CA-IDMS-using-JDBC-Type-4-Drivers-%28JNDI---IDMSDataSource%29-tp21433283p21456434.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



JESESSIONID

2009-01-14 Thread James Hoare

Hi, was wondering if someone could clear this up for me. 

We have mod_jk in apache loadbalancing our JBOSS cluster with session affinity. 
We've noticed that once the JESSIONID has been created with the call to 
req.getSession() and the jvmroute encoded by the tomcat worker, that if the 
JBOSS instance that originally created the HttpSession is taken off line the 
next JBOSS instance that receives the request doesn't rewrite the cookie with 
the new JESSIONID for that app server?

Is that the correct behaviour? I was under the impression that a call to 
req.getSession() would either return that users session or create a new one for 
that server and hence write that value to the cookie, providing the browser 
supports cookies? Should the value of the original JSESSIONID be overwritten 
with the new value? We're not using any Tomcat clustering or marking the app 
distributable in web.xml.


Thanks

James

New to NET-A-PORTER.COM: 6 fabulous boutiques! 
http://www.net-a-porter.com/boutiques 
__

CONFIDENTIALITY NOTICE
The information in this email is confidential and is intended solely for the 
addressee. Access to this email by anyone else is unauthorised. If you are not 
the intended recipient, you must not read, use or disseminate the information. 
Any views expressed in this message are those of the individual sender, except 
where the sender specifically states them to be the views of Net a Porter Ltd. 

Net A Porter Ltd is a company registered in England  Wales Number: 3820604 
Registered Office: The Dome, Whiteleys Centre, 151 Queensway, London, W2 4YN.
_


webapp in tomcat context cannot access a python proxy residing in apache

2009-01-14 Thread g f
Hello all,
not sure if this should be asked here or in the apache list so I will try
here first.

I have an application running completely inside of tomcat 6...lets call it
webappTomcat which runs on port 8084.

A coworker developed an application that runs mainly on apache(html and
javascript) although he makes ajax requests to servlets. Lets call it
webappApache.
When he makes his ajax requests he does so through a pseudo proxy(to allow
cross domain) that is written in python. This proxy resides in apache on
port 80.

We need to merge both applications. I want to merge webappApache
*into*webappTomcat.

Basically bring all of the html and javascript code from webappApache into
webappTomcat and retain the use of the proxy on Apache for cross domain
calls.

When I do this, the calls to the apache python proxy fail. It seem like
there is no *path* to the proxy from tomcat.

example:

http://localhost:8084/webappTomcat/index.jsp makes an ajax call through the
proxy to http://localhost:8084/anotherTomcatWebApp/Servlet

http://localhost:8084/webappTomcat/index.jsp ---
http://localhost/webappApache/pythonProxy.py  ---
http://localhost:8084/anotherTomcatWebApp/Servlet

so the request would look something like this:

from webappTomcat an ajax request to
http://localhost/webappApache/pythonProxy.py?url=http://localhost:8084/anotherTomcatWebAppServlet?parameterX=345parameterY=199

Is there some configuration needed on tomcat for this to work?

Keep in mind that this is not a real proxy(ie, no cacheing or anything like
that).

We were thinking that perhaps a java proxy(residing in tomcat) that makes a
call to the python proxy(residing in apache) would be what we need but it
seems kind of hacky.

Thanks in advance!


RE: Beginner - Netbeans IDE

2009-01-14 Thread Caldarale, Charles R
 From: Toriacht [mailto:brian.p.gunn...@gmail.com]
 Subject: Beginner - Netbeans IDE

 1 .How do I deploy this to my Tomcat server using my current
 configuration

First, uninstall the .exe version and download and install the .zip one.  The 
.zip includes the scripts, including ones to install it as a service or run it 
from a command line.

 2. How do I deploy to a Tomcat server on a different machine

Read the Tomcat doc about deployment:
http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html

The exact procedure will depend greatly on exactly what the other machine is 
and what kind of access you have to it.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Can Tomcat be used to host socket servers?

2009-01-14 Thread Jonathan Mast
Is it possible to use Tomcat to host socket servers? Or is Tomcat a strictly
1 port operation?

thanks


IIS 6 + Tomcat 6.0 + ISAPI + SSL

2009-01-14 Thread Alexander Diedler
Hello,
I have some question, it is possible to make SSL with an Tomcat project, which 
will be served trough the ISAPI Filter in IIS?
Open with http Port 80 is fine, but open with https .. Page cannot be found 
will be displayed.

Greetings
Alexander


RE: Can Tomcat be used to host socket servers?

2009-01-14 Thread Martin Gainty

In other words instead of committing to single port request TC use a port range 
for connector?
You might be able to accomplish the task by developing an algorithm which 
rewrites server.xml with 'unused port'
Not sure if this has been accomplished
?
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




 Date: Wed, 14 Jan 2009 09:20:27 -0500
 From: jhmast.develo...@gmail.com
 To: users@tomcat.apache.org
 Subject: Can Tomcat be used to host socket servers?
 
 Is it possible to use Tomcat to host socket servers? Or is Tomcat a strictly
 1 port operation?
 
 thanks

_
Windows Live™: Keep your life in sync. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009

Re: Help: Connecting Tomcat to CA-IDMS using JDBC Type 4 Drivers (JNDI / IDMSDataSource)

2009-01-14 Thread Filip Hanik - Dev Lists

you are calling this method

   public Connection getConnection(String username, String password) 
throws SQLException {
   throw new UnsupportedOperationException(Not supported by 
BasicDataSource);

   }

try calling

DataSource.getConnection() without a username and password

Filip


jpmad4it wrote:

David Smith-2 wrote:
  

Case matters.  Make sure you match case in all places where you refer to
the jndi name of your datasource.  Off the top, I see you configured
jdbc/TestIDMS, but then try to use jdbc/testIDMS in the test jsp.

--David





Ah thanks for spotting that.

I am now getting the error:

Error: java.lang.UnsupportedOperationException: Not supported by
BasicDataSource Not supported by BasicDataSource

Is this to do with the JNDI not recognising the IDMS driver??
  



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



configure tomcat with two conection SSL

2009-01-14 Thread peibel

Hi,

tomcat can be set two types of SSL connections, 

Depending on the page you requested enter with  user certificate or not.

Sorry for my English

thanks for your help
-- 
View this message in context: 
http://www.nabble.com/configure-tomcat-with-two-conection-SSL-tp21458441p21458441.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Help: Connecting Tomcat to CA-IDMS using JDBC Type 4 Drivers (JNDI / IDMSDataSource)

2009-01-14 Thread jpmad4it


Filip Hanik - Dev Lists wrote:
 
 you are calling this method
 
 public Connection getConnection(String username, String password) 
 throws SQLException {
 throw new UnsupportedOperationException(Not supported by 
 BasicDataSource);
 }
 
 try calling
 
 DataSource.getConnection() without a username and password
 
 Filip
 

Yeah thanks Filip, I read online about that being the problem.

I think I am now ready to setup the IDMS so that it will listen to JDBC
calls. Once I have this all setup I will come back to let you know how I got
on.

Thanks for all the help everyone.
rgs Jp
-- 
View this message in context: 
http://www.nabble.com/Help%3A-Connecting-Tomcat-to-CA-IDMS-using-JDBC-Type-4-Drivers-%28JNDI---IDMSDataSource%29-tp21433283p21458683.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Beginner - Netbeans IDE

2009-01-14 Thread Martin Gainty


if you need to use a different catalina.bat
go to NetBeans Project Right click properties / run / change target server
catalina.bat must be on path 
make sure CATALINA_HOME/bin is on PATH

Martin
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




 Date: Wed, 14 Jan 2009 05:42:58 -0800
 From: brian.p.gunn...@gmail.com
 To: users@tomcat.apache.org
 Subject: Beginner - Netbeans IDE
 
 
 Hi,
 
 I am trying to deploy my first webservice. I downloaded Netbeans IDE to
 develop it (normally use Eclipse). I already had Tomcat downloaded as an
 .exe, installed and running as a service for a while
 
 When i try to deploy my app to my server Netbeans complains that it can't
 find Catalina.bat...(as it tries to stop tomcat). I presume this is because
 Tomcat is running as a windows service or something similar and Netbeans
 can't connect
 
 I apologise if these answers are too simple for this forum but...
 
 1 .How do I deploy this to my Tomcat server using my current configuration
 2. How do I deploy to a Tomcat server on a different machine
 
 
 Many thanks,
 Toriacht
 -- 
 View this message in context: 
 http://www.nabble.com/Beginner---Netbeans-IDE-tp21456213p21456213.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

_
Windows Live™: Keep your life in sync. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_allup_howitworks_012009

Re: IIS 6 + Tomcat 6.0 + ISAPI + SSL

2009-01-14 Thread g f
You did not mention if ssl worked with tomcat in the standalone mode(without
ISAPI).
can you access https://localhost:8084/yourwebapp?

If not:

Perhaps you need to uncomment ssl support in server.xml file
Uncomment the second block and restart.
!--
 Define a SSL HTTP/1.1 Connector on port 8443
 This connector uses the JSSE configuration, when using APR, the
 connector should be using the OpenSSL style configuration
 described in the APR documentation
--
−
!--

Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true
   maxThreads=150 scheme=https secure=true
   clientAuth=false sslProtocol=TLS /

--

HTH.

On Wed, Jan 14, 2009 at 9:27 AM, Alexander Diedler adied...@tecracer.dewrote:

 Hello,
 I have some question, it is possible to make SSL with an Tomcat project,
 which will be served trough the ISAPI Filter in IIS?
 Open with http Port 80 is fine, but open with https .. Page cannot be
 found will be displayed.

 Greetings
 Alexander



RE: Beginner - Netbeans IDE

2009-01-14 Thread Toriacht

Thanks for the replies guys... 

I was aware I could uninstall the .exe and install the .zip version. The
.exe does not come with a catalina.bat (I think)...am I right? 

I suppose I was wondering was there a standard catalina.bat example that
somebody had that I could point the IDE towards so that my current config.
works or I could drop it into one of the Tomcat folders etc? If this is the
case would anybody have a catalina.bat file I could use?

If this is not the case, I am probably better off uninstalling it and
dowloading teh .zip version?

Thanks again for the replies...
Toriacht



mgainty wrote:
 
 
 
 if you need to use a different catalina.bat
 go to NetBeans Project Right click properties / run / change target server
 catalina.bat must be on path 
 make sure CATALINA_HOME/bin is on PATH
 
 Martin
 __ 
 Disclaimer and confidentiality note 
 Everything in this e-mail and any attachments relates to the official
 business of Sender. This transmission is of a confidential nature and
 Sender does not endorse distribution to any party other than intended
 recipient. Sender does not necessarily endorse content contained within
 this transmission. 
 
 
 
 
 Date: Wed, 14 Jan 2009 05:42:58 -0800
 From: brian.p.gunn...@gmail.com
 To: users@tomcat.apache.org
 Subject: Beginner - Netbeans IDE
 
 
 Hi,
 
 I am trying to deploy my first webservice. I downloaded Netbeans IDE to
 develop it (normally use Eclipse). I already had Tomcat downloaded as an
 .exe, installed and running as a service for a while
 
 When i try to deploy my app to my server Netbeans complains that it can't
 find Catalina.bat...(as it tries to stop tomcat). I presume this is
 because
 Tomcat is running as a windows service or something similar and Netbeans
 can't connect
 
 I apologise if these answers are too simple for this forum but...
 
 1 .How do I deploy this to my Tomcat server using my current
 configuration
 2. How do I deploy to a Tomcat server on a different machine
 
 
 Many thanks,
 Toriacht
 -- 
 View this message in context:
 http://www.nabble.com/Beginner---Netbeans-IDE-tp21456213p21456213.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 _
 Windows Live™: Keep your life in sync. 
 http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_allup_howitworks_012009
 

-- 
View this message in context: 
http://www.nabble.com/Beginner---Netbeans-IDE-tp21456213p21459949.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Beginner - Netbeans IDE

2009-01-14 Thread Caldarale, Charles R
 From: Toriacht [mailto:shatner.will...@gmail.com]
 Subject: RE: Beginner - Netbeans IDE

 The .exe does not come with a catalina.bat

Correct; there are no scripts in the .exe download (and I don't know why).

 I suppose I was wondering was there a standard catalina.bat
 example that somebody had that I could point the IDE towards

Yes - the one in the .zip download.  Just use that.

 I am probably better off uninstalling it and
 dowloading teh .zip version?

Yes; the .zip gives you more options and more control over Tomcat, which is 
what you need when running it under an IDE.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat6 with Custom TagLib Version 2.0

2009-01-14 Thread Axel Becker

Hi,

im am trying to use tomcat 6.0.18 with taglib version 2.0.

i have an tld in tht web-inf folder with this header:

?xml version=1.0 encoding=ISO-8859-1?
taglib xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd;
version=2.0

display-nameTest-TagLib/display-name
tlib-version1.0/tlib-version
short-nametest/short-name
urihttp://www.test.de/tags/uri

and inludes a lot of tag-Files.

In my JSP i use the following to import this taglib:

jsp:root xmlns:jsp=http://java.sun.com/JSP/Page;
  xmlns=http://www.w3.org/1999/xhtml;
  xmlns:core=http://java.sun.com/jsp/jstl/core;
  xmlns:ps=http://www.test.de/tags;
  xmlns:s=/struts-tags version=2.0 

Access the JSP throws this Message: Could not add one or more tag
libraries

If i using the old tld like this:

  ?xml version=1.0 encoding=ISO-8859-1 ?
  !DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library
1.2//EN
  http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd;

everthing works fine.

Some ideas?

Thanks
Axel




-- 
View this message in context: 
http://www.nabble.com/Tomcat6-with-Custom-TagLib-Version-2.0-tp21460721p21460721.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat and coldfusion

2009-01-14 Thread Andrew Hole
Hello guys!

I deployed coldfusion on Tomcat and everything looks fine to me except when
I shutdown the service.
This deployment was made in Linux.

Jan 14, 2009 5:29:43 PM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8189
Jan 14, 2009 5:29:44 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
01/14 17:29:44 Information [main] - Stopping Event Gateways.
01/14 17:29:49 Information [main] - ColdFusion stopped
Jan 14, 2009 5:29:49 PM org.apache.catalina.startup.ContextConfig stop
FINE: ContextConfig: Processing STOP
Jan 14, 2009 5:29:49 PM org.apache.catalina.startup.ContextConfig stop
FINE: ContextConfig: Processing STOP
Jan 14, 2009 5:29:49 PM org.apache.coyote.http11.Http11BaseProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8189

It looks that tomcat is stopped but the tomcat process still alive in the
server.
Do you have any suggestion about this issue? I'm very concerned about this
problem.

Thanks a lot


RE: Tomcat and coldfusion

2009-01-14 Thread Martin Gainty

could you display web.xml for your ColdFusion webapp
how does one create a servlet from Apache HTTP Server CF Script
?
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




 Date: Wed, 14 Jan 2009 18:15:14 +
 Subject: Tomcat and coldfusion
 From: andremailingl...@gmail.com
 To: users@tomcat.apache.org
 
 Hello guys!
 
 I deployed coldfusion on Tomcat and everything looks fine to me except when
 I shutdown the service.
 This deployment was made in Linux.
 
 Jan 14, 2009 5:29:43 PM org.apache.coyote.http11.Http11BaseProtocol pause
 INFO: Pausing Coyote HTTP/1.1 on http-8189
 Jan 14, 2009 5:29:44 PM org.apache.catalina.core.StandardService stop
 INFO: Stopping service Catalina
 01/14 17:29:44 Information [main] - Stopping Event Gateways.
 01/14 17:29:49 Information [main] - ColdFusion stopped
 Jan 14, 2009 5:29:49 PM org.apache.catalina.startup.ContextConfig stop
 FINE: ContextConfig: Processing STOP
 Jan 14, 2009 5:29:49 PM org.apache.catalina.startup.ContextConfig stop
 FINE: ContextConfig: Processing STOP
 Jan 14, 2009 5:29:49 PM org.apache.coyote.http11.Http11BaseProtocol destroy
 INFO: Stopping Coyote HTTP/1.1 on http-8189
 
 It looks that tomcat is stopped but the tomcat process still alive in the
 server.
 Do you have any suggestion about this issue? I'm very concerned about this
 problem.
 
 Thanks a lot

_
Windows Live™ Hotmail®: Chat. Store. Share. Do more with mail. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_hm_justgotbetter_howitworks_012009

Re: Tomcat and coldfusion

2009-01-14 Thread Andrew Hole
just to say one more thing:
this only happens when cfusion war is deployed in tomcat. If i try to
shutdown without cfusion.war deployed, everything works fine.
I'm seeing the cfusion log and there are no errors in stopping cfusion
engine.

Thanks

On Wed, Jan 14, 2009 at 6:15 PM, Andrew Hole andremailingl...@gmail.comwrote:

 Hello guys!

 I deployed coldfusion on Tomcat and everything looks fine to me except when
 I shutdown the service.
 This deployment was made in Linux.

 Jan 14, 2009 5:29:43 PM org.apache.coyote.http11.Http11BaseProtocol pause
 INFO: Pausing Coyote HTTP/1.1 on http-8189
 Jan 14, 2009 5:29:44 PM org.apache.catalina.core.StandardService stop
 INFO: Stopping service Catalina
 01/14 17:29:44 Information [main] - Stopping Event Gateways.
 01/14 17:29:49 Information [main] - ColdFusion stopped
 Jan 14, 2009 5:29:49 PM org.apache.catalina.startup.ContextConfig stop
 FINE: ContextConfig: Processing STOP
 Jan 14, 2009 5:29:49 PM org.apache.catalina.startup.ContextConfig stop
 FINE: ContextConfig: Processing STOP
 Jan 14, 2009 5:29:49 PM org.apache.coyote.http11.Http11BaseProtocol destroy
 INFO: Stopping Coyote HTTP/1.1 on http-8189

 It looks that tomcat is stopped but the tomcat process still alive in the
 server.
 Do you have any suggestion about this issue? I'm very concerned about this
 problem.

 Thanks a lot




Re: Tomcat and coldfusion

2009-01-14 Thread Andrew Hole
Sure. cfusion web.xml is the following:

?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;
web-app id=adobe_coldfusion
display-nameAdobe ColdFusion 8/display-name
descriptionAdobe ColdFusion 8/description
context-param id=coldfusion_context_1
param-namecftags/param-name
param-value/WEB-INF/cftags/param-value
descriptionPath to search for built-in tags. Relative to
application root.
This parameter can only be one path element./description
/context-param
context-param id=coldfusion_context_2
param-namecoldfusion.compiler.outputDir/param-name
param-value/WEB-INF/cfclasses/param-value
descriptionThis is the directory where we will place compiled
pages. It must be relative to the webapp root./description
/context-param
context-param id=coldfusion_context_4
param-namecfx.registry.nativelibrary/param-name
param-valuecfregistry/param-value
descriptionNative library that implements CFX_REGISTRY.
Used on Windows only./description
/context-param
context-param id=coldfusion_context_5
param-namecfx.report.nativelibrary/param-name
param-valuecfreport/param-value
descriptionNative library that implements CFX_REPORT.
Used on Windows only./description
/context-param
context-param id=coldfusion_context_88
param-namecf.class.path/param-name
param-value

./WEB-INF/cfusion/lib/updates,./WEB-INF/cfusion/lib,./WEB-INF/cfusion/gateway/lib,./WEB-INF/flex/jars,./WEB-INF/cfform/jars/param-value
/context-param
context-param id=coldfusion_context_89
param-namecf.lib.path/param-name
param-value./WEB-INF/cfusion/lib/param-value
/context-param

!-- CF Monitoring Filter  --
filter
filter-nameCFMonitoringFilter/filter-name
filter-classcoldfusion.bootstrap.BootstrapFilter/filter-class
init-param
param-namefilter.class/param-name

param-valuecoldfusion.monitor.event.MonitoringServletFilter/param-value
/init-param
/filter

!-- Cache Filter for cfform swfs --
filter
filter-nameCFCacheFilter/filter-name
filter-classcoldfusion.bootstrap.BootstrapFilter/filter-class
init-param
param-namefilter.class/param-name
param-valueflex.server.j2ee.cache.CacheFilter/param-value
/init-param
/filter

!-- Request Control Filter for Flash Remoting servlets--
filter
filter-nameFlashRemotingControlFilter/filter-name
filter-classcoldfusion.bootstrap.BootstrapFilter/filter-class
init-param
param-namefilter.class/param-name

param-valuecoldfusion.filter.FlashRequestControlFilter/param-value
/init-param
:$
/servlet-mapping
servlet-mapping id=coldfusion_mapping_12
servlet-nameCFCServlet/servlet-name
url-pattern*.cfr/url-pattern
/servlet-mapping
servlet-mapping id=coldfusion_mapping_13
servlet-nameCFFormGateway/servlet-name
url-pattern/CFFormGateway/*/url-pattern
/servlet-mapping
servlet-mapping id=coldfusion_mapping_14
servlet-nameCFFileServlet/servlet-name
url-pattern/CFFileServlet/*/url-pattern
/servlet-mapping

!-- start flash form settings --
servlet-mapping
servlet-nameCFInternalServlet/servlet-name
url-pattern/cfform-internal/*/url-pattern
/servlet-mapping

servlet-mapping
servlet-nameCFSwfServlet/servlet-name
url-pattern*.cfswf/url-pattern
/servlet-mapping

servlet-mapping
servlet-nameCFForbiddenServlet/servlet-name
url-pattern*.as/url-pattern
/servlet-mapping
servlet-mapping
servlet-nameCFForbiddenServlet/servlet-name
url-pattern*.sws/url-pattern
/servlet-mapping
servlet-mapping
servlet-nameCFForbiddenServlet/servlet-name
url-pattern*.swc/url-pattern
/servlet-mapping
!-- end flash form settings --

session-config
session-timeout30/session-timeout
/session-config

welcome-file-list id=WelcomeFileList_1034013110672
welcome-fileindex.cfm/welcome-file
welcome-fileindex.html/welcome-file
welcome-fileindex.htm/welcome-file
/welcome-file-list

!-- start flex2
taglib
taglib-uriFlexTagLib/taglib-uri

taglib-location/WEB-INF/lib/cf-bootstrap-for-flex.jar/taglib-location
/taglib
end flex2 --

!-- for WebSphere deployment, please uncomment --
!-- Start WebSphere deploy
resource-ref
descriptionFlex Messaging WorkManager/description
res-ref-namewm/MessagingWorkManager/res-ref-name
res-typecom.ibm.websphere.asynchbeans.WorkManager/res-type
res-authContainer/res-auth
res-sharing-scopeShareable/res-sharing-scope
/resource-ref
End WebSphere 

RE: Tomcat and coldfusion

2009-01-14 Thread Caldarale, Charles R
 From: Andrew Hole [mailto:andremailingl...@gmail.com]
 Subject: Tomcat and coldfusion

 It looks that tomcat is stopped but the tomcat process still
 alive in the server.

This is pretty much always a result of a webapp starting its own threads and 
failing to shut them down; the JVM can't terminate until all non-daemon threads 
exit.  Properly designed webapps often use a ServletContextListener to do the 
necessary thread management.

Try taking a thread dump after the shutdown request to see where the remaining 
threads are.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat and coldfusion

2009-01-14 Thread Andrew Hole
Thanks for you quick response.
How can I take a thread dump?

Thanks


On Wed, Jan 14, 2009 at 6:37 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Andrew Hole [mailto:andremailingl...@gmail.com]
  Subject: Tomcat and coldfusion
 
  It looks that tomcat is stopped but the tomcat process still
  alive in the server.

 This is pretty much always a result of a webapp starting its own threads
 and failing to shut them down; the JVM can't terminate until all non-daemon
 threads exit.  Properly designed webapps often use a ServletContextListener
 to do the necessary thread management.

 Try taking a thread dump after the shutdown request to see where the
 remaining threads are.

  - Chuck


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

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: Tomcat and coldfusion

2009-01-14 Thread Caldarale, Charles R
 From: Andrew Hole [mailto:andremailingl...@gmail.com]
 Subject: Re: Tomcat and coldfusion

 How can I take a thread dump?

Tough to tell you since you left out basic information:

1) Tomcat version
2) JRE/JDK version
3) OS type and level

If you're on a recent enough JRE/JDK (1.5 or better), you can use JConsole or 
jstack to poke around inside a running JVM.  For Linux systems, try a kill -9 
(or ctrl-\); for Windows, try ctrl-brk.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat and coldfusion

2009-01-14 Thread Andrew Hole
1) Tomcat version: 5.5.20
2) JDK Version: 1.5.0_11
3) CentOS release 5.2 (Final) - 64 bits


DestroyJavaVM prio=1 tid=0x0a1ea408 nid=0x5f9a waiting on condition
[0x..0xff9a1e40]

TP-Processor4 daemon prio=1 tid=0x0a4f2670 nid=0x5fec in Object.wait()
[0x7ffea000..0x7ffeadb0]
at java.lang.Object.wait(Native Method)
- waiting on 0xe6b71358 (a org.apache.jk.common.ChannelSocket)
at java.lang.Object.wait(Object.java:474)
at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:300)
- locked 0xe6b71358 (a org.apache.jk.common.ChannelSocket)
at
org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:660)
at
org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:870)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

http-8189-Processor24 daemon prio=1 tid=0x0a566358 nid=0x5fe6 waiting on
condition [0x802f..0x802f0eb0]
at java.lang.Thread.sleep(Native Method)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:61)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

Java2D Disposer daemon prio=1 tid=0x81ddb490 nid=0x5fca in Object.wait()
[0x81072000..0x81072db0]
at java.lang.Object.wait(Native Method)
- waiting on 0xeb885f40 (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
- locked 0xeb885f40 (a java.lang.ref.ReferenceQueue$Lock)
:$
at java.lang.Object.wait(Native Method)
- waiting on 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
at java.lang.Object.wait(Object.java:474)
at
coldfusion.util.SimpleThreadPool.getAssignment(SimpleThreadPool.java:113)
- locked 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
at coldfusion.util.SimpleWorkerThread.run(SimpleThreadPool.java:207)

Thread-11 prio=1 tid=0x0acd2a20 nid=0x5fbc in Object.wait()
[0x818a9000..0x818a9eb0]
at java.lang.Object.wait(Native Method)
- waiting on 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
at java.lang.Object.wait(Object.java:474)
at
coldfusion.util.SimpleThreadPool.getAssignment(SimpleThreadPool.java:113)
- locked 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
at coldfusion.util.SimpleWorkerThread.run(SimpleThreadPool.java:207)

Thread-10 prio=1 tid=0x0a439138 nid=0x5fbb in Object.wait()
[0x8192a000..0x8192af30]
at java.lang.Object.wait(Native Method)
- waiting on 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
at java.lang.Object.wait(Object.java:474)
at
coldfusion.util.SimpleThreadPool.getAssignment(SimpleThreadPool.java:113)
- locked 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
at coldfusion.util.SimpleWorkerThread.run(SimpleThreadPool.java:207)

Thread-9 prio=1 tid=0x0a873288 nid=0x5fba in Object.wait()
[0x81afc000..0x81afcdb0]
at java.lang.Object.wait(Native Method)
- waiting on 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
at java.lang.Object.wait(Object.java:474)
at
coldfusion.util.SimpleThreadPool.getAssignment(SimpleThreadPool.java:113)
- locked 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
at coldfusion.util.SimpleWorkerThread.run(SimpleThreadPool.java:207)

Low Memory Detector daemon prio=1 tid=0x0a0e93f0 nid=0x5fab runnable
[0x..0x]

CompilerThread1 daemon prio=1 tid=0x0a0e7f18 nid=0x5faa waiting on
condition [0x..0x887ab358]

CompilerThread0 daemon prio=1 tid=0x0a0e6e68 nid=0x5fa9 waiting on
condition [0x..0x8882c1d8]

AdapterThread daemon prio=1 tid=0x0a0e5ce8 nid=0x5fa8 waiting on condition
[0x..0x]

Signal Dispatcher daemon prio=1 tid=0x0a0e4e48 nid=0x5fa7 waiting on
condition [0x..0x]

Finalizer daemon prio=1 tid=0x0a0da568 nid=0x5fa6 in Object.wait()
[0x88baf000..0x88baff30]
at java.lang.Object.wait(Native Method)
- waiting on 0x8d774000 (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
- locked 0x8d774000 (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

Reference Handler daemon prio=1 tid=0x0a0d9fd0 nid=0x5fa5 in Object.wait()
[0x88c3..0x88c30db0]
at java.lang.Object.wait(Native Method)
- waiting on 0x8d79c5e0 (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:474)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked 0x8d79c5e0 (a java.lang.ref.Reference$Lock)

VM Thread prio=1 tid=0x0a0d7a90 nid=0x5fa4 runnable

GC task thread#0 

RE: Tomcat shutdown script initiates Heap dump collection

2009-01-14 Thread Prakash Nathan1

Hi Chuck

In catalina.sh file, I could see that JAVA_OPTS and CATALINA_OPTS are
being referenced as follows..

exec $_RUNJDB $JAVA_OPTS $CATALINA_OPTS \...

However, the value for JAVA_OPTS is not defined in catalina.sh

As I had already mentioned, ONLY CATALINA_OPTS are defined in setenv.sh
CATALINA_OPTS='-Xms512M -Xmx1536M'

Where can I find the values configured for JAVA_OPTS ?

Please guide. Thanks
Prakash
-- 
View this message in context: 
http://www.nabble.com/Tomcat-shutdown-script-initiates-Heap-dump-collection-tp21421003p21463786.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Can Tomcat be used to host socket servers?

2009-01-14 Thread Jonathan Mast
Well what I want is to have a dedicated port for a socket, I just want all
the application infrastructure to be handled by Tomcat rather than a writing
a custom solution.  Not sure if dynamically rewriting server.xml is the way
to go.

My guess would by a Valve/Connector type thing, but I'm just not that
familiar with Tomcat.  I can't be only one who has had this issue.

The situation is that we have some existing programs (written in C) that are
socket servers.  I want to redo them in Java, and having Tomcat host them
would be great because I could focus solely on the parts of the program than
do request processing and leave the housekeeping to Tomcat.

In other words, I want to write servlets that are faux-sockets.

On Wed, Jan 14, 2009 at 10:33 AM, Martin Gainty mgai...@hotmail.com wrote:


 In other words instead of committing to single port request TC use a port
 range for connector?
 You might be able to accomplish the task by developing an algorithm which
 rewrites server.xml with 'unused port'
 Not sure if this has been accomplished
 ?
 Martin
 __
 Disclaimer and confidentiality note
 Everything in this e-mail and any attachments relates to the official
 business of Sender. This transmission is of a confidential nature and Sender
 does not endorse distribution to any party other than intended recipient.
 Sender does not necessarily endorse content contained within this
 transmission.




  Date: Wed, 14 Jan 2009 09:20:27 -0500
  From: jhmast.develo...@gmail.com
  To: users@tomcat.apache.org
  Subject: Can Tomcat be used to host socket servers?
 
  Is it possible to use Tomcat to host socket servers? Or is Tomcat a
 strictly
  1 port operation?
 
  thanks

 _
 Windows Live™: Keep your life in sync.
 http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009


Re: Tomcat shutdown script initiates Heap dump collection

2009-01-14 Thread André Warnier

Prakash Nathan1 wrote:

Hi Chuck

In catalina.sh file, I could see that JAVA_OPTS and CATALINA_OPTS are
being referenced as follows..

exec $_RUNJDB $JAVA_OPTS $CATALINA_OPTS \...

However, the value for JAVA_OPTS is not defined in catalina.sh

As I had already mentioned, ONLY CATALINA_OPTS are defined in setenv.sh
CATALINA_OPTS='-Xms512M -Xmx1536M'

Where can I find the values configured for JAVA_OPTS ?



The quickie answer is to add a line

echo catalina.sh : JAVA_OPTS = $JAVA_OPTS  /var/log/tomcat_debug_file.log

to the beginning of your catalina.sh, and see what comes out.

The better answer :

To start Tomcat, you must use a command like
/etc/init.d/tomcatxx start
yes ?
If so, then look first at that script, and follow the chain of scripts 
that itself calls.  Depending on the system you are using, there may be 
other files that are read in during startup and which define options 
such as JAVA_OPTS.  Under Linux e.g., look in the /etc/default dir.
The thing is, there are so many different platform flavors and setups 
and ways to start these things, that there is no easy answer. You will 
have to piece the puzzle together yourself.


On my Linux Debian systems, the chain is roughly as follows :
/etc/init.d/tomcat5.5 does some stuff, then reads 
/etc/default/tomcat5.5, then does some more stuff, then calls up 
/usr/share/tomcat5.5/bin/startup.sh, which itself calls 
/usr/share/tomcat5.5/bin/catalina.sh, which itself runs 
/usr/share/tomcat5.5/bin/setenv.sh.

And there are probably bits I'm forgetting..

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat and coldfusion

2009-01-14 Thread Caldarale, Charles R
 From: Andrew Hole [mailto:andremailingl...@gmail.com]
 Subject: Re: Tomcat and coldfusion

Here's your culprits:

 Thread-11 prio=1 tid=0x0acd2a20 nid=0x5fbc in Object.wait()
 [0x818a9000..0x818a9eb0]
 at java.lang.Object.wait(Native Method)
 - waiting on 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
 at java.lang.Object.wait(Object.java:474)
 at
 coldfusion.util.SimpleThreadPool.getAssignment
 (SimpleThreadPool.java:113)
 - locked 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
 at
 coldfusion.util.SimpleWorkerThread.run(SimpleThreadPool.java:207)

 Thread-10 prio=1 tid=0x0a439138 nid=0x5fbb in Object.wait()
 [0x8192a000..0x8192af30]
 at java.lang.Object.wait(Native Method)
 - waiting on 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
 at java.lang.Object.wait(Object.java:474)
 at
 coldfusion.util.SimpleThreadPool.getAssignment
 (SimpleThreadPool.java:113)
 - locked 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
 at
 coldfusion.util.SimpleWorkerThread.run(SimpleThreadPool.java:207)

 Thread-9 prio=1 tid=0x0a873288 nid=0x5fba in Object.wait()
 [0x81afc000..0x81afcdb0]
 at java.lang.Object.wait(Native Method)
 - waiting on 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
 at java.lang.Object.wait(Object.java:474)
 at
 coldfusion.util.SimpleThreadPool.getAssignment
 (SimpleThreadPool.java:113)
 - locked 0xeb86a490 (a coldfusion.util.SimpleThreadPool)
 at
 coldfusion.util.SimpleWorkerThread.run(SimpleThreadPool.java:207)

These threads all originate in coldfusion, so you'll need to fix it in there, 
not Tomcat.

You can do a kill -3 to really get rid of the process, but that's drastic and 
simply masks the problem.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Can Tomcat be used to host socket servers?

2009-01-14 Thread Caldarale, Charles R
 From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
 Subject: Re: Can Tomcat be used to host socket servers?

 Not sure if dynamically rewriting server.xml is the way
 to go.

Pretty much guaranteed not to be, since that would require stopping and 
restarting Tomcat.

 The situation is that we have some existing programs
 (written in C) that are socket servers.

It's not clear to me exactly what you mean by are socket servers.  Do you 
mean they simply do a listen/accept on a server socket, waiting for connection 
requests from some client?  If so, what protocol is being used?  If it's not 
HTTP (or AJP), Tomcat won't help you.

Handling server sockets in Java borders on the trivial; using Tomcat just for 
that would be massive overkill.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6.x security-constraint redirection problem... please help!

2009-01-14 Thread samsina

See inline...


Pid-2 wrote:
 
 Martin Gainty wrote:
 please display non-proprietary attributes of HTTPS (Port 8443 or 443)
 Connector element values from %TOMCAT_HOME%/conf/server.xml
 
 OP: Don't attempt to decipher or respond to the above, it's a red
 herring.  You could instead tell us exactly which 6.x you are using and
 on which OS.
 I am running in Red Hat 3.4.6-2
 
 There's a couple of things that may be confusing the config below, which
 have some simple corrections.
 
 I usually place login.jsp and error.jsp in WEB-INF/login/, where
 they are protected from unwanted attention by default - this avoids the
 need to protect them with a security-contstraint.
 
 You are also protecting index.jsp - which will force a login when the
 apps homepage is accessed, is this what you intended?
 
 Yes
 
 Are you logging out programmatically, using the servlet method
 request.getSession().invalidate(), or are you just clearing cookies?
 
 I invalid the session programmatically... correct.
 
 Your primary problem sounds like you have placed some CSS or script
 files somewhere in a protected directory and the browser is requesting
 them without providing the correct authentication credentials.
 
 Tomcat returns the *first* file you requested inside the secured area
 after authentication is completed.  So for some reason your browser is
 requesting a script or CSS file before the JSP page.
 
 Are the script and CSS files in an unprotected directory?
 
 youa re absolutly correct, basically the senario is like this:
 basically the page is including link rel=stylesheet type=text/css
 href=/app1/resources-folder/style.css /
 So the browser should apply the style to the page, but instead it outputs
 the actual file to the broweser. So it should the style.css from the jsp
 file. 
 
 This scenario happens when i try to add url-pattern in security constraint
 in web.xml (basically adding that module patterns as i described in first
 post.
 Otherwise, it works fine.
 
 
 
 p
 
 
 
 
 Disclaimer and confidentiality note 
 Everything in this e-mail and any attachments relates to the official
 business of Sender. This transmission is of a confidential nature and
 Sender does not endorse distribution to any party other than intended
 recipient. Sender does not necessarily endorse content contained within
 this transmission. 
 
 
 
 
 Date: Tue, 13 Jan 2009 17:03:08 -0800
 From: sams...@gmail.com
 To: users@tomcat.apache.org
 Subject: Tomcat 6.x security-constraint redirection problem... please
 help!


 I have defined two roles (admin, user)

 security-role
 role-nameuser/role-name
 /security-role
  security-role
 role-nameadministrator/role-name
 /security-role

 each of these roles needs to access into separate modules in my webapp.
 For
 achieving this, I have the following security-constraint in tomcat
 web.xml:

   security-constraint
 web-resource-collection
 web-resource-nameAuthorized Access
 Area/web-resource-name
 url-pattern/index.jsp/url-pattern
 url-pattern/login.jsp/url-pattern
 url-pattern/error.jsp/url-pattern
 url-pattern/app1/*/url-pattern
 url-pattern*.jsp/url-pattern
 /web-resource-collection
 auth-constraint
 role-nameuser/role-name
 /auth-constraint
 /security-constraint

 security-constraint
 web-resource-collection
 web-resource-nameAuthorized Access
 Area/web-resource-name
 url-pattern/index.jsp/url-pattern
 url-pattern/login.jsp/url-pattern
 url-pattern/error.jsp/url-pattern
 url-pattern/app2/*/url-pattern
 /web-resource-collection
 auth-constraint
 role-nameadministrator/role-name
 /auth-constraint
 /security-constraint

 consider the following steps:

 1. Access context/app1/app1action.jsp URL 
 2. I get prompted for credentials
 3. I login as normal user, and on successful login I get redirected to
 app1action.jsp page (desired behavior)
 4. Now, I clear my cache  sessions authentication from browser
 (firefox)
 4. Browse into some link in app1action.jsp page pointing to some other
 page
 eg. context/app1/anotherpage.jsp
 5. Now I get prompted to relogin
 6. On successful login, I expect myself to get redirected to
 'anotherpage.jsp'. But instead it redirects me to the resources ( JS /
 img /
 css ) that are included with in 'anotherpage.jsp' . eg.
 context/resources/sample.js or sample.css or sample.gif 

 I spent googling on this issue for couple of  days with no luck. 

 Can you please advise how to get properly redirected ?

 ~ Many Thanks


 -- 
 View this message in context:
 http://www.nabble.com/Tomcat-6.x-security-constraint-redirection-problem...-please-help%21-tp21448079p21448079.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To 

RE: Beginner - Netbeans IDE

2009-01-14 Thread Toriacht

Thanks again guys...

i have removed the .exe version and downloaded the .zip version. I had a
look in the bin folder. There seems to be multiple references to
CATALINA_HOMA and JAVA_HOME etc. in what files/and where do I need set these
variables.

Thank
Tori



Caldarale, Charles R wrote:
 
 From: Toriacht [mailto:shatner.will...@gmail.com]
 Subject: RE: Beginner - Netbeans IDE

 The .exe does not come with a catalina.bat
 
 Correct; there are no scripts in the .exe download (and I don't know why).
 
 I suppose I was wondering was there a standard catalina.bat
 example that somebody had that I could point the IDE towards
 
 Yes - the one in the .zip download.  Just use that.
 
 I am probably better off uninstalling it and
 dowloading teh .zip version?
 
 Yes; the .zip gives you more options and more control over Tomcat, which
 is what you need when running it under an IDE.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Beginner---Netbeans-IDE-tp21456213p21465783.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat returns HTTP status of 200 when HttpServletResponse.sendError() called.

2009-01-14 Thread Caldarale, Charles R
 From: Nathan Potter [mailto:n...@opendap.org]
 Subject: Re: Tomcat returns HTTP status of 200 when
 HttpServletResponse.sendError() called.

 I mapped one of my servlets to be the default servlet:
  servlet-mapping
  servlet-namehyrax/servlet-name
  url-pattern*/url-pattern
  /servlet-mapping

 And since it doesn't serve static content like the Tomcat
 DefaultServlet, I'm not seeing the expected behavior for
 the error-page mappings.

If you don't want to rewrite your mappings (and probably program logic), then 
isolate your static content - including error pages - to some particular branch 
of your directory tree and put in a mapping for the existing DefaultServlet to 
handle it.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Beginner - Netbeans IDE

2009-01-14 Thread Caldarale, Charles R
 From: Toriacht [mailto:shatner.will...@gmail.com]
 Subject: RE: Beginner - Netbeans IDE

 in what files/and where do I need set these variables.

You do not need to set CATALINA_HOME - that is done automatically by the 
startup.bat script.

I normally set JAVA_HOME as a global environment variable, just so I don't have 
to remember to keep doing it.  Set it to the location of your JDK.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Can Tomcat be used to host socket servers?

2009-01-14 Thread Jonathan Mast
Thanks for cogent reply, Chuck :)

By socket servers, I mean the existing programs are bound to a particular
port number and just sit there waiting for requests.  The port numbers are
arbitrary, and I'm not knowledgeable enough of networking to know whether
they use HTTP or not.

I'll probably just write stand alone Java sockets servers and simply bounce
incoming requests over to a servlet I'll develop to do the heavy liffting.

The reason I would have liked Tomcat to handle the whole shebang is that now
I'll have to adjust each system that hosts these sockets to automatically
invoke them when they restart.  Kinda tedious.

Thanks again

On Wed, Jan 14, 2009 at 4:35 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
  Subject: Re: Can Tomcat be used to host socket servers?
 
  Not sure if dynamically rewriting server.xml is the way
  to go.

 Pretty much guaranteed not to be, since that would require stopping and
 restarting Tomcat.

  The situation is that we have some existing programs
  (written in C) that are socket servers.

 It's not clear to me exactly what you mean by are socket servers.  Do you
 mean they simply do a listen/accept on a server socket, waiting for
 connection requests from some client?  If so, what protocol is being used?
  If it's not HTTP (or AJP), Tomcat won't help you.

 Handling server sockets in Java borders on the trivial; using Tomcat just
 for that would be massive overkill.

  - Chuck


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

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: Can Tomcat be used to host socket servers?

2009-01-14 Thread Caldarale, Charles R
 From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
 Subject: Re: Can Tomcat be used to host socket servers?

 By socket servers, I mean the existing programs are bound
 to a particular port number and just sit there waiting for
 requests.  The port numbers are arbitrary

How do they get assigned?  When you say the program is listening for a request, 
does it have a socket_read or socket_accept up?  (The first is looking for 
data, the second for a connection request.)

 I'm not knowledgeable enough of networking to know whether
 they use HTTP or not.

That's a rather critical factor to determine whether or not you can simply pass 
on the request to a servlet.

 The reason I would have liked Tomcat to handle the whole
 shebang is that now I'll have to adjust each system that
 hosts these sockets to automatically invoke them when they
 restart.  Kinda tedious.

You won't be able to use a stock Tomcat to listen/read on those ports, but you 
could still package your socket servers inside a webapp.  A 
ServletContextListener inside the webapp would likely have to create a thread 
for each port of interest, and those threads could connect with the standar 
Tomcat port to pass on HTTP-formatted requests.  Your clients would have to 
expect HTTP as a response, or your server threads would have to convert the 
response to whatever protocol the clients do expect.

You could also write your own Tomcat connector to do the above, rather than a 
webapp, but you would then be pretty much tied to a specific level of Tomcat.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Beginner - Netbeans IDE

2009-01-14 Thread Toriacht

Hi Chuck,

thanks again for all your helpyour help. I'm nearly there...just a few more
queries...My user variables setting was taking precendence over system (was
set to a 1.6 JRE) so thats why it wasn't starting.

to get started.. i ran the service.bat to install as a service (is this
permanent?)
I then ran the service manager and service runner in the bin folder and
tomcat appears in the list of processes in task manager.
all seems good so far. Is this all I need to do?
Is this how I should always start?

Finally...when i run Netbeans and try to add Tomcat as a server it is never
visible? just Glassfish and WeRuby. If I select 'add server' it assumes I
want to add a Glassfish server and wont let me select Tomcat. Netbeans
doesn't know its there...

Thanks again,
Toriacht



Caldarale, Charles R wrote:
 
 From: Toriacht [mailto:shatner.will...@gmail.com]
 Subject: RE: Beginner - Netbeans IDE

 in what files/and where do I need set these variables.
 
 You do not need to set CATALINA_HOME - that is done automatically by the
 startup.bat script.
 
 I normally set JAVA_HOME as a global environment variable, just so I don't
 have to remember to keep doing it.  Set it to the location of your JDK.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Beginner---Netbeans-IDE-tp21456213p21466853.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Beginner - Netbeans IDE

2009-01-14 Thread Caldarale, Charles R
 From: Toriacht [mailto:shatner.will...@gmail.com]
 Subject: RE: Beginner - Netbeans IDE

 i ran the service.bat to install as a service (is this
 permanent?)

Yes.

 Is this how I should always start?

Not really.  You most likely want to have the IDE start and stop Tomcat with 
the scripts; you don't really want it running as a service while you're 
debugging.

 Netbeans doesn't know its there...

You'll have to get NetBeans help for that one.  Search the Tomcat mailing list:
http://marc.info/?l=tomcat-user

As a last resort, you can always Google...

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] Configuring a Realm

2009-01-14 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

Caldarale, Charles R wrote:
 Are you using the same database for both application usage and
 authentication?  That's odd, but doable.

Why are you apprehensive about using the same database (Datasource?) for
both authentication /and/ application use?

- -chris

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

iEYEARECAAYFAklue3gACgkQ9CaO5/Lv0PCsmgCaAnzLK2Z5+JXw+TLPAXBa1Mm2
kKUAn3qamEvEhucSX6wwx0ZwuzF3j0lB
=MtDF
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: [OT] Configuring a Realm

2009-01-14 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: [OT] Configuring a Realm

 Why are you apprehensive about using the same database
 (Datasource?) for both authentication /and/ application use?

Because I like to keep distinct things separate.  Coming from a large server, 
certified B1 security environment, we would never permit credentials to be 
stored in the same container as application data; the privacy and 
recoverability requirements are quite different.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: replacement for useBean directive

2009-01-14 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jonathan,

Jonathan Mast wrote:
 class BeanBag {
 private static AppleBean appleBean = null;
 private static BananaBean bananaBean = null;
 
 public static AppleBean getAppleBean() {

Might I recommend that you use a regular class instead of one with
static members and methods? I think you'll find it more flexible (for
instance, you will be able to extend the class and replace the object in
memory with the extended class, or you could wrap one object in another,
etc., neither of which are possible with static methods).

You could just create a new instance of this class (BeanBag) at app
startup and toss it into the application scope.

 In the Servlet code, I just obtain a bean like this:
 AppleBean appleBean = BeanBag.getAppleBean();

It would be a bit more complicated, but your new code would be:

BeanBag bb = (BeanBag)application.getAttribute(my.package.beanBag);
AppleBean appleBean = bb.getAppleBean();

If you're feeling sassy, you could implement a getAppleBean() method in
a superclass from which all of your servlets extend, and clean up your
code a little bit more. Tres' objectique!

 My question is: where (or if) should I implement the synchronization?

Synchronize the methods of your BeanBag class (whether static or not).

 But wouldn't making the methods in BeanBag synchronized be a better
 approach?

In the example, the bean in question was an application-scoped bean,
which requires synchronization in the generated Java code itself
(because there is a null check for the reference and the possibility of
creating a new object and inserting it into the application scope). Your
solution will have a single object in the application scope (or will be
a static singleton) and therefore the synchronization can be handled
locally (in the class).

Hope that helps,
- -chris

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

iEYEARECAAYFAklufdIACgkQ9CaO5/Lv0PDV1ACfQMCD60vazQTz5xhJeRd8mCbh
rdIAnigXjKQ+z7XDFWC6jLdBUI79wzPh
=Vipb
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat returns HTTP status of 200 when HttpServletResponse.sendError() called.

2009-01-14 Thread Nathan Potter


On Jan 14, 2009, at 1:38 PM, Caldarale, Charles R wrote:


From: Nathan Potter [mailto:n...@opendap.org]
Subject: Re: Tomcat returns HTTP status of 200 when
HttpServletResponse.sendError() called.

I mapped one of my servlets to be the default servlet:
servlet-mapping
servlet-namehyrax/servlet-name
url-pattern*/url-pattern
/servlet-mapping

And since it doesn't serve static content like the Tomcat
DefaultServlet, I'm not seeing the expected behavior for
the error-page mappings.


If you don't want to rewrite your mappings (and probably program  
logic), then isolate your static content - including error pages -  
to some particular branch of your directory tree and put in a  
mapping for the existing DefaultServlet to handle it.



So do you mean something like this?

servlet
servlet-namedefault/servlet-name
servlet-class
  org.apache.catalina.servlets.DefaultServlet
/servlet-class
load-on-startup1/load-on-startup
/servlet

...

servlet-mapping
servlet-namedefault/servlet-name
url-pattern/err/*/url-pattern
/servlet-mapping

And I place all of my default error pages in $CATALINA_HOME/webapps/ 
myContext/err/







- Chuck


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


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



= = =
Nathan Potterndp at opendap.org
OPeNDAP, Inc.541.752.1852



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: How to have multiple loggers with shared code also using the logger?

2009-01-14 Thread removeps-groups
 Because of the classloading hierarchy.  Once the logger is
 initialized with the common classloader, everybody uses that
 one.

Thanks.  I studied the Apache logger code.

When we call org.apache.log4j.Logger.getLogger(), it calls functions of 
LogManager.  The static initializer block of LogManager gets log4j.properties 
using the thread's class loader, so if the first webapp I run is mywebservice, 
then it will get log4j.properties from mywebservice, such as 
mywebservice/WEB-INF/classes/log4j.properties.  The root logger will be 
initialized using this log4j.properties file, and all new loggers will inherit 
this configuration, which does not seem very useful.

And since the log4j.jar resides in the ${catalina.home}/lib folder, this root 
logger is used by all web apps.

So what I did is

(1) Create a log4j.properties in ${catalina.home}/lib/log4j.properties or in a 
jar file here.

(2) This properties file should contain the configuration shared by all app 
loggers.  For me, the file is one line:
log4j.rootLogger=warn

(3) Rename log4j.properties in each webapp and swingapp and JUnit test app to 
log4j_app.properties.

(4) Modify MyLog.getLogger(), which is a function in a jar file that is shared 
by all apps (ie. a function in ${catalina.home}/lib) so that when a logger is 
created, initialize the logger from the appropriate log4j_app.properties.

import org.apache.log4j.PropertyConfigurator;

   /**
* This function attempts to locate log4j_app.properties using the
* thread's classloader, and returns a logger using the location of
* log4j_app.properties as the logger name.
* The logger will be initialized with the configuration in 
log4j_app.properties.
* This allows each application within the web server will use its own 
logger.
* This function is thread-safe, and callers don't need to synchronized on 
MyLog.
* @return
* @throws NullPointerException if log4j_app.properties does not exist
*/
   public static Logger getLogger()
   {
  ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
  URL log4j_properties = classLoader.getResource(log4j_app.properties);
  String loggerName = log4j_properties.toString();
  synchronized (MyLog.class)
  {
 Logger logger = 
Logger.getRootLogger().getLoggerRepository().exists(loggerName);
 if (logger == null)
 {
logger = Logger.getLogger(loggerName);
PropertyConfigurator.configure(log4j_properties);
System.out.println(Created logger: loggerName= + loggerName);
 }
 return logger;
  }
   }

 
 Don't do that.  Keep just one copy of the source
 somewhere, just have your packaging script put the .class
 file in the webapp package.  No need to have an abstract
 class or subclasses.

Not sure if that would work as the log4j.jar is in ${catalina.home}/lib, so the 
root logger is shared by all apps.
 

  (1) Pass a logger from the webapp to the common code
 -- ie.
  to add a Logger argument to all the functions in the
 common
  code, but this sounds tedious.
 
 That's the cost of keeping things isolated, which is a
 worthwhile goal.
 
  (2) In each webapp have a filter that sets a thread
 local
  variable like ThreadLocalLogger threadLogger.
 
 Just make sure you clear the ThreadLocal on *every*
 possible exit path out of your request processing.  If you
 don't, you will have memory leaks in PermGen causing it
 to fill up as webapps are redeployed.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat returns HTTP status of 200 when HttpServletResponse.sendError() called.

2009-01-14 Thread Caldarale, Charles R
 From: Nathan Potter [mailto:n...@opendap.org]
 Subject: Re: Tomcat returns HTTP status of 200 when
 HttpServletResponse.sendError() called.

 So do you mean something like this?
  servlet
  servlet-namedefault/servlet-name
  servlet-class
org.apache.catalina.servlets.DefaultServlet
  /servlet-class
  load-on-startup1/load-on-startup
  /servlet
  servlet-mapping
  servlet-namedefault/servlet-name
  url-pattern/err/*/url-pattern
  /servlet-mapping

Yes, but I think you're going to have to change the servlet-name value to 
something else so it doesn't conflict with the one in conf/web.xml that's 
shared by all webapps.  (It's been a while since I had to do this, but I seem 
to recall that was necessary to avoid ugly messages at startup.)

 And I place all of my default error pages in
 $CATALINA_HOME/webapps/myContext/err/

Yes.  You could also use the same technique to have the DefaultServlet handle 
other static content if you want.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: How to have multiple loggers with shared code also using the logger?

2009-01-14 Thread Caldarale, Charles R
 From: removeps-gro...@yahoo.com [mailto:removeps-gro...@yahoo.com]
 Subject: RE: How to have multiple loggers with shared code
 also using the logger?

 And since the log4j.jar resides in the ${catalina.home}/lib
 folder, this root logger is used by all web apps.

The log4j.jar is only there because you put it there.  It does not come with 
the Tomcat distribution, and it's normally placed in the WEB-INF/lib directory 
of each webapp that needs it.

By having such a jar in a common location, you've pretty much guaranteed that 
you'll have to take Tomcat down to redeploy a single webapp - the old webapp 
won't go away because log4j will be hanging onto references to it.  (A common 
cause of PermGen filling up after redeployments.)

The servlet spec (and experience) strongly suggest that webapps be kept as 
isolated as possible for this kind of reason.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org