Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » ClassFormatException with AJDT and RAD 8
icon5.gif  ClassFormatException with AJDT and RAD 8 [message #854953] Tue, 24 April 2012 11:43 Go to next message
Marshall Blythe is currently offline Marshall BlytheFriend
Messages: 4
Registered: April 2012
Junior Member
I'm on a development team using IBM Rational Application Developer (RAD) 8.0.4, and we're having some very frustrating problems with the AspectJ Developer Tools (AJDT) plugin. RAD 8.0.4 is based on Eclipse 3.6. Here's the typical scenario:


  1. Fresh install of RAD 8.0.4 - no other 3rd-party plugins installed. RAD is functioning normally at this point.
  2. Install the AJDT plugin for Eclipse 3.6. We do this by selecting Help --> Install New Software from the RAD menu, then we enter the URL for the AJDT Update Site for for Eclipse 3.6. We choose only the required features and none of the optional ones. The plugin installs without any apparent problems, and we restart RAD when prompted to do so.
  3. RAD restarts without any apparent problems, but certain preference pages (Window --> Preferences) can no longer be used. For example, selecting the "Java" or "Java EE" preferences will trigger a RAD error stating that it was "Unable to create the selected preference page". Also, some nasty error messages are being written to the workspace .log file; for example:


org.aspectj.apache.bcel.classfile.ClassFormatException: org.eclipse.jdt.internal.ui.filters.ImportDeclarationFilter is not a Java .class file
org.aspectj.apache.bcel.classfile.ClassFormatException: org.eclipse.jdt.internal.ui.JavaPlugin$2 is not a Java .class file


The complete log file is attached. Notice that the errors appear to be related to the AspectJ plugin. We have used this plugin with regular Eclipse 3.6 without any problems.

The really odd thing is that I can sometimes re-install RAD and AJDT without any problems. I don't do anything different on the subsequent installs, so I have no idea why the problem disappears. So far 3 of us have this working, but the 4th developer is stuck, and multiple re-installs have failed to solve the problem.

Does anyone have any suggestions on how to make the AJDT plugin work reliably with RAD 8.0.4? I posted the same question on the RAD forum over at IBM developerWorks, but so far no answers.
  • Attachment: workspace.log
    (Size: 432.09KB, Downloaded 213 times)

[Updated on: Tue, 24 April 2012 11:44]

Report message to a moderator

Re: ClassFormatException with AJDT and RAD 8 [message #855228 is a reply to message #854953] Tue, 24 April 2012 16:19 Go to previous messageGo to next message
Andrew Clement is currently offline Andrew ClementFriend
Messages: 162
Registered: July 2009
Senior Member
From looking at the log, the error is thrown if the class bytes fail the very first check 'does the byte data start with 0xCAFEBABE'. I'll assume the byte data does - but you could double check on the failing system using something like od:

od -h Code.class | head -1
0000000 feca beba 0000 3100 d000 0007 0102 0400

If I could install a RAD myself and recreate, I could debug it - but I imagine I can't easily get hold of a rad instance.

You can turn off JDT weaving (which is what is being triggered here) - it isn't *essential* to the operation of AJDT - compilation will work fine without it, but it does make some of the UI behave nicely. You can turn if off in workspace prefs.

It feels like something else is also modifying bytecode at launch time and there is a bit of a race depending upon who gets there first. If AspectJ is second, it looks like it fails. How does this plugin 'com.ibm.rational.llc.internal.core.CoverageCorePlugin' do its work? If it is rewriting bytecode, that may be the guy not playing well with AspectJ. Is that configurable (e.g. try once with it off, does it change things?)

cheers,
Andy
Re: ClassFormatException with AJDT and RAD 8 [message #855258 is a reply to message #855228] Tue, 24 April 2012 16:44 Go to previous messageGo to next message
Marshall Blythe is currently offline Marshall BlytheFriend
Messages: 4
Registered: April 2012
Junior Member
Quote:

If I could install a RAD myself and recreate, I could debug it - but I imagine I can't easily get hold of a rad instance.


You can download a trial version from IBM. I can't post links here just yet, but if you Google for "Trial download Rational Application Developer 8.0.4" the links will turn up. Be advised: it's a big honking download, and IBM's servers can be a bit flaky at times.

Quote:

You can turn off JDT weaving (which is what is being triggered here) - it isn't *essential* to the operation of AJDT - compilation will work fine without it, but it does make some of the UI behave nicely. You can turn if off in workspace prefs.


I checked that - it's already off Crying or Very Sad

Quote:

How does this plugin 'com.ibm.rational.llc.internal.core.CoverageCorePlugin' do its work? If it is rewriting bytecode, that may be the guy not playing well with AspectJ. Is that configurable (e.g. try once with it off, does it change things?)


I'm not sure how it works or how to turn it off, but it was an optional feature during the RAD install. I'll try re-installing RAD without this feature to see if that changes anything.
Re: ClassFormatException with AJDT and RAD 8 [message #855420 is a reply to message #854953] Tue, 24 April 2012 20:15 Go to previous messageGo to next message
Marshall Blythe is currently offline Marshall BlytheFriend
Messages: 4
Registered: April 2012
Junior Member
I re-installed RAD and AJDT, but this time I omitted the code coverage tool & a few other optional RAD features of dubious value. However, I'm still getting lots of ClassFormatExceptions in the workspace log (attached). I no longer see any references to the CoverageCorePlugin in the log, but the problem persists.
  • Attachment: workspace.log
    (Size: 395.16KB, Downloaded 185 times)
Re: ClassFormatException with AJDT and RAD 8 [message #855747 is a reply to message #855258] Wed, 25 April 2012 04:20 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 369
Registered: July 2009
Senior Member
Marshall Blythe wrote on Tue, 24 April 2012 12:44

Quote:

You can turn off JDT weaving (which is what is being triggered here) - it isn't *essential* to the operation of AJDT - compilation will work fine without it, but it does make some of the UI behave nicely. You can turn if off in workspace prefs.

I checked that - it's already off Crying or Very Sad


Based on your log, it does not look like weaving is really disabled. You can force it to be disabled by going to your plugins directory and just moving (don't delete) the org.eclipse.equinox.weaving.hook_xxx.jar file to a different directory.
Re: ClassFormatException with AJDT and RAD 8 [message #856603 is a reply to message #855747] Wed, 25 April 2012 20:38 Go to previous messageGo to next message
Marshall Blythe is currently offline Marshall BlytheFriend
Messages: 4
Registered: April 2012
Junior Member
This morning I got a response from an IBM representative regarding this problem, and here is what she said:

Quote:

Abstract
When installing AspectJ Developer Tools plug-in in Rational Application Developer 8.0.3 the product may show errors upon start up. The AspectJ repository known to cause the problem is download.eclipse.org/tools/ajdt/36/update

Symptom

Errors such as these may occur:
<exception message="org.eclipse.jdt.core.IElementChangedListener is not a
Java .class file" type="org.aspectj.apache.bcel.classfile.ClassFormatException">
<trace class="org.aspectj.apache.bcel.classfile.ClassParser"
method="readID"/>
OR
<exception message="org.eclipse.jdt.internal.core.builder.JavaBuilder is not
a Java .class file"
type="org.aspectj.apache.bcel.classfile.ClassFormatException">
<trace class="org.aspectj.apache.bcel.classfile.ClassParser"
method="readID"/>
OR
When opening the package explorer view the error is :
"Could not create the view : Plin-in org.eclipse.jdt.ui was unable to load
class org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart"

Cause

The shared classes library which is created by RAD upon startup via the
eclipse.ini entry:

-Xshareclasses:name=IBMSDP_%u

and which is located for example in:

"C:\Documents and Settings\Administrator\Local Settings\Application
Data\javasharedresources\C240D2A32P_IBMSDP_Administrator_G08"

Is not compatible with the byte-code weaving of the AspectJ plugin resulting in
classes not being loaded properly.

Resolution
1. From a command line, issuing the command to destroy the shared cache
as follows, while RAD is NOT running:

C:\Documents and Settings\Administrator>"C:\Program
Files\IBM\SDP\jdk\bin\java.exe" -Xshareclasses:destroyAll

The output should then look something like this:
"Attempting to destroy all caches in cacheDir C:\Documents and
Settings\Administrator\Local Settings\Application Data\javasharedresources\

JVMSHRC256I Persistent shared cache "IBMSDP_Administrator" has been
destroyed
Could not create the Java virtual machine."

Restart RAD (which recreates the cache if the eclipse.ini entry above is still
present).


I'm pleased to report that the solution did indeed work for us.
Re: ClassFormatException with AJDT and RAD 8 [message #856622 is a reply to message #856603] Wed, 25 April 2012 21:04 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 369
Registered: July 2009
Senior Member
Thanks for posting the answer here. I did not know this and will be sure to point people here who are having the same problem as you.
Re: ClassFormatException with AJDT and RAD 8 [message #1058699 is a reply to message #854953] Tue, 14 May 2013 17:57 Go to previous message
santosh patil is currently offline santosh patilFriend
Messages: 1
Registered: May 2013
Junior Member
even I deleted C240D2A32P_IBMSDP_ file and it worked
Thanks
Santosh patil sokke
Previous Topic:AspectJ AOP config with JSP
Next Topic:Debugging LTW weaved classes
Goto Forum:
  


Current Time: Fri Nov 28 06:14:09 GMT 2014

Powered by FUDForum. Page generated in 0.03348 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software