Re: Exception in thread "http-bio-8080-exec-120" java.lang.OutOfMemoryError: PermGen space

2016-12-03 Thread
Hi, Kaushal

If you want to view the classes loaded in memory,  the Visualvm as Chris
mentioned above.

It don't need download separeately. In Oracle JDK, the jvisualVm is already
present.

you can click second button [memory] and click stop after a few seconds.
Then all classes loaded will display.

[image: 内嵌图片 1]


Also you can add *-verbose:class* in you script file, and all classes load
will log.

Hope it helpful.

Richard



2016-11-29 15:07 GMT+08:00 Román Valoria :

> Get the JDK launch the tool and look it up yourself. It has tons of issues,
> am I sure it has that.
>
> On Tue, Nov 29, 2016 at 2:56 PM, Kaushal Shriyan  >
> wrote:
>
> > Thanks Roman and Chris for the detailed explanation. Is there a way to
> find
> > out what all java classes are loaded during runtime?
> >
> > Thanks in Advance.
> >
> > Regards,
> >
> > Kaushal
> >
> > On Tue, Nov 29, 2016 at 10:47 AM, Román Valoria 
> > wrote:
> >
> > > Sun, or should I say Oracle now, seems to be including the exact same
> > tool
> > > on the JDK. It is already pre-packaged, so it may be customized by
> > Oracle.
> > > It has the same look and feel as in the screenshot.
> > >
> > > On Tue, Nov 29, 2016 at 11:17 AM, Kaushal Shriyan <
> > > kaushalshri...@gmail.com>
> > > wrote:
> > >
> > > > On Tue, Nov 29, 2016 at 7:40 AM, Román Valoria <
> romanvalo...@gmail.com
> > >
> > > > wrote:
> > > >
> > > > > Use Java VisualVM to see PermGen memory allocation and
> troubleshoot.
> > It
> > > > > would also let you validate that your sizing parameters are
> properly
> > > set.
> > > > >
> > > > >
> > > > Hi Roman,
> > > >
> > > > Thanks for your reply. Are you referring to
> > https://visualvm.github.io/?
> > > > Please comment.
> > > >
> > > > Regards,
> > > >
> > > > Kaushal
> > > >
> > >
> >
>


Re: load server configuration file error

2016-08-08 Thread
Hi Leonid,
 When Tomcat run in Eclipse,  It work because the Eclipse server
configuration was treated for the CATALINA_BASE, Just like another
*standalone* Tomcat.
You can reconfig your server. If Error occured,  try Embeded Tomcat. Or use
Remote Debug.

Hope helpful.


2016-08-08 23:56 GMT+08:00 Mark Eggers :

> Leonid,
>
> On 8/8/2016 7:36 AM, leonidprokopets wrote:
> > It looks like a minor problem, but I'm unable to solve it. :(
> >
> > Eclipse Neon 4.6 returns this warning when I try to compile a web
> > project
> >
> > org.apache.catalina.startup.Catalina load WARNING: Unable to load
> > server configuration from [C:\Program Files (x86)\Hewlett-Packard\HP
> > Quick Start\conf\server.xml]
> >
> > Obviously this path is wrong. I'm having problem finding where it is
> > stored. How can I edit the path?
> >
> > Thanks in advance.
> >
> > Leonid.
> >
>
> This is an Eclipse configuration issue. Have you asked on the Eclipse
> mailing list?
>
> I have two Tomcat servers running from within Eclipse Neon on Windows.
> Both run as expected (once I remember to open the Servers project).
>
> How did you add the Tomcat server to Eclipse Neon?
>
> . . . just my two cents
> /mde/
>
>


Re: Tomcat Thread Dump

2015-12-09 Thread
You can use the java tool *jps*, this is a command tool.  When use like
this : jps -lv  , you can get detail infomation of all java
instance.Hope help to you.

2015-12-09 19:28 GMT+08:00 Konstantin Kolinko :

> 2015-12-09 10:09 GMT+03:00 Yogesh Patel :
> > *Tomcat version* : 7.0.53
> > *OS *: Windows 7
> >
> > We are using tomcat as standalone application not as service, In task
> > manager it does not showing PID for Tomcat. How to get PID of that tomcat
> > in order to take tomcat thread dump.
>
> Task Manager in Windows can be configured to show additional columns
> (see View menu).
>
> > What are the best practice  to take thread dump and what are the commands
> > for windows7 system.
> >
>
> https://wiki.apache.org/tomcat/FAQ/Troubleshooting_and_Diagnostics
> -> How To: Capture a thread dump
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: I'm searching for a parser of JSP

2015-09-11 Thread
Hi Kaori,
May be you need write a parser manually. Use JavaCC or Antlr will help you
complete it.
You can define your custom syntax checker.


2015-09-10 13:49 GMT+08:00 Mark Lovatt :

> Hi Kaori
>
> I don't know a parser for traditional jsp but if you use jspx then you can
> use any xml parser or the JspDocumentParser provided by Apache.
>
> Kind regards
>
> Mark Lovatt
> markmlov...@gmail.com
> uk.linkedin.com/in/mmlovatt
>
> Sent from my iPhone
>
> > On 10 Sep 2015, at 06:25, 八反田 香莉  wrote:
> >
> > Hello,
> >
> > I want to make the JSP code analysis tool. I'm looking for a parser for
> that
> > For example , when I write a JSP source code using Eclipse,
> > it's tool can check if there is any specific description.
> > But , there is no appropriate parser of JSP that can be used for such
> > purposes .I require as possible ready-to-use parser tree of JSP.
> > Can I use parser of Jaspar for such a purpose ?
> >
> > Best Regards
> > Kaori
> >
> > -
> > 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: WAR file deployment question

2014-09-16 Thread
try manager, located in the webapps/manager. You need to edit your
tomcat-users.xml, After that you can deploy your app via manager.

2014-09-16 8:11 GMT+08:00 James H. H. Lampert jam...@touchtonecorp.com:

 We have a rather large WAR file. 89,925,956 bytes. And we have cable
 internet. With its usual extremely asymmetrical bandwidth: a download pipe
 the size of an air conditioning duct, and an upload pipe the size of an
 insulin needle.

 Squirting this huge WAR file through such a narrow pipe takes over half an
 hour. But our web and FTP servers are on a hosting service's server, so
 they're not passing through the narrow pipe.

 Can I, from Manager, deploy a WAR file that's sitting on a web or FTP
 site, instead of on my local system?

 --
 James H. H. Lampert
 Touchtone Corporation

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




Re: Mod_jk error

2014-01-12 Thread
Hi, Alex
What is your mod_jk.conf file that used for mod_jk configuration.

You can config it as blow:
LoadModule jk_module modules/mod_jk.so
JkWorkersFile  conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel error
JkLogStampFormat [%a %b %d %H:%M:%S %Y]
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkMount /test_status mystatus
JkMount /hello*loadbalancer1

or Just as your configuration now, but add the JkMount to http.conf. The
JkMount /hello* loadbalancer1 will send all request start with hello  to
loadbalancer1

Hope to help you.


2014/1/11 Mark Eggers its_toas...@yahoo.com

 On 1/10/2014 2:53 PM, Alex Lucard wrote:

 .
 On Jan 10, 2014 5:00 PM, Alex Lucard priest.luc...@gmail.com wrote:

  I am running CentOS 6.5 and tomcat 7
 I cannot get the mod_jk to work
 I have a JSP page on this server and if you go to localhost:8080/Hello it
 will work but if I just go to localhost/Hello The requested URL /Hello
 was
 not found on this server.

 I have apache2 and tomcat 7 install both work.
 Here is the part I added to the httpd.conf file

 # Load the mod_jk module.
 LoadModule jk_module /usr/lib64/httpd/modules/mod_jk.so
 JkWorkersFile /etc/httpd/conf/workers.properties
 jkLogFile /var/log/mod_jk.log
 JkLogLevellevel
 JkLogStampFormat [%a %b %d %H:%M:%S %Y] 

 My workers.properties file at /etc/httpd/conf/workers.properties
 worker.list=worker1
 worker.worker1.type=ajp13
 worker.worker1.port=8009
 worker.worker1.host=localhost
 #worker.worker1.lbfactor=1


 My error log file /var/log/mod_jk.log
 [Fri Jan 10 15:19:22 2014] [1854:140509786134496] [info]
 init_jk::mod_jk.c
 (3365): mod_jk/1.2.37 initialized
 [Fri Jan 10 15:19:23 2014] [1855:140509786134496] [error]
 ajp_validate::jk_ajp_common.c (2696): worker worker1 can't resolve tomcat
 address localhost
 [Fri Jan 10 15:19:23 2014] [1855:140509786134496] [info]
 init_jk::mod_jk.c
 (3365): mod_jk/1.2.37 initialized



 What happens when you type the following from the command line:

 dig localhost

 As a workaround, replace localhost with 127.0.0.1.

 . . . . just my two cents
 /mde/

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




Re: the acceptCount attribute not work like it's configuration

2013-12-31 Thread
Oh, everything is default in server.xml except Connector configuration.
I have already explained how maxConnections is enforced by Tomcat. Where?
When? I'm sorry, I havn't know it.
the configuration of the client (number of threads, timeouts, etc.)   --
just need a simple web app, in the servlet you can sleep 60s.

Thank you for your reply.



2013/12/31 Mark Thomas ma...@apache.org

 On 31/12/2013 02:01, 侯树成 wrote:
  Hi,
  Today, I find the acceptCount  of connector is not work like it's config.
  You can try it like this:
  Connector port=8080 protocol=HTTP/1.1
 connectionTimeout=2
 redirectPort=8443 acceptCount=2 maxThreads=1
  minSpareThreads=1/
 
  use LR or JMeter make more requests( 10) .  You will find that 5
 requests
  will served correctly, others will be refused.
 
  When the acceptCount=3
 Connector port=8080 protocol=HTTP/1.1
 connectionTimeout=2
 redirectPort=8443 acceptCount=3 maxThreads=1
  minSpareThreads=1/
 
   You will find that 7 requests will served correctly, others will be
  refused.
 
 
  When the acceptCount=4
 Connector port=8080 protocol=HTTP/1.1
 connectionTimeout=2
 redirectPort=8443 acceptCount=4 maxThreads=1
  minSpareThreads=1/
 
   You will find that 9 requests will served correctly, others will be
  refused.
 
  Yes, the SUCCESS requests = 2 * acceptCount + maxthead , is it right?
 
  why the acceptCount is not work like it's configuration?
 
  Could you help me? Thank you.

 With the information provided above, no.

 I have already explained how maxConnections is enforced by Tomcat.

 The behaviour you observe in your test will depend on the configuration
 of the client (number of threads, timeouts, etc.) which you have failed
 to provide.

 Mark

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




the acceptCount attribute not work like it's configuration

2013-12-30 Thread
Hi,
Today, I find the acceptCount  of connector is not work like it's config.
You can try it like this:
Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 acceptCount=2 maxThreads=1
minSpareThreads=1/

use LR or JMeter make more requests( 10) .  You will find that 5 requests
will served correctly, others will be refused.

When the acceptCount=3
   Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 acceptCount=3 maxThreads=1
minSpareThreads=1/

 You will find that 7 requests will served correctly, others will be
refused.


When the acceptCount=4
   Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 acceptCount=4 maxThreads=1
minSpareThreads=1/

 You will find that 9 requests will served correctly, others will be
refused.

Yes, the SUCCESS requests = 2 * acceptCount + maxthead , is it right?

why the acceptCount is not work like it's configuration?

Could you help me? Thank you.


doe response auto commit when browser abort or close?

2013-12-30 Thread
Hi, I got an Exception like this:

java.lang.IllegalStateException: Cannot call sendError() after the response
has been committed


I got it in following steps:
1. Deploy a web app.
2. request the app in browser, refresh the page when it not response
fully(or close it when the page not response correctly)
3. get the exception


the exception was throw in blow code:

class OutputBuffer
 public void realWriteBytes(byte buf[], int off, int cnt) {
 .
coyoteResponse.doWrte(outputChunk);   //it will throw
java.io.IOException: An established connection was aborted
  //by the software in your host
machine
} catch (IOException e) {
// An IOException on a write is almost always due to
// the remote client aborting the request.  Wrap this
// so that it can be handled better by the error dispatcher.
throw new ClientAbortException(e);  // it will handled by
outter code.But now the commit equals true when sendError method execute,
so
   //IllegalStateException will throw.
}
}

Does the response will set commit = true when the client close or abort?
In source code, I just find the flush method or close method will set
commit = true, others was correct request/response lifecycle.

Thanks in advance.


Re: how http connector backlog attribute works?

2013-12-29 Thread
Hi,
Today, I find the acceptCount  of connector is not work like it's config.
You can try it like this:
Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 acceptCount=2 maxThreads=1
minSpareThreads=1/

Also use LR/JMeter make more requests( 10) .  You will find that 5
requests will served correctly, others will be refused.

When the acceptCount=3
   Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 acceptCount=3 maxThreads=1
minSpareThreads=1/

 You will find that 7 requests will served correctly, others will be
refused.


When the acceptCount=4
   Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 acceptCount=4 maxThreads=1
minSpareThreads=1/

Also use LR/JMeter make more requests( 10) .  You will find that 9
requests will served correctly, others will be refused.

Yes, the SUCCESS requests = 2 * acceptCount + maxthead , is it right?

why the acceptCount is not work like it's configuration?

Could you help me?



2013/12/27 侯树成 chain...@gmail.com

 Yes, this must use BIO mode, because the NIO maxConnections=1 in
 default, it won't block the LimitLatch. In my test case,(use JMeter, thread
 number is 5), 2 requests will refused soon(just 1s-2s later), then another
 3 requests will served correctly.In source code, I find the backlog
 attribute will send to ServerSocket constructor, So, the backlog attribute
 is worked inside of JDK, not in Tomcat?
 Thank you all for reply.


 2013/12/27 Mark Thomas ma...@apache.org

 On 27/12/2013 08:53, Mark Eggers wrote:
  On 12/27/2013 12:37 AM, Mark Thomas wrote:
  On 27/12/2013 07:27, Mark Eggers wrote:
  On 12/26/2013 11:09 PM, 侯树成 wrote:
 
  1.set tomcat connector like this:
Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 acceptCount=1 maxThreads=1
  minSpareThreads=1/
 
  2. deploy a war file, which contains a servlet that will sleep 60s in
  it's
  doPost method
 
  3. use LR or JMeter send 5 requests to the serlvet above
 
 
  I'm going to guess based on the Tomcat 7 documentation:
 
  request 1 gets executed and sits in your doPost for 60 seconds
  request 2 consumes the minSpareThread
  request 3 consumes the acceptCount
 
  Per documentation, connections 4 and 5 are dropped immediately.
 
  That is almost right except that there should not be a spare thread at
  step 2 since maxThreads includes any spare threads.
 
 
  Yep, that's what I would expect as well. I was just trying to
  rationalize the third accept.
 
  I agree, I would think that 1 would be served, 2 would wait, and 3-5
  would be dropped.

 Figured it out. The OP is using BIO where maxConnections == maxThreads
 by default.

 Request 1 uses the one available request processing thread.

 Request 2 is accepted but is blocked since the maximum number of
 connections has been reached.

 Request 3 uses the accept count.

 Requests 4  5 are blocked.

 It might be worth a note in the docs that the number of connections
 accepted will always be maxConnections + 1 with the + 1 being blocked
 in the acceptor thread until the number of connections drops below
 maxConnections again. I'll try and add something later today.

 Mark


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





Re: how http connector backlog attribute works?

2013-12-27 Thread
Yes, this must use BIO mode, because the NIO maxConnections=1 in
default, it won't block the LimitLatch. In my test case,(use JMeter, thread
number is 5), 2 requests will refused soon(just 1s-2s later), then another
3 requests will served correctly.In source code, I find the backlog
attribute will send to ServerSocket constructor, So, the backlog attribute
is worked inside of JDK, not in Tomcat?
Thank you all for reply.


2013/12/27 Mark Thomas ma...@apache.org

 On 27/12/2013 08:53, Mark Eggers wrote:
  On 12/27/2013 12:37 AM, Mark Thomas wrote:
  On 27/12/2013 07:27, Mark Eggers wrote:
  On 12/26/2013 11:09 PM, 侯树成 wrote:
 
  1.set tomcat connector like this:
Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 acceptCount=1 maxThreads=1
  minSpareThreads=1/
 
  2. deploy a war file, which contains a servlet that will sleep 60s in
  it's
  doPost method
 
  3. use LR or JMeter send 5 requests to the serlvet above
 
 
  I'm going to guess based on the Tomcat 7 documentation:
 
  request 1 gets executed and sits in your doPost for 60 seconds
  request 2 consumes the minSpareThread
  request 3 consumes the acceptCount
 
  Per documentation, connections 4 and 5 are dropped immediately.
 
  That is almost right except that there should not be a spare thread at
  step 2 since maxThreads includes any spare threads.
 
 
  Yep, that's what I would expect as well. I was just trying to
  rationalize the third accept.
 
  I agree, I would think that 1 would be served, 2 would wait, and 3-5
  would be dropped.

 Figured it out. The OP is using BIO where maxConnections == maxThreads
 by default.

 Request 1 uses the one available request processing thread.

 Request 2 is accepted but is blocked since the maximum number of
 connections has been reached.

 Request 3 uses the accept count.

 Requests 4  5 are blocked.

 It might be worth a note in the docs that the number of connections
 accepted will always be maxConnections + 1 with the + 1 being blocked
 in the acceptor thread until the number of connections drops below
 maxConnections again. I'll try and add something later today.

 Mark


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




how http connector backlog attribute works?

2013-12-26 Thread
Hi,
I find a problem of http bio connector,I need help.
You can find it in flowing steps:

1.set tomcat connector like this:
Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 acceptCount=1 maxThreads=1
minSpareThreads=1/

2. deploy a war file, which contains a servlet that will sleep 60s in it's
doPost method

3. use LR or JMeter send 5 requests to the serlvet above

4. use command jstack print current thread stack

NOTE: now the main acceptor thread stack like this:
http-bio-8080-Acceptor-0 daemon prio=6 tid=0x04b49800 nid=0x1a88 waiting
on condition [0x0536f000]
   java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  0x29a06cd0 (a
org.apache.tomcat.util.threads.LimitLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:969)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1281)
at
org.apache.tomcat.util.threads.LimitLatch.countUpOrAwait(LimitLatch.java:115)
at
org.apache.tomcat.util.net.AbstractEndpoint.countUpOrAwaitConnection(AbstractEndpoint.java:733)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:210)
at java.lang.Thread.run(Thread.java:662)

Now, In the 5 requests, 3 request will served correctly, but another 2
requests will received Connection refused error like this

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)

Why the 2 requests not entering the thread pool executor or taskQueue, but
get refused quickly?

Thanks in advance.