This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Exception in thread "main"  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
The problem is using wrong version of J2SE.
use j2sdk1.4.2_09.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • 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: 442
  • Mark post as helpful
  • send pies
  • 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
  • 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"
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!