Re: Problems with graphics on Tomcat 5.5.9

2005-10-07 Thread Brian Cook


You need to install the X11 libs for X.  The Java Advanced Imaging API 
calls the X libs on Linux to get font and scaling data.  You can try 
setting the JVM java.awt.headless property to true.  This will work for 
some instances.  But installing the X libs installed on your server is a 
more reliable option.


To set your java.awt.headless as true use the following line.
System.setProperty(java.awt.headless, true);



System.setProperty(java.awt.headless, true);

Mauricio Fernandez A. wrote:


Hello

I have a web App with some jsp´s showing graphics generated by jfreechart,
in my windows dev station it works fine but in my linux production server it
was working fine to some days ago and now it doesn´t.

I have Tomcat 5.5.9, JDK 1.5.0_04, Red Hat Linux on a rack

Now i obtain a ServletException generated by this reason (sorry to send the
trace but I want to be specific):

java.lang.NoClassDefFoundError

sun.java2d.SunGraphicsEnvironment.addDirFonts(SunGraphicsEnvironment.java:7
22)

sun.java2d.SunGraphicsEnvironment.registerFontsInDir(SunGraphicsEnvironment
.java:602)

sun.java2d.SunGraphicsEnvironment.access$200(SunGraphicsEnvironment.java:58
)
sun.java2d.SunGraphicsEnvironment$1.run(SunGraphicsEnvironment.java:174)
java.security.AccessController.doPrivileged(Native Method)
sun.java2d.SunGraphicsEnvironment.init(SunGraphicsEnvironment.java:94)
sun.awt.X11GraphicsEnvironment.init(X11GraphicsEnvironment.java:164)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcce
ssorImpl.java:39)

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstru
ctorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
java.lang.Class.newInstance0(Class.java:350)
java.lang.Class.newInstance(Class.java:303)

java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironmen
t.java:68)
java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1141)
org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1243)
org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1223)
org.jfree.chart.ChartUtilities.writeChartAsPNG(ChartUtilities.java:173)
org.jfree.chart.ChartUtilities.saveChartAsPNG(ChartUtilities.java:328)
org.jfree.chart.ChartUtilities.saveChartAsPNG(ChartUtilities.java:299)

com.Prueba.comandos.Graficador2.crearBarChart3DVertical(Graficador2.java:21
1)

org.apache.jsp.jsp.grafica_jsp._jspService(org.apache.jsp.jsp.grafica_jsp:1
67)

Thanks

MauricioF


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


 




--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900 



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

Re: Tracking Datasource Connection Usage?

2005-10-07 Thread Brian Cook

JWM wrote:

Two things you can do here.

   1. Set both removeAbandoned and logAbandoned  parameters to 
true.  This will reclaim most lost connections.  And log a trace of what 
code called a connection that was never closed.


2.  Use a finally block to close all of your Resultsets and 
connections.  This will insure they are closed even if your code throws 
an exception.


Example :

   ResultSet rs = null;
   Connection con  = null;
try {
   
   
   
   
}
catch(Exception e) {
   
}
finally {
   rs.close();
   con.close();
}


I started getting exceptions saying no connections were available on my JDBC
datasource  (org.gjt.mm.mysql.Driver).  The pool was definitely large enough
to handle the load.  So it appears that I'm not freeing the all the
connections as I should.  I noticed that I did not have the
'removeAbandoned' flag set on the Resource tag.  Changing that has
apparently fixed the out of connections problem.  But I really want to clean
up the code and fix it the right way.  I've got the close() statements in
place.  But obviously, I'm missing some of them somewhere.  Is there any
process for logging/tracking allocating and freeing connections (and absence
thereof.), available connections, etc?  Or are there any methods I can call
to give me this type of debug info?  What's the recommended way to debug
this?

Thanks.

JWM



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


 




--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900 



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

Tomcat5.5 stops responding after sevral days

2005-09-16 Thread Brian Cook
 processes all requests for this virtual host.  By
default, log files are created in the logs directory 
relative to

$CATALINA_HOME.  If you wish, you can specify a different
directory with the directory attribute.  Specify either a 
relative

(to $CATALINA_HOME) or absolute path to the desired directory.
This access log implementation is optimized for maximum 
performance,
but is hardcoded to support only the common and 
combined patterns.


This valve use NIO direct Byte Buffer to asynchornously 
store the

log.
   --
   !--
   Valve 
className=org.apache.catalina.valves.ByteBufferAccessLogValve
directory=logs  prefix=localhost_access_log. 
suffix=.txt

pattern=common resolveHosts=false/
   --

 /Host

   /Engine

 /Service

/Server

/server.xml


--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]



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

Broken links on the Tomcat 5.5 Docs pages

2005-09-16 Thread Brian Cook


The following links relating to realm logging on page 
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/realm-howto.html are broken



http://jakarta.apache.org/tomcat/tomcat-5.5-doc/context.html
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/host.html
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/engine.html


--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900 



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

Re: Waste of our bandwidth

2005-09-02 Thread Brian Cook


I do not know if it is an admin but the contact for the Tomcat list is :

[EMAIL PROTECTED]


[EMAIL PROTECTED] wrote:
Don't we have a list administrator that can remove this guy? 


Received: from mail.apache.org ([209.237.227.199])
  by rwcrmxc23.comcast.net (rwcrmxc23) with SMTP
  id 20050902131952r2300r7evje; Fri, 2 Sep 2005 13:19:52 +
X-Originating-IP: [209.237.227.199]
Received: (qmail 28987 invoked by uid 500); 2 Sep 2005 13:19:31 -
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: mailto:[EMAIL PROTECTED]
List-Help: mailto:[EMAIL PROTECTED]
List-Post: mailto:tomcat-user@jakarta.apache.org
List-Id: Tomcat Users List tomcat-user.jakarta.apache.org
Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org
Delivered-To: mailing list tomcat-user@jakarta.apache.org
Received: (qmail 28949 invoked by uid 99); 2 Sep 2005 13:19:31 -
Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49)
by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Sep 2005 06:19:31 -0700
X-ASF-Spam-Status: No, hits=1.1 required=10.0
tests=BIZ_TLD,NO_REAL_NAME,SUBJ_ALL_CAPS
X-Spam-Check-By: apache.org
Received-SPF: pass (asf.osuosl.org: local policy)
Received: from [216.71.84.209] (HELO westhost36.westhost.net) (216.71.84.209)
by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Sep 2005 06:19:45 -0700
Received: (from [EMAIL PROTECTED])
by westhost36.westhost.net (8.11.6/8.11.6) id j82DJTs19968;
Fri, 2 Sep 2005 08:19:29 -0500
Date: Fri, 2 Sep 2005 08:19:29 -0500
Message-Id: [EMAIL PROTECTED]
To: tomcat-user@jakarta.apache.org
References: [EMAIL PROTECTED] [EMAIL PROTECTED]
In-Reply-To: [EMAIL PROTECTED]
X-Loop: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Subject: MAIL FAILURE
X-Virus-Checked: Checked by ClamAV on apache.org

*
   THIS EMAIL IS AUTOGENERATED - DO NOT REPLY TO
*

The email you sent was not delivered to the desired recipient because
it was blocked/filtered for a specific reason, which may include:

  - reply to [EMAIL PROTECTED]
  - mail undeliverable because mailbox is not existant (or removed)
  - unsolicited email

If you  wish to contact Aaron Ardiri ([EMAIL PROTECTED]),  you may use 
the following service to send an instant message direct to his mobile
where you can put  a request for contact and an  attempt will be made 
to return your contact.


  http://www.contactme.biz/

Thankyou.

*
   THIS EMAIL IS AUTOGENERATED - DO NOT REPLY TO
*

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



--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: how to Upload file

2005-09-01 Thread Brian Cook


They are saying that to do file upload you probably want to use a 
prebuilt frame work/ package.  You can do it all your self manually but 
you would be using up a lot of time to build a basic task.  The 3 most 
popular and easiest to use are :



1. Using Struts.  If you are not already using struts then this would 
probably be way more than you are looking for.

http://struts.apache.org/


2.  The Jakarta Commons file upload project.  This provides all the 
basic capabilities and lets you support file basic file upload options 
in under 20 or so lines.  This is what I use and like.

http://jakarta.apache.org/commons/fileupload/


3.  com.oreilly.servlet.  This will work and is popular but has 
licensing restrictions.

http://www.servlets.com/cos/


Bhargav Patel wrote:

what ?
- Original Message - 
From: Guy Katz [EMAIL PROTECTED]

To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Wednesday, August 31, 2005 6:17 PM
Subject: RE: how to Upload file




1. commons-upload (jakarta-commons)
2. cos (servlets.com)


-Original Message-
From: Phillip Qin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 31, 2005 3:29 PM
To: Tomcat Users List
Subject: RE: how to Upload file


Have you tried struts html:file tag.

-Original Message-
From: Bhargav Patel [mailto:[EMAIL PROTECTED] 
Sent: August 31, 2005 1:48 AM

To: Tomcat Users List
Subject: how to Upload file

how to write upload file program using jsp ?

by default program copy file to some temporary folder on server.

how to get the path of that temporary folder ?

***Confidentiality Notice***

The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain confidential or privileged information. If you are not
the intended recipient, please notify the sender at Divinet or
[EMAIL PROTECTED]  immediately and destroy all copies of this
message and any attachments.

 




!DSPAM:431543aa140581254821471!

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


***Confidentiality Notice***

The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain confidential or privileged information. If you are not
the intended recipient, please notify the sender at Divinet or
[EMAIL PROTECTED]  immediately and destroy all copies of this
message and any attachments.

 





***Confidentiality Notice***

 The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain confidential or privileged information. If you are not
the intended recipient, please notify the sender at Divinet or
[EMAIL PROTECTED]  immediately and destroy all copies of this
message and any attachments.

 



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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: data push

2005-09-01 Thread Brian Cook



Sounds like you are wanting to use the J2EE web services.  Probably SOAP.


Lionel Farbos wrote:

You can see JMS and joram (http://joram.objectweb.org/)
Note : Joram is embedded in Jonas (http://jonas.objectweb.org/) and Tomcat 
too...

On Thu, 11 Aug 2005 11:41:34 +0100
Darryl L. Miles [EMAIL PROTECTED] wrote:



Paul Wallace wrote:



Thanks Len,
And what of other protocols? Are sockets then required? What are
some other protocols that might be used to push/pull data? (off Tomcat I
know ;))

Paul.





I'm interested in the answer to this too.  What terms do I stick into 
google to find generic socket based communication systems between 
isolated JVMs ?   Protocols, Frameworks, something that will slot in 
with TC but not as raw as HTTP I want the API to be a POJO as possible 
but with a open / setup / work / close cycle.


Idealy I'm really after a multiplexing (read as single socket) messaging 
framework that can deliver command / event like objects to a remote JVM 
for processing then return the appropiate reponse object and have 
multiple events outstanding all in different states with any sized payload.


--
Darryl L. Miles



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





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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: JNDI resource error

2005-08-31 Thread Brian Cook


That error means that Tomcat could not find the JNDI resource requested 
in either the web.xml, and or context.xml files.  What do they look like?




BATCHELOR, SCOTT (CONTRACTOR) wrote:

Can anyone give me some insite on this???

I am getting this error:

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 
'' for connect URL 'null'
at 
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
at 
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at org.ncaa.TES.Servlets.TESControllerServlet.init(TESControllerServlet.java:46)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.velocity.servlet.VelocityServlet.init(VelocityServlet.java:193)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source) 


Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(Unknown Source)
at 
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)

And here is my server.xml:
?xml version='1.0' encoding='utf-8'?
Server
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/
  Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/
  GlobalNamingResources
Environment name=simpleValue type=java.lang.Integer value=30/
Resource auth=Container description=User database that can be updated and saved 
name=UserDatabase type=org.apache.catalina.UserDatabase/
Resource auth=Container name=jdbc/iss_dev type=javax.sql.DataSource/
ResourceParams name=UserDatabase
  parameter
namefactory/name
valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
  /parameter
  parameter
namepathname/name
valueconf/tomcat-users.xml/value
  /parameter
/ResourceParams
ResourceParams name=jdbc/iss_dev
  parameter
namedriverClassName/name
valueoracle.jdbc.driver.OracleDriver/value
  /parameter
  parameter
nameurl/name
valuejdbc:oracle:thin:@hostname:1521:database/value
  /parameter
  parameter
nameusername/name
valueuname/value
  /parameter
  parameter
namepassword/name
valuepword/value
  /parameter
  parameter
namevalidationQuery/name
valueselect sysdate from dual/value
  /parameter
  parameter
namemaxIdle/name
value2/value
  /parameter
  parameter
namemaxActive/name
value20/value
  /parameter
  parameter
namemaxWait/name
value5000/value
  /parameter
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
/ResourceParams

  /GlobalNamingResources
  Service name=Catalina
Connector acceptCount=100 connectionTimeout=2 disableUploadTimeout=true port=8080 
redirectPort=8443 maxSpareThreads=75 maxThreads=150 minSpareThreads=25
/Connector
Connector port=8009 protocol=AJP/1.3 

Re: Database Pooling Follow-up

2005-08-31 Thread Brian Cook



I have a method call I think probably does what you want



   public static Connection getPooledConection(String JNDIName) {

Connection con = null;

DataSource ds = null;

   try {

Context initCtx = new InitialContext();

Context envCtx = (Context) initCtx.lookup(java:comp/env);

ds = (DataSource) envCtx.lookup(jdbc/+JNDIName);

con = ds.getConnection();
  }
  catch(Exception e){
System.out.println(new java.util.Date()+ Blah Blah Blah\n+
Conection was forced closed!\n+
JNDIName : +JNDIName+\n+e+\n+e.getMessage()+\n\n+
e.printStackTrace()  );

try {  con.close();   } catch(Exception d) {  }
  } // Close exception catch
return con;
}   // Close method


Scott Purcell wrote:

Hello,


I want to say thanks for the links yesterday in regards to my pooling problem. 
After reading the docs, I have a better handle on how this will work.
I am ready to test, and I was able to get the following to work within a JSP 
page.

But I would really like to create a Singleton class that could hand out connections based upon 
something like: singleton.getHandle(jndiname); So in my business object I can hand in a 
name and let the busines object get the connection, etc.

Does that make sense. Only problem is, I cannot figure out how to transfer the 
JSP snippet below, to physical java code.

Anyone know?

Thanks,
Scott



### JSP that works correctly ... would like to do this in a class ###



%@ 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/TestDB
select id, foo, bar from testdata
/sql:query

html
  head
titleDB Test/title
  /head
  body

  h2Results/h2
  
c:forEach var=row items=${rs.rows}

Foo ${row.foo}br/
Bar ${row.bar}br/
/c:forEach

  /body
/html


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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: No Host matches server name localhost error

2005-08-30 Thread Brian Cook



The error your getting is more likely saying that you computer can not 
resolve localhost as domain name.  If so it would have nothing to do 
with your server config.  Try using the loop back IP(127.0.0.1).  If 
this is happening on a windows box you may want to run a check for 
viruses or spyware.  If it is Linux make sure you have a listing for 
localhost in your /etc/hosts file.



Brian Moseley wrote:


i'm using tomcat 5.5.9 with a single webapp deployed with a context path 
of  and a default host named localhost. when i request the webapp's 
root resource (http://localhost:8080/), i get a 400 error with the 
message No Host matches server name localhost.


as you can see from my very minimal server.xml, i do in fact have a Host 
named localhost and have specified it as the default host for the 
engine. so, i must admit to being confused as to why i'm receiving that 
particular error message. :) i have turned on debug logging to verify 
that the context is being loaded, but i have yet to step through a 
request with a debugger. any ideas?


server.xml:

Server port=8005 shutdown=SHUTDOWN
  Service name=Catalina
Connector port=8080 enableLookups=false/
Engine name=Catalina defaultHost=localhost
  Host name=localhost appBase=webapps autoDeploy=false/
/Engine
  /Service
/Server

context.xml (in conf/Catalina/localhost/):

Context path= docBase=cosmo reloadable=true
  Environment name=cosmo/version value=0.2-4
   type=java.lang.String override=false/
  Environment name=cosmo/serverAdmin value=[EMAIL PROTECTED]
   type=java.lang.String override=false/
  Environment name=cosmo/repository/username
   value=cosmo_repository
   type=java.lang.String override=false/
  Environment name=cosmo/repository/password
   value=
   type=java.lang.String override=false/
  Resource name=jcr/cosmo
type=javax.jcr.Repository

factory=org.apache.jackrabbit.core.jndi.BindableRepositoryFactory
configFilePath=etc/repository.xml
repHomeDir=data/repository/
  Resource name=jdbc/cosmo
type=javax.sql.DataSource
maxActive=5
maxIdle=3
maxWait=1
username=sa
parameter=
driverClassName=org.hsqldb.jdbcDriver
url=jdbc:hsqldb:file:data/db/userdb/
  Resource name=mail/cosmo
type=javax.mail.Session
mail.transport.protocol=smtp/
mail.smtp.host=localhost/
mail.smtps.host=localhost/
mail.smtp.starttls.enable=false/
  Valve className=org.apache.catalina.valves.AccessLogValve
 directory=../logs prefix=access. suffix=.log
 pattern=combined resolveHosts=false/
/Context

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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: Does Tomcat run better on Linux or Windows?

2005-08-30 Thread Brian Cook


Wow this seem likely to start flame war.  Since it is written in Java 
there is really not much of a difference.  The only thing that comes to 
mind is that you have to reboot windows every time you need to make a 
change to the CLASSPATH, JAVA_HOME, or TOMCAT_HOME variables which can 
be a pain.


I will also throw in that it is my personal option(NOTE: For any 
extremists on the list I said my option.  Not an absolute fact.  Just 
one guys experience) that you spend a lot less time maintaining Linux.


This is mainly because Linux is so modular that you can uninstall 
everything but the parts you want.  So the only things I have to keep up 
with and patch are the Kernel, MySQL, Apache, and Tomcat.  No GUI, no 
extra services, etc.


Chad Lester wrote:

Is Tomcat more stable on Linux or Windows 2003? What are the pros/cons
of using it on each platform? 

 


Thank you in advance for your help and advice,

Chad

 


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

Re: JAVA_HOME beginner

2005-08-27 Thread Brian Cook


Did you download the windows installer for Tomcat5.x?  Or just Tomcat in 
a zip file.  If you did not get the installer you need to manually set 
JAVA_HOME.  Or go back and download the acuall windows installer, which 
of the two will be much eaier.


I am not sure about XP.  In Win2k you
   1.  Right click on My Computer
   2.  Select Properties
   3.  Click on the Advanced tab.
   4.  Click the button labeled Environmental Variables
   5.  Look to see if JAVA_HOME under the System Variables.  If not 
add it.  The syntax for the path has to be dead on perfect.  If is wrong 
at all it will not work.


Also be aware that with windows when you make a change to the 
Environmental varaibles you have to reboot before Windows will see the 
change.


One other thing to check is make sure you downloaded the JDK version 
1.4.2 or newer.  If you downloaded the JRE Tomcat will not be able to run.




ganesan malairaja wrote:

i am using win XP. tomcat 5.0.xx and jdk1.4_02

i tried running several jsp pages ..it resturns this errors

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK


how do i over come this ..pls help


thx



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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: configure tomcat

2005-08-27 Thread Brian Cook


Tomcat 5.x requires JDK 1.4.2 or newer.  I would get 1.5.4 or what ever 
the newest JDK is.  Especially if you will be doing any GUI development.


You do not need to configure anything in Tomcat if you are ok with its 
default values.  If you want to make any changes to Tomcat you can do so 
by making changes to the values in the server.xml file in Tomcat/conf/


All of these are basic questions that are covered in the Tomcat Docs pages.

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/index.html






Joshua Pereira wrote:
hello 
im a beginer  .

im using windows XP,
tomcat 5.0.28,
MySql 4.1
Can anyone tell me what version of JDK should i use and how do i
configure my tomcat.
can anyone show me an example configuration for windows XP .
Thanks in advance..

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





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

Re: upgrade to 5

2005-08-26 Thread Brian Cook


I would skip straight to 5.  No point in going though 2 painful 
migrations instead of just one.  All the cores stuff is the same.  Read 
over the config docs, step up a test server play with it and when your 
ready update your production server.



David Ellis wrote:

Hello,

I'm extremely new to all this.  I was wondering if it is possible to upgrade
from tomcat version 3.2.3 to version 5?

I've read that the upgrade from version 3 to 4 was difficult, so my guess is
that I will have to go to version 4 before I can go to 5.

Thanks

Dave


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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: newbie with a short question

2005-08-26 Thread Brian Cook


Couple of things

1.  You will get better responses on this list if you review the posting 
 guide at.  This post is way to vague to get specific answers.  So most 
people are not going to respond to it.


http://jakarta.apache.org/site/mail.html


2.  If I follow the description correctly you are uploading a batch file 
to tomcat.  Then loading a page with a link to that batch file.  Then 
you are clicking on the link and it is displaying contents of the batch 
file.


If I followed all of the correctly that is exactly what should happen. 
If you are clicking on an Http link that posts to a web server that 
server is going to try to return the requested resource.


If you need to execute a file locally from Tomcat then you need to use 
one of the Java method calls to execute native files.  This by the way 
is usually a bad idea.  Is what ever your batch file is doing really a 
process that you can not recreate in java?


If I have misunderstood entirely which seems likely then you may want to 
repost the question formated in accordance with the posting guilds lines 
listed above. Posts to support forums should always include a detailed 
step by step lise of the process that creates the failing, copies of 
relevant configuration files(Saying you deleted some comments in a 
config file does not really help.  We need to see it.), and the lines of 
code that are believed to be failing.




nick sturm wrote:

ok, I have done the two things on that page:
renamed the serverlet and deleted the comments around the cgi section
of the web.xml config file.

I created a directory (cgi-bin) under root and under WEB-INF neither
of which would execute the batch file when I link to them.  it would
just open the batch file.

thanks, sorry I'm very new to this.
-n

On 8/24/05, Caldarale, Charles R [EMAIL PROTECTED] wrote:


From: Allistair Crossley [mailto:[EMAIL PROTECTED]
Subject: RE: newbie with a short question

First I cause an open/save prompt with

response.addHeader(Content-Disposition, attachment;
filename=somebat.bat);

Then I use the response.getOutputStream() and stream the bat
file down it. This requires of course that you get an
inputstream to your bat file first. Copy it into your webapp
somewhere and use the servlet context
getRealPath(/bat/mybat.bat) and then i/o API to read it
into an input stream before sending outbound again.

I found that setting content type of
application/msdos-x-batch failed, as did others, just send it
without a content type as a open/save.


I must be missing something; how does the above cause an existing .bat
file on the server to be executed on the server?  (That was the original
question.)

For the OP: the CGI doc for Tomcat can be found at
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cgi-howto.html

- 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





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





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

Re: How to Configure Tomcat to display the error on to Client rather than into logs

2005-08-26 Thread Brian Cook


What is it you want to display?  The stack trace?


shyama wrote:

Hi All,
 
When a client asks for a jsp file and an error has been encountered by

Server while compiling the .jsp to .class then I would like to display
that on the client browser rather than it dumping to the log file
local_host ...log. 
 
Please let me know whether there is any parameter to be set...
 
 
Thanks in advance,

Shyama
 
 
 



Confidentiality Notice  
The information contained in this electronic 
message and any attachments to this message are

intended for the exclusive use of the addressee(s)
and may contain confidential or privileged information.
If you are not the intended recipient, please notify 
the sender at Wipro or [EMAIL PROTECTED] immediately 
and destroy all copies of this message and any attachments.



--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: jndi question

2005-08-25 Thread Brian Cook

Sean,

One thing that stands out in your message is that the conext.xml file 
was placed in the META-INF folder.  Is it also in Tomcat 
Folder/conf/Catalina/localhost/ as the module name?  i.e. If the 
context path name of your webapp is /seansApp the context.xml file 
should appear in this folder as seansApp.xml.



The context.xml file is stored in META-INF during development but needs 
to be placed in Tomcat Folder/conf/Catalina/localhost/ folder for 
deployment with the file name of the context path.





Sean Rowe wrote:
I have tried again using the method described in the url brian gave.  
Here is the stack exception I'm receiving:


*type* Exception report

*message*

*description* _The server encountered an internal error () that 
prevented it from fulfilling this request._


*exception*

javax.servlet.ServletException: Name java:comp is not bound in this Context
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) 

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781) 


org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

*root cause*

javax.naming.NameNotFoundException: Name java:comp is not bound in this 
Context

org.apache.naming.NamingContext.lookup(NamingContext.java:769)
org.apache.naming.NamingContext.lookup(NamingContext.java:152)
javax.naming.InitialContext.lookup(InitialContext.java:351)
com.transcriptionportal.utils.DBManager.init(DBManager.java:25)
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:53)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


I have enclosed my server.xml, web.xml, context.xml (that i placed in my 
web/META-INF folder), and the class I'm using to make the connection.  
Thanks again to everyone who has helped me so far.


sean

Allistair Crossley wrote:


Hi,

He isn't using that method of configuration, that's just 1 option of 
3. He is nesting his Context definition within the server.xml Host 
element. Although this is now scorned, it's still valid. The 2 other 
methods are contextname.xml as you say, and also META-INF/context.xml 
within the webapp itself. Allistair.


 


-Original Message-
From: Brian Cook [mailto:[EMAIL PROTECTED]
Sent: 23 August 2005 17:23
To: Tomcat Users List
Subject: Re: jndi question



Ok but do you have the resource defined in context.xml?  If you go to 
Tomcat Dir/conf/Cataliana/localhost/ do you see a file with the 
name of the module ending with .xml?  If so is the resource defined 
in that file?  If not you need to add it.


From the description it sounds like nothing in this set up has been 
done as was show on the example page.


http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources
-howto.html

If you use the code block that is shown, define that resource in 
web.xml and context.xml it will work.  But multiple postings latter 
it still sounds like the JNDI resource is not defined in context.xml 
and the code calling the JNDI resource differs greatly from the 
example provided.



Sean Rowe wrote:
  

The first post on this included the server.xml, and further 


down in the   

page is the relevant part of web.xml ( i just double 


checked that ).  as   

for context.xml, i have listed it in my webapp.xml file, as well as 
server.xml as all other examples have suggested.  i then 


tried it in the   

admin module, where it then put it in server.xml for me.  


i'm willing to   


try anything at this point, though, if you have any suggestions.

as for my post not being jndi specific, i applogize if 


that's the case.

i'm not really familiar with jndibut when I did a search for 
'connection pooling', jndi seemed to be what everyone 


suggested i use.

what i want to do, if it's not clear, is to create a 


connection pool to   


my MySql database.
thanks,
sean

Brian Cook wrote:



Actually the files I listed are NOT in the first post.  It   


shows the   

server.xml and the code calling it but does not show web.xml or 
context.xml.


The error you are getting just means that that the JNDI   


resource being

Re: error launching catalina.sh

2005-08-25 Thread Brian Cook


org.xml.sax Exceptions mean that one of the XML files is not properly 
formated.  Specifically this one is telling you that you have an 
unterminated Context tag somewhere.


This is most likely either Tomcat Folder/conf/server.xml or and of the 
xml files in Tomcat Folder/conf/catalina/localhost/


Check to make sure that Context tags in those files all either end 
with a '/' at the end or have a closing tag for each opening tag.


EXAMPLES
**


Context  ...  /


Context
   
blah blah blah
   
/Context



Hugo Osorio wrote:

Hello everybody

i am running Version: Apache Tomcat/5.0.29 on FreeBSD

i have been working with apache forrest, but i haven't do anything to Tomcat 
configuration


all of a sudden i've got this message, and catalina.sh begins to start, but 
it launch error messages, i cannot see anything at localhost:8080



this is the message, any help?: thank you

zulu# ./catalina.sh run 
[1] 1530
zulu# Using CATALINA_BASE: /usr/local/jakarta-tomcat5.0
Using CATALINA_HOME: /usr/local/jakarta-tomcat5.0
Using CATALINA_TMPDIR: /usr/local/jakarta-tomcat5.0/temp
Using JAVA_HOME: /usr/local/jdk1.4.2
Aug 25, 2005 4:48:03 PM org.apache.commons.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 458 column 9: The element type Context 
must be terminated by the matching end-tag /Context.
org.xml.sax.SAXParseException: The element type Context must be terminated 
by the matching end-tag /Context.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 
Source)

at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown

Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.startup.Catalina.load(Catalina.java:489)
at org.apache.catalina.startup.Catalina.load(Catalina.java:528)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:250)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:424)
Catalina.start using conf/server.xml: org.xml.sax.SAXParseException: The 
element type Context must be terminated by the matching end-tag 
/Context.
org.xml.sax.SAXParseException: The element type Context must be terminated 
by the matching end-tag /Context.

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.startup.Catalina.load(Catalina.java:489)
at org.apache.catalina.startup.Catalina.load(Catalina.java:528)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:250)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:424)
Aug 25, 2005 4:48:03 PM org.apache.commons.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 458 column 9: The element type Context 
must be terminated by the matching end-tag /Context.
org.xml.sax.SAXParseException: The element type Context must be terminated 
by the matching end-tag /Context.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 
Source)

at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown

Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)

at 

Re: connection fails seemingly at random

2005-08-25 Thread Brian Cook


You may want to review the posting guild lines at :

http://jakarta.apache.org/site/mail.html

It will increase the number of people that can respond to your 
questions.  As it stands I doubt you will get any useful responses to a 
clip of a log file with system details, description of the failing, 
explanation of the situation causing it, con fig files, or even what log 
this came from.  It does not look like catalina.out.



David Ellis wrote:

I'm using tomcat 3.2.3

Dave

- Original Message - 
From: David Ellis [EMAIL PROTECTED]

To: tomcat-user@jakarta.apache.org
Sent: Thursday, August 25, 2005 1:07 PM
Subject: connection fails seemingly at random




Here is a clip of the log file:

[jk_uri_worker_map.c (185)]: In jk_uri_worker_map_t::uri_worker_map_free,
NULL parameters

[jk_uri_worker_map.c (335)]: jk_uri_worker_map_t::uri_worker_map_close,


NULL


parameter

[jk_uri_worker_map.c (185)]: In jk_uri_worker_map_t::uri_worker_map_free,
NULL parameters

[jk_connect.c (143)]: jk_open_socket, connect() failed errno = 146

[jk_ajp13_worker.c (174)]: In jk_endpoint_t::connect_to_tomcat, failed


errno


= 146

[jk_ajp13_worker.c (587)]: Error connecting to the Tomcat process.

[jk_ajp13_worker.c (204)]: connection_tcp_get_message: Error -
jk_tcp_socket_recvfull failed

[jk_ajp13_worker.c (622)]: Error reading request

[jk_connect.c (143)]: jk_open_socket, connect() failed errno = 146

[jk_ajp13_worker.c (174)]: In jk_endpoint_t::connect_to_tomcat, failed


errno


= 146



I don't know if those NULL parameters messages are causing the problem,


but


there are alot of them in the log file, and always a different number of
them before getting the 146 error.

Thanks for any help.

Dave


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





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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: jndi question

2005-08-25 Thread Brian Cook


It has probablly already been stated before somewhere in this thread but 
what versions of Tomcat and JDK are you using?



Sean Rowe wrote:

yes, there is a file in the /conf/Catalina/localhost directory for my app

Brian Cook wrote:


Sean,

One thing that stands out in your message is that the conext.xml file 
was placed in the META-INF folder.  Is it also in Tomcat 
Folder/conf/Catalina/localhost/ as the module name?  i.e. If the 
context path name of your webapp is /seansApp the context.xml file 
should appear in this folder as seansApp.xml.



The context.xml file is stored in META-INF during development but 
needs to be placed in Tomcat Folder/conf/Catalina/localhost/ 
folder for deployment with the file name of the context path.





Sean Rowe wrote:

I have tried again using the method described in the url brian gave.  
Here is the stack exception I'm receiving:


*type* Exception report

*message*

*description* _The server encountered an internal error () that 
prevented it from fulfilling this request._


*exception*

javax.servlet.ServletException: Name java:comp is not bound in this 
Context

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) 


org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781) 


org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) 


org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

*root cause*

javax.naming.NameNotFoundException: Name java:comp is not bound in 
this Context

org.apache.naming.NamingContext.lookup(NamingContext.java:769)
org.apache.naming.NamingContext.lookup(NamingContext.java:152)
javax.naming.InitialContext.lookup(InitialContext.java:351)
com.transcriptionportal.utils.DBManager.init(DBManager.java:25)
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:53)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) 


org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


I have enclosed my server.xml, web.xml, context.xml (that i placed in 
my web/META-INF folder), and the class I'm using to make the 
connection.  Thanks again to everyone who has helped me so far.


sean

Allistair Crossley wrote:


Hi,

He isn't using that method of configuration, that's just 1 option of 
3. He is nesting his Context definition within the server.xml Host 
element. Although this is now scorned, it's still valid. The 2 other 
methods are contextname.xml as you say, and also 
META-INF/context.xml within the webapp itself. Allistair.


 


-Original Message-
From: Brian Cook [mailto:[EMAIL PROTECTED]
Sent: 23 August 2005 17:23
To: Tomcat Users List
Subject: Re: jndi question



Ok but do you have the resource defined in context.xml?  If you go 
to Tomcat Dir/conf/Cataliana/localhost/ do you see a file with 
the name of the module ending with .xml?  If so is the resource 
defined in that file?  If not you need to add it.


From the description it sounds like nothing in this set up has been 
done as was show on the example page.


http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources
-howto.html

If you use the code block that is shown, define that resource in 
web.xml and context.xml it will work.  But multiple postings latter 
it still sounds like the JNDI resource is not defined in 
context.xml and the code calling the JNDI resource differs greatly 
from the example provided.



Sean Rowe wrote:
 

The first post on this included the server.xml, and further 




down in the 

page is the relevant part of web.xml ( i just double 




checked that ).  as 

for context.xml, i have listed it in my webapp.xml file, as well 
as server.xml as all other examples have suggested.  i then 




tried it in the 

admin module, where it then put it in server.xml for me.  




i'm willing to 


try anything at this point, though, if you have any suggestions.

as for my post not being jndi specific, i applogize if 




that's the case.  

i'm not really familiar with jndibut when I did a search for 
'connection pooling', jndi seemed to be what everyone 




suggested i use.  

what i want to do, if it's not clear, is to create a 




connection pool to 


my MySql database.
thanks,
sean

Brian Cook wrote

Re: jndi question

2005-08-25 Thread Brian Cook


I thought of that but his code samples and configs are consitant with 
both the 5.0 and 5.5 docs.





Which Tomcat 5?  The configuration for the 5.0 series is not necessarily
the same as in 5.5.



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

Re: jndi question

2005-08-25 Thread Brian Cook

Sean,

I copied your code on top of mine and ran it with no problems.  So you 
can probably eliminate the code as the issue.  Also since the error is 
now on the java:comp resource and not your JNDI defined resources I 
think your context.xml and web.xml configuration is correct too.


I googled the javax.naming.NameNotFoundException on string java:comp I 
found several postings that mentioned they fixed it by removing the 
following files from their deployments.


http://forum.java.sun.com/thread.jspa?threadID=647982tstart=105

naming-common.jar,
naming-java.jar,
naming-resources.jar,
naming-factory.jar

Are these by chance in your WEB-INF folder somewhere?  Or any where in 
your Tomcat install?  I checked they are not in mine and I have :



naming-factory.jar
naming-resources.jar

in Tomcat/common/lib/

If you see these files any where else try deleting them.  Other than 
that my only idea would be to try using Tomcat 5.5.


Sean Rowe wrote:
I have tried again using the method described in the url brian gave.  
Here is the stack exception I'm receiving:


*type* Exception report

*message*

*description* _The server encountered an internal error () that 
prevented it from fulfilling this request._


*exception*

javax.servlet.ServletException: Name java:comp is not bound in this Context
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) 

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781) 


org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

*root cause*

javax.naming.NameNotFoundException: Name java:comp is not bound in this 
Context

org.apache.naming.NamingContext.lookup(NamingContext.java:769)
org.apache.naming.NamingContext.lookup(NamingContext.java:152)
javax.naming.InitialContext.lookup(InitialContext.java:351)
com.transcriptionportal.utils.DBManager.init(DBManager.java:25)
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:53)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


I have enclosed my server.xml, web.xml, context.xml (that i placed in my 
web/META-INF folder), and the class I'm using to make the connection.  
Thanks again to everyone who has helped me so far.


sean

Allistair Crossley wrote:


Hi,

He isn't using that method of configuration, that's just 1 option of 
3. He is nesting his Context definition within the server.xml Host 
element. Although this is now scorned, it's still valid. The 2 other 
methods are contextname.xml as you say, and also META-INF/context.xml 
within the webapp itself. Allistair.


 


-Original Message-
From: Brian Cook [mailto:[EMAIL PROTECTED]
Sent: 23 August 2005 17:23
To: Tomcat Users List
Subject: Re: jndi question



Ok but do you have the resource defined in context.xml?  If you go to 
Tomcat Dir/conf/Cataliana/localhost/ do you see a file with the 
name of the module ending with .xml?  If so is the resource defined 
in that file?  If not you need to add it.


From the description it sounds like nothing in this set up has been 
done as was show on the example page.


http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources
-howto.html

If you use the code block that is shown, define that resource in 
web.xml and context.xml it will work.  But multiple postings latter 
it still sounds like the JNDI resource is not defined in context.xml 
and the code calling the JNDI resource differs greatly from the 
example provided.



Sean Rowe wrote:
  

The first post on this included the server.xml, and further 


down in the   

page is the relevant part of web.xml ( i just double 


checked that ).  as   

for context.xml, i have listed it in my webapp.xml file, as well as 
server.xml as all other examples have suggested.  i then 


tried it in the   

admin module, where it then put it in server.xml for me.  


i'm willing to   


try anything at this point, though, if you have any suggestions.

as for my post not being jndi specific, i applogize if 


that's the case.

i'm not really familiar with jndibut when I did a search for 
'connection pooling', jndi seemed to be what

Re: jndi question

2005-08-25 Thread Brian Cook

Sean,

Where the files you deleted in WEB-INF/lib or commons/lib?  You should 
have naming-factory.jar and naming-resources.jar in common/lib/.  Or 
somewhere in the class path.


WEB-INF/lib is just another location in the class path you can add extra 
packages your apps may need access to.  Libraries placed there will be 
loaded first when multiple instances of the same packages occurs.  i.e. 
if you have say naming-factory.jar in both /commons/lib and WEB-INF/lib 
it will load the package in WEB-INF/lib/.


The other thing that is significant about WEB-INF/lib/ is that Tomcat 
will load an instants of every package in it for each web app.  So for 
example if you have 5 web apps that all use mysql-connector.jar.  And 
you put mysql-connector.jar in WEB-INF/lib/ for all of those apps Tomcat 
will load 5 instances of mysql-connector.jar.  Where as if you put it in 
commons/lib/ it will only load one instance saving you RAM.


I put a copy of any third party package my web apps call.  I do this 
because I want them to be completely portable.  That way if I copy them 
to anther server I do not have to worry about what packages I may have 
forgotten to add to commons/lib/.  The result is I have fewer deployment 
problems but I am using more RAM than I absolutely need to.


A typical app for me will have the following in WEB-INF/lib

mysql-connector-java-3.1.7-bin.jar
commons-dbcp-1.2.1.jar
commons-fileupload-1.0.jar
commons-httpclient-2.0.2.jar
commons-pool-1.2.jar
commons-collections-3.1.jar
itext-1.3.jar
itext-xml-1.00.jar

Looking though your stack trace it looks like you have a JSP page called 
test.jsp calling com.transcriptionportal.utils.DBManager.init().  And 
that there is a package there that uses the 
org.apache.naming.NamingContext class.  I am assuming that this is where 
you can calling the pooled connection and Tomcat needs one of those two 
 JAR's to do the JNDI call.





Sean Rowe wrote:
brian, would you mind giving me a list of the applicable jar files you 
have in your web-inf/lib folder?  i removed the files below, and made 
sure the files naming-factory and naming resources were in my common/lib 
folder.  now i'm getting this stack exception:


javax.servlet.ServletException: Cannot create resource instance
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) 

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781) 


org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

*root cause*

javax.naming.NamingException: Cannot create resource instance
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:132) 

javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304) 


org.apache.naming.NamingContext.lookup(NamingContext.java:792)
org.apache.naming.NamingContext.lookup(NamingContext.java:139)
org.apache.naming.NamingContext.lookup(NamingContext.java:780)
org.apache.naming.NamingContext.lookup(NamingContext.java:152)
com.transcriptionportal.utils.DBManager.init(DBManager.java:34)
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:53)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) 


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Different error this time, so i think i'm getting closer.  ;)  thanks 
again.


sean

Brian Cook wrote:


Sean,

I copied your code on top of mine and ran it with no problems.  So you 
can probably eliminate the code as the issue.  Also since the error is 
now on the java:comp resource and not your JNDI defined resources I 
think your context.xml and web.xml configuration is correct too.


I googled the javax.naming.NameNotFoundException on string java:comp 
I found several postings that mentioned they fixed it by removing the 
following files from their deployments.


http://forum.java.sun.com/thread.jspa?threadID=647982tstart=105

naming-common.jar,
naming-java.jar,
naming-resources.jar,
naming-factory.jar

Are these by chance in your WEB-INF folder somewhere?  Or any where in 
your Tomcat install?  I checked they are not in mine and I have :



naming-factory.jar
naming-resources.jar

in Tomcat/common/lib/

If you see

Re: jndi question

2005-08-23 Thread Brian Cook


Yes you can use JNDI with out using JSTL.  But the only way to configure 
it is to define the JNDI resources in the web.xml and context.xml files. 
   Technically you should be able to use the globally defined JNDI 
resources in server.xml, and I have seen configuration set ups doing it 
when googling.  But could never get them to work.


This highlights another area of seemingly unneeded complication in 
Java/Unix development.  Using JNDI for data sources which was supposed 
to help you save time requires that you redundantly define the JNDI 
resource in at lest 2 if not 3 places.


The admin tool which was also supposed to help save time defines the 
JNDI resources in server.xml which does not really seem to be all that 
helpful.  I am sure there is likely a reason for this but I am ignorant 
of it.  The admin tool is also supposed to let you define JNDI resources 
 per context but it errors out when ever I have tried it.


My experience with the Tomcat Admin and Manager tools is that they are 
worthless.  Of the few steps they try to help with more often that not 
they just return errors when you need to use it.  I removed them both 
and have gone back to doing set ups manually and there has not been much 
of a time difference doing it this way.


Any way for JNDI to work you will have to add the definition for it in 
both web.xml and context.xml in the Tomcat 
Folder/conf/Catalina/localhost/ folder.  This seems counter productive 
since it makes your app less portable having the data base configuration 
details inside the context and by extent the WAR file but it is what you 
have to do to get it to work right now.


I feel your pain I know it is frustrating spending hours debugging just 
the DB connection but todate that is the reality of Java web app 
development.  It is why I fear we will all be .Net developers some day.



Example :
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html

CODE

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env);
DataSource ds = (DataSource)
  envCtx.lookup(jdbc/EmployeeDB);

Connection conn = ds.getConnection();
... use this connection to access the database ...
conn.close();

/CODE





WEB.XML

resource-ref
  description
Resource reference to a factory for java.sql.Connection
instances that may be used for talking to a particular
database that is configured in the server.xml file.
  /description
  res-ref-name
jdbc/EmployeeDB
  /res-ref-name
  res-type
javax.sql.DataSource
  /res-type
  res-auth
Container
  /res-auth
/resource-ref

/WEB.XML




CONTEXT FILE

Context

  Resource  name=jdbc/EmployeeDB
auth=Container
type=javax.sql.DataSource
username=dbusername
password=dbpassword
driverClassName=org.hsql.jdbcDriver 
url=jdbc:HypersonicSQL:database
maxActive=8
maxIdle=4/

/Context

/CONTEXT FILE






Sean Rowe wrote:
Dirk, I'm sorry I didn't see the difference on the page you sent me to.  
However, if there is a way I can do this without having to use jstl, I 
would really like to know.  I was hoping to put the code in a class 
somewhere that my servlets could use.


thanks,
sean

Dirk Weigenand wrote:


Sean,

 


--- Ursprüngliche Nachricht ---
Von: Sean Rowe [EMAIL PROTECTED]
An: Tomcat Users List tomcat-user@jakarta.apache.org
Betreff: Re: jndi question
Datum: Mon, 22 Aug 2005 09:24:10 -0500

Thanks for responding Dirk.  I've practically memorized the 
documentation on the link you sent:


// Obtain our environment naming context
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env);

// Look up our data source
DataSource ds = (DataSource)
 envCtx.lookup(jdbc/EmployeeDB);

// Allocate and use a connection from the pool
Connection conn = ds.getConnection();
... use this connection to access the database ...
conn.close();

Whenever I try this, here's what I get (which led me to trying it the 
way

I posted):

javax.naming.NameNotFoundException: Name java:comp is not bound in this
Context

  



No. Did you look at
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html? 



I recommend putting the context definition in its own content.xml. On
redeploying my application tomcat wouldn't find the driver class anymore.

Mind you not the class itself but the definition of what class to load.

This problem was solved by putting the context into context.xml.

regards
  Dirk

 



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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: jndi question

2005-08-23 Thread Brian Cook


Actually the files I listed are NOT in the first post.  It shows the 
server.xml and the code calling it but does not show web.xml or context.xml.


The error you are getting just means that that the JNDI resource being 
called in the code is not defined in both web.xml and context.xml.


In looking at the code snip it in the first post I am not following what 
you are trying to do.  The post is for a JNDI question but in the code 
it looks like you are calling the DB URL directly.  The whole point of 
JDNI being to get specific URL, and configuration info outside of the 
code base.  I am not following what it is you are trying to do here.




Sean Rowe wrote:
Brian, thank you for replying.  I was afraid my topic was dead.  If you 
could look at my first post, I listed all the files that you have 
suggested I take a look at.  I have done everything you have suggested, 
but am still getting errors.  The error I am getting now is


javax.naming.NameNotFoundException: Name java:comp is not bound in this 
Context


I can't find anything on the net or in any books I've looked at that 
explains this.  As far as I can tell, java:comp should just be there.  
Any ideas?  Thanks again.


Sean

Brian Cook wrote:



Yes you can use JNDI with out using JSTL.  But the only way to 
configure it is to define the JNDI resources in the web.xml and 
context.xml files.Technically you should be able to use the 
globally defined JNDI resources in server.xml, and I have seen 
configuration set ups doing it when googling.  But could never get 
them to work.


This highlights another area of seemingly unneeded complication in 
Java/Unix development.  Using JNDI for data sources which was supposed 
to help you save time requires that you redundantly define the JNDI 
resource in at lest 2 if not 3 places.


The admin tool which was also supposed to help save time defines the 
JNDI resources in server.xml which does not really seem to be all that 
helpful.  I am sure there is likely a reason for this but I am 
ignorant of it.  The admin tool is also supposed to let you define 
JNDI resources  per context but it errors out when ever I have tried it.


My experience with the Tomcat Admin and Manager tools is that they are 
worthless.  Of the few steps they try to help with more often that not 
they just return errors when you need to use it.  I removed them both 
and have gone back to doing set ups manually and there has not been 
much of a time difference doing it this way.


Any way for JNDI to work you will have to add the definition for it in 
both web.xml and context.xml in the Tomcat 
Folder/conf/Catalina/localhost/ folder.  This seems counter 
productive since it makes your app less portable having the data base 
configuration details inside the context and by extent the WAR file 
but it is what you have to do to get it to work right now.


I feel your pain I know it is frustrating spending hours debugging 
just the DB connection but todate that is the reality of Java web app 
development.  It is why I fear we will all be .Net developers some day.



Example :
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html

CODE

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env);
DataSource ds = (DataSource)
  envCtx.lookup(jdbc/EmployeeDB);

Connection conn = ds.getConnection();
... use this connection to access the database ...
conn.close();

/CODE





WEB.XML

resource-ref
  description
Resource reference to a factory for java.sql.Connection
instances that may be used for talking to a particular
database that is configured in the server.xml file.
  /description
  res-ref-name
jdbc/EmployeeDB
  /res-ref-name
  res-type
javax.sql.DataSource
  /res-type
  res-auth
Container
  /res-auth
/resource-ref

/WEB.XML




CONTEXT FILE

Context

  Resource name=jdbc/EmployeeDB
auth=Container
type=javax.sql.DataSource
username=dbusername
password=dbpassword
driverClassName=org.hsql.jdbcDriver
url=jdbc:HypersonicSQL:database

maxActive=8
maxIdle=4/

/Context

/CONTEXT FILE






Sean Rowe wrote:

Dirk, I'm sorry I didn't see the difference on the page you sent me 
to.  However, if there is a way I can do this without having to use 
jstl, I would really like to know.  I was hoping to put the code in a 
class somewhere that my servlets could use.


thanks,
sean

Dirk Weigenand wrote:


Sean,

 


--- Ursprüngliche Nachricht ---
Von: Sean Rowe [EMAIL PROTECTED]
An: Tomcat Users List tomcat-user@jakarta.apache.org
Betreff: Re: jndi question
Datum: Mon, 22 Aug 2005 09:24:10 -0500

Thanks for responding Dirk.  I've practically memorized the 
documentation on the link you sent:


// Obtain our environment naming context
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env);

// Look up our data source
DataSource ds = (DataSource

Re: jndi question

2005-08-23 Thread Brian Cook


Ok but do you have the resource defined in context.xml?  If you go to 
Tomcat Dir/conf/Cataliana/localhost/ do you see a file with the name 
of the module ending with .xml?  If so is the resource defined in that 
file?  If not you need to add it.


From the description it sounds like nothing in this set up has been 
done as was show on the example page.


http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html

If you use the code block that is shown, define that resource in web.xml 
and context.xml it will work.  But multiple postings latter it still 
sounds like the JNDI resource is not defined in context.xml and the code 
calling the JNDI resource differs greatly from the example provided.



Sean Rowe wrote:
The first post on this included the server.xml, and further down in the 
page is the relevant part of web.xml ( i just double checked that ).  as 
for context.xml, i have listed it in my webapp.xml file, as well as 
server.xml as all other examples have suggested.  i then tried it in the 
admin module, where it then put it in server.xml for me.  i'm willing to 
try anything at this point, though, if you have any suggestions.


as for my post not being jndi specific, i applogize if that's the case.  
i'm not really familiar with jndibut when I did a search for 
'connection pooling', jndi seemed to be what everyone suggested i use.  
what i want to do, if it's not clear, is to create a connection pool to 
my MySql database.

thanks,
sean

Brian Cook wrote:



Actually the files I listed are NOT in the first post.  It shows the 
server.xml and the code calling it but does not show web.xml or 
context.xml.


The error you are getting just means that that the JNDI resource being 
called in the code is not defined in both web.xml and context.xml.


In looking at the code snip it in the first post I am not following 
what you are trying to do.  The post is for a JNDI question but in the 
code it looks like you are calling the DB URL directly.  The whole 
point of JDNI being to get specific URL, and configuration info 
outside of the code base.  I am not following what it is you are 
trying to do here.




Sean Rowe wrote:

Brian, thank you for replying.  I was afraid my topic was dead.  If 
you could look at my first post, I listed all the files that you have 
suggested I take a look at.  I have done everything you have 
suggested, but am still getting errors.  The error I am getting now is


javax.naming.NameNotFoundException: Name java:comp is not bound in 
this Context


I can't find anything on the net or in any books I've looked at that 
explains this.  As far as I can tell, java:comp should just be 
there.  Any ideas?  Thanks again.


Sean

Brian Cook wrote:



Yes you can use JNDI with out using JSTL.  But the only way to 
configure it is to define the JNDI resources in the web.xml and 
context.xml files.Technically you should be able to use the 
globally defined JNDI resources in server.xml, and I have seen 
configuration set ups doing it when googling.  But could never get 
them to work.


This highlights another area of seemingly unneeded complication in 
Java/Unix development.  Using JNDI for data sources which was 
supposed to help you save time requires that you redundantly define 
the JNDI resource in at lest 2 if not 3 places.


The admin tool which was also supposed to help save time defines the 
JNDI resources in server.xml which does not really seem to be all 
that helpful.  I am sure there is likely a reason for this but I am 
ignorant of it.  The admin tool is also supposed to let you define 
JNDI resources  per context but it errors out when ever I have tried 
it.


My experience with the Tomcat Admin and Manager tools is that they 
are worthless.  Of the few steps they try to help with more often 
that not they just return errors when you need to use it.  I removed 
them both and have gone back to doing set ups manually and there has 
not been much of a time difference doing it this way.


Any way for JNDI to work you will have to add the definition for it 
in both web.xml and context.xml in the Tomcat 
Folder/conf/Catalina/localhost/ folder.  This seems counter 
productive since it makes your app less portable having the data 
base configuration details inside the context and by extent the WAR 
file but it is what you have to do to get it to work right now.


I feel your pain I know it is frustrating spending hours debugging 
just the DB connection but todate that is the reality of Java web 
app development.  It is why I fear we will all be .Net developers 
some day.



Example :
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html 



CODE

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env);
DataSource ds = (DataSource)
  envCtx.lookup(jdbc/EmployeeDB);

Connection conn = ds.getConnection();
... use this connection to access the database ...
conn.close();

/CODE





WEB.XML

resource

Re: jndi question

2005-08-23 Thread Brian Cook


Do not need the screen shots.  Just copy and paste the stack trace error 
of the exception(All the gobblay gook that shows up on screen or in 
catalina.out when an exception is thrown.), the details of which ever 
combination of config files you are using, the code actually calling the 
JNDI resource.


Just as a future reference including all of those things in your posts 
will help get a solution to your problem faster and will increase the 
number of people that will respond to your posts.


You may find these posting guild lines helpful too.

http://jakarta.apache.org/site/mail.html


Sean Rowe wrote:
I will try all 3 once again, and provide screen shots of the errors I 
see.  I have tried these methods before, but I will try them again for a 
sanity check.

sean

Allistair Crossley wrote:


Hi,

He isn't using that method of configuration, that's just 1 option of 
3. He is nesting his Context definition within the server.xml Host 
element. Although this is now scorned, it's still valid. The 2 other 
methods are contextname.xml as you say, and also META-INF/context.xml 
within the webapp itself. Allistair.


 


-Original Message-
From: Brian Cook [mailto:[EMAIL PROTECTED]
Sent: 23 August 2005 17:23
To: Tomcat Users List
Subject: Re: jndi question



Ok but do you have the resource defined in context.xml?  If you go to 
Tomcat Dir/conf/Cataliana/localhost/ do you see a file with the 
name of the module ending with .xml?  If so is the resource defined 
in that file?  If not you need to add it.


From the description it sounds like nothing in this set up has been 
done as was show on the example page.


http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources
-howto.html

If you use the code block that is shown, define that resource in 
web.xml and context.xml it will work.  But multiple postings latter 
it still sounds like the JNDI resource is not defined in context.xml 
and the code calling the JNDI resource differs greatly from the 
example provided.



Sean Rowe wrote:
  

The first post on this included the server.xml, and further 


down in the   

page is the relevant part of web.xml ( i just double 


checked that ).  as   

for context.xml, i have listed it in my webapp.xml file, as well as 
server.xml as all other examples have suggested.  i then 


tried it in the   

admin module, where it then put it in server.xml for me.  


i'm willing to   


try anything at this point, though, if you have any suggestions.

as for my post not being jndi specific, i applogize if 


that's the case.

i'm not really familiar with jndibut when I did a search for 
'connection pooling', jndi seemed to be what everyone 


suggested i use.

what i want to do, if it's not clear, is to create a 


connection pool to   


my MySql database.
thanks,
sean

Brian Cook wrote:



Actually the files I listed are NOT in the first post.  It   


shows the   

server.xml and the code calling it but does not show web.xml or 
context.xml.


The error you are getting just means that that the JNDI   


resource being   


called in the code is not defined in both web.xml and context.xml.

In looking at the code snip it in the first post I am not   


following   

what you are trying to do.  The post is for a JNDI   


question but in the   

code it looks like you are calling the DB URL directly.  The whole 
point of JDNI being to get specific URL, and configuration info 
outside of the code base.  I am not following what it is you are 
trying to do here.




Sean Rowe wrote:

  

Brian, thank you for replying.  I was afraid my topic was 


dead.  If   

you could look at my first post, I listed all the files 


that you have   

suggested I take a look at.  I have done everything you have 
suggested, but am still getting errors.  The error I am 


getting now is
  

javax.naming.NameNotFoundException: Name java:comp is not 


bound in   


this Context

I can't find anything on the net or in any books I've 


looked at that   

explains this.  As far as I can tell, java:comp should just be 
there.  Any ideas?  Thanks again.


Sean

Brian Cook wrote:



Yes you can use JNDI with out using JSTL.  But the only way to 
configure it is to define the JNDI resources in the web.xml and 
context.xml files.Technically you should be able to use the 
globally defined JNDI resources in server.xml, and I have seen 
configuration set ups doing it when googling.  But could   


never get   


them to work.

This highlights another area of seemingly unneeded   


complication in   

Java/Unix development.  Using JNDI for data sources which was 
supposed to help you save time requires that you   


redundantly define   


the JNDI resource in at lest 2 if not 3 places.

The admin tool which was also supposed to help save time   


defines the   

JNDI resources in server.xml which

Re: Viewing PDF in Internet Explorer

2005-08-23 Thread Brian Cook


What issue?  If you are needing to get a page to load a PDF you have two 
options.


  1.  Set an A tag with the source value set to the location of the 
PDF.  This will load the PDF in the entire window assuming that they 
have the PDF plug in installed.


  2.  The other option is to use frames and have the PDF load as the 
source of one of the frames.  This will load the PDF in one of the 
frames and give you space around it if you need it.


Did that answer your question?  If not we would need at lest a hint of 
what problem is.



[EMAIL PROTECTED] wrote:

I am using Tomcat 5.0.28 and need to have a pdf document open as a plug-in
in Internet Explorer.

I tried using the response.class file (pertaining to the content-type)
recommended in the
bug documentation 24970, but it did not make a difference. Is there any
additional information/solutions that are available for this issue?

Regards,
Chris Ferraro


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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: Unable to access application if I am on VPN

2005-08-20 Thread Brian Cook


Hm Could you configure the firewall to reroute the JVM request 
thought the proxy?



Len Popp wrote:

Can you download the DTD to the server and point the config file at
the local copy?

That must be possible, otherwise you couldn't run an application on an
intranet that's not connected to the WWW.



--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: Session Tracking

2005-08-19 Thread Brian Cook


Of corse it doesn't.  If you close the browser you are killing the 
session.  So when the browser reopens it is getting a new session 
object.  This is exactly how it is supposed to work.  You might be be 
able to store the value in a cookie, but if the user blocks them or has 
set their browser to delete cookies at the end of the session as most do 
then that will not work either.


Raghaw Goswami wrote:

Hi,
I have JDK 1.5 [J2SE 5.0 update 3], Tomcat 5.5.9,Win
XP SP2,  Trying a e.g. session tracking [The Session
Tracking API] using HttpSession object.

The program works[ accessCount increments] when I
don't close the current browser and open new brwoser
with CTRL + N, But if i quit the browser and then
start again 
accessCount does not increment. 


Would appreciate any help in this regards

Thanks in Advance
R.




__ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail


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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: SSL with Tomcat 55

2005-08-19 Thread Brian Cook


hmmm wild guess here but are the cert file and the web app owned by the 
same user and group that executes the Tomcat thread(s)?  i.e. If Tomcat 
is run by user say tomcat, and the other persons web app is owned by 
another user, and the cert is owned by say root I could see it causing a 
problem.


It is a mistake I have made a lot and then waste a lot of time only to 
find I uploaded a file that Tomcat did not have the right permissions to 
use.



Hayes, Wes wrote:

Good Morning,
 
I am the Network Admin working with a programmer trying to get TomCat

5.5 working with SSL.  She is trying to run a servlet via Oracle
JDeveloper 10.1.2.  Now, on my end, I have followed the instruction for
TomCat on how to get SSL installed and it seemed to work fine.  Got the
test cert from Verisign and installed it and I can access it via
Internet Explorer on https://xxx.xxx.xxx:8443 https://xxx.xxx.xxx:8443
with no problem.  But when she tried to run her app she tells me this:
 
When I attempt to run my test stub which opens a connection to the

servlet,  I get the following error.  I do not see this error if I run
it through my browser.
 
javax.net.ssl.SSLHandshakeException:

sun.security.validator.ValidatorException: No trusted certificate found
 
Any thoughts on this?
 
 
Wesley Hayes

Network Administrator
AICPCU
720 Providence Road
Malvern, PA 19355
610-644-2100 ext. 7216
610-651-7643 (Fax)
[EMAIL PROTECTED]
 
 
 
 



***
This e-mail and any attachments to it are confidential, privileged, and 
intended solely for the named addressee(s). The unauthorized use, disclosure, 
or alteration of this e-mail is strictly prohibited. If you have received this 
e-mail in error, please notify the sender immediately and delete the e-mail.




--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: Session Tracking

2005-08-19 Thread Brian Cook


As well as the rules for session management.

Wade Chandler wrote:

I think you need to read up on the java language a
bit.  See what static and final mean.  


Wade

--- Raghaw Goswami [EMAIL PROTECTED] wrote:



Thanks for the e-mail:
First time it was 0 , then 1 , This is when the
browser was closed and opened then it never
incremented was always 0 when browser was closed and
opened. 


I am attaching the Showsession.java file for
reference. May be i am missing some thing  if the
variable is made static how can its value increment
?

R

--- Arup Vidyerthy [EMAIL PROTECTED] wrote:



Does it not increment at all or does the increment
counter gets reset and
starts all over again from 0. Basically if you


want


to keep the counter
incrementing everytime you access that page (or


hit


that that servlet) you
need to make it a static variable in your
servlet/jsp.

-Original Message-
From: Raghaw Goswami [mailto:[EMAIL PROTECTED] 
Sent: 19 August 2005 14:46

To: tomcat-user@jakarta.apache.org
Subject: Session Tracking

Hi,
I have JDK 1.5 [J2SE 5.0 update 3], Tomcat


5.5.9,Win


XP SP2,  Trying a e.g.
session tracking [The Session Tracking API] using
HttpSession object.

The program works[ accessCount increments] when I
don't close the current
browser and open new brwoser with CTRL + N, But if


i


quit the browser and
then start again accessCount does not increment. 


Would appreciate any help in this regards

Thanks in Advance
R.




__
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail






-


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









___


Yahoo! Messenger - NEW crystal clear PC to PC
calling worldwide with voicemail
http://uk.messenger.yahoo.com





-


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




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around 
http://mail.yahoo.com 


-


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


[EMAIL PROTECTED]


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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: Unable to access application if I am on VPN

2005-08-19 Thread Brian Cook


Are you saying you are taking the PC that runs Tomcat home with you and 
it does not work at home?  Or are you trying to connect to Tomcat 
running at the office from anther PC at home?  If it is the second one 
then you need to use the actual IP or domain instead of just localhost.


What other services is Tomcat connecting to? (i.e. Data Bases, LDAP, Web 
Services, App Servers, etc.) If you are taking the PC running Tomcat 
home with you.  Can you verify that you can connect to them over the 
VPN?  i.e. Log in or connect to them manually with out Tomcat over the 
VPN to make sure you have access.


The error seems to indicate that Tomcat is missing some class files or 
libraries.  Could they have been on a shared folder that you do not have 
access to over the VPN?


Sunjay Gunda wrote:

Hello All,
I am new to Tomcat. I am using the following for my application
 
Tomcat :  5.0.28 
Java :  1.4.2_08

Struts   :  1.1
Windows XP.
 
 
I am able to access my application that is hosted on my local box. http://localhost:8080/XYZ/loginForm.jsp
 
I connect through VPN for my office work. At that time, I am unable to access the same application (that I am able to access if I am not connected through VPN). Can anyone suggest what might the problem be? I am getting the following errors when I try to access the application
 
If I login as http://localhost:8080/XYZ/loginForm.jsp


type Exception report

message 


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

exception 
javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)	org.apache.jsp.loginForm_jsp._jspService(loginForm_jsp.java:101)	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)




root cause 
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection	org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:712)	org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:500)	org.apache.jsp.loginForm_jsp._jspx_meth_html_form_0(loginForm_jsp.java:132)	org.apache.jsp.loginForm_jsp._jspService(loginForm_jsp.java:91)	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)




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

-
Apache Tomcat/5.0.28
 

 


If I login as http://localhost:8080/XYZ/loginForm.do, I get the following 
message
HTTP Status 404 - Servlet action is not available
-

type Status report

message Servlet action is not available

description The requested resource (Servlet action is not available) is not 
available.

-
Apache Tomcat/5.0.28
 

 


I am able to access the admin and the manager of the tomcat even after 
connecting through VPN. But I am unable to connect to my application. Can 
anyone help me?

 


Thanks

Sunjay



-
 Start your day with Yahoo! - make it your home page 



--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: Advice for Hosting Many Individual Webapps?

2005-08-18 Thread Brian Cook


My solution for this is not elegant.  I run 8 apps on one instance of 
Tomcat and it will be growing to 12 soon.  All of those apps are set 
with autoReload set to true.  When I need to update something I 
manually copy the individual class or JSP file to the proper folder to 
over write the existing ones. So I never need to take Tomcat down unless 
I update a library in commons/lib which is almost never.  I also when in 
a hurry use the deployer to restart individual web apps so they do not 
all go down.


This works to a point but has the obvious pitfalls.  First Tomcat is 
wasting processing time constantly checking to see if it should reload 
any of the modules.  And second if I update a class file or JSP page 
that depends on another updated class or JSP file I forgot to copy over 
then that app will throw exceptions like crazy.  It also means I have to 
manually set the config files like the context.xml files which is very 
error pron.


Any one else have other ideas?




-Original Message-
From: Seth Ladd [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 16, 2005 3:12 PM

To: Tomcat Users List
Subject: Advice for Hosting Many Individual Webapps?

Hello,

We are finding outselves hosting more and more individual 
webapps, all 
running on Tomcat 5.5.9 w/ JDK 1.5.  Each of these webapps is 
developed 
and deployed on a separate schedule, and the number and 
frequency of app 
deployments is increasing.


The frequency is so much that the uptime of all of our 
applications is 
affected as we continually take down Tomcat servers in production to 
deploy a new application (or new version of the application). 
Because 
hot deploy does not work (the old favorite OOM error w/ too many 
redeploys), we bounce the Tomcat server for every redeploy.


To avoid taking down all of our applications when we need to 
redeploy a 
single app, we've begun to deploy each application to their 
own Tomcat 
instance.  All of these instances are fronted by a single 
Apache server 
handling vhosts, logging, etc.


We're just curious how common this setup really is.  We know 
we are in 
an uncommon position, with so many webapps (approaching 20, 
and growing 
very fast).  We don't want to put all our eggs in one basket, so to 
speak, so we've begun to split out individual tomcat instances.


Anyone else have to handle numerous webapps, with frequent 
deploys, and 
have to keep uptime for all apps as high as possible?  We hesitate to 
put all webapps in one tomcat, because to deploy one app 
means we have 
to take down all of our apps.  This is becoming unacceptable. 
(not to 
mention that a memory leak in one app will bring down all the apps 
living in that tomcat instance)


Any tips or tricks would be really appreciated.  Or pointers 
to previous 
material (I've found some, but nothing that jumped out at me).


Thanks very much in advance,
Seth

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






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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: Advice for Hosting Many Individual Webapps?

2005-08-18 Thread Brian Cook


I think I missed something here.  Are you not still bouncing Tomcat 
here?  If so isnt the service still going down?  What is the benifit of 
changign the ports around?  I have a feeling I missed something in the 
expliation.



George Sexton wrote:

The technique I use is this:

Run the HTTP connector on port 8080.

Forward port 80 to port 8080.

To re-start the system:

edit the server.xml and run the HTTP connector on port 7080
Change the shutdown port to 8006

Start tomcat, and wait till it comes up.

Re-run the firewall script to forward port 80 to port 7080.

Stop the instance running on port 7080.

The downside is that any active sessions get bounced and have to re-login.

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  




-Original Message-
From: Seth Ladd [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 16, 2005 3:12 PM

To: Tomcat Users List
Subject: Advice for Hosting Many Individual Webapps?

Hello,

We are finding outselves hosting more and more individual 
webapps, all 
running on Tomcat 5.5.9 w/ JDK 1.5.  Each of these webapps is 
developed 
and deployed on a separate schedule, and the number and 
frequency of app 
deployments is increasing.


The frequency is so much that the uptime of all of our 
applications is 
affected as we continually take down Tomcat servers in production to 
deploy a new application (or new version of the application). 
Because 
hot deploy does not work (the old favorite OOM error w/ too many 
redeploys), we bounce the Tomcat server for every redeploy.


To avoid taking down all of our applications when we need to 
redeploy a 
single app, we've begun to deploy each application to their 
own Tomcat 
instance.  All of these instances are fronted by a single 
Apache server 
handling vhosts, logging, etc.


We're just curious how common this setup really is.  We know 
we are in 
an uncommon position, with so many webapps (approaching 20, 
and growing 
very fast).  We don't want to put all our eggs in one basket, so to 
speak, so we've begun to split out individual tomcat instances.


Anyone else have to handle numerous webapps, with frequent 
deploys, and 
have to keep uptime for all apps as high as possible?  We hesitate to 
put all webapps in one tomcat, because to deploy one app 
means we have 
to take down all of our apps.  This is becoming unacceptable. 
(not to 
mention that a memory leak in one app will bring down all the apps 
living in that tomcat instance)


Any tips or tricks would be really appreciated.  Or pointers 
to previous 
material (I've found some, but nothing that jumped out at me).


Thanks very much in advance,
Seth

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






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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: Advice for Hosting Many Individual Webapps?

2005-08-18 Thread Brian Cook


Sorry still not following.  If Tomcat is being restarted how do you not 
have start up time?  Is it that you have two instances of Tocmat and you 
are having the firewall just point to one instance while you bounce the 
second?


If so is there an advantage to doing that over clustering?


George L. Sexton wrote:
The net effect is that users have to re-login, but there is no down time. They 
get bounced, but can immediately log back in.


Right now, startup time for my hosted machine is running in the area of 5 
minutes. So, I'm eliminating a 5 minute startup cycle.


I'm running 60 virtual hosts on one machine (P3 600). I'll be moving to a P4 
3.0GHz this weekend, but I hope to get up to 200 virtual hosts per machine.


Any way you cut it, startup time is a killer. 


On Thursday 18 August 2005 08:54, Brian Cook wrote:



I think I missed something here.  Are you not still bouncing Tomcat
here?  If so isnt the service still going down?  What is the benifit of
changign the ports around?  I have a feeling I missed something in the
expliation.

George Sexton wrote:


The technique I use is this:



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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: webapp loading order...

2005-08-17 Thread Brian Cook


Well Tomcat is not likely to do this for you so you would probably need 
to structure the app2 to wait for a trigger from app1.  You could have 
app1 POST to a servlet in app2 and have that be the trigger for the 
dependent steps.  Or have app1 write to a file that app2 will poll until 
it sees a trigger value it is set to look for.




Joe R. Lindsay wrote:

You may be right in a perfect world, but well... I don't think
we'll get there this week.
 
I have a 3rd party app that I am dependent on and I'd prefer

to avoid the cost of rmi across multiple Tomcat instances.
 
I don't give up easily so I am going to try to use the Tomcat

manager app and just script the starting and stopping of applications
rather than leave that to the vagaries of Tomcat.  I am sure to find
this imperfect but being an old ops guy, but control feels more
deterministic to me...and I've enough datacenter surprise for this
life.
 
If anyone has tried this and gone down in flames, let me know

or just have sympathy for me ;)
 
 


Joe Lindsay
email: [EMAIL PROTECTED]

 
 
 




From: QM [mailto:[EMAIL PROTECTED]
Sent: Tue 8/16/2005 5:30 PM
To: Tomcat Users List
Subject: Re: webapp loading order...



On Tue, Aug 16, 2005 at 03:23:16PM -0700, Joe R. Lindsay wrote:
: We have two webapps that communicate via jndi and
: we need to have app2 wait for app1 to load before continuing.
: Is there a way to force the order in which the webapps
: are started?

You could run the apps in separate Tomcat instances.  In that case, you
would explicitly define load order: the start script would start app1 in
instance1, then app2 i instance2.

That said, the spec doesn't cover this, as well it shouldn't -- apps should
be fairly self-sufficient such that load order is irrelevant.

-QM

--

software   -- http://www.brandxdev.net/
tech news  -- http://www.RoarNetworX.com/
code scan  -- http://www.JxRef.org/

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








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



--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: Webapp suddenly not available

2005-08-16 Thread Brian Cook
-valuecom.mycompany.myactions.SaveCustomerAction/param-value
  /init-param
  !-- Load this servlet at server startup time --
  load-on-startup5/load-on-startup
/servlet

servlet
  servlet-namegraph/servlet-name
  description
This servlet produces GIF images that are dynamically generated
graphs, based on the input parameters included on the request.
It is generally mapped to a specific request URI like /graph.
  /description
/servlet


!-- Define mappings that are used by the servlet container to
 translate a particular request URI (context-relative) to a
 particular servlet.  The examples below correspond to the
 servlet descriptions above.  Thus, a request URI like:

   http://localhost:8080/{contextpath}/graph

 will be mapped to the graph servlet, while a request like:

   http://localhost:8080/{contextpath}/saveCustomer.do

 will be mapped to the controller servlet.

 You may define any number of servlet mappings, including zero.
 It is also legal to define more than one mapping for the same
 servlet, if you wish to.
--

!-- JSPC servlet mappings start --

servlet
servlet-nameorg.apache.jsp.error_jsp/servlet-name
servlet-classorg.apache.jsp.error_jsp/servlet-class
/servlet

...More servlets here...

servlet-mapping
servlet-nameorg.apache.jsp.error_jsp/servlet-name
url-pattern/error.jsp/url-pattern
/servlet-mapping

...More servlet-mappings here...

!-- JSPC servlet mappings end --

servlet-mapping
  servlet-namecontroller/servlet-name
  url-pattern*.do/url-pattern
/servlet-mapping

servlet-mapping
  servlet-namegraph/servlet-name
  url-pattern/graph/url-pattern
/servlet-mapping


!-- Define the default session timeout for your application,
 in minutes.  From a servlet or JSP page, you can modify
 the timeout for a particular session dynamically by using
 HttpSession.getMaxInactiveInterval(). --

session-config
  session-timeout30/session-timeout!-- 30 minutes --
/session-config


/web-app





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



--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: Webapp suddenly not available

2005-08-16 Thread Brian Cook


I would try removing the context.xml file, if there is one, and 
replace the web.xml with a default one.  Then restart Tomcat.


If you still get the 404 error when calling just JSP pages and there are 
no errors in the catalina.out file then the problem is very likely in 
the syntax of the URL being used.  If this does work then the problem is 
mostlly in the web.xml file.  Possiblly in the context.xml but not 
liklly.



The context.xml file can be found in


Tomcat DirTomcat\conf\Catalina\localhost\Name of deployment dir.xml




Sample of a defulat 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
session-config
session-timeout
30
/session-timeout
/session-config
welcome-file-list
welcome-file
index.jsp
/welcome-file
/welcome-file-list
/web-app



/Sample of a defulat web.xml File


Vsevolod (Simon) Ilyushchenko wrote:



Brian Cook wrote on 08/16/2005 10:36 AM:



WOW that looks like a lot lot of unneeded complication.

I do not know if this is absolutely correct for every situation.  But 
it is my experience that if you are just doing JSP pages you do not 
need the web.xml at all.  It is only needed if you need to call a 
servlet, define a resource like JNDI, or set a context value.


Is the 404 error from Tomcat or Apache?  Do you get the 404 error when 
you try to connect one of the servlets directly?



Brian,

The error is from Tomcat - if I go to port 8080, I also see it. My issue 
is that I can't figure out how to turn debug messages on via log4j - I'm 
sure I'd see something interesting there.


Thanks,
Simon




--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: Out of memory

2005-08-12 Thread Brian Cook


You would probably be better served looking at what you can change in 
the app so it does not require so much RAM.  It has been my experience 
that when I get an out of memory error it is because I was forgetting to 
close an object, or calling too many large objects globally, or reading 
in too much data into a result set.


Of all my web apps only one requires the heap size to be raised to the 
512MB limit.  It loads multiple 1MB - 10MB overlays them on one another 
and then dynamically overlays a lot of font specific anti-aliasing text.


Unless the application is doing similarly demanding you would probably 
be better severed by debugging the app to see what is using so much RAM.


If you are making a development error like say forgetting to close an 
object something everyone on the list has done it is always better to 
learn of errors as early as possible so you do not carry it over to 
other apps.


A lesson I have learned the hard way.


Allistair Crossley wrote:
Oh yes :) 




-Original Message-
From: Wolfgang Hackl [mailto:[EMAIL PROTECTED]
Sent: 12 August 2005 09:24
To: Tomcat Users List
Subject: RE: Out of memory




You can modify the memory settings for the windows service 


also in the

service.bat file itself. I've been known to uninstall the 


service, modify 

the bat file and then service install again. 


Forget about a reinstall. Use regedit and go to 


HKEY_LOCAL_MACHINE\SOFTWARE\Apache software Foundation\Procrun
2.0\yourTomcatServiceName\Parameters\Java 


and edit the JvmMx and JvmMs settings as your deployment requires.

Kind regards
Wolfgang

--
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++

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






FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE 
---

QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---
/FONT


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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: WEB-INF/lib/myjar.jar doesn't contain file xyz...

2005-08-12 Thread Brian Cook


When I get this it is usually either because I miss spelled the library 
I was calling or because the permissions on the jar file are too 
restrictive to allow Tomcat to open it.


i.e. I logged in and transfered the file as root and the tomcat user can 
not read it.  I actually have a script now that I run every time I 
upload new files that changes the owner and group of all the files in 
the webapps dir to the tomcat user and group.



t.n.a. wrote:

Tomcat (5.5) seems reluctant to load a .jar file from the WEB-INF/lib
directory.
Specifically, it seems to load tapestly.jar (as the error is displayed
in a tapestry exception page), but it doesn't seem to want anything to
do with cayenne.jar.
The reported error is that a file in cayenne.jar is missing, which is
plain wrong: when you unzip the .jar, it's there.
Also, I've got another application that also uses cayenne.jar - on the
same tomcat server - and it just works.

Am I missing something here?

Tia,
Tomislav

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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

Re: adding mime-type

2005-08-11 Thread Brian Cook


If you are calling it though a servlet I believe you will still need the 
 set the MIME type in the HttpResponse object with a call like


response.setContentType(text/html);

I am not sure how you would do it for a JSP page.  Unless you just went 
for the inelegant option of


%  response.setContentType(text/html);   %

You would clearly need to replace text/html with the MIME type you set 
up already.



[EMAIL PROTECTED] wrote:

Hello,

I have added a mimetype for the crt-extension to the
$CATALINA_HOME/conf/web.xml-file. I have a file with this extension in the
ROOT-webapp-directory. The ROOT-webapp has no web.xml-file. I also restarted
tomcat. However, when I open the crt-file, it is still presented as a
text-file. Any idea why this is? Am I doing something wrong? Do I need to do
additional steps? I'm using tomcat 5.5.9.

greetings and thanks,

Michel Brabants



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





--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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

[Tomcat] Tomcat fails to give complete HTTP responses

2005-08-10 Thread Brian Cook


I have an instance of Tomcat5.5 running on JDK1.5.3 on RedHat9(Kernal 
2.4).  About every 7 - 10 days Tomcat stops fully responding to HTTP 
requests.


By that I mean Tomcat does seem to give some response to the browsers 
because they(the browsers) do not return an error, and they never time 
out.  It will just sit there with a blank screen waiting for the response.


I originally assumed there must be a loop some where is a servlet that 
was not ever terminating.  How ever when I bring up a process list it 
shows the java thread using 0% - 1% so I am guessing it is not simply an 
out of control loop.


Stopping and then restarting Tomcat resolves the problem for another 7 - 
10 days or so.  Until it happens again.  The catalina.out log does not 
show any errors taking place.  Running top shows that 64MB of RAM 
available, that the processor is 99% idle.  What else should I be 
looking at to track down what I have done wrong?  Has anyone else seen 
symptoms like this?



Details

Tomcat  5.5
JVM:JDK 1.5.3
OS: Linux RedHat9
Kernal: 2.4




--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

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