Atul Singhal

Greenhorn
+ Follow
since Mar 04, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Atul Singhal

I found below link quite useful to understand why strings are immutable and how they behave.

http://www.javaranch.com/journal/200409/Journal200409.jsp
12 years ago
To avoid unpacking war problem, I changed the unpacksWAR attribute value to 'false' and not getting this error any longer.

server.xml excerpts:

<Host name="localhost" appBase="webapps"
unpackWARs="false" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">


Thanks.
12 years ago
Thank a lot Tim. You are always here to help us!!!
12 years ago
Greetings,

May I ask someone here what unpackWARs attribute of host container achieve?
Apart of war file pack/unpack, Is there any performance hit?
Why would someone need to unpack the war file, if everything works fine with packed war file? Any risk with the packed war file?

Any help is highly appreciated.

12 years ago
Thanks Tim for the reply.

I can assure you that neither it is a disk space issue nor war is placed on a network drive. There is enough disk space and war is copied manually inside webapps folder.

Name of the war file is : myapp.war and my server.xml looks like:

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

<Context path="/myapp" docBase="myapp" />
<Context path="" docBase="myapp" />



When I start tomcat, myapp.war file is exploded into ROOT and myapp directory. But sometimes, ROOT directory doesn't get all the .war content. Hence the problem!!!

Can I improvise my <Context path declaration by setting other attributes?
12 years ago
Greetings,

I am running out of an intermittent issue where war file is not completely unpacked and tomcat starts loading of classes/resources. As war file is only partially unpacked, therefore all the resources are not available for loading. In my case, I get ClassNotFoundException while class is there inside war file in WEB-INF/lib location but it was not unpacked. This issue doesn't occur every time but happens only once in a while. In my case, I see following errors in the log files:

catlina.log:

SEVERE: Error listenerStart
May 16, 2012 11:04:41 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors


localhost.log

INFO: Initializing Spring root WebApplicationContext
May 16, 2012 11:04:40 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/quartz/SchedulerException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getDeclaredConstructors(Unknown Source)
at org.springframework.beans.factory.annotation.AutowiredAnnotati


Excerpts of 'server.xml' :


<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

<Context path="/myapp" docBase="myapp" />
<Context path="" docBase="myapp" />


Actually, I want to have two context roots. one is default [/] and another one is [myapp] so that I can access my application either with http://localhost:8080 or http://localhost:8080/myapp.

I observed that in the webapps directory two directories are created at the time of tomcat starts . One is ROOT and another one is myapp. But whenever the problem occurs, ROOT directory doesn't have all the contents of .war file which I think leads to the problem.

Tomcat version: 6.0.35
OS: Redhat 5.4

I don't know why .war file is not unpacked completely. Any help is highly appreciated.
12 years ago
Thanks Tim for the insight!!!

So, basically you are saying, it is fine to expect a bad response for a bad request and there is no security hole.

Actually, I tested the same thing in weblogic server as well where I used http instead of https for the secure connection. But, I noticed weblogic server doesn't respond at all not even with garbage value. So, I was tempted to understand why tomcat is responding for the bad request but not weblogic. I was also keen to understand how weblogic server handles such requests so that no response is sent for the bad request.


12 years ago
Can anyone please suggest here about stopping http request on https port?
12 years ago
Thanks Rob.

You are probably right in your analysis.

Is it possible to redirect this http request to https again for the convenient of the user?

My point is, if by mistake he/she uses http instead of https for the port 7443 , then request should be redirected to https protocol. Possible?
12 years ago
Dear Friends,

I am using Tomcat version 6. In my web application , only SSL port 7443 is being listened.
But, the problem I am facing is:

When I access my web application using URL https://hostname:7443/ ---everything works fine.
But,
When I access my web application using URL http://hostname:7443/ (no https here) . It returns some garbage value.

I am not able to comprehend why it is returng garbage response. Why even it is returning any response for http?

Now, What I am looking for is , if any user , by mistake , use http instead of https, it should redirect to https automatically. Is it possible?

Please note, port should be same in case of redirection as well which is 7443 here.

My server.xml excerpts are like:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<!--
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
<!-- GW UI will run on 7443 for non-VSP environment -->
<Connector port="7443" protocol="HTTP/1.1" SSLEnabled="true"
clientAuth="want" truststoreFile="/tmp/xyz.jks" truststorePass="adfs"
maxThreads="150" minSpareThreads="2" maxSpareThreads="5"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true"
sslProtocol="TLS" keystoreFile="/tmp/cert/acb.jks" keystorePass="dfsdf"
ciphers="SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_C


+++++++++++++++++++++++++++++++++++++++++++++++++

Any help is highly appreciated.
12 years ago