• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB java.lang. UnsupportedClassVersionError (Unsupported major.minor version 48.0)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am trying to run my first EJB. Its been problems all the way right from deploying to running. I was able to get over the NamingException after searching these forums thoroughly.(thanks to Z Zia)

I am trying to RUN the Advice example from Head First EJB.
I am now getting a new Exception (
When I try to run my client code it throws this exception:

Exception in thread "main" java.lang.UnsupportedClassVersionError: javax/ejb/EJB Home (Unsupported major.minor version 48.0)

I am using J2sdk1.4.2_04 and Sun Java System Application Server Platform Edition 8.1.

All the classpath and path settings(including j2ee,jar) are correct.

a part of the code is:

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
env.put(Context.PROVIDER_URL,"iiop://localhost:3700");
Context ic = new InitialContext(env);
Object o = ic.lookup("Advisor");
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);
Advice advisor = home.create();
System.out.println(advisor.getAdvice());

Thanks a lot!
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this error -> "Unsupported major.minor version 48.0"
simply means that you've compiled your classes with JDK 1.4, but you're trying to run them with an older JVM, problably JDK 1.3.

So it seems that the path fpor your client code must be pointing to a non-JDK 1.4 JVM

Try typing:

java -version

at a command prompt to verify your path points to a JDK 1.4 before any other VMs you may have installed,

cheers,

Dave.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic