You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew Kujtan <ak...@evertz.com> on 2012/07/09 17:55:28 UTC

Speeding up RMI calls

Tomcat Version: 7.0.27

OS: Windows XP/7

 

I'm fixing an issue we are having with a webapp that does some
communication over RMI with a remote  server. Calls that would be
instant in similar applications not inside the tomcat container are
taking more than 30 seconds when called from tomcat. After debugging
I've found that  when an RMI call is made, the classlist containing all
the jars in the webapp lib folders is being serialized with the data.
Which wouldn't be a problem normally, except the webapp has >300 jars in
its lib folder.

 

The only solution I have found is to create a custom WebAppClassloader
that returns a zero length URL array on the getURLs() call. We don't do
any dynamic class loading so breaking that is not a problem.

 

My question is, is there any other way to resolve this, like a
configuration property? If not, are there any problems that I am going
to introduce by overriding this method? Can I override the classloader
for just this webapp or am I stuck doing it for the entire tomcat
instance?

 

Thanks,

Andrew Kujtan


Re: Speeding up RMI calls

Posted by Jess Holle <je...@ptc.com>.
The only way I know to address this obnoxious issue is to create your 
own custom RMIClassLoaderSpi and install it early enough.

The custom RMIClassLoaderSpi is very simple:

       public String  getClassAnnotation( final Class cl )
       {
         return ( null );  // we don't need no stinking bloated RMI
    class annotations!
       }

otherwise the implementation can simply default to 
DefaultSpiHolder.instance.getDefaultSpi().

Of course, it is extremely silly that this issue has existed for many 
years and there's still no simple -Djava.rmi.disableClassAnnotations or 
the like.

RE: Speeding up RMI calls

Posted by Andrew Kujtan <ak...@evertz.com>.
> -----Original Message-----
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Monday, July 30, 2012 10:36 AM
> To: Tomcat Users List
> Subject: RE: Speeding up RMI calls
> 
> 
> Good Morning Andrew
> 
> a directory with spaces has dogged me in the past (I  specify
> C:\PROGRA~1 to get the 8.3 folder-name)
> glad to hear the "uber.jar" worked for you
> 
> Martin

Good Morning!

Just to clarify, 

1. I have no control over the URLs, these are provided by tomcats WebAppClassLoader
which, because it extends URLClassLoader, provides them from the getULs() method,
and is populated with the base class path and all the jars in my apps lib folder.
2. I didn't make an uber.jar, I overloaded tomcats WebAppClassLoader to just return
an empty array from the getURLs() method. 

Cheers,
Andrew

> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de
> confidentialité
> 
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
> unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig.
> Diese Nachricht dient lediglich dem Austausch von Informationen und
> entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten
> Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt
> uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas
> le destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> copie de ceci est interdite. Ce message sert à l'information seulement
> et n'aura pas n'importe quel effet légalement obligatoire. Étant donné
> que les email peuvent facilement être sujets à la manipulation, nous ne
> pouvons accepter aucune responsabilité pour le contenu fourni.
> 
> 
> > Subject: RE: Speeding up RMI calls
> > Date: Mon, 30 Jul 2012 10:26:37 -0400
> > From: akujtan@evertz.com
> > To: users@tomcat.apache.org
> >
> > > -----Original Message-----
> > > From: Martin Gainty [mailto:mgainty@hotmail.com]
> > > Sent: Saturday, July 28, 2012 10:02 AM
> > > To: Tomcat Users List
> > > Subject: RE: Speeding up RMI calls
> > >
> > >
> > > Andrew
> > >
> > > It *sounds* like you are battling a network latency problem
> > > Can you identify the target RMI server then do a simple tracert
> from
> > > client to RMI Server to determine which intermediate node is
> causing
> > > the delay?
> > >
> > > Martin
> >
> > I thought so too at first, so I moved them to the same machine with
> the
> > same results.
> > Overloading the classloader so that every RMI call did not contain a
> > list of 300+
> > "C:\Program Files\Tomcat\webapps\Root\WEB-INF\lib\my.jar;" corrected
> the
> > issue though.
> >
> > -Andrew
> >
> > > >
> > > > > > On 09/07/2012 16:55, Andrew Kujtan wrote:
> > > > > > > Tomcat Version: 7.0.27
> > > > > > >
> > > > > > > OS: Windows XP/7
> > > > > > > I'm fixing an issue we are having with a webapp that does
> some
> > > > > > > communication over RMI with a remote  server. Calls that
> would
> > > be
> > > > > > > instant in similar applications not inside the tomcat
> > container
> > > > are
> > > > > > > taking more than 30 seconds when called from tomcat. After
> > > > > debugging
> > > > > > > I've found that  when an RMI call is made, the classlist
> > > > containing
> > > > > > > all the jars in the webapp lib folders is being serialized
> > with
> > > > the
> > > > > > data.
> > > > > > > Which wouldn't be a problem normally, except the webapp has
> > > >300
> > > > > jars
> > > > > > > in its lib folder.
> > > > > >
> > > > > > In the other similar applications, are there 300+ jars on the
> > > > > classpath
> > > > > > too?
> > > > > >
> > > > > >
> > > > > > p
> > > > >
> > > > > Yes they are there as well, but the RMI calls don't include
> them,
> > > or
> > > > > any
> > > > > urls
> > > > > for that matter.
> > > > >
> > > > > >
> > > > > > > The only solution I have found is to create a custom
> > > > > > WebAppClassloader
> > > > > > > that returns a zero length URL array on the getURLs() call.
> We
> > > > > don't
> > > > > > > do any dynamic class loading so breaking that is not a
> > problem.
> > > > > > >
> > > > > > > My question is, is there any other way to resolve this,
> like a
> > > > > > > configuration property? If not, are there any problems that
> I
> > > am
> > > > > > going
> > > > > > > to introduce by overriding this method? Can I override the
> > > > > > classloader
> > > > > > > for just this webapp or am I stuck doing it for the entire
> > > tomcat
> > > > > > > instance?
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Thanks,
> > > > > > >
> > > > > > > Andrew Kujtan
> > > >
> > > > I guess no one has run into this issue before, I've pushed it
> > through
> > > > and am just overloading the classloader in the server.xml
> > > >
> > > > Hopefully this doesn't break anything.
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > > For additional commands, e-mail: users-help@tomcat.apache.org
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> 

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


RE: Speeding up RMI calls

Posted by Martin Gainty <mg...@hotmail.com>.
Good Morning Andrew

a directory with spaces has dogged me in the past (I  specify C:\PROGRA~1 to get the 8.3 folder-name)
glad to hear the "uber.jar" worked for you

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.


> Subject: RE: Speeding up RMI calls
> Date: Mon, 30 Jul 2012 10:26:37 -0400
> From: akujtan@evertz.com
> To: users@tomcat.apache.org
> 
> > -----Original Message-----
> > From: Martin Gainty [mailto:mgainty@hotmail.com]
> > Sent: Saturday, July 28, 2012 10:02 AM
> > To: Tomcat Users List
> > Subject: RE: Speeding up RMI calls
> > 
> > 
> > Andrew
> > 
> > It *sounds* like you are battling a network latency problem
> > Can you identify the target RMI server then do a simple tracert from
> > client to RMI Server to determine which intermediate node is causing
> > the delay?
> > 
> > Martin
> 
> I thought so too at first, so I moved them to the same machine with the
> same results.
> Overloading the classloader so that every RMI call did not contain a
> list of 300+
> "C:\Program Files\Tomcat\webapps\Root\WEB-INF\lib\my.jar;" corrected the
> issue though.
> 
> -Andrew
> 
> > >
> > > > > On 09/07/2012 16:55, Andrew Kujtan wrote:
> > > > > > Tomcat Version: 7.0.27
> > > > > >
> > > > > > OS: Windows XP/7
> > > > > > I'm fixing an issue we are having with a webapp that does some
> > > > > > communication over RMI with a remote  server. Calls that would
> > be
> > > > > > instant in similar applications not inside the tomcat
> container
> > > are
> > > > > > taking more than 30 seconds when called from tomcat. After
> > > > debugging
> > > > > > I've found that  when an RMI call is made, the classlist
> > > containing
> > > > > > all the jars in the webapp lib folders is being serialized
> with
> > > the
> > > > > data.
> > > > > > Which wouldn't be a problem normally, except the webapp has
> > >300
> > > > jars
> > > > > > in its lib folder.
> > > > >
> > > > > In the other similar applications, are there 300+ jars on the
> > > > classpath
> > > > > too?
> > > > >
> > > > >
> > > > > p
> > > >
> > > > Yes they are there as well, but the RMI calls don't include them,
> > or
> > > > any
> > > > urls
> > > > for that matter.
> > > >
> > > > >
> > > > > > The only solution I have found is to create a custom
> > > > > WebAppClassloader
> > > > > > that returns a zero length URL array on the getURLs() call. We
> > > > don't
> > > > > > do any dynamic class loading so breaking that is not a
> problem.
> > > > > >
> > > > > > My question is, is there any other way to resolve this, like a
> > > > > > configuration property? If not, are there any problems that I
> > am
> > > > > going
> > > > > > to introduce by overriding this method? Can I override the
> > > > > classloader
> > > > > > for just this webapp or am I stuck doing it for the entire
> > tomcat
> > > > > > instance?
> > > > > >
> > > > > >
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > Andrew Kujtan
> > >
> > > I guess no one has run into this issue before, I've pushed it
> through
> > > and am just overloading the classloader in the server.xml
> > >
> > > Hopefully this doesn't break anything.
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

RE: Speeding up RMI calls

Posted by Andrew Kujtan <ak...@evertz.com>.
> -----Original Message-----
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Saturday, July 28, 2012 10:02 AM
> To: Tomcat Users List
> Subject: RE: Speeding up RMI calls
> 
> 
> Andrew
> 
> It *sounds* like you are battling a network latency problem
> Can you identify the target RMI server then do a simple tracert from
> client to RMI Server to determine which intermediate node is causing
> the delay?
> 
> Martin

I thought so too at first, so I moved them to the same machine with the
same results.
Overloading the classloader so that every RMI call did not contain a
list of 300+
"C:\Program Files\Tomcat\webapps\Root\WEB-INF\lib\my.jar;" corrected the
issue though.

-Andrew

> >
> > > > On 09/07/2012 16:55, Andrew Kujtan wrote:
> > > > > Tomcat Version: 7.0.27
> > > > >
> > > > > OS: Windows XP/7
> > > > > I'm fixing an issue we are having with a webapp that does some
> > > > > communication over RMI with a remote  server. Calls that would
> be
> > > > > instant in similar applications not inside the tomcat
container
> > are
> > > > > taking more than 30 seconds when called from tomcat. After
> > > debugging
> > > > > I've found that  when an RMI call is made, the classlist
> > containing
> > > > > all the jars in the webapp lib folders is being serialized
with
> > the
> > > > data.
> > > > > Which wouldn't be a problem normally, except the webapp has
> >300
> > > jars
> > > > > in its lib folder.
> > > >
> > > > In the other similar applications, are there 300+ jars on the
> > > classpath
> > > > too?
> > > >
> > > >
> > > > p
> > >
> > > Yes they are there as well, but the RMI calls don't include them,
> or
> > > any
> > > urls
> > > for that matter.
> > >
> > > >
> > > > > The only solution I have found is to create a custom
> > > > WebAppClassloader
> > > > > that returns a zero length URL array on the getURLs() call. We
> > > don't
> > > > > do any dynamic class loading so breaking that is not a
problem.
> > > > >
> > > > > My question is, is there any other way to resolve this, like a
> > > > > configuration property? If not, are there any problems that I
> am
> > > > going
> > > > > to introduce by overriding this method? Can I override the
> > > > classloader
> > > > > for just this webapp or am I stuck doing it for the entire
> tomcat
> > > > > instance?
> > > > >
> > > > >
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Andrew Kujtan
> >
> > I guess no one has run into this issue before, I've pushed it
through
> > and am just overloading the classloader in the server.xml
> >
> > Hopefully this doesn't break anything.
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> 

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


RE: Speeding up RMI calls

Posted by Martin Gainty <mg...@hotmail.com>.
Andrew

It *sounds* like you are battling a network latency problem
Can you identify the target RMI server then do a simple tracert from client to RMI Server to determine which intermediate node is causing the delay?

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.


> Subject: RE: Speeding up RMI calls
> Date: Fri, 27 Jul 2012 17:31:17 -0400
> From: akujtan@evertz.com
> To: users@tomcat.apache.org
> 
> > > On 09/07/2012 16:55, Andrew Kujtan wrote:
> > > > Tomcat Version: 7.0.27
> > > >
> > > > OS: Windows XP/7
> > > > I'm fixing an issue we are having with a webapp that does some
> > > > communication over RMI with a remote  server. Calls that would be
> > > > instant in similar applications not inside the tomcat container
> are
> > > > taking more than 30 seconds when called from tomcat. After
> > debugging
> > > > I've found that  when an RMI call is made, the classlist
> containing
> > > > all the jars in the webapp lib folders is being serialized with
> the
> > > data.
> > > > Which wouldn't be a problem normally, except the webapp has >300
> > jars
> > > > in its lib folder.
> > >
> > > In the other similar applications, are there 300+ jars on the
> > classpath
> > > too?
> > >
> > >
> > > p
> > 
> > Yes they are there as well, but the RMI calls don't include them, or
> > any
> > urls
> > for that matter.
> > 
> > >
> > > > The only solution I have found is to create a custom
> > > WebAppClassloader
> > > > that returns a zero length URL array on the getURLs() call. We
> > don't
> > > > do any dynamic class loading so breaking that is not a problem.
> > > >
> > > > My question is, is there any other way to resolve this, like a
> > > > configuration property? If not, are there any problems that I am
> > > going
> > > > to introduce by overriding this method? Can I override the
> > > classloader
> > > > for just this webapp or am I stuck doing it for the entire tomcat
> > > > instance?
> > > >
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > Andrew Kujtan
> 
> I guess no one has run into this issue before, I've pushed it through
> and am just overloading the classloader in the server.xml 
> 
> Hopefully this doesn't break anything.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

RE: Speeding up RMI calls

Posted by Andrew Kujtan <ak...@evertz.com>.
> > On 09/07/2012 16:55, Andrew Kujtan wrote:
> > > Tomcat Version: 7.0.27
> > >
> > > OS: Windows XP/7
> > > I'm fixing an issue we are having with a webapp that does some
> > > communication over RMI with a remote  server. Calls that would be
> > > instant in similar applications not inside the tomcat container
are
> > > taking more than 30 seconds when called from tomcat. After
> debugging
> > > I've found that  when an RMI call is made, the classlist
containing
> > > all the jars in the webapp lib folders is being serialized with
the
> > data.
> > > Which wouldn't be a problem normally, except the webapp has >300
> jars
> > > in its lib folder.
> >
> > In the other similar applications, are there 300+ jars on the
> classpath
> > too?
> >
> >
> > p
> 
> Yes they are there as well, but the RMI calls don't include them, or
> any
> urls
> for that matter.
> 
> >
> > > The only solution I have found is to create a custom
> > WebAppClassloader
> > > that returns a zero length URL array on the getURLs() call. We
> don't
> > > do any dynamic class loading so breaking that is not a problem.
> > >
> > > My question is, is there any other way to resolve this, like a
> > > configuration property? If not, are there any problems that I am
> > going
> > > to introduce by overriding this method? Can I override the
> > classloader
> > > for just this webapp or am I stuck doing it for the entire tomcat
> > > instance?
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Andrew Kujtan

I guess no one has run into this issue before, I've pushed it through
and am just overloading the classloader in the server.xml 

Hopefully this doesn't break anything.

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


RE: Speeding up RMI calls

Posted by Andrew Kujtan <ak...@evertz.com>.

> -----Original Message-----
> From: Pid [mailto:pid@pidster.com]
> Sent: Thursday, July 12, 2012 5:22 PM
> To: Tomcat Users List
> Subject: Re: Speeding up RMI calls
> 
> On 09/07/2012 16:55, Andrew Kujtan wrote:
> > Tomcat Version: 7.0.27
> >
> > OS: Windows XP/7
> >
> >
> >
> > I'm fixing an issue we are having with a webapp that does some
> > communication over RMI with a remote  server. Calls that would be
> > instant in similar applications not inside the tomcat container are
> > taking more than 30 seconds when called from tomcat. After debugging
> > I've found that  when an RMI call is made, the classlist containing
> > all the jars in the webapp lib folders is being serialized with the
> data.
> > Which wouldn't be a problem normally, except the webapp has >300
jars
> > in its lib folder.
> 
> In the other similar applications, are there 300+ jars on the
classpath
> too?
> 
> 
> p

Yes they are there as well, but the RMI calls don't include them, or any
urls
for that matter. 

> 
> > The only solution I have found is to create a custom
> WebAppClassloader
> > that returns a zero length URL array on the getURLs() call. We don't
> > do any dynamic class loading so breaking that is not a problem.
> >
> > My question is, is there any other way to resolve this, like a
> > configuration property? If not, are there any problems that I am
> going
> > to introduce by overriding this method? Can I override the
> classloader
> > for just this webapp or am I stuck doing it for the entire tomcat
> > instance?
> >
> >
> >
> > Thanks,
> >
> > Andrew Kujtan
> >
> >
> 
> 
> --
> 
> [key:62590808]
> 
> 


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


Re: Speeding up RMI calls

Posted by Pid <pi...@pidster.com>.
On 09/07/2012 16:55, Andrew Kujtan wrote:
> Tomcat Version: 7.0.27
> 
> OS: Windows XP/7
> 
>  
> 
> I'm fixing an issue we are having with a webapp that does some
> communication over RMI with a remote  server. Calls that would be
> instant in similar applications not inside the tomcat container are
> taking more than 30 seconds when called from tomcat. After debugging
> I've found that  when an RMI call is made, the classlist containing all
> the jars in the webapp lib folders is being serialized with the data.
> Which wouldn't be a problem normally, except the webapp has >300 jars in
> its lib folder.

In the other similar applications, are there 300+ jars on the classpath too?


p

> The only solution I have found is to create a custom WebAppClassloader
> that returns a zero length URL array on the getURLs() call. We don't do
> any dynamic class loading so breaking that is not a problem.
> 
> My question is, is there any other way to resolve this, like a
> configuration property? If not, are there any problems that I am going
> to introduce by overriding this method? Can I override the classloader
> for just this webapp or am I stuck doing it for the entire tomcat
> instance?
> 
>  
> 
> Thanks,
> 
> Andrew Kujtan
> 
> 


-- 

[key:62590808]