aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Head First EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Head First EJB" Watch "Head First EJB" New topic
Author

Head First EJB

Oscar Diaz
Greenhorn

Joined: Apr 16, 2004
Posts: 3
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
34Server.jar
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.
oscar


oscar
Shih-Chia Cheng
Greenhorn

Joined: Apr 08, 2004
Posts: 2
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
n(ShutdownUtilDelegate.java:137)
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:
No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
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
eption(ReplyMessage_1_2.java:93)
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(
ClientResponseImpl.java:108)
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
entSC.java:132)
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!
Jeff Pavlocak
Greenhorn

Joined: Apr 26, 2004
Posts: 16
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.

http://www.coderanch.com/t/159160/java-EJB-SCBCD/certification/error-compilation
Hope this helps.
Jeff
Johannes de Jong
tumbleweed
Bartender

Joined: Jan 27, 2001
Posts: 5089
Also have a look here Head First EJB: 1st tut error
Good luck.
 
Consider Paul's rocket mass heater.
 
subject: Head First EJB