apache-tomcat front/backend problems

2005-08-18 Thread Daryn
Hi there

first time mailing to this list so apologies if this is not the place to
ask 
this question. if so, please tell me where to go. (yes, I know. whole
heap of 
dodgy replies to that last sentence. :)

I've recently configured an apache front end with virtual hosting on
port 
8000 to relay to port 8009 etc on tomcat. This set of errors keeps
appearing 
when I try to access the host:8000. Any ideas please anyone?

all and any help appreciated deeply.

thanks v. much

Steve
(errors from apache log follow)

[Thu Aug 18 17:36:57 2005] [notice] channelApr.open(): create tcp socket

135599344
[Thu Aug 18 17:36:57 2005] [error] channelApr.open() attempt to connect
to 
xxx.xxx.xxx.xxx:8009 (tchost) failed 111
[Thu Aug 18 17:36:57 2005] [error] ajp13.connect() failed
ajp13:tchost:8009
[Thu Aug 18 17:36:57 2005] [error] ajp13.service() failed to connect
endpoint 
errno=9 Bad file descriptor
[Thu Aug 18 17:36:57 2005] [error] ajp13.service() Error  forwarding 
ajp13:tchost:8009 1 1
[Thu Aug 18 17:36:57 2005] [notice] ajp13.done() close endpoint 
ajp13:tchost:8009 error_state 1
[Thu Aug 18 17:36:57 2005] [error] mod_jk.handler() Error connecting to 
tomcat 12



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



apache-tomcat front/backend problems

2005-08-18 Thread Daryn
Hi there

first time mailing to this list so apologies if this is not the place to ask 
this question. if so, please tell me where to go. (yes, I know. whole heap of 
dodgy replies to that last sentence. :)

I've recently configured an apache front end with virtual hosting on port 
8000 to relay to port 8009 etc on tomcat. This set of errors keeps appearing 
when I try to access the host:8000. Any ideas please anyone?

all and any help appreciated deeply.

thanks v. much

Steve
(errors from apache log follow)

[Thu Aug 18 17:36:57 2005] [notice] channelApr.open(): create tcp socket 
135599344
[Thu Aug 18 17:36:57 2005] [error] channelApr.open() attempt to connect to 
xxx.xxx.xxx.xxx:8009 (tchost) failed 111
[Thu Aug 18 17:36:57 2005] [error] ajp13.connect() failed ajp13:tchost:8009
[Thu Aug 18 17:36:57 2005] [error] ajp13.service() failed to connect endpoint 
errno=9 Bad file descriptor
[Thu Aug 18 17:36:57 2005] [error] ajp13.service() Error  forwarding 
ajp13:tchost:8009 1 1
[Thu Aug 18 17:36:57 2005] [notice] ajp13.done() close endpoint 
ajp13:tchost:8009 error_state 1
[Thu Aug 18 17:36:57 2005] [error] mod_jk.handler() Error connecting to 
tomcat 12


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



RE: Mysql pooling datasource in tomcat 4

2002-04-16 Thread daryn nakhuda

Excellent, thanks a lot!

I ended up using Protomatter's jdbc pooling (
http://protomatter.sourceforge.net ) and it seems to be doing the trick.



-Original Message-
From: Steven Elliott [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 16, 2002 2:46 AM
To: [EMAIL PROTECTED]
Subject: Re: Mysql pooling datasource in tomcat 4


 original message
 From: Daryn Nakhuda [EMAIL PROTECTED]
 Date: Mon, 15 Apr 2002 11:43:57 -0700 (PDT)
 To: [EMAIL PROTECTED]
 Subject: Mysql pooling datasource in tomcat 4


 Has any one had success creating a pooling datasource for mysql in tomcat
 4?

 I was able to successfully create a functional datasource jdni resource
 based on the instructions in the jndi resources HOW-TO

Unfortunately by using the Tomcat (4.0.x) default JNDI datasource factory
(aka Tyrex) you not only do not have a pool manager interface but you don't
have a pool.  The Tyrex factory only sets up one physical connection and one
pool instance AFAIK.

In order to create a pool you either can use the jakarta-commons DBCP
factory or write your own implementation.  Craig McClanahan recently posted
this DBCP implementation which works with TC 4.0.x.

 Craig's post
 It should be possible to use the DBCP based pool even with Tomcat 4.0.x by
 overriding the default JNDI factory for javax.sql.DataSource objects (I
 haven't tested this, but in theory it should all work).
 This requires the following steps:

 * Download recent nightly builds of the Collections, Pool, and DBCP
 packages from Jakarta Commons
 (http://jakarta.apache.org/builds/jakarta-commons/nightly/) and put
 the JAR files into $CATALINA_HOME/common/lib along with your JDBC
 driver.

 * Configure the factory parameter in the ResourceParams element
 to set the JNDI ObjectFactory class for this resource:

   ResourceParams name=jdbc/EmployeeDB
 parameter
   namefactory/name
   valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 ... other configuration parameters ...
   /ResourceParams

 * Configure the other parameter values of the ResourceParams element
 from the list of supported properties below:
 - driverClassName - Fully qualified Java class name of the JDBC driver
 - maxActive   - Maximum number of active connections at one time
 - maxIdle - Maximum number of idle connections at one time
 (if more are returned to the pool, they will be
 closed to release database resources)
 - maxWait - Number of milliseconds the pool will wait when there
 are no available connections before causing
 getConnection() to throw an exception
 - password- Database password
 - url - Connection URL (also accepts driverName for
 backwards compatibility)
 - user- Database username
 - validationQuery - Optional SQL SELECT statement used to validate a
 connection before returning it to the application
 (must return at least one row).  This is helpful
 in catching stale connections because of timeouts
 or recycling of the database without stopping
 Tomcat.

 Alternatively, you can use any other connection pool you like, if you
 create your own javax.naming.spi.ObjectFactory implementation class (the
 JNDI object factory interface) and registering its name with the factory
 parameter.  Documentation is in the JNDI Specification and the
 corresponding Service Provider Interface document, at:

 http://java.sun.com/products/jndi/docs.html

As I said this implementation works fine for TC 4.0.x. and as Craig mentions
the DBCP BasicDataSourceFactory class is a good model for writing your own
implementation.

HTH

Steven

//*
* VTV Learning Corporation
*Los Angeles  -  Boston  -  Lisbon
*   (http://www.vtvLearning.com/)
*/


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Mysql pooling datasource in tomcat 4

2002-04-15 Thread Daryn Nakhuda


Has any one had success creating a pooling datasource for mysql in tomcat 
4? 

I was able to successfully create a functional datasource jdni resource 
based on the instructions in the jndi resources HOW-TO

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

But there doesn't appear to be any pooling of connections (or my minimum 
poolsize is being ignored).

Should I scrap the resource creation in the server.xml, and just create 
the datasource in my startup servlet's init? 

Should I be explicitly be using the datasource implementation that came 
with the jdbc driver (mm.mysql), such as 
org.gjt.mm.mysql.jdbc2.optional.MysqlConnectionPoolDataSource rather than 
javax.sql.DataSource? 


This seems like a pretty common task, but none of the related messages 
I've found in the archive seem to have an answer..

Thanks.

daryn


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




resource-env-ref

2002-03-29 Thread daryn nakhuda


Following the jdni howto (
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html );
I setup the following in my web.xml, and made sure it's in the right place
according to the dtd, but I still get the following error:

PARSE error at line 121 column 23
org.xml.sax.SAXParseException: Element type res-env-ref-name must be
declared.

What am I doing wrong?


--web.xml--
!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
.
.
/taglib
.
.
  resource-env-ref
res-env-ref-name
  jdo/sajdo
/res-env-ref-name
res-env-ref-type
  com.sun.forte4j.persistence.PersistenceManagerFactoryImpl
/res-env-ref-type
  /resource-env-ref
.
.
resource-ref


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




jndi resource question

2002-03-28 Thread Daryn Nakhuda


I have two different jndi resources I'm trying to setup in tomcat 4. The 
first is a javax.sql.Datasource, the second is a 
com.sun.forte4j.persistence.PersistenceManagerFactoryImpl.

1. The datasource works, but doesn't seem to be pooling. Any clues? what's 
with this tyrex i keep reading about. :)

2. The PersistenceManagerFactoryImpl doesn't work. I get this error:
--
javax.naming.NamingException: Cannot create resource instance
at 
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:167)
at 
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:311)
at org.apache.naming.NamingContext.lookup(NamingContext.java:835)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at 
org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
at javax.naming.InitialContext.lookup(InitialContext.java:354)
--

I don't know if I really need to set this up in jndi, or not, but I was 
also having problems just creating it from the datasource, so I thought 
I'd give it a try. My server.xml, web.xml, and code bits are below.

Thanks,

Daryn



Server.xml
--
Resource name=jdbc/sadb auth=Container type=javax.sql.DataSource/
ResourceParams name=jdbc/sadb
parameter
namedriverClassName/name
valueorg.gjt.mm.mysql.Driver/value
/parameter
parameter
namedriverName/name
valuejdbc:mysql://127.0.0.1/dbmail/value
/parameter
parameter
nameuser/name
valuefoo/value
/parameter
parameter
namepassword/name
valuebar/value
/parameter
/ResourceParams

Resource name=jdo/sajdo auth=Container 
type=com.sun.forte4j.persistence.PersistenceM
anagerFactoryImpl/
ResourceParams name=jdo/sajdo
parameter
nameConnectionFactoryName/name
valuejdbc/sadb/value
/parameter
/ResourceParams

---
web.xml
  resource-ref
res-ref-name
  jdbc/sadb
/res-ref-name
res-type
  javax.sql.DataSource
/res-type
res-auth
  Container
/res-auth
  /resource-ref
  resource-ref
res-ref-name
  jdo/sajdo
/res-ref-name
res-type
  com.sun.forte4j.persistence.PersistenceManagerFactoryImpl
/res-type
res-auth
  Container
/res-auth
  /resource-ref

-

code (servlet that is loaded on startup, this is in init() )
-

InitialContext initialContext = new InitialContext();

ds = (DataSource) initialContext.lookup(java:comp/env/jdbc/sadb);

pmf = (PersistenceManagerFactoryImpl) initialContext.lookup(java:comp/env/jdo/saj
do);


it chokes on the second line. 


I've also tried 

pmf = new PersistenceManagerFactoryImpl();
pmf.setConnectionFactoryName(java:comp/env/jdbc/sadb);

to no avail..




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




SAXParseException on catalina.sh run

2002-03-28 Thread Daryn Nakhuda


I'm getting the following error when I run 'catalina.sh run'. It'll happen 
whether I say /path/to/catalina.sh or ./ or just catalina.sh. another user 
with nearly identical server.xml and web.xml doesn't get the error (the 
only differences between our files are port numbers and user names)

Any ideas?  I'm pretty sure the errors are referring to web.xml, and I can 
make it have other errors, but can't get rid of this one, even though 
someone else w/ the same file won't have a problem..

something in my env??!
 

--error--
Starting service Tomcat-Standalone
Apache Tomcat/4.0.3
PARSE error at line 1 column 1
org.xml.sax.SAXParseException: The markup in the document preceding the 
root element must be well-formed.
PARSE error at line 1 column 1
org.xml.sax.SAXParseException: The markup in the document preceding the 
root element must be well-formed.
PARSE error at line 1 column 1
org.xml.sax.SAXParseException: The markup in the document preceding the 
root element must be well-formed.


Server.xml (first few lines)

!-- Example Server Configuration File --
!-- Note that component elements are nested corresponding to their
 parent-child relationships with each other --

web.xml (first few lines)


!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
http://java.sun.com/j2ee/dtds/web-app_2.2.dtd;

web-app
  servlet






--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: SAXParseException on catalina.sh run

2002-03-28 Thread Daryn Nakhuda


The odd thing is that another tomcat server running on the same box with a 
virtually identical (except port numbers and user names) web.xml file 
doesn't complain at all. That's why I was wondering if it was something in 
my environment screwing it up?

my first six lines (exactly):
---
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
http://java.sun.com/j2ee/dtds/web-app_2.2.dtd;

web-app
--

I've tried it both with and without the ?xml line since the other guy's 
works without it.. any other ideas? can I turn up the debugging?



On Thu, 28 Mar 2002, Jeff Larsen wrote:

 The XML parser in Tomcat 4.0.3 requires STRICT adherence
 to XML standards.  I struggled for a while myself before
 I discovered that XML sub-elements must appear in the SAME ORDER
 as they are listed in the DTD. That was news to me, because I
 had never seen a parser that required it.
 
 So...  make sure your XML is absolutely correct.  Your parse error
 is coming at line 1 column 1 so make sure your web.xml starts with
 ?xml version=1.0 encoding=ISO-8859-1? and then make sure
 your !DOCTYPE tag is is exactly right. One wrong letter will
 screw it up. Note that server.xml does not need the opening ?xml 
 or !DOCTYPE tags, but web.xml does.
 
 
 - Original Message - 
 From: Daryn Nakhuda [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, March 28, 2002 4:07 AM
 Subject: SAXParseException on catalina.sh run
 
 
  
  I'm getting the following error when I run 'catalina.sh run'. It'll happen 
  whether I say /path/to/catalina.sh or ./ or just catalina.sh. another user 
  with nearly identical server.xml and web.xml doesn't get the error (the 
  only differences between our files are port numbers and user names)
  
  Any ideas?  I'm pretty sure the errors are referring to web.xml, and I can 
  make it have other errors, but can't get rid of this one, even though 
  someone else w/ the same file won't have a problem..
  
  something in my env??!
   
  
  --error--
  Starting service Tomcat-Standalone
  Apache Tomcat/4.0.3
  PARSE error at line 1 column 1
  org.xml.sax.SAXParseException: The markup in the document preceding the 
  root element must be well-formed.
  PARSE error at line 1 column 1
  org.xml.sax.SAXParseException: The markup in the document preceding the 
  root element must be well-formed.
  PARSE error at line 1 column 1
  org.xml.sax.SAXParseException: The markup in the document preceding the 
  root element must be well-formed.
  
  
  Server.xml (first few lines)
  
  !-- Example Server Configuration File --
  !-- Note that component elements are nested corresponding to their
   parent-child relationships with each other --
  
  web.xml (first few lines)
  
  
  !DOCTYPE web-app
  PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
  http://java.sun.com/j2ee/dtds/web-app_2.2.dtd;
  
  web-app
servlet
  
  
  
  
  
  
  --
  To unsubscribe:   mailto:[EMAIL PROTECTED]
  For additional commands: mailto:[EMAIL PROTECTED]
  Troubles with the list: mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 

-- 



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]