Discussion:
Tomcat Java Settings for each webapps, and virtual host strange issue.
Peter
2013-12-26 04:30:57 UTC
Permalink
Hi all, I am having strange issues with tomcat 7 as well as tomcat 8,
following is details of that issue, please someone help me to configure
java for each webapps


# This Java is supported by one webapp "host1"
$ ./java -version
java version "1.7.0_45"
OpenJDK Runtime Environment (rhel-2.4.3.3.el6-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)


# This Java supports another webapp "host2", but does not support above
webapp "host1"
$ ./java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)


This is setenv file in tomcat/bin directory
$ cat setenv.sh
#!/bin/sh

# Webapps1 Java
JAVA_HOME="/usr/local/www/html/TOMCAT_DEMO/tomcat/JAVA_Latest/jdk1.7.0_45"
JRE_HOME="/usr/local/www/html/TOMCAT_DEMO/tomcat/JAVA_Latest/jdk1.7.0_45/jre"


# Webapps2 Java
#JAVA_HOME="/usr/lib/jvm/jre-1.7.0"
#JRE_HOME="/usr/lib/jvm/jre-1.7.0"


export JRE_HOME
export JAVA_HOME

CATALINA_BASE="/usr/local/www/html/TOMCAT_DEMO/tomcat"
export CATALINA_BASE

JAVA_OPTS="-Xmx2048m -Xms512m -server -Djava.awt.headless=true
-Djava.util.prefs.systemRoot=$CATALINA_BASE/content/thredds/javaUtilPrefs"
export JAVA_OPTS


$ ./version.sh
Using CATALINA_BASE: /usr/local/www/html/TOMCAT_DEMO/tomcat
Using CATALINA_HOME: /usr/local/www/html/TOMCAT_DEMO/tomcat
Using CATALINA_TMPDIR: /usr/local/www/html/TOMCAT_DEMO/tomcat/temp
Using JRE_HOME:
/usr/local/www/html/TOMCAT_DEMO/tomcat/JAVA_Latest/jdk1.7.0_45/jre
Using CLASSPATH:
/usr/local/www/html/TOMCAT_DEMO/tomcat/bin/bootstrap.jar:/usr/local/www/html/TOMCAT_DEMO/tomcat/bin/tomcat-juli.jar
Server version: Apache Tomcat/7.0.47
Server built: Oct 18 2013 01:07:38
Server number: 7.0.47.0
OS Name: Linux
OS Version: 2.6.32-431.el6.x86_64
Architecture: amd64
JVM Version: 1.7.0_45-b18
JVM Vendor: Oracle Corporation


$ cat server.xml
<?xml version='1.0' encoding='utf-8'?>

<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener
className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />


<GlobalNamingResources>

<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"

factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>

<Service name="Catalina">

<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443" />

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

<Engine name="Catalina" defaultHost="localhost">

<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm
className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Realm className="org.apache.catalina.realm.MemoryRealm"
digest="SHA" />
</Realm>

<Host name="localhost" appBase="webapps" unpackWARs="true"
autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="/home/user/host_log"
prefix="localhost_access_log." suffix=".txt" pattern="%h %l
%u %t &quot;%r&quot; %s %b" />
</Host>



<!-- =========================================Virtual Host
configuration=========================================================== -->

<!-- Working only with Java version "jre-1.7.0" on centos -->

<Host name="host1" appBase="webapps" unpackWARs="true"
autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="/home/user/host_log"
prefix="host1_access_log."
suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />
<Context path=""
docBase="/usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/host1" debug="0"
reloadable="true"/>
</Host>

<Host name="host2" appBase="webapps" unpackWARs="true"
autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="/home/user/host_log"
prefix="host2_access_log."
suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />
<Context path=""
docBase="/usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/host2" debug="0"
reloadable="true"/>
</Host>

<Host name="host3" appBase="webapps" unpackWARs="true"
autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="/home/user/host_log"
prefix="host3_access_log."
suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />
<Context path=""
docBase="/usr/local/www/html/TOMCAT_DEMO/tomcat/webapps/host3" debug="0"
reloadable="true"/>
</Host>

<!-- =========================================Virtual Host
configuration=========================================================== -->


</Engine>
</Service>
</Server>


Thanks in advance,

Peter
Mark Thomas
2013-12-26 09:12:18 UTC
Permalink
Post by Peter
Hi all, I am having strange issues with tomcat 7 as well as tomcat 8,
following is details of that issue, please someone help me to configure
java for each webapps
You can't do that. You can only have one version of Java per OS process
/ Tomcat instance. If you want different Java versions for different web
applications you need to have separate Tomcat instances.

Marl
Peter
2013-12-26 19:17:48 UTC
Permalink
Thanks *Mark,* Martin Gainty, André Warnier for you time

As some of you suggested I need to have different tomcat for different java
version....


Do you mean if I have 2 webapps, which works on 2 difference java versions
then, do I have to create 2 tomcat folders ? like this

/tomcat7_copy1 --->www.host1.com
bin

setenv.sh ----> java version1 for app1
start.sh
stop.sh

conf
logs
server
webapps ---> app1
work

/tomcat8_copy2 --->www.host2.com
bin

setenv.sh ----> java version2 for app2
start.sh
stop.sh
conf
logs
server
webapps ---> app2
work


if this is what you said, I suspect tomcat will get confused I think,
please guide me how can create 2 hosts ?

for instance I want to do like this, port should be 80

tomcat7_copy1 as www.host1.com
tomcat8_copy2 as www.host2.com

what will be the configuration, I suspect system will be confused with 2
versions of java, may be PID configuration is needed to solve conflict, but
I have no much idea about this tomcat and java.

what will be server.xml ?
what will be setenv.sh ?

what I expect from you people is if I type *www.host1.com
<http://www.host1.com>* on browser I should get *tomcat7 default index
page*, and for *www.host2.com <http://www.host2.com>* I should get *tomcat8
default index page*, both should work simultaneously without any
disturbance like, suppose if I run stop.sh of tomcat7, it should not
disturb tomcat8.

Hope my requirement is clear to all of you.

Please help me.


Thanks in advance.

- Peter
Post by Mark Thomas
Post by Peter
Hi all, I am having strange issues with tomcat 7 as well as tomcat 8,
following is details of that issue, please someone help me to configure
java for each webapps
You can't do that. You can only have one version of Java per OS process
/ Tomcat instance. If you want different Java versions for different web
applications you need to have separate Tomcat instances.
Marl
---------------------------------------------------------------------
David kerber
2013-12-26 19:35:17 UTC
Permalink
Post by Peter
Thanks *Mark,* Martin Gainty, André Warnier for you time
As some of you suggested I need to have different tomcat for different java
version....
Do you mean if I have 2 webapps, which works on 2 difference java versions
then, do I have to create 2 tomcat folders ? like this
Not absolutely necessary, if Tomcat is able to run on both JREs that you
are trying to use. For example, TC7 can run on both JRE6 and JRE7. So
you just need to start separate instances of TC with the appropriate
parameters to the correct JRE.

However, it may be easier to manage if you have separate installations
of TC for the different JRE versions.
Post by Peter
/tomcat7_copy1 --->www.host1.com
bin
setenv.sh ----> java version1 for app1
start.sh
stop.sh
conf
logs
server
webapps ---> app1
work
/tomcat8_copy2 --->www.host2.com
bin
setenv.sh ----> java version2 for app2
start.sh
stop.sh
conf
logs
server
webapps ---> app2
work
if this is what you said, I suspect tomcat will get confused I think,
please guide me how can create 2 hosts ?
for instance I want to do like this, port should be 80
Each instance of Tomcat needs to listen on a unique combination of IP
address:port. So you can't have both TC instances listening on
a.b.c.d:port1; the second one will fail to start in this case. One of
them will need to listen on e.f.g.h:port1, or on a.b.c.d:port2.
Post by Peter
tomcat7_copy1 as www.host1.com
tomcat8_copy2 as www.host2.com
what will be the configuration, I suspect system will be confused with 2
versions of java, may be PID configuration is needed to solve conflict, but
I have no much idea about this tomcat and java.
what will be server.xml ?
what will be setenv.sh ?
what I expect from you people is if I type *www.host1.com
<http://www.host1.com>* on browser I should get *tomcat7 default index
page*, and for *www.host2.com <http://www.host2.com>* I should get *tomcat8
default index page*, both should work simultaneously without any
disturbance like, suppose if I run stop.sh of tomcat7, it should not
disturb tomcat8.
Hope my requirement is clear to all of you.
Your requirements are clear enough (except for the listening
address:port), but you have a fair amount of work ahead of you to get it
to do what you want.
Post by Peter
Please help me.
Thanks in advance.
- Peter
Post by Mark Thomas
Post by Peter
Hi all, I am having strange issues with tomcat 7 as well as tomcat 8,
following is details of that issue, please someone help me to configure
java for each webapps
You can't do that. You can only have one version of Java per OS process
/ Tomcat instance. If you want different Java versions for different web
applications you need to have separate Tomcat instances.
Marl
---------------------------------------------------------------------
André Warnier
2013-12-26 21:33:44 UTC
Permalink
Post by Peter
Thanks *Mark,* Martin Gainty, André Warnier for you time
As some of you suggested I need to have different tomcat for different java
version....
The very first question which you should maybe ask yourself (or the developers of the
webapps), is *why* these webapps require different Java versions. It should not be so.
Peter
2013-12-27 07:49:15 UTC
Permalink
Guys see here is that error message , I am attaching log file also please
help

OS - Centos 6.5 64 bit

HTTP Status 500 - Error instantiating servlet class
gov.noaa.pfel.erddap.Erddap
------------------------------

*type* Exception report

*message* *Error instantiating servlet class gov.noaa.pfel.erddap.Erddap*

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

*exception*

javax.servlet.ServletException: Error instantiating servlet class
gov.noaa.pfel.erddap.Erddap
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)

*root cause*

java.lang.ExceptionInInitializerError
gov.noaa.pfel.erddap.Erddap.<init>(Erddap.java:196)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
java.lang.Class.newInstance(Class.java:374)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)

*root cause*

java.lang.RuntimeException: Ask the ERDDAP administrator to look at
the detailed error message in [bigParentDirectory]/logs/log.txt .
gov.noaa.pfel.erddap.util.EDStatic.<clinit>(EDStatic.java:2322)
gov.noaa.pfel.erddap.Erddap.<init>(Erddap.java:196)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
java.lang.Class.newInstance(Class.java:374)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)


Please help me

Peter
Post by André Warnier
Post by Peter
Thanks *Mark,* Martin Gainty, André Warnier for you time
As some of you suggested I need to have different tomcat for different java
version....
The very first question which you should maybe ask yourself (or the
developers of the webapps), is *why* these webapps require different Java
versions. It should not be so.
---------------------------------------------------------------------
Mark Eggers
2013-12-27 08:01:49 UTC
Permalink
Post by Peter
Guys see here is that error message , I am attaching log file also please
help
OS - Centos 6.5 64 bit
HTTP Status 500 - Error instantiating servlet class
gov.noaa.pfel.erddap.Erddap
------------------------------
*type* Exception report
*message* *Error instantiating servlet class gov.noaa.pfel.erddap.Erddap*
*description* *The server encountered an internal error that prevented it
from fulfilling this request.*
*exception*
javax.servlet.ServletException: Error instantiating servlet class
gov.noaa.pfel.erddap.Erddap
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)
*root cause*
java.lang.ExceptionInInitializerError
gov.noaa.pfel.erddap.Erddap.<init>(Erddap.java:196)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
java.lang.Class.newInstance(Class.java:374)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)
*root cause*
java.lang.RuntimeException: Ask the ERDDAP administrator to look at
the detailed error message in [bigParentDirectory]/logs/log.txt .
gov.noaa.pfel.erddap.util.EDStatic.<clinit>(EDStatic.java:2322)
gov.noaa.pfel.erddap.Erddap.<init>(Erddap.java:196)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:526)
java.lang.Class.newInstance(Class.java:374)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)
Please help me
Peter
Post by André Warnier
Post by Peter
Thanks *Mark,* Martin Gainty, André Warnier for you time
As some of you suggested I need to have different tomcat for different java
version....
The very first question which you should maybe ask yourself (or the
developers of the webapps), is *why* these webapps require different Java
versions. It should not be so.
This looks like an ERDDAP setup problem.

Are you trying to set up:

http://coastwatch.pfeg.noaa.gov/erddap/index.html


If so, did you read / understand / follow :

http://coastwatch.pfeg.noaa.gov/erddap/download/setup.html

It looks like that the application should just work. The documentation
recommends the latest JRE / JDK 7.

/mde/
Peter
2013-12-27 09:12:08 UTC
Permalink
Post by Mark Eggers
Post by Peter
Guys see here is that error message , I am attaching log file also please
help
OS - Centos 6.5 64 bit
HTTP Status 500 - Error instantiating servlet class
gov.noaa.pfel.erddap.Erddap
------------------------------
*type* Exception report
*message* *Error instantiating servlet class gov.noaa.pfel.erddap.Erddap*
*description* *The server encountered an internal error that prevented it
from fulfilling this request.*
*exception*s
http://coastwatch.pfeg.noaa.gov/erddap/index.html
<http://coastwatch.pfeg.noaa.gov/erddap/index.html> If so, did you read /
http://coastwatch.pfeg.noaa.gov/erddap/download/setup.html
<http://coastwatch.pfeg.noaa.gov/erddap/download/setup.html> It looks like
that the application should just work. The documentation recommends the
latest JRE / JDK 7. /mde/*
There is no setup problem
*# ERDDAP works fine with this Java*
java version "1.7.0_45"
OpenJDK Runtime Environment (rhel-2.4.3.3.el6-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)


*# This Java supports almost all webapps of mine, except ERDDAP *
$ ./java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)



- Peter
Post by Mark Eggers
---------------------------------------------------------------------
André Warnier
2013-12-27 09:58:35 UTC
Permalink
Post by Peter
Post by Mark Eggers
Post by Peter
Guys see here is that error message , I am attaching log file also please
help
OS - Centos 6.5 64 bit
HTTP Status 500 - Error instantiating servlet class
gov.noaa.pfel.erddap.Erddap
------------------------------
*type* Exception report
*message* *Error instantiating servlet class gov.noaa.pfel.erddap.Erddap*
*description* *The server encountered an internal error that prevented it
from fulfilling this request.*
*exception*s
http://coastwatch.pfeg.noaa.gov/erddap/index.html
<http://coastwatch.pfeg.noaa.gov/erddap/index.html> If so, did you read /
http://coastwatch.pfeg.noaa.gov/erddap/download/setup.html
<http://coastwatch.pfeg.noaa.gov/erddap/download/setup.html> It looks like
that the application should just work. The documentation recommends the
latest JRE / JDK 7. /mde/*
There is no setup problem
*# ERDDAP works fine with this Java*
java version "1.7.0_45"
OpenJDK Runtime Environment (rhel-2.4.3.3.el6-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
*# This Java supports almost all webapps of mine, except ERDDAP *
$ ./java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
Peter,
one of the main aims/goals/targets of Java, is to provide, on any machine and under any
operating system, a "virtual environment" that allows any application written in Java, to
run anywhere where a Java Virtual Machine is available, without any change in the Java
code of the application.
A secondary aim/goal/target is to insure that any Java application which works under a
given version of the JVM, would continue to work on later versions of that JVM.

These are the aims.

Anyone can write a Java JVM, as long as that JVM satisfies the official description of how
a JVM should work.

Two JVMs that advertise the same "level" /should/ behave in exactly the same way with
respect to running Java applications; but that is the ideal, and in the practice this is
not always 100% true.
No code is perfect, a JVM is a very complex thing, and writing a JVM is not easy. So
different JVMs may exhibit slight differences, and any JVM can have bugs.

In many cases, for Java applications it does not matter, because they rarely use these
little "corners" where the differences between one and the other JVM may influence the way
in which a particular application works.

But sometimes, it can happen that one application works under one JVM, and not under
another. You have obviously encountered such a case.

There are 2 possibilities :
a) either the application (this webapp) does something that it should not really be doing,
if it is supposed to be portable between different JVMs
b) or there is a bug in the JVM under which the application fails

In case (a), you should discuss the issue with whoever wrote that application.
In case (b), you should discuss the issue with whomever wrote the JVM.

But neither in case (a) nor case (b), there is much that the Tomcat developers (or the
people on this list) can do about it.
The Tomcat code itself seems to run fine on both of the JVMs that you are using.
It is with the webapp application that the problem shows up, and nobody here has the code
of that application.

In your case, it seems that when the application fails, in one of the error messages it
points to some application-specific logfile, where presumably the error information is
provided in more details.
Please find that logfile and look at it.
And if you do not find it, then ask the developers of that application what this is all
about. Because with the information which you have provided so far, it does not look as if
Tomcat code is in any way implicated in the problem.
André Warnier
2013-12-27 09:16:25 UTC
Permalink
Post by Peter
Guys see here is that error message , I am attaching log file also please
help
And did you see that :

java.lang.RuntimeException: Ask the ERDDAP administrator to look at
the detailed error message in [bigParentDirectory]/logs/log.txt .

Did you ask him ?
Peter
2013-12-27 09:27:57 UTC
Permalink
there is no log.txt but I can attach catalina logs

Please look into the attachment

All my webapps are working fine with following java downloaded from Oracle
website except ERDDAP



*# ls *.gz -1jdk-7u45-linux-x64.tar.gzjre-7u45-linux-x64.tar.gz*

*# Folders*
jdk1.7.0_45
jre1.7.0_45

Please help me.

Peter
Post by Peter
Post by Peter
Guys see here is that error message , I am attaching log file also please
help
java.lang.RuntimeException: Ask the ERDDAP administrator to look at
the detailed error message in [bigParentDirectory]/logs/log.txt .
Did you ask him ?
---------------------------------------------------------------------
David kerber
2013-12-27 12:17:42 UTC
Permalink
Post by Peter
there is no log.txt but I can attach catalina logs
Please look into the attachment
Attachments don't come through on this list; copy the contents of the
file into your message.
Post by Peter
All my webapps are working fine with following java downloaded from
Oracle website except ERDDAP
*# ls *.gz -1
jdk-7u45-linux-x64.tar.gz
jre-7u45-linux-x64.tar.gz*
*
*
*# Folders*
jdk1.7.0_45
jre1.7.0_45
Please help me.
As Andre and Mark said, we can't help you. You need to contact the
Erddap people about this.
Post by Peter
Peter
Guys see here is that error message , I am attaching log file also please
help
java.lang.RuntimeException: Ask the ERDDAP administrator to look at
the detailed error message in [bigParentDirectory]/logs/log.__txt .
Did you ask him ?
------------------------------__------------------------------__---------
---------------------------------------------------------------------
André Warnier
2013-12-26 13:02:40 UTC
Permalink
Post by Peter
Hi all, I am having strange issues with tomcat 7 as well as tomcat 8,
following is details of that issue, please someone help me to configure
java for each webapps
Thanks for all the detailed information.

But I believe that you have things the wrong way around.
It is not a question of "the webapp (or Tomcat) choosing its Java JVM".

If you look at the way in which Tomcat is being started (script in /etc/init.d or
(tomcat_dir)/bin/startup.sh), you will see that the command being run is "java", followed
by parameters which tell this "java" which Java code modules to run.
(And not the other way around).

From the OS point of view, the process which really runs on your computer is a JVM (Java
Virtual Machine) (./java or whatever). Once you start this particular JVM process, you
tell it to load and run some Java code : in this case, a Tomcat java code module. This
Java code then starts to run (inside the JVM), and it reads its configuration files
(server.xml etc.) to set itself up. This includes which TCP/IP ports it should be
listening on, which Hosts and webapps it should load and configure etc.

You can start and run several (identical or different) JVM's concurrently, as distinct
processes within your OS, and you can tell each one to run a different set of Java code
modules : e.g. another Tomcat instance with different parameters, different Hosts and
different webapps.
(As long as the different instances do not conflict with one another, for example by
trying to use the same TCP/IP ports).
Loading...