Re: Tomcat 9.0.36 - JDK 13/14

2020-06-29 Thread Kiran Badi
inished in [45] ms
29-Jun-2020 20:19:37.322 INFO [main]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
application directory [C:\Program Files\Apache Software
Foundation\apache-tomcat-9.0.36\webapps\ROOT]
29-Jun-2020 20:19:37.353 INFO [main]
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web
application directory [C:\Program Files\Apache Software
Foundation\apache-tomcat-9.0.36\webapps\ROOT] has finished in [31] ms
29-Jun-2020 20:19:37.356 INFO [main]
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
["http-nio-8080"]
29-Jun-2020 20:19:37.363 INFO [main]
org.apache.catalina.startup.Catalina.start Server startup in [12,032]
milliseconds

springwar-1.0.1-SNAPSHOT is build with JDK 14.01 and its demo war just to
troubleshoot this issue. POM for it as below.


http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
4.0.0

org.springframework.boot
spring-boot-starter-parent
2.3.1.RELEASE
 

com.kiran
springwar
1.0.2-SNAPSHOT
war
springwar
Sample project to deploy war to tomcat


14




org.springframework.boot
spring-boot-starter-web



org.springframework.boot
spring-boot-starter-tomcat
provided


org.springframework.boot
spring-boot-starter-test
test


org.junit.vintage
junit-vintage-engine








org.springframework.boot
spring-boot-maven-plugin






Sample test cases are as below.


public class Greeting {

private final long id;
private final String content;

public Greeting(long id, String content) {
this.id = id;
this.content = content;
}

public long getId() {
return id;
}

public String getContent() {
return content;
}
}

import java.util.concurrent.atomic.AtomicLong;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

private static final String template = "Hello, %s!";
private final AtomicLong counter = new AtomicLong();

@GetMapping("/greeting")
public Greeting greeting(@RequestParam(value = "name", defaultValue =
"World") String name) {
return new Greeting(counter.incrementAndGet(), String.format(template,
name));
}
}


import org.springframework.boot.builder.SpringApplicationBuilder;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

public class ServletInitializer extends SpringBootServletInitializer {

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder
application) {
return application.sources(SpringwarApplication.class);
}

}


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SpringwarApplication {

public static void main(String[] args) {
SpringApplication.run(SpringwarApplication.class, args);
}

}





On Mon, Jun 29, 2020 at 4:57 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 6/26/20 22:01, Kiran Badi wrote:
> > we fixed the issue Mark.
> >
> > Actually tomcat was running on JDK 1.8 and applications were built
> > using JDK 13/14.So when they were deployed to tomcat running with
> > 1.8, they were giving 404.
> >
> > Now plan is to explore and upgrade tomcat to at least jdk 13.
> >
> > It would have been nice really to have at least some error saying
> > major.minor version exception or something like that in some logs
> > somewhere which java often throws in these cases.
> >
> > Any ways we are good to go now. Thanks for your reply.
>
> My experience is that mismatched .class file versions do just that:
> they result in errors being logged to stdout / catalina.out.
>
> Perhaps you have a logging configuration which disables that?
>
> - -chris
>
> > On Fri, Jun 26, 2020 at 6:34 AM Mark Thomas 
> > wrote:
> >
> >> On 26/06/2020 05:45, Kiran Badi wrote:
> >>> Hi All,
> >>>
> >>> I wanted to check if tomcat 9.0.36 supports open jdk 13/14.
> >>
> >> Supported Java versions are listed at:
> >> http://tomcat.apache.org/whichversion.html
> >>
> >> "Java 8 and later" includes Java 13 and Java 14.
> >>
> >>> I created a simple spring boot war file and compiled/built it
> >>> with
> >> openjdk
> >>> 13/14. After running maven install , I deployed the war file
> >>> from the target directory to tomcat webapps using tomcat
> >>> manager. It did not work and gave me 404 messages with bo

Re: Tomcat 9.0.36 - JDK 13/14

2020-06-26 Thread Kiran Badi
we fixed the issue Mark.

Actually tomcat was running on JDK 1.8 and applications were built using
JDK 13/14.So when they were deployed to tomcat running with 1.8, they were
giving 404.

Now plan is to explore and upgrade tomcat to at least jdk 13.

It would have been nice really to have at least some error saying major.minor
version exception or something like that in some logs somewhere which java
often throws in these cases.

Any ways we are good to go now. Thanks for your reply.



On Fri, Jun 26, 2020 at 6:34 AM Mark Thomas  wrote:

> On 26/06/2020 05:45, Kiran Badi wrote:
> > Hi All,
> >
> > I wanted to check if tomcat 9.0.36 supports open jdk 13/14.
>
> Supported Java versions are listed at:
> http://tomcat.apache.org/whichversion.html
>
> "Java 8 and later" includes Java 13 and Java 14.
>
> > I created a simple spring boot war file and compiled/built it with
> openjdk
> > 13/14. After running maven install , I deployed the war file from the
> > target directory to tomcat webapps using tomcat manager. It did not work
> > and gave me 404 messages with both 13/14. No error or any exception
> > anywhere in logs.Catalina log just says a war file is deployed.
>
> That is normally indicative of a configuration error.
>
> > Then i compiled the same spring boot app with jdk 8 and deployed it with
> > tomcat and it works fine. I am able to call my endpoints with no issues.
> >
> > I am having a hard time deploying angular/spring boot and building war
> file
> > and deploying it on tomcat 9.0x with openjdk 13. So I thought this might
> be
> > a good place to start with.
>
> If you can provide the code you use to create the sample, e.g. as a
> GitHub project somebody may be able to take a look.
>
> Mark
>
> >
> > I used the below pom file.
> >
> > 
> > http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
> > http://www.w3.org/2001/XMLSchema-instance";
> > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> > https://maven.apache.org/xsd/maven-4.0.0.xsd";>
> > 4.0.0
> > 
> > org.springframework.boot
> > spring-boot-starter-parent
> > 2.3.1.RELEASE
> >  
> > 
> > com.kiran
> > springwar
> > 1.0.2-SNAPSHOT
> > war
> > springwar
> > Sample project to deploy war to tomcat
> >
> > 
> > 14
> > 
> >
> > 
> > 
> > org.springframework.boot
> > spring-boot-starter-web
> > 
> >
> > 
> > org.springframework.boot
> > spring-boot-starter-tomcat
> > provided
> > 
> > 
> > org.springframework.boot
> > spring-boot-starter-test
> > test
> > 
> > 
> > org.junit.vintage
> > junit-vintage-engine
> > 
> > 
> > 
> > 
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Tomcat 9.0.36 - JDK 13/14

2020-06-25 Thread Kiran Badi
Hi All,

I wanted to check if tomcat 9.0.36 supports open jdk 13/14.

I created a simple spring boot war file and compiled/built it with openjdk
13/14. After running maven install , I deployed the war file from the
target directory to tomcat webapps using tomcat manager. It did not work
and gave me 404 messages with both 13/14. No error or any exception
anywhere in logs.Catalina log just says a war file is deployed.

Then i compiled the same spring boot app with jdk 8 and deployed it with
tomcat and it works fine. I am able to call my endpoints with no issues.

I am having a hard time deploying angular/spring boot and building war file
and deploying it on tomcat 9.0x with openjdk 13. So I thought this might be
a good place to start with.

I used the below pom file.


http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
4.0.0

org.springframework.boot
spring-boot-starter-parent
2.3.1.RELEASE
 

com.kiran
springwar
1.0.2-SNAPSHOT
war
springwar
Sample project to deploy war to tomcat


14




org.springframework.boot
spring-boot-starter-web



org.springframework.boot
spring-boot-starter-tomcat
provided


org.springframework.boot
spring-boot-starter-test
test


org.junit.vintage
junit-vintage-engine






Re: Amazon EC2 Tomcat 7.0.85 not starting up due to some memory issue .Please mask if

2018-05-17 Thread Kiran Badi
Thanks Jakel for the link and thanks Shawn for reply and some insights.

I did scan some of my application logs and can see some kind of XSS attacks
originating from china/Russia .Most of them were targeted to the database.
Tried to reproduce many of them , they don't yield anything.

I have not yet figured as how they have gained entry to the system.I will
spend some time this weekend to patch the things up and see if I can
investigate this further.



On Thu, May 17, 2018 at 3:11 AM, Jäkel, Guido  wrote:

> Dear Kiran,
>
> there might be many other ways to compromise your server. But I wonder
> about the application you run on you Tomcat and if you know about the
> wide-used exploit in the Java JSF library "Primefaces" (see
> https://www.exploit-db.com/exploits/43733/).
>
> With greetings
>
> Guido
>
> >-Original Message-
> >From: Kiran Badi [mailto:ki...@poonam.org]
> >Sent: Wednesday, May 16, 2018 7:13 PM
> >To: Tomcat Users List 
> >Subject: Re: Amazon EC2 Tomcat 7.0.85 not starting up due to some memory
> issue .Please mask if
> >
> >Yes tomcat is not starting up. I am also suspecting that EC2 instance was
> >probably compromised. Not sure as how but I see some rogue programs were
> >running under tomcat user. I use putty with private keys to login and
> those
> >keys are not in public view for sure.
> >
>


Re: Amazon EC2 Tomcat 7.0.85 not starting up due to some memory issue .Please mask if

2018-05-16 Thread Kiran Badi
Yes tomcat is not starting up. I am also suspecting that EC2 instance was
probably compromised. Not sure as how but I see some rogue programs were
running under tomcat user. I use putty with private keys to login and those
keys are not in public view for sure.

These program were talking to some servers based out of China,Russia and
Germany with tcp,http and stratrum-tcp protocol with jsonp as data exchange
formt. I am not sure as how they got access to my ec2 instance and got
themselves installed.

I did some initial analysis on this one and have put those files in my g
drive which I have made public. I suspect either they have used tomcat to
gain access or they might have used yum updates for getting access to ec2
instance.


cronjobs.txt contains information that some programs were running with
tomcat user id.

hs_err_pid23773.log contains pid  details for tomcat event.

jwzckuz.cf  is probably some config file installed by hacker.

rciwd - was actual program which was consuming too much of swap and cpu and
was running as cron job. Not sure as what this is.

script.txt is actual script I extracted from one of the http request by
capturing traffic via wireshark.

files with names 0515 are tcpdump capture on the server taken while
unauthorised programs were running.

172-xx-68-244  is my ec2 instance and 98.122.xx.xx is my ip in the trace.

https://drive.google.com/drive/folders/1K5gfXTEvmuoIynCYtlwmf7DknyGkvhMI?usp=sharing

appreciate if someone from tomcat team take a look at all the files I have
attached in the drive.

Please let me know if more information is needed.













On Wed, May 16, 2018 at 11:09 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 5/15/18 5:58 PM, Kiran Badi wrote:
> > For some reason my application hosted on ec2 is just not starting
> > up. I know I never had any memory issues in last 1 year or so.
> >
> > I see below trace in catalina.out file. I am not sure if I need to
> > add swap space or file permission is an issue here. Something
> > changed in ec2 that is causing this error.I think they auto updated
> > the tomcat version as well from 7.0.82 to 7.0.85.
> >
> > I seriously need some suggestions. I also need some suggestion as
> > how to prevent bots from trying to access manager app.
> >
> > May 14, 2018 8:44:46 PM org.apache.catalina.realm.LockOutRealm
> > filterLockedAccounts WARNING: An attempt was made to authenticate
> > the locked user "admin"
>
> It sure looks like Tomcat has started, since it is processing
> requests. Are you sure it's not starting?
>
> > java.util.logging.ErrorManager: 4 java.io.FileNotFoundException:
> > /usr/share/tomcat7/logs/catalina.2018-05-15.log (Permission
> > denied) at java.io.FileOutputStream.open0(Native Method)
>
> Obviously this is not memory-related. Did you intend to report this as
> a part of your problem?
> > Java HotSpot(TM) 64-Bit Server VM warning: INFO:
> > os::commit_memory(0x7f48f29d, 65536, 1) failed;
> > error='Cannot allocate memory' (errno=12) # # There is insufficient
> > memory for the Java Runtime Environment to continue. # Native
> > memory allocation (mmap) failed to map 65536 bytes for committing
> > reserved memory. # An error report file with more information is
> > saved as: # /usr/share/tomcat7/hs_err_pid23773.log # # Compiler
> > replay data is saved as:
> >
>
> The Java stack trace might be helpful, as would the native stack trace.
>
> What are your memory-related JVM launch parameters? What JVM are you
> using (version, architecture)?
>
> Odd that allocating 64kib should fail...
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlr8Sa0ACgkQHPApP6U8
> pFiBZg/+JmjmrlDUZuzoleg1ypwrxM51NSCCUPxLCxy/tI2UZF2MgRUwDZU3tdXX
> iHJsfwZ83bCt8m9eFBVy/4jWUQNjlDK+ahDBTOeqJvDkaNtdYLiLRBMqegtXF9JT
> cyt2nQdsetKx+rsI5HGytXBX6OuzJCSAw+bVHzzq2KFiOe4gnyqItsLg8TyXM+50
> giB0WlIBldyqj+kD9S8hRwqTTIXkAg4H+tI8+piBKKAojfLpuZB3qGhXhTncEMBA
> LL8Udbrz08vU3gXMg5U07pUHc/Vkn8U1axgcn4U3lQ0flKHRkBeabp/wVZ6a1Cuj
> a918715HRqZPezqEYoEYJjyUHV13c07T1nKFcLfR97VhFx1WjuTEGuHFriYjsPXN
> Qo0J6ej4+z0JItQVJ3w3qxijU9Vt0kEJq53raeclqNgdxhaVvLDDrPOxwZWvT9vz
> 1FiIyylRTNlC0tEAV3osQ9MFhf4eUgLGPGbEN69U+pEJ4Y2WgTlioKsueVDZcNrs
> czS6x0sR1Rd1waYQbnIXNpzIngQNAsnrw9cX73FSTmRVT3VGNdtlIFYzQ9aIl3UX
> 3cuLlqyumLySIV6BjORu6TgqGefSw+KYOJagTWo6IuExzLeU1vYs4V/ZVGt5qHQO
> kKLJmRaQozQ4u+ajMR9Lp5ESsLtjs+TPWy5tu4cQr6SE9PzL1fo=
> =Bm4c
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Amazon EC2 Tomcat 7.0.85 not starting up due to some memory issue

2018-05-15 Thread Kiran Badi
Hi All,

For some reason my application hosted on ec2 is just not starting up. I
know I never had any memory issues in last 1 year or so.

I see below trace in catalina.out file. I am not sure if I need to add swap
space or file permission is an issue here. Something changed in ec2 that is
causing this error.I think they auto updated the tomcat version as well
from 7.0.82 to 7.0.85.

I seriously need some suggestions. I also need some suggestion as how to
prevent bots from trying to access manager app.

May 14, 2018 8:44:46 PM org.apache.catalina.realm.LockOutRealm
filterLockedAccounts
WARNING: An attempt was made to authenticate the locked user "admin"
May 14, 2018 8:44:46 PM org.apache.catalina.realm.LockOutRealm
filterLockedAccounts
WARNING: An attempt was made to authenticate the locked user "admin"
May 14, 2018 8:44:47 PM org.apache.catalina.realm.LockOutRealm
filterLockedAccounts
WARNING: An attempt was made to authenticate the locked user "admin"
May 14, 2018 8:44:47 PM org.apache.catalina.realm.LockOutRealm
filterLockedAccounts
WARNING: An attempt was made to authenticate the locked user "admin"
May 14, 2018 8:44:47 PM org.apache.catalina.realm.LockOutRealm
filterLockedAccounts
WARNING: An attempt was made to authenticate the locked user "admin"
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException:
/usr/share/tomcat7/logs/catalina.2018-05-15.log (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at org.apache.juli.FileHandler.openWriter(FileHandler.java:498)
at org.apache.juli.FileHandler.publish(FileHandler.java:272)
at java.util.logging.Logger.log(Logger.java:738)
at java.util.logging.Logger.doLog(Logger.java:765)
at java.util.logging.Logger.logp(Logger.java:1042)
at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:185)
at org.apache.juli.logging.DirectJDKLog.error(DirectJDKLog.java:151)
at
org.apache.catalina.valves.AccessLogValve.open(AccessLogValve.java:1220)
at
org.apache.catalina.valves.AccessLogValve.rotate(AccessLogValve.java:1015)
at
org.apache.catalina.valves.AccessLogValve.log(AccessLogValve.java:1155)
at
org.apache.catalina.valves.AccessLogValve.log(AccessLogValve.java:991)
at
org.apache.catalina.core.AccessLogAdapter.log(AccessLogAdapter.java:51)
at
org.apache.catalina.core.ContainerBase.logAccess(ContainerBase.java:1386)
at
org.apache.catalina.core.ContainerBase.logAccess(ContainerBase.java:1393)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:490)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
May 15, 2018 12:15:03 AM org.apache.catalina.valves.AccessLogValve open
SEVERE: Failed to open access log file
[/usr/share/tomcat7/logs/localhost_access_log.2018-05-15.txt]
java.io.FileNotFoundException:
/usr/share/tomcat7/logs/localhost_access_log.2018-05-15.txt (Permission
denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at
org.apache.catalina.valves.AccessLogValve.open(AccessLogValve.java:1212)
at
org.apache.catalina.valves.AccessLogValve.rotate(AccessLogValve.java:1015)
at
org.apache.catalina.valves.AccessLogValve.log(AccessLogValve.java:1155)
at
org.apache.catalina.valves.AccessLogValve.log(AccessLogValve.java:991)
at
org.apache.catalina.core.AccessLogAdapter.log(AccessLogAdapter.java:51)
at
org.apache.catalina.core.ContainerBase.logAccess(ContainerBase.java:1386)
at
org.apache.catalina.core.ContainerBase.logAccess(ContainerBase.java:1393)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:490)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

Java HotSpot(TM) 64-Bit Serve

Re: Tomcat 7.082 not starting in EC2 after doing yum update

2017-10-26 Thread Kiran Badi
Ok this is resolved. It was permission issue. now tomcat runs under its own
user id and for some reason I missed to read tomcat.conf file.

Now it works however server start up is now very slow.

INFO: Server startup in 352544 ms

something which was very fast in earlier version 7.081  and 7.050

Let me check logs tomorrow for finer details.

Thanking you
Kiran Badi


I will

On Thu, Oct 26, 2017 at 11:03 PM, Kiran Badi  wrote:

> Hi,
>
> Couple of hours(3 hrs) back I did yum update to install 7.0.82 version to
> install latest security patch.
>
> Yum update went well. Then tried to install ROOT war, after stopping and
> un deploying existing ROOT.war. Deployment failed saying that ROOT folder
> already exists. So deleted ROOT folder and ROOT.war from the web apps
> folder. After this step, tomcat 7 seems to be not starting for some reason
> and neither its writing to logs anything.
>
>  I think I messed something very badly.
>
> How do I figure this out. Do I need to do clean install again via wget ?
>
> I hate to say that my linux skills are very rusty. so appreciate some help.
>
> [root]# sudo service tomcat7 start
> [root]#  [  OK  ]
> [root]# sudo service tomcat7 status
> [root]# s not running[WARNING]
>
> whenever I try to restart , the only place it writes is tomcat7-initd.log
>
> /usr/sbin/tomcat7: line 40: /usr/share/tomcat7/logs/catalina.out:
> Permission denied
>
> and permissions I have on this folder is
>
> drwxr-xr-x 2 ec2-user ec2-user 12288 Oct 27 02:07 /usr/share/tomcat7/logs/
>
>
>
> Thanking you
> Kiran Badi
>
>
>
>
>
>
>
>
>


Tomcat 7.082 not starting in EC2 after doing yum update

2017-10-26 Thread Kiran Badi
Hi,

Couple of hours(3 hrs) back I did yum update to install 7.0.82 version to
install latest security patch.

Yum update went well. Then tried to install ROOT war, after stopping and un
deploying existing ROOT.war. Deployment failed saying that ROOT folder
already exists. So deleted ROOT folder and ROOT.war from the web apps
folder. After this step, tomcat 7 seems to be not starting for some reason
and neither its writing to logs anything.

 I think I messed something very badly.

How do I figure this out. Do I need to do clean install again via wget ?

I hate to say that my linux skills are very rusty. so appreciate some help.

[root]# sudo service tomcat7 start
[root]#  [  OK  ]
[root]# sudo service tomcat7 status
[root]# s not running[WARNING]

whenever I try to restart , the only place it writes is tomcat7-initd.log

/usr/sbin/tomcat7: line 40: /usr/share/tomcat7/logs/catalina.out:
Permission denied

and permissions I have on this folder is

drwxr-xr-x 2 ec2-user ec2-user 12288 Oct 27 02:07 /usr/share/tomcat7/logs/



Thanking you
Kiran Badi


Re: Context Dependency Injection with Tomcat 7.0 x / 8.0 x

2016-10-10 Thread Kiran Badi
Thanks Mark,Christoper, Andreas and Chris for reply. Please accept
apologies for delayed response.

Tomee is an option but I need to see if client is ok with it. They are very
much in Tomcat and has most application deployed with Tomcat.

Chris,I would be happy to go with Spring, however the client I have has few
legacy projects and I need  to see if I can suggest them spring.

Weld and openbeans seems to be good option I can explore.Thanks



On Thu, Oct 6, 2016 at 6:02 AM, Mark Eggers 
wrote:

> Kiran,
>
> On 10/5/2016 5:15 PM, Kiran Badi wrote:
> > Hi All,
> >
> > I wanted to check if their is a way to do CDI with Tomcat for 7x and 8x
> > version as per JEE spec ?
> >
> > I have a project for which I wanted to use CDI the way spring does it.
> >
> > Appreciate if someone can suggest something.
> >
> >
> > - Kiran
> >
>
> Probably the easiest way to do this is to use TomEE:
>
> http://tomee.apache.org/
>
> . . . just my two cents
> /mde/
>
>


Context Dependency Injection with Tomcat 7.0 x / 8.0 x

2016-10-05 Thread Kiran Badi
Hi All,

I wanted to check if their is a way to do CDI with Tomcat for 7x and 8x
version as per JEE spec ?

I have a project for which I wanted to use CDI the way spring does it.

Appreciate if someone can suggest something.


- Kiran


Re: request.getParameter and special characters - Apache Tomcat/7.0.57 on win 7

2016-05-18 Thread Kiran Badi
Thanks Mark. Those links were very helpful and saved a lot of my time. I
had good learning :)

For few of the character which I was aware, I think I can go via C URL tag.
But I have see as what other special characters I might have. Its coming
from third party and I do not control it and I am using those as parameter
for the link.

 Testing





">CURLTEST

C URL seems to do pretty good job at encoding parameters.

Servlet TestServlet for param2 testing !@#$%^&*()_-+=~`<>?/"' testing1

On Wed, May 18, 2016 at 3:38 AM, Mark Thomas  wrote:

> On 18/05/2016 04:25, Kiran Badi wrote:
> > Hi ,
> >
> > I have this link in jsp which has below tags,
> >
> > <%@page contentType="text/html" pageEncoding="UTF-8"%>
> >
> >  Testing
> >
> > and then my servlet looks like below,
> >
> > /*
> >  * To change this license header, choose License Headers in Project
> > Properties.
> >  * To change this template file, choose Tools | Templates
> >  * and open the template in the editor.
> >  */
> > package controller;
> >
> > import java.io.IOException;
> > import java.io.PrintWriter;
> > import javax.servlet.ServletException;
> > import javax.servlet.annotation.WebServlet;
> > import javax.servlet.http.HttpServlet;
> > import javax.servlet.http.HttpServletRequest;
> > import javax.servlet.http.HttpServletResponse;
> >
> > /**
> >  *
> >  * @author Kiran
> >  */
> > @WebServlet(name = "TestServlet", urlPatterns = {"/TestServlet"})
> > public class TestServlet extends HttpServlet {
> >
> > /**
> >  * Processes requests for both HTTP GET and
> > POST
> >  * methods.
> >  *
> >  * @param request servlet request
> >  * @param response servlet response
> >  * @throws ServletException if a servlet-specific error occurs
> >  * @throws IOException if an I/O error occurs
> >  */
> > protected void processRequest(HttpServletRequest request,
> > HttpServletResponse response)
> > throws ServletException, IOException {
> > response.setContentType("text/html;charset=UTF-8");
> > try (PrintWriter out = response.getWriter()) {
> > /* TODO output your page here. You may use following sample
> > code. */
> > String param = request.getParameter("teststring");
> > String param1 = new
> > String(request.getParameter("teststring").getBytes("UTF-8"));
> > out.println("");
> > out.println("");
> > out.println("");
> > out.println("Servlet TestServlet");
> > out.println("");
> > out.println("");
> > out.println("Servlet TestServlet at " +
> > request.getContextPath() + "");
> > out.println("Servlet TestServlet at " + param + "");
> > out.println("Servlet TestServlet at " + param1 +
> "");
> > out.println("");
> > out.println("");
> > }
> > }
> >
> > // 
> > /**
> >  * Handles the HTTP GET method.
> >  *
> >  * @param request servlet request
> >  * @param response servlet response
> >  * @throws ServletException if a servlet-specific error occurs
> >  * @throws IOException if an I/O error occurs
> >  */
> > @Override
> > protected void doGet(HttpServletRequest request, HttpServletResponse
> > response)
> > throws ServletException, IOException {
> > processRequest(request, response);
> > }
> >
> > /**
> >  * Handles the HTTP POST method.
> >  *
> >  * @param request servlet request
> >  * @param response servlet response
> >  * @throws ServletException if a servlet-specific error occurs
> >  * @throws IOException if an I/O error occurs
> >  */
> > @Override
> > protected void doPost(HttpServletRequest request, HttpServletResponse
> > response)
> > throws ServletException, IOException {
> > processRequest(request, response);
> > }
> >
> >}
> >
> > and getParameter for some reason seems to truncating the value after &
> >
> > Servlet TestServlet at testingServlet TestServlet at testing
> >
> > I really need to understand as what characters are accepted and what
> > characters get truncated with getParameter.
> >
> > I am building few links on the fly which might have space,backslashes,
> > comma and & characters in it.So wanted to understand should I encode it
> via
> > js or container can take care of those for me.
>
> https://tools.ietf.org/html/rfc3986
> https://www.w3.org/TR/REC-html40/interact/forms.html#form-data-set
>
> Keep in mind that there are multiple levels of encoding here. You may
> need to encode some characters for use in a JSP as well.
>
> Mark
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


request.getParameter and special characters - Apache Tomcat/7.0.57 on win 7

2016-05-17 Thread Kiran Badi
Hi ,

I have this link in jsp which has below tags,

<%@page contentType="text/html" pageEncoding="UTF-8"%>

 Testing

and then my servlet looks like below,

/*
 * To change this license header, choose License Headers in Project
Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Kiran
 */
@WebServlet(name = "TestServlet", urlPatterns = {"/TestServlet"})
public class TestServlet extends HttpServlet {

/**
 * Processes requests for both HTTP GET and
POST
 * methods.
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample
code. */
String param = request.getParameter("teststring");
String param1 = new
String(request.getParameter("teststring").getBytes("UTF-8"));
out.println("");
out.println("");
out.println("");
out.println("Servlet TestServlet");
out.println("");
out.println("");
out.println("Servlet TestServlet at " +
request.getContextPath() + "");
out.println("Servlet TestServlet at " + param + "");
out.println("Servlet TestServlet at " + param1 + "");
out.println("");
out.println("");
}
}

// 
/**
 * Handles the HTTP GET method.
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
processRequest(request, response);
}

/**
 * Handles the HTTP POST method.
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
processRequest(request, response);
}

   }

and getParameter for some reason seems to truncating the value after &

Servlet TestServlet at testingServlet TestServlet at testing

I really need to understand as what characters are accepted and what
characters get truncated with getParameter.

I am building few links on the fly which might have space,backslashes,
comma and & characters in it.So wanted to understand should I encode it via
js or container can take care of those for me.

container connector setting has URIEncoding="UTF-8" settings.

Thanking you
Kiran Badi


Re: Tuckey Rewrite URL and infinite loop exception trace for Tomcat 7.0.57

2016-04-25 Thread Kiran Badi
I resolved it.My bad, to and from rule were having same url mapping and I
feel thats the reason it filter was recursively called and finally
resulting into stackoverflow error.

On Mon, Apr 25, 2016 at 7:02 PM, Kiran Badi  wrote:

> Hi,
>
> I am having some issues with  Tuckey Rewrite URL/Tomcat 7.0.57 and for
> some reasons I believe I am not getting it correct. It seems to me that I
> am getting into infinite loop somewhere.Not sure why but conditions do
> match.
>
>
>  Hello World! This is a link I am
> trying to clean it.
>
> Below is test servlet.
>
>
>  protected void processRequest(HttpServletRequest request,
> HttpServletResponse response)
> throws ServletException, IOException {
> response.setContentType("text/html;charset=UTF-8");
> try (PrintWriter out = response.getWriter()) {
> String[] params =
> request.getPathInfo().substring(1).split("/");
> System.out.println(params[0]);
> String testid = request.getParameter("testid");
> RequestDispatcher rd =
> request.getRequestDispatcher("/WEB-INF/views/Hello.jsp");
> rd.include(request, response);
> }
> }
>
>
> 
>  http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd";>
>
> 
> 
>
> 
> 
> The rule means that requests to /test/status/ will be
> redirected to /rewrite-status
> the url will be rewritten.
> 
> /test/status/
> %{context-path}/rewrite-status
> 
> 
>  Sample redirect
>  operator="equal">[0-9]
> ^/GetServlet(.*)$
> /GetServlet/testid/%{parameter:testid}
> 
>
> 
> 
> The outbound-rule specifies that when response.encodeURL is
> called (if you are using JSTL c:url)
> the url /rewrite-status will be rewritten to /test/status/.
>
> The above rule and this outbound-rule means that end users
> should never see the
> url /rewrite-status only /test/status/ both in thier location
> bar and in hyperlinks
> in your pages.
> 
> /rewrite-status
> /test/status/
> 
> 
>
>
>
>
>
>
> INFO: org.tuckey.web.filters.urlrewrite.substitution.VariableReplacer
> DEBUG: variable %{parameter:testid} type: parameter, name: 'testid'
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.substitution.VariableReplacer
> DEBUG: resolved to: 50
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.substitution.VariableReplacer
> DEBUG: replaced sb is /GetServlet/testid/50
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs
> to be forwarded to /GetServlet/testid/50
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG:
> looking for hostname match on current server name localhost
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking
> for status path on /cleanurl/GetServlet/testid/50
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing
> request for /GetServlet/testid/50
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: query string
> added
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called
> with /GetServlet/testid/50?testid=50
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Sample redirect
> (rule 1) run called with /GetServlet/testid/50?testid=50
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from"
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "50"
> against [0-9]
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
> INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: conditions match
> Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationDispatcher
> invoke
> SEVERE: Servlet.ser

Tuckey Rewrite URL and infinite loop exception trace for Tomcat 7.0.57

2016-04-25 Thread Kiran Badi
Hi,

I am having some issues with  Tuckey Rewrite URL/Tomcat 7.0.57 and for some
reasons I believe I am not getting it correct. It seems to me that I am
getting into infinite loop somewhere.Not sure why but conditions do match.


 Hello World! This is a link I am trying
to clean it.

Below is test servlet.


 protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
String[] params = request.getPathInfo().substring(1).split("/");
System.out.println(params[0]);
String testid = request.getParameter("testid");
RequestDispatcher rd =
request.getRequestDispatcher("/WEB-INF/views/Hello.jsp");
rd.include(request, response);
}
}



http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd";>






The rule means that requests to /test/status/ will be
redirected to /rewrite-status
the url will be rewritten.

/test/status/
%{context-path}/rewrite-status


 Sample redirect
[0-9]
^/GetServlet(.*)$
/GetServlet/testid/%{parameter:testid}




The outbound-rule specifies that when response.encodeURL is
called (if you are using JSTL c:url)
the url /rewrite-status will be rewritten to /test/status/.

The above rule and this outbound-rule means that end users
should never see the
url /rewrite-status only /test/status/ both in thier location
bar and in hyperlinks
in your pages.

/rewrite-status
/test/status/








INFO: org.tuckey.web.filters.urlrewrite.substitution.VariableReplacer
DEBUG: variable %{parameter:testid} type: parameter, name: 'testid'
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.substitution.VariableReplacer
DEBUG: resolved to: 50
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.substitution.VariableReplacer
DEBUG: replaced sb is /GetServlet/testid/50
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs to
be forwarded to /GetServlet/testid/50
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG:
looking for hostname match on current server name localhost
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking
for status path on /cleanurl/GetServlet/testid/50
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing
request for /GetServlet/testid/50
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: query string
added
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called
with /GetServlet/testid/50?testid=50
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Sample redirect
(rule 1) run called with /GetServlet/testid/50?testid=50
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from"
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.Condition DEBUG: evaluating "50"
against [0-9]
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: conditions match
Apr 25, 2016 6:38:41 PM org.apache.catalina.core.ApplicationDispatcher
invoke
SEVERE: Servlet.service() for servlet default threw exception
java.lang.StackOverflowError
at
org.apache.catalina.connector.Request.notifyAttributeAssigned(Request.java:1547)
at org.apache.catalina.connector.Request.setAttribute(Request.java:1538)
at
org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:541)
at
org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttpRequest.java:288)
at
org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttpRequest.java:288)
at
org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttpRequest.java:288)
at
org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttpRequest.java:288)
at
org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttpRequest.java:288)
at
org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttpRequest.java:2

Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-18 Thread Kiran Badi
Hi Chris,

Ok but I had bunch of similar issues with file upload when I had done with
struts 2 and plain J2ee. So thought worth checking.

Maybe JavaScript part might be culprit or  form data of JS might have some
limit on size.and file upload via JS is supported only in last couple of
years.Older browsers relied iframe for uploads.

Yes without all the info it's hard to tell anything for sure.

On Monday, January 18, 2016, Joleen Barker  wrote:

> I am not positive, but I thought the older browsers had a 2GB limit. The
> company I worked for ran in to a similar problem and it was the result of
> the browser. I think Chrome didn't have the issue and IE did. We ended up
> making a note in the Known Issues of the manual about the limitation. This
> is going back awhile though.
>
> -Joleen
>
> On Mon, Jan 18, 2016 at 7:40 AM, Christopher Schultz <
> ch...@christopherschultz.net > wrote:
>
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > Kiran,
> >
> > On 1/18/16 1:33 AM, Kiran Badi wrote:
> > > Did you exclude your upload servlet from struts.xml ? By default
> > > struts intercepts all multi part requests and this messes a lot
> > > specially when you have hybrid framework when few modules are plain
> > > j2ee and few are struts 2 or Spring MVc in the same app.
> >
> > OP states that the Filter is placed before Struts. Struts's
> > interceptors fire from within Struts's Filter, so that shouldn't be a
> > problem.
> >
> > > Are you upload less than 2gb file ?
> >
> > I think, ultimately, this is going to be a problem with Javascript,
> > the browser (as yet unnamed), or the OP's code.
> >
> > - -chris
> > -BEGIN PGP SIGNATURE-
> > Comment: GPGTools - http://gpgtools.org
> > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> >
> > iEYEARECAAYFAlac3UcACgkQ9CaO5/Lv0PDFZQCfRt5WfvmP48UwxfM23FP0l0Uz
> > 1AYAn15i3dRPe7d7nVpEU69VW66eyQnQ
> > =d1St
> > -END PGP SIGNATURE-
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> 
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> >
> >
>


Re: File size >= 2GB not uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]

2016-01-17 Thread Kiran Badi
Did you exclude your upload servlet from struts.xml ? By default struts
intercepts all multi part requests and this messes a lot specially when you
have hybrid framework when few modules are plain j2ee and few are struts 2
or Spring MVc in the same app.

Are you upload less than 2gb file ?

On Monday, January 18, 2016, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Rahul,
>
> On 1/17/16 11:28 PM, Rahul Singh wrote:
> > Code flow is attached, forgot to attach in trailing mail.
> >
> > --
> - --
> >
> >
> *From:* Rahul Singh >
> > *Sent:* Monday, January 18, 2016 8:39 AM *To:* Tomcat Users List
> > *Subject:* Re: File size >= 2GB not uploaded in application
> > [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK 1.7.79]
> >
> > Hello Christopher, thanks for your prompt response !!
> >
> >> Why didn't you come to the Tomcat community first?
> > Sorry for the delay, we wanted to make sure about the component
> > causing the problem.
> >
> >
> >>> I don't have a test-case in front of me, but I'm fairly
> >>> confident that Tomcat allows file uploads of greater than 2GiB.
> >>> I suspect the problem
> > is another component.
> >>> Are you using Servlet 3.0-based file upload, or are you
> >>> allowing Struts to handle the file-upload for you? If you use
> >>> Servlet-3.0 file-upload, then you'll have code that deals with
> >>> Multipart classes and configuration in web.xml. If you are
> >>> using Struts's file-upload, then you'll mostly just be calling
> >>> getFile or getInputStream or however Struts 2 does things (I
> >>> can't remember how it all works off the top of my head).
> >
> >
> > In our case the filter class implements the javax.servlet.flter
> > and imports javax.servlet.* The Filter class mentioned in the
> > previous threads is the first one as declared in the web.xml
> > (followed by other struts filters). All (url) requests are mapped
> > to this filter. So this is where our file upload request goes. It
> > is only in greater than 2 gb file upload request that the
> > dofilter() fails to get any request. So we feel servlet 3.0 being
> > used in our case the Filter is not being able to handle greater
> > than 2 gb requests.
> >
> >
> >>> The point is, if you are using Struts, then Tomcat will not
> >>> touch the request and Struts is handling the whole thing. If
> >>> Struts is the problem, you'll need to talk to the Struts
> >>> team[1].
> >
> >>> If you are using Servlet-3.0 file-upload, then Struts is just a
> >>> red herring and this is the right place to get your issue
> >>> solved.
> >
> > As mentioned above Servlet 3.0 is being used. So request the
> > tomcat community to please look into our issue.
> >
> >>> So far, you have posted some configuration for Struts and some
> >>> JSP tablib-filled code, plus some Java code for a Filter. You
> >>> didn't say where the Filter was in the filter chain (before or
> >>> after Struts filter). You also mentioned that the form is
> >>> actually posted using XMLHttpRequest and not through a standard
> >>> form, but you didn't explain what component is doing that or
> >>> how it actually works.
> >
> >>> There isn't enough information here to make any sense of the
> >>> situation. Can you please address all of the questions I've
> >>> posed above and maybe we can then help you?
> >
> >
> > <<>>> We need to model the following code to be told:
> > jsp submit of the form How the .js submit it further in
> > XmlHttpRequest How the Filter is declared How the web.xml is
> > declared
> >
> >
> >> Are you sure the request is even made to the server in these
> >> cases?What if the Javascript upload component is failing before
> >> it even starts?
> >
> > Yes the request is made in these cases. We have compared the
> > scenario for greater than 2gb and lesser size file uploads and
> > drawn the following inference from it.We have checked the request
> > and content length for dofilter() method in our logs. The
> > JavaScript is not the culprit in this case. The JavaScript sets the
> > AJAX field to success after sending request and thereafter waits
> > for response(which is not received in our case). Our application
> > works fine for lesser than 2 gb fie uploads but fails for greater
> > size files as the request fails to reach the dofilter() method
> > after which the request can be forwarded to the requested method.
> >
> >
> >
> > Regards, Rahul
> >
> >  From: Christopher Schultz
> > > Sent: Saturday, January
> 16, 2016
> > 9:33 AM To: Tomcat Users List Subject: Re: File size >= 2GB not
> > uploaded in application [Tomcat 7.0.54 Struts: 2.3.24 JAVA: openJDK
> > 1.7.79]
> >
> > Rahul,
> >
> > On 1/15/16 1:02 AM, Rahul Singh wrote:
> >> Thanks for your guidelines, we have big hope from Apache Tomcat
> >> Team to solve this problem as this is show stopper for our
> >> application, we have also rais

Re: Tomcat Session issue - Session not expiring on browser close event

2015-09-19 Thread Kiran Badi
Thanks Chris, Let me check user guide and come back.

On Fri, Sep 18, 2015 at 11:26 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 9/17/15 11:11 PM, Kiran Badi wrote:
> > Thanks Chris and David for reply. I did change the timeout values
> > from 30 to 10.
> >
> > I have some workflow kind of screens,but I do not store work flows
> > fields data in session. Session contains only attributes which are
> > similar to ids. All data is persisted in the mysql database and I
> > get the data from the database. I do have some performance issues
> > with mysql,but that can wait for sometime.
> >
> > (I believe the default maximum is 10,000
> >
> > I hope this should be for single instance of tomcat and If I use
> > cluster, this limit will not apply.
>
> This is for a single instance of Tomcat, but if you are using
> distributable sessions, you may find that limit being lowered from N *
> 10,000 to 10,000 / N for each node.
>
> > 5K is my break even point for my app, So I think I can live with
> > this default. However it will be good to know if this limit can be
> > changed somehow.
>
> It's very easy to change the default maximum. Have a look at the
> users' guide for how to do that.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJV/C0oAAoJEBzwKT+lPKRYOUQP/3u1WOKrbkh2EpTYaxwCqn6C
> GjfBL10yOIg4f0gQ/2URr+pkRwD8M06BYDGHKDC+C1vFBCLZ3H637Pqetmziiolx
> tu8uclwpRJQREh0gw/Cc0l8kocSWiN+m0Ad3SyxaRvGXCVxqQ5xxJC78F6biMEov
> 7/dgsAUw+IunJtUkqVj4MVIHDtGzcj7Xidnk8S1gPSZ1MY0dwmdI6XCBWPDGEhj5
> fFcgQaC2tcMfrrgIS3/uzVRse5FYZGsHNHRtnKGFSCppf4y/lTA1DccUnZPCh/wY
> wI9CJ6OX1f/LMLKvXfBPvvQjvTbYA7u74w/SkmBjyt3Jg4zMwfsHMlrNce+cZYtl
> rYK69uWN1lplcpcM0l8c5gMJuG4x3S1pQJHPZZdUHH2sqfCxYLwqERbnThbzD11U
> HdDuxWn8WOEuoakPtW9FoHymc2RL090wMmJoQyfNREVOk4fV6QPYuhJffEA5nQxs
> vGYYAfQOVuxrZ3LdFWRNAnshhLjC0ZYk6xFUdMwXLtD2fceGigzGqLC/1yWfrrpE
> LueyWXbKxNGYNbUReavYRuI6D0R9V7h96gQzf4YWE6Dt4eYKKjWN48iAX9iT085W
> L9W8jiIHJaHSgNVDiRostSPtAUz3H6HVtKmd4mHabTr0Zo69MylC0c7Ef89YDQlM
> 69v7eo45E3deb5f8hrED
> =FOM/
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Tomcat Session issue - Session not expiring on browser close event

2015-09-17 Thread Kiran Badi
Thanks Chris and David for reply. I did change the timeout values from 30
to 10.

I have some workflow kind of screens,but I do not store work flows fields
data in session. Session contains only attributes which are similar to ids.
All data is persisted in the mysql database and I get the data from the
database. I do have some performance issues with mysql,but that can wait
for sometime.

(I believe the default maximum is 10,000

I hope this should be for single instance of tomcat and If I use cluster,
this limit will not apply.

5K is my break even point for my app, So I think I can live with this
default. However it will be good to know if this limit can be changed
somehow.

Sorry for delayed response, was bit held up firefighting in office.

- Kiran

On Mon, Sep 14, 2015 at 10:37 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 9/13/15 8:40 PM, Kiran Badi wrote:
> >> Perhaps you should think about using a leaner session, and then
> >> sessions living for longer than necessary won't be such a big
> >> problem
> >
> > What do you mean by leaner session ? Storing less objects in
> > session or changing default timeout from 30 mins to something of
> > less value ?
>
> I mean storing a lower total number of bytes in the session. For
> instance, you can either store an Integer "id" for an object graph
> located in a database in the session, or you can store the whole
> object graph itself in the session. Storing only the id saves you a
> lot of memory but then you need to load the objects from the db to
> actually use them. Storing the object graph in the session makes your
> application faster, but it will consume much more memory.
>
> If you can afford the slow-down, then a single server can handle many
> more logged-in users if you store only the ids in the session.
>
> > I think got probable answer to my issue, I had overlooked the JSP
> > part, I have JSP's and by default JSP creates session, and this was
> > reason as why I was seeing thousands of session in my app.
>
> Perhaps. You should only create a session when necessary. An empty
> session does not take up much memory, but you should take care not to
> create too many of them (I believe the default maximum is 10,000).
>
> > Is their a way to kill the session after certain period of inactive
> > time where user is not doing anything on the site or I need to
> > adjust my timeout value ?
>
> The timeout value *is* the way to kill inactive sessions. It can be
> set in web.xml.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJV9tuYAAoJEBzwKT+lPKRYhlkP/1k87UfGFrmkMYPTmUgEmVqz
> 1R6GQFSP4QJKmad+yTSDFWQBoFDKrO3C6NTBicawgjS/gQ4oLatJQUHZTK+ywSeM
> SDmZ2yOwSgzQ2trnbqpD0dENf0gp3rOQdzdNE5a8JOozhEO3oZglkIKnP1dLyoml
> I8iijVU61tGJZMfKTVDbTkTOxhTHd0G4kDHCqxTSwpVCC7qFWHWr49AhUeanWBZr
> jGezka2ZNV+aKh5bEOHH3Lh8EEIYxTrXpCtm1MZayOV1JmaOi74RByiC9AUjbtPg
> z5NsAvVMwqiTWJ1XrL7Y56GQ1IfdUhfBpDg32OnvUuparwCq0hu35dw0RuidElOw
> BpE4MRvuRobsZEo4aF+LOA7kyKk0R2hFRIYBaH8yTWf4S7hUVXmYAdNDT4fcR27U
> KDoMoEGH+qp+8cLZRrjCNUIwEu1dxBMJOe6Hk1v1aVnCiixB4z/ywjp4jfF7uBXm
> vG8j4k9ozriWHpJxinmV0/LTGBOiCI7xYbjVBmXnpsNdzpd9pFLacyh6X6fFQO8D
> jbV1zIzVN/VKDD3fGMoSm+/dj91QgIAUbvJbEDBZZtS4imuji3FNfiEprBiPDB6b
> iG4RyS33M6xRNEVkIDu0bflXIyW6HzVcdMtwOAbMH3Pv6L9SkqBJaTSUCGaitah1
> ZJ4u/nTH6eKxFFRjHgkr
> =oCoO
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Tomcat Session issue - Session not expiring on browser close event

2015-09-13 Thread Kiran Badi
Hi Chris,

Thanks Chris for reply.

Perhaps you should think about using a leaner session, and then
sessions living for longer than necessary won't be such a big problem

What do you mean by leaner session ? Storing less objects in session or
changing default timeout from 30 mins to something of less value ?


I think got probable answer to my issue, I had overlooked the JSP part, I
have JSP's and by default JSP creates session, and this was reason as why I
was seeing thousands of session in my app.

Is their a way to kill the session after certain period of inactive time
where user is not doing anything on the site or I need to adjust my timeout
value ?





On Wed, Sep 9, 2015 at 9:34 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 9/7/15 12:54 PM, Kiran Badi wrote:
> > I have few attributes saved in session they seems to living for
> > close to 30 minutes which is session timeout in web xml.
> >
> > I need to kill the session once the browser closes on the client
> > side.
>
> You need to free server resources, or you want the client to be
> disconnected from their (old) session?
>
> > Is their a way to do it on server side rather than doing via some
> > kind of ajax handler.
>
> Yes and no.
>
> If you have the cookie set with no expiration date (the default with
> Tomcat's container-managed sessions), then the browser will forget the
> cookie when it closes.
>
> If you *do* have an expiration date on your cookies, then AJAX is the
> only way, and there's no guarantee that the browser is actually going
> to send that AJAX message when it's closing the page.
>
> If you want the serer to kill the session immediately upon browser
> close (regardless of "expiration" date), your only hope is AJAX, and I
> can tell you right now you shouldn't bet on that working.
>
> > Doing it via ajax means injecting that code in all my jsp's and
> > have lot many.
>
> Sounds like session cookies are the way to go.
>
> Perhaps you should think about using a leaner session, and then
> sessions living for longer than necessary won't be such a big problem.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJV8DVQAAoJEBzwKT+lPKRYG4gP/0qOpYTP5D0xmPVZAaHFAhFY
> Guz8sdBXxnfWlYwWYDZMcbtpOjpi91i5N9W42X0oeFTttkXH5Dzvfo7TpYo9OPnv
> RRNdQZncehtlH0nZKjU7rnDFkiCUBWr6/LiblJikOMleItCZDfDIUpmakX7mgs+w
> P0Y976SgdIPVxFjlqXc+Pgxnup6t8lFcNmrBPe93Jmb9QxzL1o4qcevdTz7KVdwo
> BRKPHOEAGXTawcJM9E14e2tUa/8J+M7kTovoCkxjK5+VQSi+2k5KDmMDlxEdn6iO
> HPSwpvsHxNyWd21rREIQhNfWOADYar5+phw5g+ifGtRxfhbY+cGzD2DzfrsUkZQB
> +a0iGf9OgQb/wFIONWZbbx1zl6IQTiajZjuKuSfA5CXYDLbnyfsIMQ1Y77tlSZIZ
> ZIw6k2NiRzKgMm54Fnms8ixAGtIHX9j7qGaJvGVQjc0ZxIexsrp9DgzWt6+BmRbD
> H7gMmcT/pl4UzI6fSlOm9d8E/PtL3sd7pGQhEwVb4Y9U1Ihq/bHlPHrTsn0I14H3
> UYZpDFKGHHH8I7r7OrBiMFSWICNsNL2c4BgRU/uzTvEivCRrnJBUjzVGtWsYscvj
> HwwTxUzIMnUOe+Uc09PDmh231vKhFYIWsdFDR1MFPQfZUZ9MYPe49xxmLq0rmo4+
> tqTv8vYdaMtWWbmd+G6B
> =tPe/
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Tomcat Session issue - Session not expiring on browser close event

2015-09-07 Thread Kiran Badi
Hi ,

I have few attributes saved in session they seems to living for close to 30
minutes which is session timeout in web xml.

I need to kill the session once the browser closes on the client side.

Is their a way to do it on server side rather than doing via some kind of
ajax handler.

Doing it via ajax means injecting that code in all my jsp's and have lot
many.

Thanking you
Kiran Badi


Re: doDelete Servlet

2015-09-07 Thread Kiran Badi
Yup I solved this , just not deleting anything, I am not just setting flag
to yes or no.

Thanks Chris.

On Fri, Sep 4, 2015 at 3:44 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 9/4/15 3:19 PM, Kiran Badi wrote:
> > I have CRUD Multipart request and I have implemented it correctly
> > works fine at my local host.
> >
> > I have upload upload pdf and tiff files, all this implemented via
> > ajax call using onchange handler on file input multiple tag.
> >
> > The challenge I am having is that doDelete just deletes the file
> > with the request on server, but their is no protection.
> >
> > How do I protect doDelete call from getting misused ?
> >
> > Is their something in Tomcat I can use to protect doDelete vals
> > from getting misused ?
>
> How do you do user authentication and authorization? The doDelete
> method should be protected by default if you have enabled
> container-managed authentication and authorization.
>
> Also, the default doDelete method should be a no-op and therefore
> safe. If you have implemented your own doDelete method, you can use
> whatever safety-checks you with in order to prevent misuse.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJV6fSSAAoJEBzwKT+lPKRYa60QAJMiKXcobGQ0RK/7e515DKEz
> DEa34PrMGaiLvrFlw0Y9UwiS3wnUl1isRXycTTuIVFGr6uFUkRvWFcT7d1QM0s2M
> mm3kIEPbtMQR54Exr0r9zGE1Ds+wWzPz12s/F4B3Wt1WKdqaobPLMTucD1Mvha/M
> uAOFUBCGNhH7hQnu2w0Vcj9vNoEQnezSrgj8DtovxOT/lfDugJ6P3ToJEIG/tlEn
> m3qMEkeIqZvGP+fRYHdAxNYoSrOJ3EDvKMxjIOFHWzHNZ/eVBQCn7qg8TaiOPf4f
> h7q6bS2p0XZzzyXG9vamaMDepVCffXAfiC7Me6gDuPWd+J7/iabAgd8r1qhbKW4B
> RbzTXKQ7yETYxqIVg3wzTUsCKJ8w/mzmKBz7VierYvrWOI0fu/14MbynZUSySnuq
> 8fr+tTmAmQddJ34vmiCBfYhhYGBQgNXQM/cL5wS5gpdUufnA5Lzr93rJFEBcAajF
> DLiOYEkfm+I8XPxP8ih25wceMvdf+y7NCBRu6c6zPb+/aCrjZEMyofS7+b92gK8B
> AuwK3o2Xhb/vU/NThJXGW/vbzkCQTMJpZuePSP6yMpSjkPuTb7mysKIfqFsmC3dW
> 6ctigwiYJYkK3xzP8RV4pdNGJTdjxMnWtvx0cDYQ1Zee+55UhJXp5LvKvwTeB8b1
> D45cr+g1BxpWZxe4r0Wx
> =wWvm
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


doDelete Servlet

2015-09-04 Thread Kiran Badi
Hi ,

I have CRUD Multipart request and I have implemented it correctly works
fine at my local host.

I have upload upload pdf and tiff files, all this implemented via ajax call
using onchange handler on file input multiple tag.

The challenge I am having is that doDelete just deletes the file with the
request on server, but their is no protection.

How do I protect doDelete call from getting misused ?

Is their something in Tomcat I can use to protect doDelete vals from
getting misused ?

- Kiran


Re: Dynamically Create Subdomains - Tomcat 7x

2015-09-04 Thread Kiran Badi
Thanks Chris,

I have running tomcat with mysite hosted on it.I am trying to extend it and
get some extra mileage from my app.

I think I can go with hostname approach and see how it goes.

I have another query for which I will open another discussion.

Thanks everyone.

- Kiran


On Fri, Sep 4, 2015 at 1:49 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 9/4/15 12:25 PM, Kiran Badi wrote:
> > Let me try again Chris, I have this site www.mysite.com  ready with
> > some x amount of features in it
> >
> > Now I need to customize this site based on regions,states, and
> > cities.I will most likely go with cities.
> >
> > So I need my main site to redirect to city1.mysite.com  etc
> > based on cookie value which I create on mysite.com(This is landing
> > page)
> >
> >
> >
> > what i need  is similar to as what  www.blogger.com or craiglist
> > does.Ex
> > http://www.quikr.com/all-cities,https://geo.craigslist.org/iso/us
> >
> > when we add a blog, it creates user.blogger.com and for another
> > user, it creates user1.blogger.com
> >
> > I am looking something similar ?
> >
> > Can this be done with just tomcat or I need to front end tomcat
> > with apache ?
> >
> > Is it required to spend extra money on DNS or creating different
> > folder/subdirectory for each region ?
> >
> > I have a single war file, and I intent to do this isolation
> > service layer/DB layer.
> >
> > Does this make sense ?
> >
> > I know its high level generic ask,but I really need some direction.
> > Maybe I am again vague,but I hope examples will give some direction
> > as what I am looking for.
>
> I agree with Chris Derham: if you have DNS set up to send *.mysite.com
> to your service, then all of those requests will go to your Tomcat
> server; it's up to you to decide what to do at that point.
>
> You *could* add an  (programmatically) for every single prefix
> you might think of to auto-generate, OR you could just use the default
> host for everything and then detect the hostname the user is using in
> order to customize some part of your application.
>
> I wouldn't bother trying to modify the configuration of the running
> Tomcat... instead, I'd just use the hostname to decide what to do once
> inside the application.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJV6dm/AAoJEBzwKT+lPKRYRkwQAJab8C/me3Uc46+w/8mSy+sH
> E25uNcbG5Inkz3X4cFOsjjPMbgPzMBFCY2rGaguO9nAfAt17gfAFyxwWoa+tI/HW
> i0US92kJwmlHWCTMgJKGBKQl7ca6BgwffzSvJuyfbdHHbLPeWH4CdgXSHCpgoX/8
> +gdi7Fawnq2elxvC2/xtWLSHfFBW7HkbJ6zKAD/U+zJPd2wh410sB0rZtm4yuFdt
> KYKAhOw1lzQ2zTKM2L7PWSLKjYfBtP08Mdi09f5u22yqGG7S63YOUkHZZXfg3+ui
> SowpRSuYe8KIfP+wgJxFxspyQ4xYVltaXeitZTgV1TWV760cGx3qbTYuAG6muf5e
> xd+QheLD2hWnbRRqLhplJAvlxKgKA8FmqZ8iFR3h9WNiXLePXpEYZlZpNWOSOaQE
> ju7lhP9BsNOWPidPv39i3YuOopnk5wyGaRivBwkgNLEzGwxmXkCEePnDf1kWumYQ
> 8T6l2OjSw7owkMtDJI97DPs8jSUIYJMCPbxR+PlNXiMs2SzZV+KIiLYPVNwU+IMe
> AjHYIOtgmH5G1nivu5tupjDutO4OY2gu66QDi7SzSFpZ0XvXAbml7asU3dwlppoq
> RldOZ01zEI8Z6yu0RRlxer1jPaDExZBkGIxin2ILdpxd562yWOUFbGYgBpdOjhI1
> ldoTCter5Kxa0U6CaS1l
> =USc4
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Dynamically Create Subdomains - Tomcat 7x

2015-09-04 Thread Kiran Badi
Let me try again Chris, I have this site www.mysite.com  ready with some x
amount of features in it

Now I need to customize this site based on regions,states, and cities.I
will most likely go with cities.

So I need my main site to redirect to city1.mysite.com  etc based on
cookie value which I create on mysite.com(This is landing page)



what i need  is similar to as what  www.blogger.com or craiglist does.Ex
http://www.quikr.com/all-cities,https://geo.craigslist.org/iso/us

when we add a blog, it creates user.blogger.com and for another user, it
creates user1.blogger.com

I am looking something similar ?

Can this be done with just tomcat or I need to front end tomcat with apache
?

Is it required to spend extra money on DNS or creating different
folder/subdirectory for each region ?

I have a single war file, and I intent to do this isolation service
layer/DB layer.

Does this make sense ?

I know its high level generic ask,but I really need some direction. Maybe I
am again vague,but I hope examples will give some direction as what I am
looking for.

- Kiran





On Fri, Sep 4, 2015 at 9:03 AM, chris derham  wrote:

> > I need something like,
> >
> > My main landing page  www.mysite.com
> >
> > Subdomains I am looking for
> >
> > myfeature1.mysite.com
> >
> > myfeature2.mysite.com
> >
> > myfeature3.mysite.com
> >
> > etc
> >
> > myfeature is  a cookie value which comes from www.mysite.com(this is
> > landing page which drops myfeature cookie)..
> >
> > - Kiran
>
> so if you map *.mysite.com DNS name to a single server, it can do all of
> that.
>
> You are asking a very generic high level question, without providing
> details of what you have tried, and what isn't working. Hence you
> really need to open up more and explain. Can a single site handle all
> of these "features" or do you need isolation between them? Is this a
> "how can I setup DNS?" or a "how can I setup websesrvers against host
> names?" kind of question. It really is worded very openly so people
> will be hard pushed to help
>
> Chris
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Dynamically Create Subdomains - Tomcat 7x

2015-09-04 Thread Kiran Badi
Hi Andre,

I need something like,

My main landing page  www.mysite.com

Subdomains I am looking for

myfeature1.mysite.com

myfeature2.mysite.com

myfeature3.mysite.com

etc

myfeature is  a cookie value which comes from www.mysite.com(this is
landing page which drops myfeature cookie)..

- Kiran




On Fri, Sep 4, 2015 at 3:34 AM, André Warnier (tomcat) 
wrote:

> On 04.09.2015 05:31, Kiran Badi wrote:
>
>> Hi,
>>
>> I need some help, I need to create subdomains dynamically, Is this
>> possible
>> ?
>>
>> I have a site, www.mymainsite.com
>>
>> on this main site, I drop the zipcode and city cookie and then I forward
>> it
>> to front controller, and it's this front controller  which will point it
>> to
>> city subdomain.
>>
>> Can we create subdomains on the fly in tomcat ?
>>
>>
> Kiran,
> Can you try to re-phrase your question in terms which people without a
> crystal ball would understand ?
>
>
>
> Ce qui se conçoit bien s'énonce clairement - Et les mots pour le dire
> arrivent aisément.
> L'Art poétique (1674)
> Nicolas Boileau-Despréaux
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Dynamically Create Subdomains - Tomcat 7x

2015-09-03 Thread Kiran Badi
Hi,

I need some help, I need to create subdomains dynamically, Is this possible
?

I have a site, www.mymainsite.com

on this main site, I drop the zipcode and city cookie and then I forward it
to front controller, and it's this front controller  which will point it to
city subdomain.

Can we create subdomains on the fly in tomcat ?

- Kiran


Re: Tomcat 7.0.27 and Tomcat 7.0.50 - Valve - Dead thread and Crawlers

2015-07-19 Thread Kiran Badi
yes its StuckThreadDetectionValve for Tomcat 7.0.27. I made the change and
its working fine now.Thanks

On Sat, Jul 18, 2015 at 4:29 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 7/17/15 10:35 AM, Kiran Badi wrote:
> > I wanted to check if this setting in Server.xml is still valid,
> >
> >  > className="org.apache.catalina.valves.CrawlerSessionManagerValve"
> > crawlerUserAgents="*[bB]ot.*|.*Yahoo!
> > Slurp.*|.*Feedfetcher-Google.*." sessionInactiveInterval="180"/>
> >
> > 
> >
> > I edited by server xml and added these valves,but I adding tomcat
> > refuses to start up and I see for some reasons Tomcat is not able
> > to find those classes.
> >
> > Do I need do download some jar files to make it work ?
> >
> > I am looking for these valves just to make sure that I collect
> > valid data from crawlers.
> >
> > and manage long running threads.
>
> Shouldn't that be "StuckThreadDetectionValve"?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJVqrcdAAoJEBzwKT+lPKRYNAoP/ApJMqGqHCCIHARFJZUNRtwA
> N0/m2M9miica2bpZXI0HCZ9hOg3/Bx3eb7JhaHTYyWhpdGN2YWdX9KO8r5cX1KNI
> T0nLGgQ0NaYPtCWAAUq/KdaRWRTPZW+p37GldNAjnfztxF1FcZltFZRU1IrhgnVY
> VKrK9olehNLfKMP+n63aqqwPZbSMxk1i6NPGzHPJU1IYHuOfMzFP+G7Kmtk+hWKz
> pX7sdblOOmxZUcZlCcIg6aJL+mhJ1r4epp2Okh0Ava/RbfXMjGK6h31hnglvp/w5
> eyA6StxW+xlJwDNxcsFUHuV4blqlih8t2+3MBG4GkYo/b3N5iUZIHIotCuUwKiXM
> Y2VRRzfgUUIuqXK5gGRkMENLQwM0PF10i6omdPlLGMkDA73ogidjlEJGsxuRNP3v
> 8uq30Vrmd16WiXhHzT715zVDqYYmHBsx6srgVMQHPk/k1ioum5G+qZmme4Oq76qt
> Z7oQ9nuooC8aFmby8/xiePYOwQr6dn0TnUUmplOHSIYbn+LTVW3lDojsGONi/8u7
> +DY5NnDbJdCUlP0u4gjlMzm5IosaINTkfpRWZNtLqsSwi47sR8oJIuag5ClOWgux
> yZwk2KS4JtFaJR1phlOQU74Iult9ZmIiwpSbpG8BvZBR67vBkHB6OgnSmEwgkGbO
> zpPSKTNsnvVDNcyW/4+t
> =QQ4x
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Tomcat 7.0.27 and Tomcat 7.0.50 - Valve - Dead thread and Crawlers

2015-07-18 Thread Kiran Badi
Hah thanks Kolinko ,I will try it today and provide update.

On Saturday, July 18, 2015, Konstantin Kolinko 
wrote:

> 2015-07-17 18:35 GMT+03:00 Kiran Badi >:
> > Hi
> >
> > I wanted to check if this setting in Server.xml is still valid,
> >
> >  > crawlerUserAgents="*[bB]ot.*|.*Yahoo! Slurp.*|.*Feedfetcher-Google.*."
> > sessionInactiveInterval="180"/>
> >
> >  > threshold="300"/>
>
> You have a space character between package and class name above (just
> before "DeadThreadDetectionValve").  Remove it.
>
>
> > I edited by server xml and added these valves,but I adding tomcat refuses
> > to start up and I see for some reasons Tomcat is not able to find those
> > classes.
> >
> > Do I need do download some jar files to make it work ?
> >
> > I am looking for these valves just to make sure that I collect valid data
> > from crawlers.
> >
> > and manage long running threads.
> >
> > - Kiran
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org 
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
>
>


Tomcat 7.0.27 and Tomcat 7.0.50 - Valve - Dead thread and Crawlers

2015-07-17 Thread Kiran Badi
Hi

I wanted to check if this setting in Server.xml is still valid,





I edited by server xml and added these valves,but I adding tomcat refuses
to start up and I see for some reasons Tomcat is not able to find those
classes.

Do I need do download some jar files to make it work ?

I am looking for these valves just to make sure that I collect valid data
from crawlers.

and manage long running threads.

- Kiran


Re: Tomcat - OOM Perm gen

2015-07-12 Thread Kiran Badi
Hi Chris,

Here is link for Dump files,

https://drive.google.com/folderview?id=0BxOQjvXCnkSifjZEcEYzUTNTbUFoUWdrdmMyT18wdkZDS0hEOEgwRnl6RTBWN0V6UlA1YU0&usp=sharing

I tried using eclipse MAT Analyser and I see most of the threads on related
to tomcat web context loader. I still need to spend some time on that.

I think my apps still needs some cleanup.

After a day or 2 , it often dies a slow death with message,

Exception in thread "ajp-bio-17703-exec-11"
Exception: java.lang.OutOfMemoryError thrown from the
UncaughtExceptionHandler in thread "ajp-bio-17703-exec-11"

I am going to upload a new war today and see if it resolves the issue.

I will need some help with from this group in managing bots which are
spanning 100's of sessions in my case.I will initiate a new thread on that.

Sorry for delayed replies from my end.

- Kiran

On Mon, Jul 6, 2015 at 4:38 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 7/5/15 10:24 AM, Kiran Badi wrote:
> > Sorry for taking time to reply Chris.
> >
> >> Christopher Schultz wrote: Are you periodically hot-re-deploying
> >> your application in production? If so, you may want to stop doing
> >> that, as it appears that you have a ClassLoader-pinning leak in
> >> your application or some dependent library
> >
> > I do not do hot deployment in production. But somehow I feel its
> > leaking memory.
>
> What makes you think that?
>
> > There are some threads which for some reasons remains hanging.
>
> Threads related to Tomcat, or threads that are started by your
> application?
>
> > But I think I will focus on it later on. I do have copy of your
> > presentation. I will go through it and may be post couple of
> > question if I have.
>
> The presentation is markt's, not mine.
>
> >> You should be able to run a reasonable service in half a gig of
> >> heap space. Just be aware that caching information in your
> >> application is going to significantly increase the amount of heap
> >> space required by your application in a steady-state.
> >
> > Yup I am aware of this limitation. I know cache is often stored in
> > local heap and probably that's reason it consumes heap space.
>
> Well... there are many ways to cache data, but if you are caching it
> in your application (and not in an out-of-process-cache like ehcache,
> memcached, etc.) then by definition it's in your application's heap spac
> e.
>
> > Currently I am checking if ehcache or jcs meets my need. Ehcache
> > for some reasons fills my heap very fast.I tried storing some 100
> > json strings and retrieving them. My OOM's started once I
> > integrated this library in my web inf /lib folder.After I removed
> > it, frequency of OOM has substantially decreased.Probably I am not
> > using it correctly somewhere.
>
> You may also be using in-memory caching as opposed to on-disk caching.
>
> > Do you know what open source caching people frequently use for java
> > web apps ?
>
> Honestly, I would spend your time by disabling any caching and making
> sure that the application doesn't leak memory *before* you add any
> caching before you start introducing any kind of caching.
>
> >> Fetching a lot of data isn't usually a big deal. Just make sure
> >> that your "fetch size" is set to something reasonable. There are
> >> some JDBC drivers (MySQL Connector/J in particular) that will
> >> load the entire ResultSet into memory before allowing you to
> >> traverse it unless you make arrangements to limit that memory
> >> usage.
> >>
> >> But bringing-back thousands of records from a db isn't a problem
> >> -- unless you don't *have to* in which case you might want to
> >> optimize your queries to avoid pulling data you don't actually
> >> need.
> >>
> >> But too-many-records would be a performance problem, not a
> >> memory problem.
> >
> > haha.Its fetch size which my autocomplete was missing...I am not
> > sure how I missed it but it was missing.
>
> I would remove all the caching and make sure that the application
> works properly without leaking any memory before moving on to improve
> performance.
>
> To do otherwise would be considered premature optimization. Nobody
> likes an application that falls-over, even if it does so with
> high-performance. Users will tolerate a slow application if it's the
> only thing wrong with it.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPG

Re: why is Tomcat 7 invoking WebSocket protocol?

2015-07-05 Thread Kiran Badi
Thanks Charles for clarification.

On Tue, Jun 30, 2015 at 12:47 PM, Caldarale, Charles R <
chuck.caldar...@unisys.com> wrote:

> > From: Kiran Badi [mailto:ki...@poonam.org]
> > Subject: Re: why is Tomcat 7 invoking WebSocket protocol?
>
> > I know for sure I am not using websockets in my application, but stack
> > trace shows me wsfilter used by tomcat getting called for some reason,
>
> As it should be.
>
> > Just for understanding purpose, is this valid flow , exceptions needs to
> > bubble up through all the filters ?
>
> Of course.  Any method on the call stack gets a shot at the exception.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail and
> its attachments from all computers.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Tomcat - OOM Perm gen

2015-07-05 Thread Kiran Badi
Sorry for taking time to reply Chris.

Are you periodically hot-re-deploying your application in production?
If so, you may want to stop doing that, as it appears that you have a
ClassLoader-pinning leak in your application or some dependent library

I do not do hot deployment in production.But somehow I feel its leaking
memory.There are some threads which for some reasons remains hanging.
But I think I will focus on it later on. I do have copy of your
presentation.I will go through it and may be post couple of question if I
have.

You should be able to run a reasonable service in half a gig of heap
space. Just be aware that caching information in your application is
going to significantly increase the amount of heap space required by
your application in a steady-state.

Yup I am aware of this limitation. I know cache is often stored in local
heap and probably that's reason it consumes heap space.
Currently I am checking if ehcache or jcs meets my need. Ehcache for some
reasons fills my heap very fast.I tried storing some 100 json strings and
retrieving them.
My OOM's started once I integrated this library in my web inf /lib
folder.After I removed it, frequency of OOM has substantially
decreased.Probably I am not using it correctly somewhere.

Do you know what open source caching people frequently use for java web
apps ?

Fetching a lot of data isn't usually a big deal. Just make sure that
your "fetch size" is set to something reasonable. There are some JDBC
drivers (MySQL Connector/J in particular) that will load the entire
ResultSet into memory before allowing you to traverse it unless you
make arrangements to limit that memory usage.

But bringing-back thousands of records from a db isn't a problem --
unless you don't *have to* in which case you might want to optimize
your queries to avoid pulling data you don't actually need.

But too-many-records would be a performance problem, not a memory proble
m.

haha.Its fetch size which my autocomplete was missing...I am not sure how I
missed it but it was missing.
Thanks Mark.



On Tue, Jun 30, 2015 at 1:17 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 6/29/15 10:21 AM, Kiran Badi wrote:
> > Christopher Schultz wrote:
> >> The number of users shouldn't impact your PermGen space. Perhaps
> >> only once you get to that stage are you hitting enough of your
> >> features to load classes into PermGen. (Or maybe you are using
> >> String.intern a lot...)
> >
> > I analysed some logs and I could see that users query features
> > which makes DB calls, so those calls do have 1000's of rows in
> > it.But some calls also fetch empty result set and some error out,
> > partly because code for those calls are broken( Some of those dao
> > classes have hard coded DB parameter which I am cleaning it out
> > now). As far as I know I do not do any string cancat, those calls
> > are all simple list fetch calls to views.
> >
> > I am trying to implement some caching using either ehcache or JCS
> > but I think it has to wait for some time, till I gain some
> > understanding on how these works.( I think I need to serialize lot
> > of model classes for that probably will require some code changes
> > again).i  know I have lot of work to do ,maybe I one at a time
> > change :)
> >
> >> PermGen failures will effect the whole JVM. There is no way to
> >> protect App B from App A unless they are in different JVMs.
> >
> > I can understand this. so doing daily restart now to manage  issue
> > till I figure out some solution to it.
> >
> >> What makes you say that? It seems that you have more information
> >> than you are giving us.
> >
> > Its not hardened code so I think it still has some issues with it.
> > Also during development I can see similar errors on local dev box,
> > If I do deploy and redeploy at least 8 to 10 times, I start seeing
> > those  perm gen errors,its just that it references a new class
> > file every time,maybe I can share it with you all once I get it
> > again.
>
> Stop right there.
>
> Are you periodically hot-re-deploying your application in production?
> If so, you may want to stop doing that, as it appears that you have a
> ClassLoader-pinning leak in your application or some dependent library.
>
> See this presentation for more information:
> http://people.apache.org/~markt/presentations/2010-11-04-Memory-Leaks-60
> mins.pdf
>
> > Also it's I have written this code and I am not that fantastic
> > coder yet, but I will reach there short span :)
> >
> >
> >> Usually, PermGen doesn&#x

Re: why is Tomcat 7 invoking WebSocket protocol?

2015-06-30 Thread Kiran Badi
ve.java:222)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

On Tue, Jun 30, 2015 at 12:23 PM, André Warnier  wrote:

> Hi.
>
> Sorry to jump in, and to top-post, and maybe make an irreverential comment
> :
>
> But maybe the solution consists simply in renaming that filter, so that it
> does not give the mistaken impression that the WebSocket protocol is
> necessarily being used ?
>
> Kiran Badi wrote:
>
>> Hi Mark,
>>
>> Sorry to jumping in
>>
>> But even I have seen this in few of my exception traces though I never use
>> websockets.Some where down the line when exception is thrown wsfilter
>> shows
>> up in traces.I am guessing it should be some kind of exception filter so
>> it
>> bubbles up for exception types irrespective of protocol.
>>
>> Let me check my old stack traces and post few snippets of it,but they were
>> valid exception in my case just that I never had websockets in my app.
>>
>> On Monday, June 29, 2015, Mark Thomas  wrote:
>>
>>  On 29/06/2015 07:12, Ric Bernat wrote:
>>>
>>>> We have a Jersey application running on Tomcat 7.0.62. In production,
>>>> 99.9% of our web service calls run quickly (e.g., 100ms), but there are
>>>> about half a dozen web service calls per hour that take an extraordinary
>>>> amount of time to complete: 30-120 seconds (not ms).
>>>>
>>>> We do not use WebSockets in our application. However, our profiling tool
>>>> clearly shows that Tomcat is invoking the WebSocket protocol on the
>>>> slow-running web service calls. In the stack trace below, see this line:
>>>>
>>>> org.apache.tomcat.websocket.server.WsFilter.doFilter (WsFilter.java:46)
>>>>
>>> That shows nothing of the sort. I suggest you take a look at the code in
>>> question before jumping to invalid conclusions.
>>>
>>> Mark
>>>
>>>
>>>  How can we track down what is causing Tomcat to use the WebSocket
>>>> protocol, given that our application code does not make any references
>>>> to WebSocket annotations, etc.? Or is there a configuration option we
>>>> can use to cause Tomcat to not use WebSockets?
>>>>
>>>> Thanks much.
>>>>
>>>>  Stack trace
>>>>   org.glassfish.jersey.server.ApplicationHandler.handle
>>>> (ApplicationHandler.java:13)
>>>>   org.glassfish.jersey.servlet.WebComponent.service
>>>> (WebComponent.java:401)
>>>>   org.glassfish.jersey.servlet.ServletContainer.service
>>>> (ServletContainer.java:386)
>>>>   org.glassfish.jersey.servlet.ServletContainer.service
>>>> (ServletContainer.java:335)
>>>>   org.glassfish.jersey.servlet.ServletContainer.service
>>>> (ServletContainer.java:222)
>>>> ….catalina.core.ApplicationFilterChain.internalDoFilter
>>>> (ApplicationFilterChain.java:303)
>>>> …g.apache.catalina.core.ApplicationFilterChain.doFilter
>>>> (ApplicationFilterChain.java:208)
>>>>org.apache.tomcat.websocket.server.WsFilter.doFilter
>>>>
>>> (WsFilter.java:46)
>>>
>>>> ….catalina.core.ApplicationFilterChain.internalDoFilter
>>>> (ApplicationFilterChain.java:241)
>>>> …g.apache.catalina.core.ApplicationFilterChain.doFilter
>>>> (ApplicationFilterChain.java:208)
>>>>org.apache.catalina.core.StandardWrapperValve.invoke
>>>> (StandardWrapperValve.java:220)
>>>>org.apache.catalina.core.StandardContextValve.invoke
>>>> (StandardContextValve.java:122)
>>>> …apache.catalina.authenticator.AuthenticatorBase.invoke
>>>> (AuthenticatorBase.java:505)
>>>>   org.

Re: why is Tomcat 7 invoking WebSocket protocol?

2015-06-30 Thread Kiran Badi
Hi Mark,

Sorry to jumping in

But even I have seen this in few of my exception traces though I never use
websockets.Some where down the line when exception is thrown wsfilter shows
up in traces.I am guessing it should be some kind of exception filter so it
bubbles up for exception types irrespective of protocol.

Let me check my old stack traces and post few snippets of it,but they were
valid exception in my case just that I never had websockets in my app.

On Monday, June 29, 2015, Mark Thomas  wrote:

> On 29/06/2015 07:12, Ric Bernat wrote:
> >
> > We have a Jersey application running on Tomcat 7.0.62. In production,
> > 99.9% of our web service calls run quickly (e.g., 100ms), but there are
> > about half a dozen web service calls per hour that take an extraordinary
> > amount of time to complete: 30-120 seconds (not ms).
> >
> > We do not use WebSockets in our application. However, our profiling tool
> > clearly shows that Tomcat is invoking the WebSocket protocol on the
> > slow-running web service calls. In the stack trace below, see this line:
> >
> > org.apache.tomcat.websocket.server.WsFilter.doFilter (WsFilter.java:46)
>
> That shows nothing of the sort. I suggest you take a look at the code in
> question before jumping to invalid conclusions.
>
> Mark
>
>
> >
> > How can we track down what is causing Tomcat to use the WebSocket
> > protocol, given that our application code does not make any references
> > to WebSocket annotations, etc.? Or is there a configuration option we
> > can use to cause Tomcat to not use WebSockets?
> >
> > Thanks much.
> >
> >  Stack trace
> >   org.glassfish.jersey.server.ApplicationHandler.handle
> > (ApplicationHandler.java:13)
> >   org.glassfish.jersey.servlet.WebComponent.service
> > (WebComponent.java:401)
> >   org.glassfish.jersey.servlet.ServletContainer.service
> > (ServletContainer.java:386)
> >   org.glassfish.jersey.servlet.ServletContainer.service
> > (ServletContainer.java:335)
> >   org.glassfish.jersey.servlet.ServletContainer.service
> > (ServletContainer.java:222)
> > ….catalina.core.ApplicationFilterChain.internalDoFilter
> > (ApplicationFilterChain.java:303)
> > …g.apache.catalina.core.ApplicationFilterChain.doFilter
> > (ApplicationFilterChain.java:208)
> >org.apache.tomcat.websocket.server.WsFilter.doFilter
> (WsFilter.java:46)
> > ….catalina.core.ApplicationFilterChain.internalDoFilter
> > (ApplicationFilterChain.java:241)
> > …g.apache.catalina.core.ApplicationFilterChain.doFilter
> > (ApplicationFilterChain.java:208)
> >org.apache.catalina.core.StandardWrapperValve.invoke
> > (StandardWrapperValve.java:220)
> >org.apache.catalina.core.StandardContextValve.invoke
> > (StandardContextValve.java:122)
> > …apache.catalina.authenticator.AuthenticatorBase.invoke
> > (AuthenticatorBase.java:505)
> >   org.apache.catalina.core.StandardHostValve.invoke
> > (StandardHostValve.java:170)
> >  org.apache.catalina.valves.ErrorReportValve.invoke
> > (ErrorReportValve.java:103)
> >org.apache.catalina.valves.AccessLogValve.invoke
> > (AccessLogValve.java:957)
> > org.apache.catalina.core.StandardEngineValve.invoke
> > (StandardEngineValve.java:116)
> > org.apache.catalina.connector.CoyoteAdapter.service
> > (CoyoteAdapter.java:423)
> > …g.apache.coyote.http11.AbstractHttp11Processor.process
> > (AbstractHttp11Processor.java:1079)
> > …ote.AbstractProtocol$AbstractConnectionHandler.process
> > (AbstractProtocol.java:620)
> > …ache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun
> > (NioEndpoint.java:1747)
> > …apache.tomcat.util.net.NioEndpoint$SocketProcessor.run
> > (NioEndpoint.java:1706)
> >   java.util.concurrent.ThreadPoolExecutor.runWorker
> > (ThreadPoolExecutor.java:1145)
> >  java.util.concurrent.ThreadPoolExecutor$Worker.run
> > (ThreadPoolExecutor.java:615)
> > …he.tomcat.util.threads.TaskThread$WrappingRunnable.run
> > (TaskThread.java:61)
> >java.lang.Thread.run (Thread.java:745)
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> 
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org 
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
>
>


Re: Tomcat - OOM Perm gen

2015-06-29 Thread Kiran Badi
Hi Chris,

The number of users shouldn't impact your PermGen space. Perhaps only
once you get to that stage are you hitting enough of your features to
load classes into PermGen. (Or maybe you are using String.intern a
lot...)

I analysed some logs and I could see that users query features which makes
DB calls, so those calls do have 1000's of rows in it.But some calls also
fetch empty result set and some error out, partly because code for those
calls are broken( Some of those dao classes have hard coded DB parameter
which I am cleaning it out now). As far as I know I do not do any string
cancat, those calls are all simple list fetch calls to views.

I am trying to implement some caching using either ehcache or JCS but I
think it has to wait for some time, till I gain some understanding on how
these works.( I think I need to serialize lot of model classes for that
probably will require some code changes again).i  know I have lot of work
to do ,maybe I one at a time change :)


PermGen failures will effect the whole JVM. There is no way to protect
App B from App A unless they are in different JVMs.

I can understand this. so doing daily restart now to manage  issue till I
figure out some solution to it.

What makes you say that? It seems that you have more information than
you are giving us.

Its not hardened code so I think it still has some issues with it. Also
during development I can see similar errors on local dev box, If I do
deploy and redeploy at least 8 to 10 times, I start seeing those  perm gen
errors,its just that it references a new class file every time,maybe I can
share it with you all once I get it again.
Also it's I have written this code and I am not that fantastic coder yet,
but I will reach there short span :)


Usually, PermGen doesn't have to be enormous. What's your memory cap
with your hosting provider?

I have private tomcat 7x but I remember hosting provider mentioning that
512mb is final,but I will check with them again later this week.

Below is what I see in catalina logs when I do restart of tomcat,


Picked up _JAVA_OPTIONS: -Xms20m  -Xmx128m -XX:MinHeapFreeRatio=20
-XX:MaxHeapFreeRatio=40 -XX:NewSize=10m  -XX:MaxNewSize=10m
-XX:SurvivorRatio=6 -XX:TargetSurvivorRatio=80
 -XX:+CMSClassUnloadingEnabled -XX:+CMSClassUnloadingEnabled

I think was thinking CMSClassUnloadingEnabled should fix my perm gen
issues, but I think its not the case.



You either need more PermGen space, or you need to locate some kind of
leak in your application and fix it. IIRC, there are some RMI-related
leaks and Proxy-related leaks in PermGen depending upon your exact
circumstances.

It would be good to know what's in PermGen when it hits its limit.

What are your current heap settings, including PermGen? What JVM?

Try:
$ jmap -heap 

and

$ jmap -permstat 


I will try to get those dumps but I do not use any RMI or generate some
kind of proxies . Mine is simple app with lot of forms in it. Though there
are few calls which fetches lot of data from servers.Sometimes few
autocomplete calls fetch 1000's of records.I am trying to remove those
calls.

Below is my jvm details

Apache Tomcat/7.0.50 1.7.0_17-b02 Oracle Corporation Linux
2.6.32-531.29.2.lve1.3.11.1.el6.x86_64 amd64

Thanks Chris for reply.

On Fri, Jun 26, 2015 at 11:56 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 6/25/15 6:32 PM, Kiran Badi wrote:
> > I have 2 web apps sitting on single tomcat instance, App A(
> > Classic JSP/Servlet/jstl/velocity App)  and App B (Struts2 based
> > app).
> >
> > Now I have added S2 to App A and trying to fix some bad code in it
> > with it.But after making this change I keep getting out of OOM
> > issues once user count reaches to 75
>
> The number of users shouldn't impact your PermGen space. Perhaps only
> once you get to that stage are you hitting enough of your features to
> load classes into PermGen. (Or maybe you are using String.intern a
> lot...).
>
> > + and App A seems to be bringing App B down with it.
>
> PermGen failures will effect the whole JVM. There is no way to protect
> App B from App A unless they are in different JVMs.
>
> > Below is trace I get in catalina out log. I think I can increase
> > memory
>
> Yes, you can.
>
> > but it will not solve this
>
> What makes you say that? It seems that you have more information than
> you are giving us.
>
> > and I have hard limit of memory with hosting provider.
>
> Usually, PermGen doesn't have to be enormous. What's your memory cap
> with your hosting provider?
>
> > Is their anything in tomcat that I need to enable which can give me
> > some mileage?
>
> There is nothing you can do in Tomcat to make your application load
> 

Tomcat - OOM Perm gen

2015-06-25 Thread Kiran Badi
Hi All,

I have 2 web apps sitting on single tomcat instance, App A( Classic
JSP/Servlet/jstl/velocity App)  and App B (Struts2 based app).

Now I have added S2 to App A and trying to fix some bad code in it with
it.But after making this change I keep getting out of OOM issues once user
count reaches to 75 + and App A seems to be bringing App B down with it.
Below is trace I get in catalina out log. I think  I can increase memory
but it will not solve this and I have hard limit of memory with hosting
provider. Is their anything in tomcat that I need to enable which can give
me some mileage ? How do I fix this ?

Jun 24, 2015 6:49:19 PM org.apache.catalina.core.ApplicationDispatcher
invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.OutOfMemoryError: PermGen space
at com.sun.beans.infos.ComponentBeanInfo.(ComponentBeanInfo.java:35)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:374)
at java.lang.Class.newInstance(Class.java:327)
at com.sun.beans.finder.InstanceFinder.instantiate(InstanceFinder.java:96)
at com.sun.beans.finder.InstanceFinder.instantiate(InstanceFinder.java:107)
at com.sun.beans.finder.BeanInfoFinder.instantiate(BeanInfoFinder.java:63)
at com.sun.beans.finder.BeanInfoFinder.instantiate(BeanInfoFinder.java:41)
at com.sun.beans.finder.InstanceFinder.find(InstanceFinder.java:81)
at java.beans.Introspector.findExplicitBeanInfo(Introspector.java:436)
at java.beans.Introspector.(Introspector.java:386)
at java.beans.Introspector.getBeanInfo(Introspector.java:161)
at java.beans.Introspector.getBeanInfo(Introspector.java:248)
at java.beans.Introspector.(Introspector.java:395)
at java.beans.Introspector.getBeanInfo(Introspector.java:161)
at java.beans.Introspector.getBeanInfo(Introspector.java:248)
at java.beans.Introspector.(Introspector.java:395)
at java.beans.Introspector.getBeanInfo(Introspector.java:161)
at java.beans.Introspector.getBeanInfo(Introspector.java:248)
at java.beans.Introspector.(Introspector.java:395)
at java.beans.Introspector.getBeanInfo(Introspector.java:161)
at
freemarker.ext.beans.BeansWrapper.populateClassMapWithBeanInfo(BeansWrapper.java:1147)
at
freemarker.ext.beans.BeansWrapper.populateClassMap(BeansWrapper.java:1072)
at
freemarker.ext.beans.BeansWrapper.introspectClassInternal(BeansWrapper.java:1010)
at freemarker.ext.beans.BeansWrapper.introspectClass(BeansWrapper.java:969)
at freemarker.ext.beans.BeanModel.(BeanModel.java:140)
at freemarker.ext.beans.StringModel.(StringModel.java:90)
at freemarker.ext.beans.StringModel$1.create(StringModel.java:75)
at freemarker.ext.beans.BeansModelCache.create(BeansModelCache.java:45)

Jun 24, 2015 6:49:19 PM org.apache.struts2.dispatcher.Dispatcher error
SEVERE: Exception occurred during processing request:
javax.servlet.ServletException: java.lang.OutOfMemoryError: PermGen space
org.apache.jasper.JasperException: javax.servlet.ServletException:
java.lang.OutOfMemoryError: PermGen space
at
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:60)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164)
at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
at
com.opensymphony.xwork2.DefaultAction

Re: Tomcat 7.0.57 - Deployment Issue

2015-05-13 Thread Kiran Badi
Thanks *Jeffrey Janner *and *Mark Eggers*, I was able to deploy the app
successfully in its own virtual host. Actually I think apache httpd was
interfering somewhere and I raised the support ticket with my provider.I
think they made some changes to host file and it started working. I had
done same set up as given in the link by Charles.Now it works like a charm
and I also have manager interface to upload war files :)

Sometimes I get this error while using manager interface,

“Error invoking method check” when deploying a WAR on Tomcat
<http://stackoverflow.com/questions/1536364/error-invoking-method-check-when-deploying-a-war-on-tomcat>

But deployment happens quite successfully but it does not start the app.
Need to restart the server fix this.

Quick google search showed me that  its related to OOM. Is this related to
manager app or tomcat is starving of memory?



On Wed, May 13, 2015 at 11:17 AM, Jeffrey Janner <
jeffrey.jan...@polydyne.com> wrote:

> > -Original Message-----
> > From: Kiran Badi [mailto:ki...@poonam.org]
> > Sent: Tuesday, May 12, 2015 9:30 PM
> > To: Tomcat Users List
> > Subject: Re: Tomcat 7.0.57 - Deployment Issue
> >
> > Thanks Hassan/Prabhu/Charles for reply.
> >
> > I tried the options given in this link.
> >
> > http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts
> >
> > but for some reasons still its not working.I have pasted the server xml
> > for
> > reference. I have unlimited website hosting plan with arvixe.com , but
> > for
> > some reasons it's still not working.Not sure if these guys needs to add
> > something special to hosts file.
> >
> > here is link for actual site -
> >
> > homelyhotels.com - you will probably see cgi-bin folder.
> >
> > Below server xml, I have added just a second host tag for webapp2. I am
> > bit
> > hesitant to make changes wrt to webapp1(removing context tags etc due to
> > lack of time on my end along with lack of sufficient knowledge in case
> > something breaks,however I will eventually clean that as well).
> >
> ...
> > 
> >
> > 
> > 
> >
> >   
> >   
> >
> >   
> >   
> > 
> >  >resourceName="UserDatabase"/>
> >   
> >
> >> unpackWARs="true" autoDeploy="true">
> >
> > 
> > 
> >
> > 
> >  > directory="logs"
> >prefix="localhost_access_log." suffix=".txt"
> >pattern="%h %l %u %t "%r" %s %b" />
> >
> >   
> >
> >
> >   www.webapp1.com
> >   myhostid.myserver.mywebhost.com
> >>   docBase="/home/myhostid/tomcat/webapps/manager">
> >   
> >
> >> appBase="/home/myhostid/hosts/webapp2/webapps" xmlValidation="false"
> > xmlNamespaceAware="false" unpackWARs="true" autoDeploy="true">
> >   www.webapp2.com
> >> directory="logs"
> >prefix="webapp2_access_log." suffix=".txt"
> >pattern="%h %l %u %t "%r" %s %b" />
> >
> > 
> >   
> > 
> >
> Kiran -
> What no one has asked about yet is this:  What does your directory
> structure look like? Where are the catalina_home and catalina_base
> environment variables pointed?  Is it, I suspect, /home/myhostid/tomcat?
> If so, then deployment of the server using the above config will result in
> the following:
> For localhost and any request that comes in on the server's network
> interfaces that doesn't match your explicit host names or their alias,
> everything under the /home/myhostid/tomcat/webapps will be deployed once
> for the  named "localhost". So, for example
> http://localhost/webapp2/webapps/ would result in reaching the webapp2
> pages (might need to add ROOT or webapp2 to the end, but you could reach
> it).
> For the  named "webapp1", you will essentially re-deploy the
> application(s) that was deployed for localhost. We call that
> double-deployment, and it's something to avoid.
> For the  named "webapp2.com", it will only deploy the application
> webapp2, but in so doing it will unpack the war into a directory named the
> same as the war file, which makes that application now available at the
> other hosts.
>
> What

Re: Tomcat 7.0.57 - Deployment Issue

2015-05-12 Thread Kiran Badi
Thanks Hassan/Prabhu/Charles for reply.

I tried the options given in this link.

http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts

but for some reasons still its not working.I have pasted the server xml for
reference. I have unlimited website hosting plan with arvixe.com , but for
some reasons it's still not working.Not sure if these guys needs to add
something special to hosts file.

here is link for actual site -

homelyhotels.com - you will probably see cgi-bin folder.

Below server xml, I have added just a second host tag for webapp2. I am bit
hesitant to make changes wrt to webapp1(removing context tags etc due to
lack of time on my end along with lack of sufficient knowledge in case
something breaks,however I will eventually clean that as well).





  
  
  
  
  
  
  
  
  

  
  


  

  
  



















  
  

  
  


  

  







  

   
  www.webapp1.com
  myhostid.myserver.mywebhost.com
  
  
   
  
  www.webapp2.com
  
   

  





On Tue, May 12, 2015 at 7:43 AM, Caldarale, Charles R <
chuck.caldar...@unisys.com> wrote:

> > From: Kiran Badi [mailto:ki...@poonam.org]
> > Subject: Re: Tomcat 7.0.57 - Deployment Issue
>
> > for some reasons it's not going well. Its getting deployed as single app
> > www.mywebapp1.com\mywebapp2\ rather than 2 seperate sites.
>
> Which is exactly what you configured it to do.
>
> > mywebapp1 is deployed as root.war
>
> That should be ROOT.war; be precise - this is all case-sensitive.
>
> > and I uploaded the webapp2.war in webapps folder and edited server.xml
> with
> > below details,
>
> >  
> >   www.webapps2.com
> >   myhostid.myhost.myhostserver.com
>
> An  element does not create a second site; it merely provides an
> alternate name for a given site.  You need multiple  elements if you
> want separate sites.  Read these:
> http://wiki.apache.org/tomcat/CreateVirtualHosts
> http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts
>
> >> docBase="/home/myhostid/tomcat/webapps/webapps2">
>
> Do not put  elements in server.xml - very bad idea.  Also, the
> debug attribute has not be used for nearly a decade.  You really, really
> need to read the documentation.
>
> > I did not touch webapp1 app since its deployed as root.war and its
> working
> > fine..
>
> Not with that name, it isn't.
>
> > One more thing, do need have one more connector tag as I see these error
> on
> > catalina logs
>
> > May 11, 2015 7:11:51 PM org.apache.coyote.AbstractProtocol init
> > SEVERE: Failed to initialize end point associated with ProtocolHandler
> > ["http-bio-17701"]
> > java.net.BindException: Address already in use :17701
>
> You appear to have two  elements with the same port.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail and
> its attachments from all computers.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Tomcat 7.0.57 - Deployment Issue

2015-05-11 Thread Kiran Badi
for some reasons it's not going well. Its getting deployed as single app

www.mywebapp1.com\mywebapp2\ rather than 2 seperate sites.

mywebapp1 is deployed as root.war

and I uploaded the webapp2.war in webapps folder and edited server.xml with
below details,

 
  www.webapps2.com
  myhostid.myhost.myhostserver.com
  
   
   
   

I did not touch webapp1 app since its deployed as root.war and its working
fine..

One more thing, do need have one more connector tag as I see these error on
catalina logs

May 11, 2015 7:11:51 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-17701"]
May 11, 2015 7:11:51 PM org.apache.coyote.AbstractProtocol init
SEVERE: Failed to initialize end point associated with ProtocolHandler
["http-bio-17701"]
java.net.BindException: Address already in use :17701



On Fri, May 8, 2015 at 10:09 PM, Kiran Badi  wrote:

> Thanks Hassan. I will let you know.
>
> On Fri, May 8, 2015 at 9:50 PM, Hassan Schroeder <
> hassan.schroe...@gmail.com> wrote:
>
>> On Fri, May 8, 2015 at 6:14 PM, Kiran Badi  wrote:
>>
>> > Here is server.xml I am going to try in this weekend. I have added host
>> > tags inside the engine element and mapped webapp1 and webapp2.
>>
>> Looks good, though I didn't actually try them :-)
>>
>> > Do I need to rename both war files to ROOT.war and drop into the
>> respective
>> > folders or just drop the war file as is ? I have context xml inside
>> > meta-inf for both apps.
>>
>> Yes, each webapp has its own ROOT context, so rename.
>>
>> > Maybe I can experiment this in dev local box before propagating it to
>> live
>> > server.
>>
>> Absolutely. Virtualization rocks. I find myself typing "vagrant up" so
>> frequently :-)
>>
>> Let us know how it goes!
>>
>> H*
>> --
>> Hassan Schroeder  hassan.schroe...@gmail.com
>> http://about.me/hassanschroeder
>> twitter: @hassan
>> Consulting Availability : Silicon Valley or remote
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


Re: Tomcat 7.0.57 - Deployment Issue

2015-05-08 Thread Kiran Badi
Thanks Hassan. I will let you know.

On Fri, May 8, 2015 at 9:50 PM, Hassan Schroeder  wrote:

> On Fri, May 8, 2015 at 6:14 PM, Kiran Badi  wrote:
>
> > Here is server.xml I am going to try in this weekend. I have added host
> > tags inside the engine element and mapped webapp1 and webapp2.
>
> Looks good, though I didn't actually try them :-)
>
> > Do I need to rename both war files to ROOT.war and drop into the
> respective
> > folders or just drop the war file as is ? I have context xml inside
> > meta-inf for both apps.
>
> Yes, each webapp has its own ROOT context, so rename.
>
> > Maybe I can experiment this in dev local box before propagating it to
> live
> > server.
>
> Absolutely. Virtualization rocks. I find myself typing "vagrant up" so
> frequently :-)
>
> Let us know how it goes!
>
> H*
> --
> Hassan Schroeder  hassan.schroe...@gmail.com
> http://about.me/hassanschroeder
> twitter: @hassan
> Consulting Availability : Silicon Valley or remote
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Tomcat 7.0.57 - Deployment Issue

2015-05-08 Thread Kiran Badi
Thanks Hassan for reply.

Here is server.xml I am going to try in this weekend. I have added host
tags inside the engine element and mapped webapp1 and webapp2.

Do I need to rename both war files to ROOT.war and drop into the respective
folders or just drop the war file as is ? I have context xml inside
meta-inf for both apps.

Maybe I can experiment this in dev local box before propagating it to live
server.





  
  
  
  
  
  
  
  
  

  
  


  

  
  



















  
  

  
  


  

  







  

   
  www.webapp1.com
  myaccountid.myserver.mywebhoster.com
  
   
  
   
  
  www.webapp2.com
  myaccountid.myserver.mywebhoster.com
  
   
  
   
   
  



On Thu, May 7, 2015 at 10:46 PM, Hassan Schroeder <
hassan.schroe...@gmail.com> wrote:

> On Thu, May 7, 2015 at 7:24 PM, Kiran Badi  wrote:
>
> > www.webapp1.com
> >
> > Now I have another webapp2. which I need to deploy it to same tomcat and
> > access it as
> >
> > www.webapp2.com
> >
> > How do I do this ? Appreciate some direction on this please
>
> The docs are probably a good place to start:
>
> http://tomcat.apache.org/tomcat-7.0-doc/virtual-hosting-howto.html
>
> HTH,
> --
> Hassan Schroeder  hassan.schroe...@gmail.com
> http://about.me/hassanschroeder
> twitter: @hassan
> Consulting Availability : Silicon Valley or remote
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Tomcat 7.0.57 - Deployment Issue

2015-05-07 Thread Kiran Badi
Hi All,

I need some help with my situation here.

I have private tomcat with hosting provider which allows me to deploy
unlimited domains/sites.

Now I have 1 web application deployed to that tomcat at the root folder.
Lets call this app as webapp1. I just rename webapp1.war to ROOT.war and
drop it in webapps folders. So it works and can accessed by

www.webapp1.com

Now I have another webapp2. which I need to deploy it to same tomcat and
access it as

www.webapp2.com

How do I do this ? Appreciate some direction on this please

- Kiran


Re: My problem: I cannot successfully get or set a session attribute from a JSP file.

2014-12-08 Thread Kiran Badi
I agree with Terence check if request is indeed getting fire. Add couple of
alerts to jquery call. You can also check if value is getting added to
session via tomcat manager admin interface , I remember there is option to
see session values /attributes over there.

On Monday, December 8, 2014, Terence M. Bandoian  wrote:

> On 12/6/2014 3:19 PM, Jim Anderson wrote:
>
>>
>> Hi to all,
>>
>> I am currently developing some server side JSP code. By and large, things
>> are progressing and working well. I have gotten half way decent at
>> debugging my java/javascript/jquery/jsp/HTML source code, but I have run
>> into a problem in JSP where the code does not work, but I have found no
>> clues as to why it is not working.
>>
>> The environment that I am working in is Tomcat 7.0.54 and I am using java
>> 1.8 and jquery 1.7.2.
>>
>> What I am trying to do:
>>
>> I have html code with an embedded javascript that runs jquery code. The
>> jquery code being run makes an ajax call to a JSP file on the server side,
>> which I will call s.jsp. This file is a very simple file whose sole
>> function is to take a registration name and query an SQL database to see if
>> the name has already been used at the web site. The registration name is
>> passed with a method call that looks like this:
>>
>> regName = request.getParameter("registrationName"); [item 1]
>>
>> This all works fine for me. So far so good. If the registration name is
>> good, the state of my application logic changes. I guess there are multiple
>> ways to store state, but I have chosen to store the state as a session
>> variable.  I searched the net and found an example of JSP code that uses
>> the session object to store information as an attribute with a statement
>> that looks something like:
>>
>> session.setAttribute("logicState","nameValidated"); [item 2]
>>
>> I tried adding this line and when I now push the submit button of my HTML
>> form, which calls s.jsp as an action, the application hangs (in firefox). I
>> receive no error messages anywhere. Usually, when I add bad code in s.jsp I
>> will get a stacktrace from firefox or error messages in the firefox debug
>> console, or both. Or I will error message in my own homegrown debug code,
>> but that does not happen. I know that my home grown code does not get
>> called, so I can infer that the call to s.jsp is never made, but I cannot
>> be 100% certain of this. I also checked my tomcat/logs directory and there
>> was nothing in the log files that I would not expect.
>>
>> So my first question is:  Can I simply add item 2, above, to my jsp file
>> and expect that tomcat will recognize that I am referencing the session
>> object?  In s.jsp, item 1, above, references the request object and tomcat
>> handles that and I am expecting that it will also hand my reference to the
>> session object.
>>
>> My second question is more general. My code is not working and there are
>> no error messages. Can anyone speculate why this would be the case?  Is
>> there any   place else I should be looking for error messages?
>>
>> Jim A.
>>
>>
>
> Hi, Jim-
>
> You should be able to see in Firebug or the Network tab of the Firefox
> developer's tools whether or not the request was actually sent by the
> browser.
>
> -Terence Bandoian
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: INFO: TLD skipped Messages in logs

2014-10-29 Thread Kiran Badi
Thanks Mark

On Tuesday, October 28, 2014, Mark Thomas  wrote:

> On 28/10/2014 00:59, Kiran Badi wrote:
> > Hi
> >
> > Can someone reply to this query please.
> > On 10/2/2014 8:10 PM, Kiran Badi wrote:
> >> Hi,
> >>
> >> I am getting below messages in the logs,
> >>
> >> Oct 26, 2014 4:05:46 PM org.apache.catalina.startup.TaglibUriRule body
> >> INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already
> >> defined
> >> Oct 26, 2014 4:05:46 PM org.apache.catalina.startup.TaglibUriRule body
> >> INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
> >> Oct 26, 2014 4:05:46 PM org.apache.catalina.startup.TaglibUriRule body
> >> INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already
> >> defined
> >>
> >> I have jstl.jar in web/lib app folder and probably have jstl jar in
> >> the tomcat lib directory.
> >>
> >> I wanted to understand if this messages are related to duplicate jstl
> >> jar or something else .
>
> Normally this is caused by duplicate JSTL JARs.
>
> Mark
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org 
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
>
>


Re: INFO: TLD skipped Messages in logs

2014-10-27 Thread Kiran Badi

Hi

Can someone reply to this query please.
On 10/2/2014 8:10 PM, Kiran Badi wrote:

Hi,

I am getting below messages in the logs,

Oct 26, 2014 4:05:46 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already 
defined

Oct 26, 2014 4:05:46 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
Oct 26, 2014 4:05:46 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already 
defined


I have jstl.jar in web/lib app folder and probably have jstl jar in 
the tomcat lib directory.


I wanted to understand if this messages are related to duplicate jstl 
jar or something else .


- Kiran Badi

-





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



INFO: TLD skipped Messages in logs

2014-10-26 Thread Kiran Badi

Hi,

I am getting below messages in the logs,

Oct 26, 2014 4:05:46 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
Oct 26, 2014 4:05:46 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
Oct 26, 2014 4:05:46 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined

I have jstl.jar in web/lib app folder and probably have jstl jar in the 
tomcat lib directory.


I wanted to understand if this messages are related to duplicate jstl 
jar or something else .


- Kiran Badi

-



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Struts 2 /Glassfish to Tomcat migration

2014-10-18 Thread Kiran Badi
Thanks Chris. I was able to fix the issue.

On Fri, Oct 3, 2014 at 10:52 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 10/3/14 8:02 PM, Kiran Badi wrote:
> > Thanks Chris for replying.I did resolve the 404  issue,it's error
> > on my part. One of view jsp was in incorrect folder so it was
> > throwing 404 error.Fixed it and now it works fine.
> >
> > I do not recall as how I installed this tomcat probably I
> > downloaded the zip file and then integrated that installation with
> > netbeans.
>
> The Tomcat server zip distribution does not contain any .dll files.
> You either downloaded and installed the .dll files yourself or you
> used the Windows Installer package which includes these libraries.
>
> > x86-64 do I need to download this file from apache tomcat site ?
> > how do I use this file ? edit the environment variables ?
>
> You should have several .dll files if you have a single one. Take a
> look at them to determine which is the correct one for your
> architecture and put it in whatever your java.library.path is, named
> tcnative-1.dll.
>
> Or, if you don't want or need the APR connector, then disable the
> APRLifecycleListener in server.xml and the JVM won't even try to load it.
>
> - -chris
>
> > On Thu, Oct 2, 2014 at 10:38 PM, Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> > Kiran,
> >
> > On 10/2/14 9:59 PM, Kiran Badi wrote:
> >>>> I am migration my glassfish struts 2 based application to
> >>>> Tomcat 7.055.
> >>>>
> >>>> I am coming across 2 issues, first one is below exception
> >>>> while starting Tomcat
> >>>>
> >>>> java.lang.UnsatisfiedLinkError: C:\Apache Software
> >>>> Foundation\apache-tomcat-7.0.55\bin\tcnative-1.dll: Can't
> >>>> load IA 64-bit .dll on a AMD 64-bit platform
> >
> > You have the IA-64 library in your path, and you need the x86-64
> > library instead. How did you install Tomcat? If you used the
> > binary installer, it should have correctly detected your
> > architecture and used the correct library. If you installed it
> > manually, you should have a selection of tcnative .dll files. fine
> > the x86-64 one and use that.
> >
> >>>> these are java information,
> >>>>
> >>>> Using CATALINA_BASE:   "C:\Apache Software
> >>>> Foundation\apache-tomcat-7.0.55" Using CATALINA_HOME:
> >>>> "C:\Apache Software Foundation\apache-tomcat-7.0.55" Using
> >>>> CATALINA_TMPDIR: "C:\Apache Software
> >>>> Foundation\apache-tomcat-7.0.55\temp" Using JRE_HOME:
> >>>> "C:\Program Files\Java\jdk1.7.0_13"
> >>>>
> >>>> Though the server starts and I can access the home page, but
> >>>> it seems like struts.xml file is getting ignored and i am
> >>>> getting 404 for all jsp which are under web-inf.
> >
> > The inability to start the APR connector won't have any effect on
> > this.
> >
> > How are you trying to access your .jsp files within WEB-INF? Via a
> > direct URL or some kind of internal forward from another URL?
> >
> >>>> Is their any migration guide from glassfish 4x to Tomcat ?
> >
> > You shouldn't have to do too much to migrate, as long as you don't
> > have anything GlassFish-specific in your webapp. You should be able
> > to take your existing WAR file and drop it into Tomcat's webapps/
> > directory. That should get you 90% of the way. If you use
> > JNDI-based resources, you'll have additional configuration, but I
> > won't get into that unless you actually need it.
> >
> >>>> I was thinking that copying struts.xml to config directory
> >>>> and setting dispatcher servlet should be sufficient. I am
> >>>> missing anything here.
> >
> > What is "config directory" and how did you "set [the] dispatcher
> > servlet"?
> >
> > -chris
> >>
> >> -
> >>
> >>
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
>
> iQ

Re: Struts 2 /Glassfish to Tomcat migration

2014-10-03 Thread Kiran Badi
Thanks Chris for replying.I did resolve the 404  issue,it's error on my
part. One of view jsp was in incorrect folder so it was throwing 404
error.Fixed it and now it works fine.

I do not recall as how I installed this tomcat probably I downloaded the
zip file and then integrated that installation with netbeans.


x86-64 do I need to download this file from apache tomcat site ? how do I
use this file ? edit the environment variables ?

On Thu, Oct 2, 2014 at 10:38 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Kiran,
>
> On 10/2/14 9:59 PM, Kiran Badi wrote:
> > I am migration my glassfish struts 2 based application to Tomcat
> > 7.055.
> >
> > I am coming across 2 issues, first one is below exception while
> > starting Tomcat
> >
> > java.lang.UnsatisfiedLinkError: C:\Apache Software
> > Foundation\apache-tomcat-7.0.55\bin\tcnative-1.dll: Can't load IA
> > 64-bit .dll on a AMD 64-bit platform
>
> You have the IA-64 library in your path, and you need the x86-64
> library instead. How did you install Tomcat? If you used the binary
> installer, it should have correctly detected your architecture and
> used the correct library. If you installed it manually, you should
> have a selection of tcnative .dll files. fine the x86-64 one and use that.
>
> > these are java information,
> >
> > Using CATALINA_BASE:   "C:\Apache Software
> > Foundation\apache-tomcat-7.0.55" Using CATALINA_HOME:   "C:\Apache
> > Software Foundation\apache-tomcat-7.0.55" Using CATALINA_TMPDIR:
> > "C:\Apache Software Foundation\apache-tomcat-7.0.55\temp" Using
> > JRE_HOME:"C:\Program Files\Java\jdk1.7.0_13"
> >
> > Though the server starts and I can access the home page, but it
> > seems like struts.xml file is getting ignored and i am getting 404
> > for all jsp which are under web-inf.
>
> The inability to start the APR connector won't have any effect on this.
>
> How are you trying to access your .jsp files within WEB-INF? Via a
> direct URL or some kind of internal forward from another URL?
>
> > Is their any migration guide from glassfish 4x to Tomcat ?
>
> You shouldn't have to do too much to migrate, as long as you don't
> have anything GlassFish-specific in your webapp. You should be able to
> take your existing WAR file and drop it into Tomcat's webapps/
> directory. That should get you 90% of the way. If you use JNDI-based
> resources, you'll have additional configuration, but I won't get into
> that unless you actually need it.
>
> > I was thinking that copying struts.xml to config directory and
> > setting dispatcher servlet should be sufficient. I am missing
> > anything here.
>
> What is "config directory" and how did you "set [the] dispatcher servlet"?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJULgw0AAoJEBzwKT+lPKRYoI8P/2N1QNVZK1ZfvPqNNY2sALE0
> 4obJMM/vKtzDsKrJmJ+kaTfSAt1Cnd6fOP3VCFUYrfkKGWUjOfTczxN6c2RgvJbV
> R8Y9nwUhevgb2Y36slZ2Kda6g2XmxH5WR8PU/qEF8qRu+ZM7BSkKAkfUz+lrbrC2
> a4MD02LmiQXaXEyxsFzOcW+Ig9iMUi4gpCA5hJw9SJtObedeW9rfQDrNJVpMd559
> FFUdGE6hz2/+3JcTV+gYutYrS0sGuPrTL/WA+X7OYTdPheU6R9JmiK8OmLBA6COg
> aNBT6k/Bm29NgTQVAXATkomI7fBCV3HRYlIH7eA1oZgMPgSKf6PTdrfKaAvZZfz0
> qxXl9dD7gXgssNN59CxxDu2xHlYv11RMN/vlVodpdWWHWkttetigpQi1wL3dDfJd
> uBzi8vl8DXVcs+44sZ+lPNa07VjHRxR8zElqTppQ9f500ozQN+5j18LYtOKefoOZ
> HmQ1lhs721hN5XzWP1xQRZGFNVg1fb0tBFVf/n2TT3n9DhiQhXpy029xKYkUBa9q
> Ch2iFzQN1HbLimBVuUlKx2fDjy8P6BWUfN0I1T9kSPLwZwtSZy8V0JuSuaOdkNby
> kQ6PQBV5CMQNdMNcNE5rIDUA66YyLOMXMYnN/pQaT5JIoeTJL0b2jVNweFGcdukp
> ANyaJNqtL6SuIS7DUmvE
> =QXr1
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Struts 2 /Glassfish to Tomcat migration

2014-10-02 Thread Kiran Badi
I am migration my glassfish struts 2 based application to Tomcat 7.055.

I am coming across 2 issues, first one is below exception while starting
Tomcat

java.lang.UnsatisfiedLinkError: C:\Apache Software
Foundation\apache-tomcat-7.0.55\bin\tcnative-1.dll: Can't load IA 64-bit
.dll on a AMD 64-bit platform

these are java information,

Using CATALINA_BASE:   "C:\Apache Software Foundation\apache-tomcat-7.0.55"
Using CATALINA_HOME:   "C:\Apache Software Foundation\apache-tomcat-7.0.55"
Using CATALINA_TMPDIR: "C:\Apache Software
Foundation\apache-tomcat-7.0.55\temp"
Using JRE_HOME:"C:\Program Files\Java\jdk1.7.0_13"


Though the server starts and I can access the home page,
but it seems like struts.xml file is getting ignored and i am getting 404
for all jsp which are under web-inf.

Is their any migration guide from glassfish 4x to Tomcat ?

I was thinking that copying struts.xml to config directory and setting
dispatcher servlet should be sufficient.I am missing anything here.


Re: Deploy application as Root

2014-09-14 Thread Kiran Badi
Hi Ognjen,

Thanks for information. Let me try this approach. I have another 3 weeks
for doing deployment for first piece of second app.

Probably I will start another fresh thread for few of my doubts.

Thanks and Appreciate your assistance.

- Kiran



On Fri, Sep 12, 2014 at 3:19 AM, Ognjen Blagojevic <
ognjen.d.blagoje...@gmail.com> wrote:

> Kiran,
>
>  Question I have is that if I upload war file via manager app, where does
>> it
>> go ?
>>
>
> It goes to appBase (e.g. direcotry "webapps") as war file, and if neither
> unpackWARs at  element nor unpackWAR of Context element is set to
> "false", they are unpacked to the directory of the same name (e.g.
> webapps/ROOT.war is unpacked to directory webapps/ROOT).
>
>
>  I can understand that ROOT goes to the ROOT folder if I delete the root
>> folder, how about myapp.war ?
>>
>
> myapp.war will be extracted to directory myapp.
>
>
>  Does it go to work folder ?
>>
>
> All web applications are unpacked to appBase folder. Work folder is
> internal Tomcat folder.
>
>
> On 12.9.2014 4:22, Kiran Badi wrote:
>
>> However I have another application which I will be deploying in the same
>> tomcat.
>>
>> This will be basically myapp2.war ,so how do I manage this deployment so
>> that whenever someones gives www.myapp2.com, it should open up ?
>>
>> I assume we cannot have 2 root deployment in the same tomcat.
>>
>
> You need to create two webapps directories, e.g. "webapps-myapp1" and
> "webapps-myapp2", and configure two  elements in server.xml
> accordignly, e.g.:
>
>   
>   
>
> Then you may deploy two ROOT.war files to two different webapps folders.
>
> If you want to use Manager application for each of your virtual hosts you
> need to copy directory webapps/manager/ to both webapps-myapp1/manager/ and
> webapps-myapp2/manager/.
>
> -Ognjen
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Deploy application as Root

2014-09-14 Thread Kiran Badi
Thanks Sergio, I will give this approach a shot for next deployment.

On Fri, Sep 12, 2014 at 2:31 AM, Sergio Fernández  wrote:

> Hi,
>
> On 12/09/14 04:22, Kiran Badi wrote:
>
>> This will be basically myapp2.war ,so how do I manage this deployment so
>> that whenever someones gives www.myapp2.com, it should open up ?
>>
>> I assume we cannot have 2 root deployment in the same tomcat.
>>
>
> Usually you can delegate the VirtualHost resolution to a regular HTTP
> server, such as apache2 or nginx, proxing using AJP or any of the available
> connectors.
>
> BTW, relevant for the question what started this thread, remember that
> Tomcat Manager comes with a basic set of REST web services that you may
> find useful. Without messing with manually removing directories, you can
> just PUT your war to the root context as follows:
>
> http://localhost:8080/manager/text/deploy?path=%2F&update=true
>
> Further details at the documentation:
>
> http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.
> html#Supported_Manager_Commands
>
> Hope that helps.
>
> Cheers,
>
> --
> Sergio Fernández
> Partner Technology Manager
> Redlink GmbH
> m: +43 660 2747 925
> e: sergio.fernan...@redlink.co
> w: http://redlink.co
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Deploy application as Root

2014-09-11 Thread Kiran Badi
Ok I fixed this issue. Moved the context tag to context.xml and deployed it
as ROOT. Works fine now.

However I have another application which I will be deploying in the same
tomcat.

This will be basically myapp2.war ,so how do I manage this deployment so
that whenever someones gives www.myapp2.com, it should open up ?

I assume we cannot have 2 root deployment in the same tomcat.



On Thu, Sep 11, 2014 at 9:29 PM, Kiran Badi  wrote:

> Ok I made the changes, and trying.
>
> Andre, I tried your approach, it still same error.Making changes to server
> xml now.
>
> Pointing appBase to webapps.
>
> Question I have is that if I upload war file via manager app, where does
> it go ?
>
> I can understand that ROOT goes to the ROOT folder if I delete the root
> folder, how about myapp.war ?
>
> Does it go to work folder ?
>
> Konstantin, I have below version only difference is that localhost is on
> windows and not working one is on linux.
>
> Apache Tomcat/7.0.501.7.0_51-b13Oracle CorporationWindows Vista6.0x86
>
> On Thu, Sep 11, 2014 at 4:32 AM, Ognjen Blagojevic <
> ognjen.d.blagoje...@gmail.com> wrote:
>
>> Kiran,
>>
>> On 11.9.2014 5:52, Kiran Badi wrote:
>>
>>> I am trying to deploy application as ROOT.war in tomcat  7.50 provided by
>>> hosting service provider, but for some reasons I get below message
>>>
>>> FAIL - War file "ROOT.war" cannot be uploaded if context is defined in
>>> server.xml
>>>
>>>
>>> I have below in server xml,
>>>
>>>
>>> Host name="Myapp.com" appBase="path  to public_html folder">
>>>www.myapp.com
>>>myuserid.myhostingprovider.com
>>>
>>>>>docBase="path to /tomcat/webapps/manager">
>>>
>>> 
>>>
>>
>> You seem to specify the same directory for Host's appBase and Context's
>> docBase. That is wrong.
>>
>> AppBase is a place where you will be putting your web applications (.war
>> files or directories). On default Tomcat installation that is "webapps"
>> directory.
>>
>> DocBase is a place where single web application resides. It may be
>> relative to AppBase (e.g. "ROOT"), or absolute (e.g.
>> "/usr/local/tomcat/webapps/ROOT").
>>
>> The two should not point to the same directory.
>>
>>
>> Next, configuring contexts in server.xml is not recommended [1]. You
>> should remove  elements from your server.xml, and move them to
>> /META-INF/context.xml in web applications. If you do that, also remove
>> docBase attributes.
>>
>> -Ognjen
>>
>> [1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.
>> html#Defining_a_context
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


Re: Deploy application as Root

2014-09-11 Thread Kiran Badi
Ok I made the changes, and trying.

Andre, I tried your approach, it still same error.Making changes to server
xml now.

Pointing appBase to webapps.

Question I have is that if I upload war file via manager app, where does it
go ?

I can understand that ROOT goes to the ROOT folder if I delete the root
folder, how about myapp.war ?

Does it go to work folder ?

Konstantin, I have below version only difference is that localhost is on
windows and not working one is on linux.

Apache Tomcat/7.0.501.7.0_51-b13Oracle CorporationWindows Vista6.0x86

On Thu, Sep 11, 2014 at 4:32 AM, Ognjen Blagojevic <
ognjen.d.blagoje...@gmail.com> wrote:

> Kiran,
>
> On 11.9.2014 5:52, Kiran Badi wrote:
>
>> I am trying to deploy application as ROOT.war in tomcat  7.50 provided by
>> hosting service provider, but for some reasons I get below message
>>
>> FAIL - War file "ROOT.war" cannot be uploaded if context is defined in
>> server.xml
>>
>>
>> I have below in server xml,
>>
>>
>> Host name="Myapp.com" appBase="path  to public_html folder">
>>www.myapp.com
>>myuserid.myhostingprovider.com
>>
>>>docBase="path to /tomcat/webapps/manager">
>>
>> 
>>
>
> You seem to specify the same directory for Host's appBase and Context's
> docBase. That is wrong.
>
> AppBase is a place where you will be putting your web applications (.war
> files or directories). On default Tomcat installation that is "webapps"
> directory.
>
> DocBase is a place where single web application resides. It may be
> relative to AppBase (e.g. "ROOT"), or absolute (e.g.
> "/usr/local/tomcat/webapps/ROOT").
>
> The two should not point to the same directory.
>
>
> Next, configuring contexts in server.xml is not recommended [1]. You
> should remove  elements from your server.xml, and move them to
> /META-INF/context.xml in web applications. If you do that, also remove
> docBase attributes.
>
> -Ognjen
>
> [1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.
> html#Defining_a_context
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Deploy application as Root

2014-09-10 Thread Kiran Badi
Hi,

I am trying to deploy application as ROOT.war in tomcat  7.50 provided by
hosting service provider, but for some reasons I get below message

FAIL - War file "ROOT.war" cannot be uploaded if context is defined in
server.xml


I have below in server xml,


Host name="Myapp.com" appBase="path  to public_html folder">
  www.myapp.com
  myuserid.myhostingprovider.com
  
  
  
   


However the ROOT.war gets deployed correctly in my local
machine.Appreciate some help here for fixing this issue.



- Kiran


Re: Tomcat-user versus StackOverflow

2014-03-14 Thread Kiran Badi
I think I prefer  to stay with Tomcat users list. Problem with SO is that
they close the questions without the second thought.Its becoming more of
kind of dictatorship. Too generic , close it and too easy, flame the poster
altitude.

Again I don't have any issues with SO and I did receive lot of assistance
from there and I still use it,but would not prefer apache list going SO way
till they provide the same flexibility as we get in apache list.


On Fri, Mar 14, 2014 at 2:59 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Joesph,
>
> On 3/14/14, 12:38 PM, Joesph Bleau wrote:
> > It's refreshing to see people who still care about user-list
> > communities. They seem to foster the kind of individuals I enjoy
> > communicating with, but are sadly dwindling.
>
> Come meet some of us in Denver in April:
> http://apachecon.com/
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJTI1F/AAoJEBzwKT+lPKRYmIUP/3jDkiqAmoKMusa5SFP66L3z
> cGf0j32MoU2jeNs09GUBpCwC2CpBeD7tqebhPoSP4g30qsxaqFIFeiJo0J1JVxkg
> 6w6n7YUhe9R5jzoJW2GKhJIXp7RobqEenfXS5KGYWspPxoeZHemSvA4Mk0kWjY9b
> 2zfK8fQLrXNcGkTmn+xwEFo6j37RWvTWsG6quIahTcoBExGkVjwq6CMxFIxKvU6r
> iBC8DQxg5b93Gpx5LWEqYgi2gX4cztqVzjQPUXxCKo77ozKt5pzF4JKKvEPhsU+2
> x6ZyINtic4dbCs0/CG+xc37RDrgUfUOyJQRdfpZtyTcUX/EB1EEGM+EZ6eSFBE91
> YjCPH9VF7I8a/MXkEvraAUviDa9faGG+uTX/+qQHNFoBF6AJh5ZpgC6lh+uv9Wsl
> 513QNkGigfkk5/l4Fcuy22wsdgxNahop1hsuJL+7X4kGuvr2CZKFQOYl8jOBcLpp
> 5h7E8no1PfrSnTlwYNlTdOjhlV5RvD2FUVTniYWn7nxmx2I+MK7kFD9EwQCgXfUw
> saZeA+5URpSOaNN9I2u225seZWiEtNvepZ0PXdQZ9N9LhW4R1L2ci/UAwAacyqPX
> RPebVF4Z5LqLDV/GhnPjyR2qoLpraPkTngXzT3Eua0WrHNcW6lNlsJR8C8yF/dfw
> HSFm34lSXYyfWmPGJ0lk
> =Ai2E
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext for tomcat 7.0.50

2014-02-06 Thread Kiran Badi
I had a missing jars in lib for this version of tomcat. Once added java
mail api jars, it started to work again.




On Thu, Feb 6, 2014 at 4:28 AM, Shivam Mishra  wrote:

> 2014-02-06 14:50:33 Commons Daemon procrun stderr initialized
> 06-Feb-2014 14:50:34.636 INFO [main]
> org.apache.catalina.core.AprLifecycleListener.init The APR based Apache
> Tomcat Native library which allows optimal performance in production
> environments was not found on the java.library.path: C:\Program
> Files\Apache Software Foundation\Tomcat
> 8.0\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
> Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;;C:\Program Files
> (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS
>
> Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
> Files (x86)\EgisTec MyWinLocker\x64;C:\Program Files (x86)\EgisTec
> MyWinLocker\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program
> Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R)
> Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management
> Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management
> Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management
> Engine Components\IPT;C:\Program
>
> Files\Java\jdk1.8.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program
> Files (x86)\MySQL\MySQL Utilities 1.3.5\;;.
> 06-Feb-2014 14:50:35.189 INFO [main]
> org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
> ["http-nio-8080"]
> 06-Feb-2014 14:50:35.245 INFO [main]
> org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared
> selector for servlet write/read
> 06-Feb-2014 14:50:35.251 INFO [main]
> org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
> ["ajp-nio-8009"]
> 06-Feb-2014 14:50:35.258 INFO [main]
> org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared
> selector for servlet write/read
> 06-Feb-2014 14:50:35.258 INFO [main]
> org.apache.catalina.startup.Catalina.load Initialization processed in 1511
> ms
> 06-Feb-2014 14:50:35.348 INFO [main]
> org.apache.catalina.core.StandardService.startInternal Starting service
> Catalina
> 06-Feb-2014 14:50:35.349 INFO [main]
> org.apache.catalina.core.StandardEngine.startInternal Starting Servlet
> Engine: Apache Tomcat/8.0.1
> 06-Feb-2014 14:50:35.375 INFO [localhost-startStop-1]
> org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> application directory C:\Program Files\Apache Software Foundation\Tomcat
> 8.0\webapps\docs
> 06-Feb-2014 14:50:36.370 INFO [localhost-startStop-1]
> org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> application directory C:\Program Files\Apache Software Foundation\Tomcat
> 8.0\webapps\examples
> 06-Feb-2014 14:50:37.825 INFO [localhost-startStop-1]
> org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> application directory C:\Program Files\Apache Software Foundation\Tomcat
> 8.0\webapps\manager
> 06-Feb-2014 14:50:37.936 INFO [localhost-startStop-1]
> org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> application directory C:\Program Files\Apache Software Foundation\Tomcat
> 8.0\webapps\name
> 06-Feb-2014 14:50:38.023 INFO [localhost-startStop-1]
> org.apache.catalina.startup.HostConfig.deployDirectory Deploying web
> application directory C:\Program Files\Apache Software Foundation\Tomcat
> 8.0\webapps\ROOT
> 06-Feb-2014 14:50:38.100 INFO [main]
> org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
> ["http-nio-8080"]
> 06-Feb-2014 14:50:38.115 INFO [main]
> org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler
> ["ajp-nio-8009"]
> 06-Feb-2014 14:50:38.120 INFO [main]
> org.apache.catalina.startup.Catalina.start Server startup in 2861 ms
>
>
>
> On Thu, Feb 6, 2014 at 2:37 PM, Mark Thomas  wrote:
>
> > On 06/02/2014 03:32, Kiran Badi wrote:
> > > Hi All,
> > >
> > > I have 3 tomcats installed in my machine, one is 7.0.27, 7.0.35 and
> > 7.0.50
> > >
> > > Now when I deploy my war file to 7.0.27/7.0.35 it works perfectly fine
> > and
> > > deployment goes through.
> > >
> > > But on 7.0.50 it fails with below message,
> > >
> > > FAIL - Application at context path /myapp could not be started
> > >
> > > FAIL - Encountered exception org.apache.catalina.LifecycleException:
> > > Failed to start component
> > >
> >
> [StandardEngine[Catalina].StandardHost[localho

Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext for tomcat 7.0.50

2014-02-05 Thread Kiran Badi
Hi All,

I have 3 tomcats installed in my machine, one is 7.0.27, 7.0.35 and 7.0.50

Now when I deploy my war file to 7.0.27/7.0.35 it works perfectly fine and
deployment goes through.

But on 7.0.50 it fails with below message,

FAIL - Application at context path /myapp could not be started

FAIL - Encountered exception org.apache.catalina.LifecycleException:
Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]

In catalina logs I see below message,

eb 05, 2014 10:22:21 PM org.apache.catalina.deploy.NamingResources cleanUp
WARNING: Failed to retrieve JNDI naming context for container
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
so no cleanup was performed for that container
javax.naming.NameNotFoundException: Name [comp/env] is not bound in
this Context. Unable to find [comp].
at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
at 
org.apache.catalina.deploy.NamingResources.cleanUp(NamingResources.java:988)
at 
org.apache.catalina.deploy.NamingResources.stopInternal(NamingResources.java:970)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at 
org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5664)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:141)
at 
org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1258)
at 
org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:716)
at 
org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:221)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at 
org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at 
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:611)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at 
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
at 
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


I am not sure as why its not able to find JNDI resource when other 2
version sitting on same local host can find it.

I have JRE 7 and I am on windows vista home edition with 32 bit OS.

- Kiran


Re: Trying to install tomcat 7.0.35 but after installation it shows me as Apache Tomcat 7.0.2

2013-01-23 Thread Kiran Badi
Resolved and I am good now.Updated to 7.0.35.

Thanks Chris

On Wed, Jan 23, 2013 at 3:54 PM, Kiran Badi  wrote:

> My bad, I removed 7.0.2 instance by using service.bat uninstall from cmd
> prompt and now I am not able to install updated one. getting the below
> message.Do I need to set environment variables, I dont remember setting it
> earlier for any of version I had installed.
>
> Microsoft Windows [Version 6.0.6002]
> Copyright (c) 2006 Microsoft Corporation.  All rights reserved.
>
> C:\Windows\system32>cd
> "C:\apache-tomcat-7.0.35-windows-x86\apache-tomcat-7.0.35
> \bin"
>
> C:\apache-tomcat-7.0.35-windows-x86\apache-tomcat-7.0.35\bin>service.bat
> install
>
> The tomcat.exe was not found...
> The CATALINA_HOME environment variable is not defined correctly.
> This environment variable is needed to run this program
>
> C:\apache-tomcat-7.0.35-windows-x86\apache-tomcat-7.0.35\bin>
>
> On Wed, Jan 23, 2013 at 2:42 PM, Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA256
>>
>> Chris,
>>
>> On 1/23/13 4:32 AM, chris derham wrote:
>> > If you really want to run 7.0.35 instead of 7.0.2, then remove the
>> > service for 7.0.2, and then install the 7.0.35 service. To
>> > uninstall the service, go to cmd prompt and from CATALINA_HOME\bin
>> > run service uninstall.
>>
>> +1
>>
>> - -chris
>> -BEGIN PGP SIGNATURE-
>> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
>> Comment: GPGTools - http://gpgtools.org
>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>>
>> iEYEAREIAAYFAlEAPSgACgkQ9CaO5/Lv0PDtIwCePDlf9/2pKV+bipP5aDtCjqYF
>> PtsAnRLMKENcNaSb6C5zQNbBgYrDkl82
>> =bB/S
>> -END PGP SIGNATURE-
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


Re: Trying to install tomcat 7.0.35 but after installation it shows me as Apache Tomcat 7.0.2

2013-01-23 Thread Kiran Badi
My bad, I removed 7.0.2 instance by using service.bat uninstall from cmd
prompt and now I am not able to install updated one. getting the below
message.Do I need to set environment variables, I dont remember setting it
earlier for any of version I had installed.

Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>cd
"C:\apache-tomcat-7.0.35-windows-x86\apache-tomcat-7.0.35
\bin"

C:\apache-tomcat-7.0.35-windows-x86\apache-tomcat-7.0.35\bin>service.bat
install

The tomcat.exe was not found...
The CATALINA_HOME environment variable is not defined correctly.
This environment variable is needed to run this program

C:\apache-tomcat-7.0.35-windows-x86\apache-tomcat-7.0.35\bin>

On Wed, Jan 23, 2013 at 2:42 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Chris,
>
> On 1/23/13 4:32 AM, chris derham wrote:
> > If you really want to run 7.0.35 instead of 7.0.2, then remove the
> > service for 7.0.2, and then install the 7.0.35 service. To
> > uninstall the service, go to cmd prompt and from CATALINA_HOME\bin
> > run service uninstall.
>
> +1
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iEYEAREIAAYFAlEAPSgACgkQ9CaO5/Lv0PDtIwCePDlf9/2pKV+bipP5aDtCjqYF
> PtsAnRLMKENcNaSb6C5zQNbBgYrDkl82
> =bB/S
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: Trying to install tomcat 7.0.35 but after installation it shows me as Apache Tomcat 7.0.2

2013-01-22 Thread Kiran Badi
Also I see version number 7.0.2 in welcome page.
On Jan 22, 2013 11:52 PM, "Caldarale, Charles R" 
wrote:

> > From: Kiran Badi [mailto:ki...@poonam.org]
> > Subject: Trying to install tomcat 7.0.35 but after installation it shows
> me as Apache Tomcat 7.0.2
>
> > I downloaded the Tomcat 7.0.35 from core binary distribution.32-bit
> > Windows zip<http://www.motorlogy.com/apache/tomcat/tomcat-7/v7.0.35/
> > bin/apache-tomcat-7.0.35-windows-x86.z>
>
> > I wanted to install this as service in windows 32 bit vista home
> premium.I
> > installed it correctly and I can open and get into admin page.
>
> Are you actually running it as a service, or from the .bat scripts?
>
> > However in admin page of tomact I see the version as
> > Apache Tomcat 7.0.2
>
> What "admin" page are you referring to?  Tomcat has a default welcome page
> which shows the version, a manager app (which requires configuration to
> access), and the service monitor (tomcat7w.exe); which one are you talking
> about?
>
> > Any ideas as why I am seeing 7.0.2 rather than 7.0.35 ?
>
> I just downloaded and installed the 7.0.35 32-bit .zip file from the same
> mirror, with no problems.  Are you sure you don't have an earlier version
> of Tomcat installed as well?  (Note that 7.0.2 never progressed beyond
> beta.)
>
> You should probable remove all the Tomcats you can find, and reinstall
> from a fresh download.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail and
> its attachments from all computers.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: Trying to install tomcat 7.0.35 but after installation it shows me as Apache Tomcat 7.0.2

2013-01-22 Thread Kiran Badi
I want to run it as service.I installed this by running service bat file
from cmd prompt.once installation was success full.I checked local
host:8080.over there I see version 7.0.2 .I cannot remove all tomcats since
it will large effort for me.but I know there nothing wrong with those.they
sit in different directories.I will paste the screen to marrow as and will
rechech once again.
 On Jan 22, 2013 11:52 PM, "Caldarale, Charles R" <
chuck.caldar...@unisys.com> wrote:

> > From: Kiran Badi [mailto:ki...@poonam.org]
> > Subject: Trying to install tomcat 7.0.35 but after installation it shows
> me as Apache Tomcat 7.0.2
>
> > I downloaded the Tomcat 7.0.35 from core binary distribution.32-bit
> > Windows zip<http://www.motorlogy.com/apache/tomcat/tomcat-7/v7.0.35/
> > bin/apache-tomcat-7.0.35-windows-x86.z>
>
> > I wanted to install this as service in windows 32 bit vista home
> premium.I
> > installed it correctly and I can open and get into admin page.
>
> Are you actually running it as a service, or from the .bat scripts?
>
> > However in admin page of tomact I see the version as
> > Apache Tomcat 7.0.2
>
> What "admin" page are you referring to?  Tomcat has a default welcome page
> which shows the version, a manager app (which requires configuration to
> access), and the service monitor (tomcat7w.exe); which one are you talking
> about?
>
> > Any ideas as why I am seeing 7.0.2 rather than 7.0.35 ?
>
> I just downloaded and installed the 7.0.35 32-bit .zip file from the same
> mirror, with no problems.  Are you sure you don't have an earlier version
> of Tomcat installed as well?  (Note that 7.0.2 never progressed beyond
> beta.)
>
> You should probable remove all the Tomcats you can find, and reinstall
> from a fresh download.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail and
> its attachments from all computers.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Trying to install tomcat 7.0.35 but after installation it shows me as Apache Tomcat 7.0.2

2013-01-22 Thread Kiran Badi
Hi All,

>From this link,

http://tomcat.apache.org/download-70.cgi

 I downloaded the Tomcat 7.0.35 from core binary distribution.32-bit
Windows 
zip
 
(pgp
, 
md5
)

http://www.motorlogy.com/apache/tomcat/tomcat-7/v7.0.35/bin/apache-tomcat-7.0.35-windows-x86.zip

I wanted to install this as service in windows 32 bit vista home premium.I
installed it correctly and I can open and get into admin page.

However in admin page of tomact I see the version as
Apache Tomcat 7.0.2

Any ideas as why I am seeing 7.0.2 rather than 7.0.35 ? I need to install
7.0.35

- Kiran


[OT]- MYSQL + Tomcat + Apache + Java Hosting in India

2012-10-03 Thread Kiran Badi

Hi

Not sure if this list accepts these types of questions here,still asking 
shamelessly sorry for this.


If anyone knows some good web hosting provider in India, can they reply 
here or to me privately.


I checked with bigrock,rediff and some other known provider like sify 
and they said that they do not support java  or tomcat.


Thanks
Kiran Badi

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Where do I store Images in tomcat structure so that I can retrive it properly in all browsers

2012-09-22 Thread Kiran Badi

On 9/17/2012 10:20 PM, Christopher Schultz wrote:

If you instead implemented your own "aliases" feature using a servlet,
you could do it in a smarter way because you understand your own URL
space: you might always know that /images/X will translate directly
into /file/place/on/the/disk/X and you don't have to do a prefix
match. You could do something like this:

// configured once
Map dirMapping = ...;
String imageURIPrefix = "/images/";

// For each request:
String uri = request.getRequestURI();
String imageDirStr = uri.substring(0, uri.indexOf('/'));
File dir = dirMapping.get(imageDirStr);

Now you know where your file should be, and there wasn't any linear
lookup: it was all done using hashes.


Ah, I can implement it, if my understanding is correct, what you are 
suggesting here is that grab the incoming url, check if they are making 
a request to Images, if yes then point the url to the appropriate 
directory of images for serving.I can do this if it gives me good 
performance.


I was under impression that Tomcat checks for the alias only once during 
it start up phase and somehow maintains the list of it in memory and 
will do automatic match without scanning each alias.My bad.


Alias as per my understanding is the one of the places where Tomcat 
looks for resources to  serve for the requests.


   Probably not: the suggestion was to use, say, ${imagePrefix} in your
   context's aliases setup to simplify the re-location of your image root
   on disk.

I did not get this probably one of the reasons could be I am still 
struggling to come to speed.I might need some more days to think as what 
this means in terms of implementation.


   There's really only one rule for servlet programming:

   Don't use class-level data that changes.

   There are other considerations, of course, but a servlet is not a
   sacred beast. There's only one way to learn how to do it properly:
   fall on your face a few times.

Yes I understand this somewhat and thats the reason probably I am 
somewhat hesitating to reuse some of classes and thats increasing size 
of my code and probably duplicating my code.But again there are some 
good things, I can extend those classes in future and can bring down 
those modules if required without impacting any thing or making an 
changes to existing code.This is only plus point I can see 
now.Everything now is independent of each other. Finally at least I am 
enjoying doing something good rather than finding silly bugs and chasing 
developers for fixing those.


I will upgrade to 7.30 shortly if it saves me some memory.

Thanks Chris and Konstantin.Appreciate your guidance.




Re: Where do I store Images in tomcat structure so that I can retrive it properly in all browsers

2012-09-13 Thread Kiran Badi

On 9/13/2012 8:13 AM, Christopher Schultz wrote:

Large sites will use a single URL that ends up resolving the images
from some kind of data source. That data source might be a disk (e.g.
you could forward to the DefaultServlet) or a database (relational or
otherwise) where you would write your own servlet to retrieve the data
yourself.

I would use a servlet that gets the image identifier from the request
parameters or "path info" and then continues from there. As Konstantin
points out, using Tomcat's "aliases" feature means that these requests
may have to perform a linear search through all the aliases to find
the requested resource. If you write a custom servlet, it will likely
perform much better than that.
 this is what I am doing it right now and maybe bit different from what 
large sites do.I can see the point and can write filter which will scan 
the request url and point it to respective images directory and then 
serve it.



I store the images in the respective directory, for example for category 
A with subcategory sc, I store in C://A/sc and then write images names 
to the database.


and via jsp

I get this in this format,

img src ="A/test/{Imagename}" with image name coming from the database.

Below is way it looks in requests.

URLMethodResultTypeReceivedTakenInitiator 
Wait‎‎Start‎‎Request‎‎Response‎‎Cache read‎‎ Gap‎‎
/our/UploadedImages/sc/cl1.jpgGET200image/jpeg40.73 
KB0.54 s21904051410967
/our/UploadedImages/sc/cl2.jpgGET200image/jpeg45.33 
KB327 ms21902497801186
/our/UploadedImages/sc/cl3.jpgGET200image/jpeg26.39 
KB405 ms219014026501108
/our/UploadedImages/sc/cl4.jpgGET200image/jpeg40.73 
KB0.51 s21902812340998
/our/UploadedImages/sc/cl5.jpgGET200image/jpeg23.43 
KB0.51 s21904051100


However I am not getting if I am writing the single servlet which 
resolves the images uri, how will it help in improving performance ? If 
Images are in different directories, isn't tomcat needs to scan that 
directory and resolve it ?


Initially I had a single directory,but though it would be nightmare in 
case of maintenance, so thought of refactoring it now.


>>>>

3. Having 200 aliases means that Tomcat would have to try 200
different prefixes for each resource lookup. Maybe it would not be
noticeable (compared to the other time spent in delivering a
response), but it still seems like a waste of time.

Why should it do resource lookup when I am telling it to look at the exact 
directory by giving it the exact name of the file ? In fact while storing also 
I am
giving it the exact directory path to where it needs to store ?

Do you believe my understanding the way aliases works is incorrect ?



2. It is possible to define a system property (via -D in the options

list at startup, or via catalina.properties file) and reference it as
${propname}.

This approach will require me to refactor my existing code,so I will think of 
using this in my next module.There are couple of things I am planning to get it 
dynamically ,but again somewhat scared if I can ever write thread safe 
servlets/classes which can serve multiple concurrent requests.Currently I have 
close to 50% of code which is reused.But I need to deal with this sooner the 
better else I am going to have war file which will be atleast 40mb in size with 
unmanageable number of jsp/servlets/beans.

Thanks Chris and Konstantio for replies.Currently I am on 7.027/7.011 and maybe 
after some days, I will upgrade to 7.030 or still better have one more TC for 
testing purpose.

- Kiran Badi




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Where do I store Images in tomcat structure so that I can retrive it properly in all browsers

2012-09-11 Thread Kiran Badi

On 9/8/2012 4:09 PM, Konstantin Kolinko wrote:

Regarding the aliases feature:

single path -> multiple file paths: No
multiple different non-intersecting paths -> multiple file paths: Yes

As far as I remember, an example of using multiple aliases is present
in documentation.

Thanks Konstantin, it seems to be working perfectly fine.

This is how I am doing it now,

aliases="/UploadedImages=c:/UploadedImages,/st=c:/st,/sb=c:/sb,/UploadedImages/scr=c:/UploadedImages/scr,/UploadedImages/scyr=c:/UploadedImages/scyr,/UploadedImages/sem=c:/UploadedImages/sem">


Now I have one clarification, I am going need  close to 150 
categories(think of marketplace) and there will be fair amount of images 
upload which my users will be doing.


I expect the aliases to grow till 150 to 200 paths, do you feel this is 
correct.I am not sure as how large sites deal when they have heavy 
volumes of images getting uploaded on daily basis.


Do I need to cautious here on anything.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Where do I store Images in tomcat structure so that I can retrive it properly in all browsers

2012-09-08 Thread Kiran Badi

Thanks Konstantin, I will check this and revert back.

On 9/8/2012 4:09 PM, Konstantin Kolinko wrote:

2012/9/8 Kiran Badi :

Hi Chris and All,

I hope its alright if I reopen my old thread since I want to expand my
earlier requirement.

I have a requirement  where for each category I need to have separate
folders where the Images should go in.

Currently for all categories my images goes into the C://UploadedImages
folder and it working fine.



Now I was wondering , if its possible that I can do something like,



Regarding the aliases feature:

single path -> multiple file paths: No
multiple different non-intersecting paths -> multiple file paths: Yes

As far as I remember, an example of using multiple aliases is present
in documentation.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Where do I store Images in tomcat structure so that I can retrive it properly in all browsers

2012-09-07 Thread Kiran Badi

Hi Chris and All,

I hope its alright if I reopen my old thread since I want to expand my 
earlier requirement.


I have a requirement  where for each category I need to have separate 
folders where the Images should go in.


Currently for all categories my images goes into the C://UploadedImages 
folder and it working fine.




Now I was wondering , if its possible that I can do something like,



I should be having 100+ products with somewhat similar design in 
nature,I just want to put them in their own folders.


Can I do this with Tomcat 7.027 or latest version.I can upgrade if 
required.I remember sometimes back this was requirement for one of the 
posters here and I believe someone had asked him to file for enhancement 
request.So was wondering if this can be done now.


If this cannot be done with Tomcat, is their any other open source 
solution for this.I can code couple of lines if this saves me some bugs.


On 6/5/2012 7:41 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kiran,

On 6/5/12 1:31 AM, Kiran Badi wrote:

After playing around for a day,

this is another solutions which worked for me,


with Tomcat 7.0.11 in context.xml

Good, except that you should really upgrade to the latest Tomcat 7.0
version. Plenty of security fixed have been shipped since 7.0.11.


I think now I understand as how aliases work, /UploadedImages is
the aliaspath and c:/UploadedImages is the docbase to which it
refers.

Is this understanding correct ?

/UploadedImages is the URL where resources in C:\UploadedImages can be
requested. The term "docbase" doesn't really apply as it has a number
of connotations that aren't appropriate here.


In manager app I see something called /files , not sure as what is
this ?

That is likely to be another webapp, but I have no idea where in the
manager app you are looking, so I can't really comment.

Remember that Tomcat will (by default) auto-deploy any directory in
the CATALINA_BASE/webapps directory -- even those that you don't
consider to be a legitimate webapp. So, if you have a directory called
"files" in there, then Tomcat will deploy that into "/files" and
possibly expose some resources that you hadn't intended to be
available via HTTP.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/OE5UACgkQ9CaO5/Lv0PDk9gCgizMK2Qv4pjSPt+4zNORyQ59D
PfgAoLWM3pz9K/aPLIvGuwKHQKVmYOxF
=M4dM
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] Re: Warning: js modified in the future- not able to find the files

2012-08-08 Thread Kiran Badi

Thanks Pid for reply.
Unfortunately nothing  changed on my system.Even time was correct and I 
did not see any logged time event events anywhere in logs.


Just a js library which had close to 12 files in it from apache folder 
disappeared without a trace.But the good news was that JS Library inside 
the app war file did not get impacted.
Using that war file I was able to recover the library.Maybe its just my 
good luck.


Probably since library was inside war file, it did not get impacted.

Strange issue.

On 8/5/2012 1:35 PM, Pid wrote:

On 01/08/2012 04:35, Kiran Badi wrote:

Hi All,

I have TC 7.0.11/7.0.27 and Apache 2.2 all sitting in the C://Program
Files/Apache Software Foundation folder.

I came across a strange issue today where in close to 10+ Javascript
files were missing from the folder.

Below is the way I do things
I use dreamweaver for designing the page and under apache server, I drop
all js/css/html files.Once design is finalised,I move those HTML/JS/CSS
files to Netbeans+ TC 7.0.11 environment for building serverside code,
and once its ready, I create the  build  and then I deploy it in TC 7.0.27.

Today for some reasons close to 10 + same js files were missing from all
servers, I am lost as how to recover those files now,

I came across this message while rebuilding the project today,

Warning:  modified in the future.
Warning: js modified in the future.
Warning: js\lib modified in the future.

I dont know as what is cause of this,but I know nothing has changed from
my system today.There is nothing in event logs

My environment is Win7 Home premium 32 bit,I am totally at the loss now
as most of my client side functionality is gone and I am still assessing
the damage to java code.

Just wanted to check if there exists any way to get back those files.

That's not a Tomcat problem.
Check the clocks on everything that is writing to the file system.


p


- Kiran

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Warning: js modified in the future- not able to find the files

2012-07-31 Thread Kiran Badi

Hi All,

I have TC 7.0.11/7.0.27 and Apache 2.2 all sitting in the C://Program 
Files/Apache Software Foundation folder.


I came across a strange issue today where in close to 10+ Javascript 
files were missing from the folder.


Below is the way I do things
I use dreamweaver for designing the page and under apache server, I drop 
all js/css/html files.Once design is finalised,I move those HTML/JS/CSS 
files to Netbeans+ TC 7.0.11 environment for building serverside code, 
and once its ready, I create the  build  and then I deploy it in TC 7.0.27.


Today for some reasons close to 10 + same js files were missing from all 
servers, I am lost as how to recover those files now,


I came across this message while rebuilding the project today,

Warning:  modified in the future.
Warning: js modified in the future.
Warning: js\lib modified in the future.

I dont know as what is cause of this,but I know nothing has changed from 
my system today.There is nothing in event logs


My environment is Win7 Home premium 32 bit,I am totally at the loss now 
as most of my client side functionality is gone and I am still assessing 
the damage to java code.


Just wanted to check if there exists any way to get back those files.

- Kiran

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Happy Birthday, Chuck!

2012-07-27 Thread Kiran Badi
please accept my best wishes. chuck.
On Jul 27, 2012 3:19 AM, "Leon Rosenberg"  wrote:

> Maybe a little bit late, but still!
> Happy Birthday Chuck!
> Leon
>
> On Thu, Jul 26, 2012 at 10:46 PM, Rainer Jung 
> wrote:
> > On 26.07.2012 15:46, Gregor S. wrote:
> >>
> >> Hi Chuck,
> >>
> >> thanks again for your valuable comments on this list, and keep it up!
> >>
> >> Cheers!
> >
> >
> > +2 !
> >
> > Rainer
> >
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Logging framework for Tomcat -Exceptions

2012-07-11 Thread Kiran Badi

On 7/12/2012 7:20 AM, Tim Watts wrote:

No offense, but this really isn't a list for teaching Java.
But what the hell, I'll make one "exception":

public class DAOException extends Exception {
 public DAOException(String msg) {
super();
 }
 
 public DAOException(String msg) {

super(msg);
 }
 
 public DAOException(String msg, Throwable cause) {

super(msg, cause);
 }
 
 public DAOException(Throwable cause) {

super(cause);
 }
}

That's all I'll s say on this thread.
I know Tim something was missing.Just 20 mins back I fixed the class,now 
I get the cool stack trace,damm it file upload stuff is breaking and 
passing null values.I will fix it.


I know this is not a place to learn Java and thats not my intention.Its 
time for me to implement robust logging framework,so thought let me ask 
here as which is light weight and yet can log exceptions preferably both 
handled and unhandled.


and thanks for some headsup.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Logging framework for Tomcat -Exceptions

2012-07-11 Thread Kiran Badi

Hi,

I have below code for catching DAO exceptions,but I feel its not correct 
way to do this,Can some one point me to some library which will capture 
all exceptions which my code will throw and works with tomcat. I 
implementing Model2 mvc pattern and to my surprise I am able to show 
values to the view but database is not getting inserted.I am lost given 
that no exception is also being thrown anywhere.All logs looks clean but 
DB is not updated.


import java.sql.Connection;

public interface DAO {

Connection getConnection() throws DAOException;

}

public class DAOException extends Exception {
private static final long serialVersionUID = 19192L;

public DAOException() {
}
public DAOException(String message) {
this.message = message;
}
@Override
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
private String message;

@Override
public String toString() {
return message;
}
}

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection pool issue

2012-06-28 Thread Kiran Badi

On 6/27/2012 8:35 PM, Christopher Schultz wrote:

100 active db connections sounds like a lot. Do you really need to
support 100 simultaneous connections to your database? Can your
database support that many connections with active queries from each?
Do you have a cluster? Remember that each member in the cluster will
therefore open a maximum of 100 connections to your database. 10
cluster members means 1000 simultaneous connections.
to begin with I am targetting 1000 users at any time.I know this is too 
much to dream off.But again let me try for that.


I will enable abondered detection settings.Thanks for bringing to notice.

There's no time like the present: this problem will only get worse
over time.

I had written a bunch of DAO  classes sometimes back,but there was bug in DB 
design(for one functionality,I forgot to relate tables properly) and after 
fixing that I somehow forgot to to use model 2 design(again my bad its hard to 
wire the brain to work this way when you can just make easy calls and then 
present data to the client and yet do MVC) and started working  old way and due 
to this db calls went into the servlet.For other module I am fixing this and 
will make action servlet which will read request uri and then do the 
appropriate action.I have almost visualised,inserts and deletes.Trying to find 
the way to see how to make edit work.I have around 10 images and around 10 
fields which I need to perists somewhere before final insert.

God bless me.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection pool issue

2012-06-26 Thread Kiran Badi
Probably waited too long for a connection. What does your pool 
configuration look like? Look in META-INF/context.xml or, I suppose, in 
conf/server.xml for  elements.


 type="javax.sql.DataSource"

   maxActive="100" maxIdle="30" maxWait="1"
   username="user" password="xxx" 
driverClassName="com.mysql.jdbc.Driver"

   url="jdbc:mysql://localhost:3306/mysitedb"/>

This is my configuration in context.xml Chris.

 I had a bug in my code  and I was not closing connection, I fixed it 
and now this is working fine.

an architectural comment: it's probably not a great idea to
obtain a database connection directly from your Servlet. Doing so
likely ties your business logic directly to both the servlet API *and*
the JDBC API.

If you want to switch to some other data source (e.g. a
non-JDBC-supported data source like MongoDB, Cassandra, etc.), then
you have to re-write your whole app. If you want to support Websocket,
then you have to completely re-write your webapp. If you want to
create an Android or Swing-based version, you have to completely
re-write your app. See the pattern here?


I know existing design is somewhat a kind of limitation,but again at 
this point ,its just to hard to implement this change.


Let me think over this.It will take sometime.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection pool issue

2012-06-26 Thread Kiran Badi
On 6/26/2012 12:09 PM, Steven Sinclair wrote:
> You can use java jmx console to monitor the number of db connections.
Thanks Steven, I will check this.Actually servlet was leaking connection
and I had forgot to close connection.Fixed it now.

But I still need to monitor DB side.I will check jmx console.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat DBCP Connection pool issue

2012-06-25 Thread Kiran Badi

Hi All,

While testing the pagination links ,I am getting below error,

SEVERE: null
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, 
pool error Timeout waiting for idle object
at 
org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:114)
at 
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at 
indianads.getServicesTourDetail.doGet(getServicesTourDetail.java:106)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at 
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

Was able to get connection
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
at 
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
at 
org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1144)
at 
org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)

... 24 more

Where should I look to see as how many connection are establised on the 
DB side and how many I have still that I can use ?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Javamail exception in tomcat 7.0.11

2012-06-19 Thread Kiran Badi

On 6/19/2012 11:09 PM, Mark Eggers wrote:

If I remember correctly, you're using NetBeans. There are at least two ways of 
removing the JAR from the packaging without impacting your project.

If you're using the NetBeans standard build mechanism:

1. Go to Project->Properties->Libraries
2. Uncheck the 'Package' checkbox next to the JAR that should not be included
Yes Mark, done this as well,but still get reference error for those 
jars.There is no checkbox, you just add it and then remove it thats only 
2 options I see.


I will fix this sometime later as now I am ignoring those errors as I no 
longer need those jars.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Protect JSP from Direct Access in Tomcat 7.0.xx

2012-06-19 Thread Kiran Badi

Yup done this Sharon.Thanks
On 6/19/2012 2:03 PM, Sharon Prober (sprober) wrote:

You could always position your jsp's inside the WEB-INF dir
This will enable you to access them only through server redirects rather
than absolute url's

Sharon

-Original Message-----
From: Kiran Badi [mailto:ki...@poonam.org]
Sent: Tuesday, June 19, 2012 3:10 AM
To: Tomcat Users List
Subject: Protect JSP from Direct Access in Tomcat 7.0.xx

Hi All,

I need your guidance again.I have bunch of JSP's close to 100+ which I
need to protect it from direct access.

I have this mapping in web xml and this is not working,It seems that
probably i need to define a role first and then use below settings.But
unfortunately my app is open internet application which does not use
realm at all.


DenyAccesstoDirectJSP

sample.jsp
Sample confirmation JSP
*.jsp  GET
POST  


All my jsp's are residing in the webpages folder of project directory.I
know this is incorrect and probably gives direct access to jsp's.

So I have some clarification to ask,

1. is their a way to tell tomcat to not to serve direct jsp's probably
via web xml

2. Is their any extra setting that is required if I move my JSP's inside
web-inf.I created a folder under web-inf and create sample hello
world.jsp and then tried to invoke that jsp but got 404 message.

- Kiran

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Javamail exception in tomcat 7.0.11

2012-06-19 Thread Kiran Badi

On 6/19/2012 9:55 PM, Pid * wrote:

Unfortunately you've completely omitted the code for setting the
session object, so we can only guess why it's not working.
Yup Pid, I realized it later on when Tim highlighted it.Its fixed 
now.Thanks I am able to send mail comfortably.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Javamail exception in tomcat 7.0.11

2012-06-19 Thread Kiran Badi

On 6/19/2012 11:23 AM, Tim Watts wrote:

I have send mail servlet, which looks something like below,
>  
>  protected void doPost(HttpServletRequest request, HttpServletResponse

>  response) throws ServletException, IOException {
>   String emailRecipient = request.getParameter("name");
>//   String emailRecipient = "xxx";
>try {
>Message msg = new MimeMessage(this.session);

Looks like your mail session isn't getting initialized properly and you
left out that piece of the puzzle.  How&  where does 'this.session' get
set?


This was the real issue.Caught the exception now and could see the root 
cause now and fixed it.Eureka you guys are genius and eye  for detail.


One more suggestion I need, I had mail.jar/mailapi.jar/pop3.jar/smtp.jar 
all over, they were in project library, tomcat lib and I remove all 
those reference and had just mail.jar in tomcat lib,bounced the server 
many times and only after that I managed to make this work.


How do you remove safely all reference without impacting the server or 
your build script ? Do you just comment out the reference of jars or 
your physically remove them from the folder ?
Now a days quite often my build fails if I remove or other jars,so want 
to learn this trick as well.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Protect JSP from Direct Access in Tomcat 7.0.xx

2012-06-18 Thread Kiran Badi

On 6/19/2012 10:22 AM, Tim Watts wrote:

Hopefully, you're trying to use or move toward the MVC (Model, View,
Controller) pattern.  If not, you should.  Google "MVC design pattern".
There are many, many frameworks that will make this easier for you (once
you learn them): Struts, Spring MVC...

If you're well into your project and don't want to add a framework to it
you could write a simple servlet that uses an algorithm to map URI paths
to JSPs then forwards to the JSP using a dispatcher.  For instance, you
could put your JSPs in myapp/WEB-INF/jsps.  Then have the servlet map a
URI such as /sample to /WEB-INF/jsps/sample.jsp (all relative
to /myapp).

http://localhost:8080/mysite/WEB-INF/jsp/newjsp.jsp

I just created folder jsp under WEB-INF and then added newjsp.jsp(this
is hello world jsp) and then ran the file.I get 404 error. I am trying
all this with netbeans.

Well I hope by now you understand why or we're just going in circles.
Of course, that URL gives a 404: it's trying to access WEB-INF which is
never accessible via HTTP.  But it is accessible via
RequestDispatcher.forward() -- e.g.:


servletCtx.getRequestDispatcher("/WEB-INF/jsp/newjsp.jsp").forward(request, 
response);

This is kind of like what you said earlier that your servlets are
essentially doing, right?
No I did not do the way you mentioned.I just created a jsp under WEB-INF 
and invoked it directly and got 404.I think I now see what you are 
mentioning.

and its wonderful idea.Makes perfect sense now.Thanks Tim.



This isn't a great approach because you really aren't separating the
model from the view (all the app logic and display logic are housed in
the JSP -- a maintenance nightmare).  But if you don't have time to
re-architect the app now, it will hide the .jsp's from "direct access".
And it will put you in a slightly better position if/WHEN you do
re-architect it.

I think I am using kind of MVC pattern of course the one used around 6
to 8 years back.I am using jsp as view, servlet as kind controller and
then some beans/jstl and el to make my life easy somewhat. I would love
to work with frameworks like spring or struts someday.


They're free you know. :-)  But of course, free software doesn't add
hours to the day.  You're basically rolling your own MVC and that will
probably help you understand better what these frameworks do.  But move
away from this as soon as you can.  They've solved a lot of problems you
probably haven't even considered and they can make your applications
much less brittle if you take the time to learn them well.
Yup I have another project in mind which I plan to roll out soon 
probably either with spring or JSF.Maybe in a month or 2.I am fast 
learner and risk taker.





Ok  let me explain as what I need again,

I have form A with say about 10 fields, lets call this as jsp A. So in
browser bar it looks like http://localhost:8080/mysite/A.jsp


Ah, so you do want SOME of your JSPs to be URL accessible!  Well, if
A.jsp doesn't and never ever will have any dependencies on the
application's state then fine.  Maybe it's true today but I doubt it
will stay that way.  So it's probably better to be consistent and hide
this as well.


User fills this A.jsp and then clicks Submit button. It posts the form
to Servlet B which does insert in the database and then forwards the
request via request dispatcher to  C.jsp which has some confirmation
details in it.(Unique reference ids pulled out from DB).


So on submit, an HTTP POST is sent to http://localhost:8080/mysite/B.
Then servlet B does its work and essentially invokes:

ctx.getRequestDispatcher("/C.jsp").forward(request, response);

then C.jsp sends back the response using data from the session.

Is this right?

(btw, you know your app'ss requirements better than I, but storing all
data in the session isn't the only scope available.  It's likely that a
lot of response data needn't survive past the current request.  In that
case, setting request attributes would be better -- less memory needed,
less likely to pick up data that's inappropriate for the current
request).
Yup thats correct.I will explore this option of moving attributes to 
request.Thanks.

Now with my existing setup if I directly give url like

http://localhost:8080/mysite/C.jsp   I go directly to C Jsp which I
should not because its not suppose to be accessed directly.


Right.  Put C.jsp in WEB-INF, get a request dispatcher for
"/WEB-INF/C.jsp", forward to that and go home.

Yup got it.I think this should resolve my issue.


-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Javamail exception in tomcat 7.0.11

2012-06-18 Thread Kiran Badi

Hi All,

I have send mail servlet, which looks something like below,

protected void doPost(HttpServletRequest request, HttpServletResponse 
response) throws ServletException, IOException {

   String emailRecipient = request.getParameter("name");
//   String emailRecipient = "xxx";
try {
Message msg = new MimeMessage(this.session);
msg.setFrom(new InternetAddress("xxx"));
System.out.println(" remoteAddr is " + emailRecipient + "'");
for (int i = 0; i < 10; i++) {
msg.setRecipients(Message.RecipientType.TO, 
InternetAddress.parse(emailRecipient, false));

}

msg.setSubject("Test email");
msg.setText("Hello This is test mail");
msg.setSentDate(new Date());
Transport.send(msg); *(This is line number 60)*
System.out.println("Message sent OK.");
} catch (Exception ex) {
 
Logger.getLogger(MailSendingServlet.class.getName()).log(Level.SEVERE, 
null, ex);

}
}
}

and I have javamail reference declared in context.xml something like 
this one,



mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"

mail.debug="true" />

and web.xml something like


   My site mail server

mail/mysitemailsession
javax.mail.Session
Container
Shareable


With this setting now I am getting below exception,

avax.mail.MessagingException: Could not connect to SMTP host: localhost, 
port: 25;

  nested exception is:
java.net.ConnectException: Connection refused: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
at 
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)

at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at indianads.MailSendingServlet.doPost(MailSendingServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at 
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
at 
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:288)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)
... 29 more

Now my problem is Where do I change the port setting and why is the 
servlet looking at port 25.I thought it should read config stuff from 
context.xml and should connect to smtp server mentioned in context.xml ? 
I

Re: Protect JSP from Direct Access in Tomcat 7.0.xx

2012-06-18 Thread Kiran Badi

On 6/19/2012 8:03 AM, Tim Watts wrote:

Hi Kiran,

On Tue, 2012-06-19 at 05:40 +0530, Kiran Badi wrote:

Hi All,

I need your guidance again.I have bunch of JSP's close to 100+ which I
need to protect it from direct access.


By "direct access" do you mean that http://host/myapp/sample.jsp is
returning the JSP source code rather than executing it?  Or do you mean
that you don't want any .jsp URLs to be accessible to users?
No its not returning source code.I have couple of jsps where in I use EL 
in those to access session objects and directly accessing those jsps is 
not something I want.



I have this mapping in web xml and this is not working,It seems that
probably i need to define a role first and then use below settings.But
unfortunately my app is open internet application which does not use
realm at all.


DenyAccesstoDirectJSP

sample.jsp
Sample confirmation JSP
*.jsp
GET
POST




This isn't going to help you. Dump it.

Yup its not helping.



All my jsp's are residing in the webpages folder of project directory.I
know this is incorrect and probably gives direct access to jsp's.

So I have some clarification to ask,

1. is their a way to tell tomcat to not to serve direct jsp's probably
via web xml


If by "serve direct jsp's" you mean "don't return source code" then,
yes.  Put them under your web app's directory.  For example, if your web
app's context is 'myapp' then in tomcat it will be deployed under
/webapps/myapp.  You could put them directly in this directory
or group them under a separate directory; 'jsps' for instance.  Then
sample.jsp would be addressed as http://host/myapp/sample.jsp (or
http://host/myapp/jsps/sample.jsp )

Yup I have same setup.Still its not working.my bad.



2. Is their any extra setting that is required if I move my JSP's inside
web-inf.I created a folder under web-inf and create sample hello
world.jsp and then tried to invoke that jsp but got 404 message.


First of all, it's WEB-INF. Case matters.

Ok got it.



No, there's no special "setting" that will directly expose anything
under WEB-INF via a URL.  That's the part of the Servlet Spec.  It's a
Good Thing®.  However, if you're trying to make your JSPs inaccessible
via URLs, then you can move them there and have them indirectly accessed
using a servlet which forwards the request to them.  See
ServletContext.getRequestDispatcher() and RequestDispatcher.forward().
Yup I have lot many of request dispatchers in servlets.Almost all my 
JSP's are using data which is forwarded by servlets.I pull data from db 
via servlet, store it in session scope,forward it to jsp and in jsp 
access it via el.On logoff I remove attributes from the session.



Hopefully, you're trying to use or move toward the MVC (Model, View,
Controller) pattern.  If not, you should.  Google "MVC design pattern".
There are many, many frameworks that will make this easier for you (once
you learn them): Struts, Spring MVC...

If you're well into your project and don't want to add a framework to it
you could write a simple servlet that uses an algorithm to map URI paths
to JSPs then forwards to the JSP using a dispatcher.  For instance, you
could put your JSPs in myapp/WEB-INF/jsps.  Then have the servlet map a
URI such as /sample to /WEB-INF/jsps/sample.jsp (all relative
to /myapp).

http://localhost:8080/mysite/WEB-INF/jsp/newjsp.jsp

I just created folder jsp under WEB-INF and then added newjsp.jsp(this 
is hello world jsp) and then ran the file.I get 404 error. I am trying 
all this with netbeans.

This isn't a great approach because you really aren't separating the
model from the view (all the app logic and display logic are housed in
the JSP -- a maintenance nightmare).  But if you don't have time to
re-architect the app now, it will hide the .jsp's from "direct access".
And it will put you in a slightly better position if/WHEN you do
re-architect it.
I think I am using kind of MVC pattern of course the one used around 6 
to 8 years back.I am using jsp as view, servlet as kind controller and 
then some beans/jstl and el to make my life easy somewhat. I would love 
to work with frameworks like spring or struts someday.


Ok  let me explain as what I need again,

I have form A with say about 10 fields, lets call this as jsp A. So in 
browser bar it looks like http://localhost:8080/mysite/A.jsp


User fills this A.jsp and then clicks Submit button. It posts the form 
to Servlet B which does insert in the database and then forwards the 
request via request dispatcher to  C.jsp which has some confirmation 
details in it.(Unique reference ids pulled out from DB).


Now with my existing setup if I directly give url like

http://localhost:8080/mysite/C.jsp   I go directly to C Jsp which I 
should not because its not suppose to be accessed directly

Protect JSP from Direct Access in Tomcat 7.0.xx

2012-06-18 Thread Kiran Badi

Hi All,

I need your guidance again.I have bunch of JSP's close to 100+ which I 
need to protect it from direct access.


I have this mapping in web xml and this is not working,It seems that 
probably i need to define a role first and then use below settings.But 
unfortunately my app is open internet application which does not use 
realm at all.



DenyAccesstoDirectJSP

sample.jsp
Sample confirmation JSP
*.jsp
GET
POST



All my jsp's are residing in the webpages folder of project directory.I 
know this is incorrect and probably gives direct access to jsp's.


So I have some clarification to ask,

1. is their a way to tell tomcat to not to serve direct jsp's probably 
via web xml


2. Is their any extra setting that is required if I move my JSP's inside 
web-inf.I created a folder under web-inf and create sample hello 
world.jsp and then tried to invoke that jsp but got 404 message.


- Kiran

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: URL Rewriting

2012-06-15 Thread Kiran Badi
Andre, I am a big fan of yours with the way you explain the things in 
neat way.Being a moderator/owner of some of large lists of my profession 
for close to 8 years now I rarely had this kind of patience to write so 
much and so neat.


BTW For the time being, I would prefer to keep this thread on hold 
though point d is something I can experiment with.


Give me sometime to think about to redesign this piece of code.

On 6/15/2012 3:53 AM, André Warnier wrote:

Kiran Badi wrote:

Please inline for my answers Andre.

Kiran,


Why does that "id=17" visible in the URL bother you ?
Is it because of some security aspect ? (that the user could change 
it, and get something else than what they should be getting ?)
Thanks for reminding this aspect.I was not checking for empty 
resultset in my code.Fixed that one now.:)


1) If that is the case, then the basic logic of your application is 
flawed.  If this is information that really needs to be sent by the 
browser to the server, then the browser must have that information. 
And if that information originally comes from the server and is sent 
to the browser, then there is /nothing/ that you can do to block 
some user from playing around with it, before sending it back to the 
server.
If you do not want the user to be able to play around with some 
information, then don't send it to him in the first place. O

Ok let me share the way I wrote this piece,

href="<%=request.getContextPath()%>/getmyservice.do?id=${myid}"> , 
this is link basically where I append the id(id comes from DB) send 
this to the servlet and it the pulls the records from db for 
corresponding id and then sends it back again to JSP for display.But 
I am not able to figure out as why I not getting the url of jsp 
something like


http://localhost:8080/ourstory/myiddata.jsp

.So thought that let me try to rewrite the url in case if its possible.


2) if the browser /must/ send some information to the server as part 
of the URL, then there is /nothing/ that can be done on the server 
side, to stop the browser showing this information in the URL bar.


To illustrate this :
- imagine that the server sends a page to the browser, and this page 
contains a link like :
href="http://localhost:8080/mysite/getmyservice.do?id=my-very-secret-information";>click 
here


Then the user, just by moving his mouse above "click here", sees the 
content of that link at the bottom of his screen, in the status bar, 
right ?
And the user can right-click on "click here", and choose "copy link 
location".
And then the user can open another browser window, and paste this 
URL in the URL bar.
And then the user can modify this link before hitting the return 
button, so that the link now looks like

http://localhost:8080/mysite/getmyservice.do?id=some-other-information
right ?
And all this happens in the browser, /before/ the server even sees 
this browser request.

So what could the server do ?
This is interesting information,how about sending the info as POST 
rather than Get.Not sure if I can convert clicking of the link from 
get from post.but I will try.But again the place where I am 
displaying the generating the links, is not within form, they just 
hyperlinks with id appended to it.


Now I know both get/post can be broken if one wants it,thats all 
together is different case,but for now I need tidy and clean url with 
no id appended to it.


Does my requirement makes sense ?



Since you ask it that way, the answer would be no.

Step 1 : the browser contacts the server via a request with some URL 
(doesn't really mater which one at this stage, but in this first step 
there is no "id" yet).


Step 2 : the server does something with that request, and returns some 
response to the browser.  In this response, somewhere, the "id" to use 
in step 3 must be mentioned, or some other way to retrieve the id.


Step 3 : the browser sends another request to the server, in which 
this "id" parameter must be included (or some other way for the server 
to retrieve the correct id).


Step 4 : the server receives this second request, retrieves the id, 
and does something useful with it.


Now, at step 3, if the browser must include this "id" value in the 
request, it must include it somewhere.  This "somewhere" can be :


a) in the URL of a hyperlink.  In that case, the user will see the id 
parameter in the hyperlink, and in the browser URL bar when the user 
clicks the hyperlink.


b) in the body of the request. In this case, the user would not see 
the id parameter in the URL at step 3.  But it also means that the 
request in step 3 must be a POST request.

That is typically done with a

...

...


You cannot do that with a simple hyperlink. Clicking a hyperlink sends 
a GET request, not a POST request. And GET requests do not have a body.
It also means that the server, at step 2, must compose and

Re: URL Rewriting

2012-06-15 Thread Kiran Badi

 Why are you so eager to remove the ids from the URL?

Thanks Chris for reply,It was looking ugly thats the reason.Anyways, now 
that I have fixed most of gaps, I think I should be fine with this.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: URL Rewriting

2012-06-13 Thread Kiran Badi

Thanks Hassan.

If you want 'clean' URLs you should get rid of the '.jsp' too, but ...



The bottom line is the value for 'id' needs to come from somewhere.
Your choices are:

1) Embed it in the URL for GET requests, either via query string or
as path info  (e.g. /story/data/17 ) and handle the security aspect
(if any) yourself

Kiran : I think this is what I am presently doing.


2) Use a form to POST the request with the id included (a bit clunky,
  same security issue)
Form will not work as data is dynamic and form I feel will not serve the 
purpose.


3) Save the 'id' in session and use that -- everyone sees the same URL
  e.g. /story/data but with unique data. Obviously, this doesn't work for
  a resource that's intended to be shared  :-)
Yup I agree, session is ruled out.I just dont have that much patience to 
figure the things out if I get some nasty behavior.I just dont have that 
level of skill nor time.
The way I have done this is ok for me, it serves my purpose and also I 
dont have the data which is kind of private.Its just that I was 
exploring if we can hide the id.


HTH,



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: URL Rewriting

2012-06-13 Thread Kiran Badi

Please inline for my answers Andre.

Kiran,


Why does that "id=17" visible in the URL bother you ?
Is it because of some security aspect ? (that the user could change 
it, and get something else than what they should be getting ?)
Thanks for reminding this aspect.I was not checking for empty resultset 
in my code.Fixed that one now.:)


1) If that is the case, then the basic logic of your application is 
flawed.  If this is information that really needs to be sent by the 
browser to the server, then the browser must have that information. 
And if that information originally comes from the server and is sent 
to the browser, then there is /nothing/ that you can do to block some 
user from playing around with it, before sending it back to the server.
If you do not want the user to be able to play around with some 
information, then don't send it to him in the first place. O

Ok let me share the way I wrote this piece,

href="<%=request.getContextPath()%>/getmyservice.do?id=${myid}"> , this 
is link basically where I append the id(id comes from DB) send this to 
the servlet and it the pulls the records from db for corresponding id 
and then sends it back again to JSP for display.But I am not able to 
figure out as why I not getting the url of jsp something like


http://localhost:8080/ourstory/myiddata.jsp

.So thought that let me try to rewrite the url in case if its possible.


2) if the browser /must/ send some information to the server as part 
of the URL, then there is /nothing/ that can be done on the server 
side, to stop the browser showing this information in the URL bar.


To illustrate this :
- imagine that the server sends a page to the browser, and this page 
contains a link like :
href="http://localhost:8080/mysite/getmyservice.do?id=my-very-secret-information";>click 
here


Then the user, just by moving his mouse above "click here", sees the 
content of that link at the bottom of his screen, in the status bar, 
right ?
And the user can right-click on "click here", and choose "copy link 
location".
And then the user can open another browser window, and paste this URL 
in the URL bar.
And then the user can modify this link before hitting the return 
button, so that the link now looks like

http://localhost:8080/mysite/getmyservice.do?id=some-other-information
right ?
And all this happens in the browser, /before/ the server even sees 
this browser request.

So what could the server do ?
This is interesting information,how about sending the info as POST 
rather than Get.Not sure if I can convert clicking of the link from get 
from post.but I will try.But again the place where I am displaying the 
generating the links, is not within form, they just hyperlinks with id 
appended to it.


Now I know both get/post can be broken if one wants it,thats all 
together is different case,but for now I need tidy and clean url with no 
id appended to it.


Does my requirement makes sense ?



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: URL Rewriting

2012-06-12 Thread Kiran Badi


On 6/13/2012 9:18 AM, Oguz Kologlu wrote:

There is a handy URL rewrite filter already built.
http://www.tuckey.org/urlrewrite/

You can hide the ID if you post the form  but you need to be a bit more 
specific with what you want to do

Oz

Thanks Oguz,

I have bunch of functionalities which are showing up with urls  as

http://localhost:8080/mysite/getmyservice.do?id=17 and I just need to hide them 
and show some neat url something like mysite/getmyservice.do without displaying 
parameters.

Will hiding the url's cause any other issues ?

- Kiran


On 13/06/2012, at 1:21 PM, Kiran Badi wrote:


Hi All,

For some of the functionality, I have url in the below format

http://localhost:8080/mysite/getmyservice.do?id=17

What I was looking for is to hide the id part of the url and just show 
something like

http://localhost:8080/mysite/getmyservice.do#

Is this hack possible with tomcat 7.011 or 7.027 or I need to write some filter 
to do this?

I have Tomcat 7.027 on win 7 home premium and url is generated via servlet/jsp.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



URL Rewriting

2012-06-12 Thread Kiran Badi

Hi All,

For some of the functionality, I have url in the below format

http://localhost:8080/mysite/getmyservice.do?id=17

What I was looking for is to hide the id part of the url and just show 
something like


http://localhost:8080/mysite/getmyservice.do#

Is this hack possible with tomcat 7.011 or 7.027 or I need to write some 
filter to do this?


I have Tomcat 7.027 on win 7 home premium and url is generated via 
servlet/jsp.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Can someone suggest mail some opensource mail server which works well with Tomcat.

2012-06-11 Thread Kiran Badi

On 6/10/2012 1:49 AM, André Warnier wrote:

Kiran Badi wrote:


Any feedback on apache james ?


I've never used it, so I can't comment. What I would ask is: why are
you are specifically looking for a Java-based mail server?

I was looking for open source server ,capable for serving atleast 5k 
mails daily to begin with.Since I am using java api, I am under 
impression that java based mail servers will have support for java 
api's.




Kiran,

Let me try to explain again what several other people here have tried 
to explain to you already.


There are two different and separate things here :

1) an email server, capable of
- sending out the emails that your application is composing, toward 
email recipients that are "somewhere else"
- receiving emails coming from other senders and destined to some 
local "email mailbox", and putting these emails in that mailbox, so 
that a local recipient can read them when they want


2) an interface library, which provides an API that makes it easy for 
your application to
- compose emails that you want to send out; and forward these emails 
to the email server, so that it can send them out
- connect to a mailbox, to read received emails that are waiting for 
someone to read them; and maybe parsing these emails, to extract 
something out of them; and maybe to forward one of these emails to 
some other mailbox.


(1) is a separate package (like sendmail, exim4, courier, and several 
others).  You install it, configure it and run it as a daemon.  Then 
you create "email accounts" with that email server, so that it would 
have "email mailboxes" with "email addresses" to which external 
people/programs can send emails.
This package can be written in any language, it does not matter; your 
programs will not directly call the internal functions of this email 
server, so it will make no difference whether it is written in Java or 
not.


(2) is an API library, and for that one it will matter what language 
it is written in, because your programs will need to call functions of 
this library, to send outgoing emails or to read incoming emails that 
are sitting in one of the email server's mailboxes.


Graphically :

(your.program <===> email library) < SMTP or POP3 or IMAP --> 
email server <> Internet


<===> are calls from your program, into functions of the library
<---> is a TCP/IP connection between that library and some email 
server, and the "language" used over that connection is SMTP or POP3 
or IMAP


It is similar to what you would use if your program needed to talk to 
another webserver:


(your.program <===> HTTP Client library) <--- HTTP or HTTPS --> web 
server
It does not matter if the web server is an Apache httpd, IIS, Tomcat 
or www.google.com, or whatever language that webserver is written in, 
or if it is local or remote.


Similarly, it does not matter which email server you are going to 
use.  It just needs to support the email protocol you want to use and 
which your library supports.


The /library/ is what matters.
And for Java, the one that comes to mind first is Javamail.
(It can help you composing ans sending emails; but I do not know if it 
can /read/ incoming emails).




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Thanks Andre. I am clear on what I want and thanks for clarifying it.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Can someone suggest mail some opensource mail server which works well with Tomcat.

2012-06-09 Thread Kiran Badi

On 6/8/2012 12:17 PM, Jose María Zaragoza wrote:

Kiran: Is google mail a part of google apps or its normal gmail service
which we use ?.I feel there might be some limits on the number of requests
like google api's Can you elaborate more please.


Take a look this

http://www.google.com/enterprise/apps/business/products.html?section=gmail

I don't know if this is good ( or if it's useful enough for you )
because I don't have used it, but if I would like to work with GMail
in a enterprise enviroment , I would look this first
Jose,I do have bunch of domains with google apps,but I havent checked if 
I can reuse those with my application.Let me explore that as well.


Let me explain as What I want to do,

I have a web application which I am working on,in this application I 
have certain features (think daily deals site) ,and I have send out 
those daily deal information to my registered users via mail.In addition 
to this sometimes I have to receive mail on behalf of my users and then 
pass them to their mail ids.


This is requirement I have to work on now and for this I need some 
servers to send and receive mails.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Can someone suggest mail some opensource mail server which works well with Tomcat.

2012-06-09 Thread Kiran Badi


Any feedback on apache james ?


I've never used it, so I can't comment. What I would ask is: why are
you are specifically looking for a Java-based mail server?

I was looking for open source server ,capable for serving atleast 5k 
mails daily to begin with.Since I am using java api, I am under 
impression that java based mail servers will have support for java api's.


- Kiran

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Can someone suggest mail some opensource mail server which works well with Tomcat.

2012-06-06 Thread Kiran Badi




If you are going to use Javamail to access a remote mailbox (even if
it's on localhost), then you can use any email server software that
otherwise meets your needs. Javamail can communicate with any POP3 or
IMAP server -- it need not be Java-based. You can even use Google Mail
as your email service if you want (for both SMTP/send and
POP3/IMAP/fetch).

Kiran: Is google mail a part of google apps or its normal gmail service which 
we use ?.I feel there might be some limits on the number of requests like 
google api's Can you elaborate more please.

Any feedback on apache james ?







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Can someone suggest mail some opensource mail server which works well with Tomcat.

2012-06-06 Thread Kiran Badi

Thanks David ,I will research java email server and Chris for replying,

High level requirement which I feel I need is, to send mail(ex pw reset 
mails, welcome mails, HTML Content deals mails etc), receive mails( yes 
I need to receive mails as well),


Integrate well with Tomcat means that it should not have more set up or 
communication issues talking to tomcat.I plan to use Javamail api's and 
read mail servers parameters via web xml resources section.



On 6/6/2012 11:46 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kiran,

On 6/6/12 12:24 PM, Kiran Badi wrote:

I have a requirement to send pw reset mails,send deals HTML mails
etc.

So for this I was looking for some mail servers which can work with
my existing setup which I can integrate with Tomcat 7.0x,should
have pop3/smtp support.

Do you want to send messages, receive messages, or both? Sounds like
you definitely want to send, but do you really need to receive?

When you say "integrate with Tomcat 7.0x", do you mean that you want
to run the "mail server" in-process with Tomcat? I would guess that a
separate process would be more secure, more reliable, and give you
more options. For instance, there are many tried-and-true mail servers
that are not Java-based that could certainly meet your needs as long
as you don't need them to be in-process. For example: sendmail, EXIM,
Courier, and others are all available as options through most Linux
package-managers.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/PnoYACgkQ9CaO5/Lv0PATlACeLFwTshyue/N7U45Wf6CzdR68
Uf4AoI8U4INzbUHX07VLRmpgrQQBPxKL
=fYSN
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Can someone suggest mail some opensource mail server which works well with Tomcat.

2012-06-06 Thread Kiran Badi

Hi,

I have a requirement to send pw reset mails,send deals HTML mails etc.

So for this I was looking for some mail servers which can work with my 
existing setup which I can integrate with Tomcat 7.0x,should have 
pop3/smtp support.


can some one give me some  other names which I can check ?.

PS:I am going through apache james to see if it works for me.



- Kiran Badi

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Where do I store Images in tomcat structure so that I can retrive it properly in all browsers

2012-06-05 Thread Kiran Badi



On 6/5/2012 7:41 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kiran,

On 6/5/12 1:31 AM, Kiran Badi wrote:

After playing around for a day,

this is another solutions which worked for me,


with Tomcat 7.0.11 in context.xml

Good, except that you should really upgrade to the latest Tomcat 7.0
version. Plenty of security fixed have been shipped since 7.0.11.


Yes , I will try to give a shot.But it will take sometime.But 
application is deployed in latest tomcat version 7.0.27 and this is my 
development server.

I think now I understand as how aliases work, /UploadedImages is
the aliaspath and c:/UploadedImages is the docbase to which it
refers.

Is this understanding correct ?

/UploadedImages is the URL where resources in C:\UploadedImages can be
requested. The term "docbase" doesn't really apply as it has a number
of connotations that aren't appropriate here.


Thanks for clarification.



In manager app I see something called /files , not sure as what is
this ?

That is likely to be another webapp, but I have no idea where in the
manager app you are looking, so I can't really comment.

Remember that Tomcat will (by default) auto-deploy any directory in
the CATALINA_BASE/webapps directory -- even those that you don't
consider to be a legitimate webapp. So, if you have a directory called
"files" in there, then Tomcat will deploy that into "/files" and
possibly expose some resources that you hadn't intended to be
available via HTTP.
Kiran : Yup, Had an empty files folder inside webapps and this was 
showing up.


Many thanks Chris,Appreciate your assistance.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/OE5UACgkQ9CaO5/Lv0PDk9gCgizMK2Qv4pjSPt+4zNORyQ59D
PfgAoLWM3pz9K/aPLIvGuwKHQKVmYOxF
=M4dM
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Where do I store Images in tomcat structure so that I can retrive it properly in all browsers

2012-06-04 Thread Kiran Badi

After playing around for a day,

this is another solutions which worked for me,

 with 
Tomcat 7.0.11 in context.xml


I think now I understand as how aliases work, /UploadedImages is the 
aliaspath and c:/UploadedImages is the docbase to which it refers.


Is this understanding correct ?

In manager app I see something called /files , not sure as what is this ?

On 6/2/2012 4:45 AM, Kiran Badi wrote:


On 6/1/2012 9:27 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kiran,

On 5/31/12 10:37 PM, Kiran Badi wrote:

Ok I did it this way in TC 7.0.27 as I decided not to touch
Netbeans setup with 7.0.11( I had messed up TC7.0.11 after doing
several trial and error stuff,felt real pain)

I have TC7.0.27 running as window service which I use it deploy my
latest build everyday.

In server xml, I added below context between host tags



You shouldn't put  elements in server.xml. Also, using a
docBase that has files appear at random can be problematic when it
comes to caching, etc. and users often have problems.
Kiran : I had never thought about caching , and  caching is one of key 
features which I am planning to implement.

so I did not use aliases at all, is this good solution or I am
missing something again.

Presumably you have an existing webapp that does the upload part: make
C:\UploadedImages into an "alias" for that webapp instead of creating
a second webapp for it.

Ok I will give try to create alias and see how it goes.

Thanks.


- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/I5l0ACgkQ9CaO5/Lv0PCtJwCgrGbdhRjeSetyRz8Zr3Bvzkt0
mU0AnidgFANsdy8ZFNoo8/SPLCCY11+E
=7Q6w
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Where do I store Images in tomcat structure so that I can retrive it properly in all browsers

2012-06-01 Thread Kiran Badi


On 6/1/2012 9:27 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kiran,

On 5/31/12 10:37 PM, Kiran Badi wrote:

Ok I did it this way in TC 7.0.27 as I decided not to touch
Netbeans setup with 7.0.11( I had messed up TC7.0.11 after doing
several trial and error stuff,felt real pain)

I have TC7.0.27 running as window service which I use it deploy my
latest build everyday.

In server xml, I added below context between host tags



You shouldn't put  elements in server.xml. Also, using a
docBase that has files appear at random can be problematic when it
comes to caching, etc. and users often have problems.
Kiran : I had never thought about caching , and  caching is one of key 
features which I am planning to implement.

so I did not use aliases at all, is this good solution or I am
missing something again.

Presumably you have an existing webapp that does the upload part: make
C:\UploadedImages into an "alias" for that webapp instead of creating
a second webapp for it.

Ok I will give try to create alias and see how it goes.

Thanks.


- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/I5l0ACgkQ9CaO5/Lv0PCtJwCgrGbdhRjeSetyRz8Zr3Bvzkt0
mU0AnidgFANsdy8ZFNoo8/SPLCCY11+E
=7Q6w
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



  1   2   >