K. Gil

Ranch Hand
+ Follow
since Apr 29, 2011
K. likes ...
Tomcat Server Java Linux
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by K. Gil

is it local cluster with members on the same machine, or members are hosted on separate boxes?
Is your network interface enabled for multicast?
8 years ago
yes, you can do. You need to add new worker to:

uriworkermap.properties
workers.properties


and then configure/redirect mappings for specified urls/patterns to new worker.
8 years ago
are you running apache on port 8080?
You mentioned that ip:8080 returns "it works!" which is petty much apache things, not tomcat.
Pretty messy here. Can you copy paste your apache configs and tomcat server.xml ?
8 years ago

i follow the instruction by using the C:\apache-tomcat-7.0.40> startup.bat at my cmd and the tomcat appear for 1 seconds and disappear again [...]



What's inside tomcat logs?
8 years ago

className.var cannot be resolved to a type


i copied the hole project from my workspace into /webapps but the result is the same.



This error message means, that the program can't recognize "className.var" as a type.
The cause of the problem can be that you have not imported the package that contains "className.var"
8 years ago

set CATALINA_OPTS=-Xms256m -Xmx1024m



try:
set CATALINA_OPTS="-Xms256m -Xmx1024m"

if that doesn't help, try to increase -Xmx to as much as you can on your machine, and see if it's still failing with OOM. If it does, it's a big chance that your tomcat ignore CATALINA_OPTS from your bat script. How do you starting your tomcat, using bat or running tomcat as service?
8 years ago

then I think there is a chance that you don't have a servlet/JSP container there



or something wrong with apache / tomcat mapping.

If that's shared hosting with cPanel and shared tomcat, then usual case is that mapping is set to *.jsp so that mod_jk or mod_rewrite redirect these requests to tomcat. If that's private tomcat account, then most of hosts redirect 100% requests to tomcat, just exclude whatever you want to be excluded.

Anyway, whatever it is, I would suggest to contact your host, after all it's a problem on their side, and something you pay for (support).
8 years ago
JSP

Anyway the hosting services I contacted are providing tomcat 3,4 which is not suitable with Java 7.



It's really difficult to believe that someone offer tomcat 3 and 4 in 2013...

8 years ago
There's linux and windows version of mod_jk available to download:
http://tomcat.apache.org/download-connectors.cgi

You can also use mod_rewrite on windows, which (I believe) comes with default windows Apache installation.
8 years ago
A default Tomcat installation includes the Manager.
Here is an example URL where you can replace localhost with your website host name: http://localhost/manager/html/

Configuring Manager Application Access:
It would be quite unsafe to ship Tomcat with default settings that allowed anyone on the Internet to execute the Manager application on your server. Therefore, the Manager application is shipped with the requirement that anyone who attempts to use it must authenticate themselves, using a username and password that have one of manager-** roles associated with them (the role name depends on what functionality is required). Further, there is no username in the default users file ($CATALINA_BASE/conf/tomcat-users.xml) that is assigned to those roles. Therefore, access to the Manager application is completely disabled by default.
http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Configuring_Manager_Application_Access

Tomcat Manager is one of default applications, but there's no user with role manager by default in your conf/tomcat-users.xml
8 years ago
well, tomcat is using as much memory as much you will assign to it. What is your configuration for heap size?
8 years ago

[...] Note, however, that Connection pools work best when you obtain a Connection, do everything you can with it quickly, then close the Connection. You should not attempt to hold the same Connection for long periods of time. [...]



+1 from here

usual case is that jdbc connection pool timeout is set to value higher at backend database timeout,
let's say you're using mysql database, with timeout 120 seconds for idle connection, and jdbc is
configured for 180 seconds. In this case it's just meaner of time when you will get problems, because
your jdbc connection pool trying to re-use your connection which is actually closed at the other side already.

you can also configure validationQuery, which will be executed against your database to verify if connection
is still active and in good state, before jdbc connection pool will return that connection to your tomcat apps.
That's the basic JNDI common attribute.

You can do further and use some of tomcat specific JDBC "enhanced attributes" (as long as long you don't
plan to move your app to other servlet container or something bigger like jboss). With tomcat enhanced
attributes you may try to use "validationInterval" which will (kind of) force to do connection validation
every XX seconds instead of every time you're trying to use it. And if you're trying to re-use connection
that was validated already 30 seconds ago, it will not validate it again and assume it is active.

8 years ago

SEVERE: Allocate exception for servlet Myservlet
java.lang.ClassNotFoundException: com.practice.taha.servlet



did you uploaded your jar correctly? tomcat / your application can't find it.
8 years ago
bash/cron script or logrotate. Easy and simple.
8 years ago
any exceptions in tomcat logs? Could be your application is not deployed due to some errors.
8 years ago