Sparodic NoClassDefFoundError: org/mozilla/javascript/optimizer/OptRuntime

Hi,

I have a script running very nicely on it's own.  However, when I run
multiple threads, I get the following error sparodically:

java.lang.NoClassDefFoundError:
org/mozilla/javascript/optimizer/OptRuntime
at
org.mozilla.javascript.gen.c1._c0(c:\temp\javascripts\testObjects.js)

at
org.mozilla.javascript.gen.c1.call(c:\temp\javascripts\testObjects.js
)
at
org.mozilla.javascript.gen.c1.exec(c:\temp\javascripts\testObjects.js
)
at
com.lexmark.olympus.action.scripting.ScriptThread.run(ScriptThread.ja
va:59)
at java.lang.Thread.run(Thread.java:536)

Does anyone have any ideas what's going on?

thanks!

David

PS  I've obviously checked that OptRuntime is in the classpath, and it
must be, as scripts run happily much of the time!

0
redcoat
1/20/2005 10:20:32 PM
netscape.mozilla.jseng 1530 articles. 0 followers. Follow

5 Replies
245 Views

Similar Articles

[PageSpeed] 2

redcoat wrote:
> Hi,
> 
> I have a script running very nicely on it's own.  However, when I run
> multiple threads, I get the following error sparodically:
> 
> java.lang.NoClassDefFoundError:
> org/mozilla/javascript/optimizer/OptRuntime
> at
> org.mozilla.javascript.gen.c1._c0(c:\temp\javascripts\testObjects.js)
> 
> at
> org.mozilla.javascript.gen.c1.call(c:\temp\javascripts\testObjects.js
> )
> at
> org.mozilla.javascript.gen.c1.exec(c:\temp\javascripts\testObjects.js
> )
> at
> com.lexmark.olympus.action.scripting.ScriptThread.run(ScriptThread.ja
> va:59)
> at java.lang.Thread.run(Thread.java:536)
> 
> Does anyone have any ideas what's going on?

1. Which JVM/platform do you use?
2. If you add "synchronized" to loadClass method in 
src/org/mozilla/javascript/DefiningClassLoader.java, would it help?

Regards, Igor
0
Igor
1/20/2005 11:32:51 PM
Hi Igor,

I'm using Java 1.4.1_01 on Windows.

You mean to change the source myself and then rebuild it?  I can try.

Do you have any idea what the issue is?  Please see my message that I
just posted with the code I'm using - would you mind perusing it and
seeing if you think it's ok?

Many thanks!

David

0
redcoat
1/20/2005 11:45:20 PM
redcoat wrote:
> Hi Igor,
> 
> I'm using Java 1.4.1_01 on Windows.
> 
> You mean to change the source myself and then rebuild it?  I can try.

Yes

> 
> Do you have any idea what the issue is?

It was reported once in the past, but the reason for the problem is not 
known since it is no clear why that class should contain any 
synchronization code at all.

Regards, Igor
0
Igor
1/21/2005 2:52:20 PM
Nope, that still doesn't work!!!!

Can you remember when this was last reported - we are pretty stuck.
Any other ideas where to look?

Many thanks,

David

0
redcoat
1/21/2005 5:46:21 PM
redcoat wrote:
> Nope, that still doesn't work!!!!
> 
> Can you remember when this was last reported - we are pretty stuck.
> Any other ideas where to look?

I forgot that adding "synchronized" is not enough as it was necessary to 
add synchronized (parentLoader) as well. Here is the original report:

--------------------------------------------------------------
......
We've had some problems when using Rhino library with Tomcat. We ran 
multiple worker threads on the server side to execute a JavaScript, and 
occasionally but persistently Rhino would throw exceptions like

java.lang.NoClassDefFoundError: org/mozilla/javascript/optimizer/OptRuntime
at org.mozilla.javascript.gen.c3._c0(import)
at org.mozilla.javascript.gen.c3.call(import)
at org.mozilla.javascript.gen.c3.exec(import)

We eventually found that the cause is that Rhino's classloader 
DefiningClassLoader doesn't synchronize the access to its parent loader, 
Tomcat's WebappClassLoader. Once the synchronization is done, no 
exceptions are thrown out.

Now we have two choices

1. Fix Rhino's class loader DefiningClassLoader to synchronize the 
access to the parent loader, or
2. Fix Tomcat's class loader WebappClassLoader.

Do you think that DefiningClassLoader should synchronize the access to 
its parent class loader?
--------------------------------------------------------------

The fix was described later was:

--------------------------------------------------------------
Here is what we did to DefiningClass.java -  we made all methods 
"synchronized" and also synchronized the access to the parent loader in 
method loadClass,

    public synchronized Class loadClass(String name, boolean resolve)
        throws ClassNotFoundException
    {
        Class cl = findLoadedClass(name);
        if (cl == null) {
            if (parentLoader != null) {
              synchronized(parentLoader) {
                cl = parentLoader.loadClass(name);
              }
            } else {
                cl = findSystemClass(name);
            }
        }
        if (resolve) {
            resolveClass(cl);
        }
        return cl;
    }
--------------------------------------------------------------

Regards, Igor
0
Igor
1/21/2005 7:52:10 PM
Reply:

Similar Artilces:

java.lang.NoClassDefFoundError: org/mozilla/javascript/optimizer/OptRuntime
Hi, I am trying to update catalina.policy file in Tomcat for my web application which uses Rhino. When I enable the Security Manager, it throws an exception as below. Could some one please help me out with this. Using CATALINA_BASE: C:\jakarta-tomcat-5.5.9 Using CATALINA_HOME: C:\jakarta-tomcat-5.5.9 Using CATALINA_TMPDIR: C:\jakarta-tomcat-5.5.9\temp Using JAVA_HOME: C:\jrockit-jdk1.5.0_03 Using Security Manager java.lang.NoClassDefFoundError: org/mozilla/javascript/optimizer/OptRuntime at org.mozilla.javascript.gen.c1._c0(TRN_FinalizeLots.js:1) at org.mozill...

mozilla-community-brasil@lists.mozilla.org vs community-brasil@lists.mozilla.org
--5p8PegU4iirBW1oA Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Eu ainda n=C3=A3o sei porque algumas pessoas manda email para mozilla-community-brasil@lists.mozilla.org quando deveriam enviar email para community-brasil@lists.mozilla.org. O envio de emails para mozilla-community-brasil@lists.mozilla.org e o uso do "responder para todos" faz com que eu e outras pessoas recebam email duplicado pois emails para mozilla-community-brasil@lists.mozilla.org possuem Reply-To: Lista de discuss=C3=A3o...

ftp.mozilla.org/pub/mozilla.org/
ftp.mozilla.org/pub/mozilla.org/ I have used the above ftp in the past. I notice that the Index now shows "addons" and lists numerically the available addons (extensions ?) - Previously they were listed IIRC "extensions". How does one determine WHAT are the contents of the various "directories" eg "ftp://ftp.mozilla.org/pub/addons/17/" = Chromedit...... Any assistance is greatly appreciated.... regards:captjlddavis On 9/28/2007 15:59, captjlddavis wrote: > ftp.mozilla.org/pub/mozilla.org/ > > I have used the above ftp in t...

black screen: http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/
I use the b2g-17.0a1.en-US.mac64.dmg<http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/b2g-17.0a1.en-US.mac64.dmg> and get a black screen emulator. thanks. ...

http://ftp.mozilla.org/pub/mozilla.org/ is unavailable
Hi all, http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-1.9.1-l10n/ is unavailable for several days. I can't test recent builds :-( Does anybody can access latest-mozilla-1.9.1-l10n? With best regards, Siarhei It seems now, it is local network problem :-/ �� 27.05.2009 12:57, Siarhei �������(��): > Hi all, > > http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-1.9.1-l10n/ > is unavailable for several days. > > I can't test recent builds :-( > > Does anybody can access latest-mozilla-1.9.1-l...

bonsai-l10n.mozilla.org lxr.mozilla.org interlinking wrong
When I'm on http://bonsai-l10n.mozilla.org/cvslog.cgi?file=l10n/mk/toolkit/defines.inc&rev=&root=/l10n and if I click on any of the links that go to lxr.mozilla.org, it goes to a wrong url of: http://lxr.mozilla.org/l10n/source/l10n/mk/toolkit/defines.inc instead of the correct: http://lxr.mozilla.org/l10n/source/mk/toolkit/defines.inc (notice that the wrong url has one /l10n/ more) Also, on http://lxr.mozilla.org/l10n/source/mk/toolkit/defines.inc the links to "Cvs Log" "Cvs blame" etc. go to the incorrect url of: http://bonsai.mozilla.org/cvslog.cg...

bonsai.mozilla.org moving / cvs.mozilla.org outage planned
We're planning to move bonsai.mozilla.org to a new machine today. Among other things, the new machine is a lot faster. During the changeover the Mozilla source code cvs repository will be down for a half hour to an hour. The bonsai.mozilla.org web site should be up continuously, and that change will be transparent when the DNS change propogates. At this point, we are planning to take cvs.mozilla.org offline at approximately 8:00pm PDT tonight (Tuesday, September 23) to facilitate moving the bonsai databases to the new server without losing any check-in data. -- Dave Mille...

ftp://ftp.mozilla.org/pub/mozilla.org/ 550 Permission denied.
Anyone else getting the same? http://www.seamonkey-project.org/releases/ 64bit linux build (near bottom of page) Linux/x86_64 Linux/x86_64 .tar.bz2 (readme) (MD5 sum) (SHA1 sum) tries to link to: ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.33.1/contrib/seamonkey-2.33.1.en-US.linux-x86_64.tar.bz2 but that results in a 550 Permission denied error. Yeah, ftp://ftp.mozilla.org/pub/ doesn't work either. However, I remember reading this newsgroup thread: https://groups.google.com/forum/#!topic/mozilla.general/Jqm5Q1swEnA ... It is after the 5th so ftp.mo...

localize.mozilla.org: Firefox Cup still a project in localize.mozilla.org
As far as I know, the football championship 2010 has ended on 11/07. If somebody missed it, Spain is the champion, beating Netherlands 1:0 a.e.t. Would it not make sense to retire it? Or to cloak it some way? TiA smo PS: SL version was 100% by the time it was needed. the contents have grown since to hard-to-understand 38206 words ("that need your attention", status 0% completed), As far as I can see, changes involve Add-ons and thats where they belong. Thanks, Vito. We are investigating it and will report back with a fix soon. smo wrote: > As far as I k...

wiki.mozilla.org/B2G/Gaia -> wiki.mozilla.org/Gaia
Hey all, FYI: wiki.mozilla.org/B2G/Gaia has moved to wiki.mozilla.org/Gaia Trond. ...

Mozilla lexicon on wiki.mozilla.org
Hi everyone, The Mozilla lexicon is a new effort to gather and define Mozilla-project specific terms on the Mozilla Wiki. https://wiki.mozilla.org/Lexicon:Home As Mozilla has grown significantly with new employees and active contributors from across the globe, the Contributor Engagement team is gathering project-related terms in one place and will work with interested contributors to define key terms. To be clear, the lexicon will not compete with MDN, which is our platform for technical/web standards documentation. The lexicon will focus on defining non-technical, project-related ...

Mozilla lexicon on wiki.mozilla.org
Hi everyone, The Mozilla lexicon is a new effort to gather and define Mozilla-project specific terms on the Mozilla Wiki. https://wiki.mozilla.org/Lexicon:Home As Mozilla has grown significantly with new employees and active contributors from across the globe, the Contributor Engagement team is gathering project-related terms in one place and will work with interested contributors to define key terms. To be clear, the lexicon will not compete with MDN, which is our platform for technical/web standards documentation. The lexicon will focus on defining non-technical, project-related ...

ftp.mozilla.org has no Mozilla files
It's coming up claiming to be a server at oregonstate.edu. It lists other things like apache, linux, mysql, etc., but no Mozilla. 'Sup with that? On Fri, 17 Oct 2003 16:36:59 GMT, John A. <no.john@spammers.virginiaquilter.allowed.com> wrote: >It's coming up claiming to be a server at oregonstate.edu. It lists >other things like apache, linux, mysql, etc., but no Mozilla. > >'Sup with that? Tried it again and this time connected to gatech.edu. The files are there. I guess it's just the oregonstate.edu mirror that's missing. JA On 1...

mozilla.org vs mozilla.com
I did a google search for thunderbird and had mozilla.com coming first in the search results and so I went there and downloaded it. But then I thought wasn't it supposed to be mozilla.org. So I went to mozilla.org also and download a version of thunderbird from there too. Now the two copies of thunderbird for windows setup programs were marked as of the same version (1.5.0.7), but the sizes are different. I wonder what's wrong. If mozilla.com and mozilla.org are both legitimate sites, why did they have to confuse us like this? "emrefan" <dksleung@hotmail.com>...

Web resources about - Sparodic NoClassDefFoundError: org/mozilla/javascript/optimizer/OptRuntime - netscape.mozilla.jseng

Resources last updated: 12/4/2015 2:03:10 PM