• 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

Exception in thread "main"

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

I've bought the Head First EJB book and keep getting the following exception when running j2ee.bat


J2EE server listen port: 1050
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/corba/se/internal/util/IdentityHashtable
at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.<clinit>(Util.java:87)

at com.sun.corba.ee.internal.POA.POAImpl.activate(POAImpl.java:935)
at com.sun.corba.ee.internal.POA.POAImpl.activate_object(POAImpl.java:89
5)
at com.sun.corba.ee.internal.CosNaming.TransientNameService.initialize(T
ransientNameService.java:117)
at com.sun.corba.ee.internal.CosNaming.TransientNameService.<init>(Trans
ientNameService.java:70)
at com.sun.enterprise.iiop.POAProtocolMgr.initializeNaming(POAProtocolMg
r.java:103)
at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:226)
at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)


I've tried in vain to find the solution but no joy. I think it's probably a classpath issue so here's whats setup with them:

CLASSPATHC:\j2sdkee1.3.1\lib\j2ee.jar
J2EE_HOMEC:\j2sdkee1.3.1
JAVA_HOMEC:\jdk1.5.0
PATHC:\j2sdkee1.3.1\bin;C:\jdk1.5.0\bin
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note that the NoClassDefFoundError usually happens when the class was there when everything was compiler but is missing at runtime when it needs to be dynamically linked as the result of a method call or creation of a new object, for instance. Make sure your class path is correct.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is using wrong version of J2SE.
use j2sdk1.4.2_09.
 
Valentin Crettaz
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
albert II,

Welcome to Javaranch, a friendly place for Java greenhorns

We hope you are enjoying your stay here at Javaranch. We'd like you to modify your display name in order to comply with our naming policy.

We thank you for your comprehension
 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Definitely IdentityHashtable class is part of j2ee.jar .Make sure you have correct version of j2se.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Error Message:
J2EE server listen port: 1080
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/corba/se/internal/util/IdentityHashtable
at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.<clinit>(Util.java:87)


This is because "J2EE RI relies on Sun's J2SE for CORBA support". See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4761595
So in our case, this is a problem with the jdk or j2se used in the PATH
IdentityHashtable class
In jdk 1.5 IdentityHashtable.class is in "com.sun.corba.se.impl.util.IdentityHashtable" inside the rt.jar
In jdk 1.4 IdentityHashtable.class is in "com.sun.corba.se.internal.util.IdentityHashtable" inside the rt.jar <-- j2ee wants this one

The util.class in the j2ee.jar (j2ee lib folder) expects the IdentityHashtable class in "com.sun.corba.se.internal.util.IdentityHashtable".
But like me if you have been using jdk 1.5 in the Path/Classpath it cannot obviously find the class IdentityHashtable.
Solution is to use jdk 1.4 in the class path.
change JAVA_HOME=C:\SDKs\jdk1.5.0 to "JAVA_HOME=C:\SDKs\jdk 1.4.2_09"
 
Squanch that. And squanch this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic