• 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Head First EJB

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been learning EJB with this book on EJB. I was able to create and deploy the Advisor bean using deploytool with 'Advisor' as JNDI Name (without the quotes). When I run the AdviceClient to invoke getAdvice() on the bean, I got
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
40)at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
)at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
a:280)at javax.naming.InitialContext.lookup(InitialContext.java:347)
at AdviceClient.go(AdviceClient.java:16) at AdviceClient.main(AdviceClient.java:10)
My J2EE 1.3 RI Server on Windows XP is running smoothly with this final message on the console
Loading jar:/C:/j2sdkee1.3.1/repository/master/applications/AdviceApp10828111758
J2EE server startup complete.

The command that caused the error was -
java -cp AdviceAppClient.jar;c:\j2sdkee1.3.1\bin\j2ee.jar;d:\projects\java\advice AdviceClient
Any suggestions will be much appreciated.
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use this book to learn EJB too;
And I also encountered some problems with this example program, but the exception message was different, they were generated after calling getAdvice() method with the remote object, as follows:

java.rmi.RemoteException: CORBA BAD_OPERATION 0 No; nested exception is:
org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed: No
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.mapSystemExceptio
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.go(AdviceClient.java:25)
at AdviceClient.main(AdviceClient.java:10)
Caused by: org.omg.CORBA.BAD_OPERATION: vmcid: 0x0 minor code: 0 completed:
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemExc
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
... 2 more
I really don't know why I got this kind of weird and mystic exception.
Can somebody help? Thanks!
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the EJB Certification (SCBCD) forum, "error in compilation" post updated April 26th 2004.
I believe the link below will take you there, but if not use the above. The answer is in there.

Hope this helps.
Posts: 5089
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also have a look here Head First EJB: 1st tut error
Good luck.
    Bookmark Topic Watch Topic
  • New Topic