You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Satish Mahankali <sa...@wipro.com> on 2002/03/28 10:47:11 UTC
Problems with concurrent users accessing servlets on Apache1.3.22-Tomcat 4.0
Hi,
I have the following environment setup
Apache 1.3.22, Tomcat 4.0, Connector:WARP, OS: Windows 2000
Our JSP's/Servlets work perfectly fine when a single user is accessing the
same.
For some reason when two or more users access our web site concurrently,
we get wierd results where an Internal Server Error with HTTP 500 - Page
Cannot be displayed is thrown back to the browser. Then I thought the
problem may be because of our servlets but then, put a sleep of 10 sec in
the example servlets of Tomcat4.0 (RequestInfoExample.java) and still
getting the same results with Tomcat example Servlets as well. The whole
setup seems to be behaving like where only one user can use the system at
the same time.
Any help would be highly appreciated.
Here's the configuration:
APACHE: httpd.conf
==================
LoadModule webapp_module modules/mod_webapp.so
AddModule mod_webapp.c
NameVirtualHost ggnnok108220
WebAppConnection conn warp localhost:8008
<VirtualHost ggnnok108220:80>
serverName ggnnok108220
WebAppDeploy examples conn /examples/
</VirtualHost>
SSLMutex sem
SSLRandomSeed startup builtin
SSLSessionCache none
SSLLog logs/SSL.log
SSLLogLevel error
<VirtualHost ggnnok108220:443>
serverName ggnnok108220
#WebAppDeploy IPDC conn /IPDC/
WebAppDeploy examples conn /examples/
SSLEngine On
SSLCertificateFile conf/ssl/test-ipdc.cert
SSLCertificateKeyFile conf/ssl/test-ipdc.key
</VirtualHost>
Tomcat: Server.xml configuration
================================
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Service name="Tomcat-Apache">
<Connector className="org.apache.catalina.connector.warp.WarpConnector"
port="8008" minProcessors="5" maxProcessors="75"
enableLookups="false"
acceptCount="10" debug="0"/>
<!-- Replace "localhost" with what your Apache "ServerName" is set
to -->
<Engine className="org.apache.catalina.connector.warp.WarpEngine"
name="Apache" debug="0" appBase="webapps">
<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="apache_log." suffix=".txt"
timestamp="true"/>
<!-- Because this Realm is here, an instance will be shared
globally -->
<Realm className="org.apache.catalina.realm.MemoryRealm" />
</Engine>
</Service>
</Server>
Regards,
Satish.
jndi resource question
Posted by Daryn Nakhuda <da...@marinated.org>.
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>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<parameter>
<name>driverName</name>
<value>jdbc:mysql://127.0.0.1/dbmail</value>
</parameter>
<parameter>
<name>user</name>
<value>foo</value>
</parameter>
<parameter>
<name>password</name>
<value>bar</value>
</parameter>
</ResourceParams>
<Resource name="jdo/sajdo" auth="Container" type="com.sun.forte4j.persistence.PersistenceM
anagerFactoryImpl"/>
<ResourceParams name="jdo/sajdo">
<parameter>
<name>ConnectionFactoryName</name>
<value>jdbc/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: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>