Rohit Bajaj
asked on
java.lang.ClassFormatError
HI,
I have a project written in java springs. When i run the file containing the main method i am getting the following error :
Exception in thread "Main Thread" java.lang.ClassFormatError : javax/mail/MessagingExcept ion : Missing Code attribute
at java.lang.ClassLoader.defi neClass1(N ative Method)
-----------File----------- ---------- -
package com.yatra.extremesearch.ap p;
import org.apache.log4j.Logger;
import org.springframework.contex t.support. ClassPathX mlApplicat ionContext ;
public class ExtremeSearchApp {
private static final Logger logger = Logger.getLogger(ExtremeSe archApp.cl ass);
public static void main(String args[]){
try {
logger.info("=====Starting Extreme search======");
new ClassPathXmlApplicationCon text("clas spath*:spr ing/root-c ontext.xml ");
} catch (Exception e) {
logger.error(e.getMessage( ));
}
}
}
Unable to find out the reason for it.
Thanks
I have a project written in java springs. When i run the file containing the main method i am getting the following error :
Exception in thread "Main Thread" java.lang.ClassFormatError
at java.lang.ClassLoader.defi
-----------File-----------
package com.yatra.extremesearch.ap
import org.apache.log4j.Logger;
import org.springframework.contex
public class ExtremeSearchApp {
private static final Logger logger = Logger.getLogger(ExtremeSe
public static void main(String args[]){
try {
logger.info("=====Starting
new ClassPathXmlApplicationCon
} catch (Exception e) {
logger.error(e.getMessage(
}
}
}
Unable to find out the reason for it.
Thanks
Seems to be one of your libraries . ClassFormatError is thrown when the JVM cannot interpret a class file . Can you replace the java mail jar and see.
ASKER
Hi,
What should i replace the mail.jar with ?
If i remove it i get the error :
The archive: /libs/jars/java/mail.jar which is referenced by the classpath, does not exist.
How do i make my code run ? I dont need to test whether the mailling functionallity is working or not.
Can i just remove the need of mail.jar ?
Please advice how to do it.
Thanks
What should i replace the mail.jar with ?
If i remove it i get the error :
The archive: /libs/jars/java/mail.jar which is referenced by the classpath, does not exist.
How do i make my code run ? I dont need to test whether the mailling functionallity is working or not.
Can i just remove the need of mail.jar ?
Please advice how to do it.
Thanks
Well , if you don't want to test email , then you will have to remove references to mail.jar from within your code too.
When I suggested you to replace mail.jar , I meant that it should be replaced with another version , maybe a newer version . What version are you using currently?
When I suggested you to replace mail.jar , I meant that it should be replaced with another version , maybe a newer version . What version are you using currently?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found it myself. No exact answer was given