You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Li Li <fa...@gmail.com> on 2014/07/04 06:56:47 UTC

can tomcat use aio instead of nio in linux?

I have a background thread that is using hornetq client to receive jms
topic message from a remote hornetq broker. This thread is started as
ServletContextListener when tomcat starts.

But the tomcat throws strange Exception:

llegal access: this web application instance has been stopped already.
Could not load java.net.SocketTimeoutException.  The eventual
following stack trace is caused by an error thrown for debugging
purposes as well as to attempt to terminate the thread which caused
the illegal access, and has no functional impact.

java.lang.IllegalStateException

        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1588)

        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)

        at org.jboss.netty.channel.socket.oio.AbstractOioWorker.run(AbstractOioWorker.java:75)

        at org.jboss.netty.channel.socket.oio.OioWorker.run(OioWorker.java:51)

        at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)

        at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)

        at org.jboss.netty.util.VirtualExecutorService$ChildExecutorRunnable.run(VirtualExecutorService.java:175)

        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:744)

I suspect that hornetq use linux aio and cause jvm can't use nio which
is used by tomcat.
one solution may modify hornetq to use nio instead of aio. But I don't
know how to do it.
Another solution is letting tomcat using aio instead of nio. it it possilbe?

my os is ubuntu 12.04 with libaio installed. I can send and receive
topic messages in a standalone java application. My java version is :

java version "1.7.0_45"

Java(TM) SE Runtime Environment (build 1.7.0_45-b18)

Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

tomcat version is 7.0.47

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


Re: can tomcat use aio instead of nio in linux?

Posted by Mark Thomas <ma...@apache.org>.
On 04/07/2014 05:56, Li Li wrote:
> I have a background thread that is using hornetq client to receive jms
> topic message from a remote hornetq broker. This thread is started as
> ServletContextListener when tomcat starts.
> 
> But the tomcat throws strange Exception:
> 
> llegal access: this web application instance has been stopped already.

What is strange about this?

Something in your application continues to run (a thread you started
maybe?) after the web application has stopped. That isn't allowed so you
get an error.


> I suspect that hornetq use linux aio and cause jvm can't use nio which
> is used by tomcat.

And your basis for that conclusion (which is completely wrong in case
that wasn't obvious) is what?

> one solution may modify hornetq to use nio instead of aio. But I don't
> know how to do it.
> Another solution is letting tomcat using aio instead of nio. it it possilbe?

Since your assumptions regarding the problem are wrong, so are you
assumptions about the possible solution.

The correct solution is to fix whatever broken code is trying to load
classes after the web application has stopped.

> my os is ubuntu 12.04 with libaio installed. I can send and receive
> topic messages in a standalone java application. My java version is :
> 
> java version "1.7.0_45"
> 
> Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
> 
> Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
> 
> tomcat version is 7.0.47

Thanks for the verison info. Most people don't bother. I'd consider a
Tomcat upgrade.

Mark


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