This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

HF EJB chapter 1 - need help

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Help!!!
I've spent many days trying to get the AdviceClient to run but always got the same error:
C:\projects\advice>java -cp %CLASSPATH%;AdviceAppClient.jar AdviceClient

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/corba/se/inte
rnal/util/JDKBridge
at com.sun.corba.ee.internal.core.IOR$LocalCodeBaseSingletonHolder.<clin
it>(IOR.java:90)
at com.sun.corba.ee.internal.core.IOR.<init>(IOR.java:238)
at com.sun.corba.ee.internal.iiop.messages.LocateReplyMessage_1_2.read(L
ocateReplyMessage_1_2.java:137)
at com.sun.corba.ee.internal.iiop.IIOPInputStream.unmarshalHeader(IIOPIn
putStream.java:126)
at com.sun.corba.ee.internal.iiop.IIOPConnection.getResponse(IIOPConnect
ion.java:671)
at com.sun.corba.ee.internal.iiop.IIOPConnection.send(IIOPConnection.jav
a:778)
at com.sun.corba.ee.internal.corba.InitialNamingClient.locateObject(Init
ialNamingClient.java:786)
at com.sun.corba.ee.internal.corba.InitialNamingClient.getIORUsingHostIn
fo(InitialNamingClient.java:597)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveCorbaloc(I
nitialNamingClient.java:573)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveUsingORBIn
itRef(InitialNamingClient.java:544)
at com.sun.corba.ee.internal.corba.InitialNamingClient.cachedInitialRefe
rences(InitialNamingClient.java:1080)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolve_initial_r
eferences(InitialNamingClient.java:981)
at com.sun.corba.ee.internal.corba.ORB.resolve_initial_references(ORB.ja
va:2425)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav
a:52)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120
)
at javax.naming.InitialContext.lookup(Unknown Source)
at AdviceClient.go(AdviceClient.java:17)
at AdviceClient.main(AdviceClient.java:11)

Here is my path:

Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Pe
rsonal Communications;C:\apache-ant-1.6.5\bin;%ANT_HOME%\bin;C:\j2sdk1.4.2_09\bi
n;C:\j2sdkee1.3.1\bin;C:\jdk1.3.1_16\bin;C:\j2sdkee1.3.1\lib;C:\Program Files\Su
n\jstudio_ent8\AppServ8.1UR2\bin;;C:\Sun\AppServer\bin;C:\Program Files\Sun\jstu
dio_ent8\ide\uml1\modules\DoorsIntegrationFiles\modules\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

and CLASSPATH:
CLASSPATH=C:\j2sdkee1.3.1\lib\j2ee.jar;C:\projects\advice

Thanks
Quang
[ November 29, 2005: Message edited by: Quang Pham ]
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Quang,

Do you have the j2ee library in your classpath?
Regards.
 
Quang Pham
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Valentin Tanase:
Hi Quang,

Do you have the j2ee library in your classpath?
Regards.



Hi Valentin
I took the j2ee.jar out of the classpath and it give me less errors.

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(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at AdviceClient.go(AdviceClient.java:17)
at AdviceClient.main(AdviceClient.java:11)

-----------------
Classpath now looks like this:
CLASSPATH=C:\j2sdkee1.3.1\lib;C:\projects\advice
---------------------

Quang

[ November 29, 2005: Message edited by: Quang Pham ]
[ November 29, 2005: Message edited by: Quang Pham ]
 
Quang Pham
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Valentin Tanase:
Hi Quang,

Do you have the j2ee library in your classpath?
Regards.



Yes I do
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read this thread and let me know if it helps you:

https://coderanch.com/t/317367/EJB-JEE/java/Running-headfirst-ejb-st-chapter

Regards.
 
Quang Pham
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Valentin Tanase:
Please read this thread and let me know if it helps you:

https://coderanch.com/t/317367/EJB-JEE/java/Running-headfirst-ejb-st-chapter

Regards.



Thank you so much for your help but I could not find jndi.properties file any where in my c: drive.

Any idea?
I am using j2ee RI (the learning server) to run this.

Quang
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Quang,

You need to find the apropriate values for both java.naming.factory.initial weblogic.jndi.WLInitialContextFactory and java.naming.provider.url system properties. They are vendor specific, hence check your container's documentation or search the net. Next you need to use one of the techniques I explained in the other posting to make those properties available to the InitialContext (either programatically, or using -D options when starting the JVM, or having the jndi.properties in your classpath). Any of them should work.
Regards.
 
Quang Pham
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Valentin Tanase:
Hi Quang,

You need to find the apropriate values for both java.naming.factory.initial weblogic.jndi.WLInitialContextFactory and java.naming.provider.url system properties. They are vendor specific, hence check your container's documentation or search the net. Next you need to use one of the techniques I explained in the other posting to make those properties available to the InitialContext (either programatically, or using -D options when starting the JVM, or having the jndi.properties in your classpath). Any of them should work.
Regards.



Hi Valentin
I am now having another type of error not sure what it is and how to solve it:

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/corba/se/internal/util/JDKBridge
at com.sun.corba.ee.internal.core.IOR$LocalCodeBaseSingletonHolder.<clinit>(IOR.java:90)
at com.sun.corba.ee.internal.core.IOR.<init>(IOR.java:238)
at com.sun.corba.ee.internal.iiop.messages.LocateReplyMessage_1_2.read(LocateReplyMessage_1_2.java:137)
at com.sun.corba.ee.internal.iiop.IIOPInputStream.unmarshalHeader(IIOPInputStream.java:126)
at com.sun.corba.ee.internal.iiop.IIOPConnection.getResponse(IIOPConnection.java:671)
at com.sun.corba.ee.internal.iiop.IIOPConnection.send(IIOPConnection.java:778)
at com.sun.corba.ee.internal.corba.InitialNamingClient.locateObject(InitialNamingClient.java:786)
at com.sun.corba.ee.internal.corba.InitialNamingClient.getIORUsingHostInfo(InitialNamingClient.java:597)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveCorbaloc(InitialNamingClient.java:573)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveUsingORBInitRef(InitialNamingClient.java:544)
at com.sun.corba.ee.internal.corba.InitialNamingClient.cachedInitialReferences(InitialNamingClient.java:1080)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolve_initial_references(InitialNamingClient.java:981)
at com.sun.corba.ee.internal.corba.ORB.resolve_initial_references(ORB.java:2425)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:52)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120)
at javax.naming.InitialContext.lookup(Unknown Source)
at AdviceClient.go(AdviceClient.java:18)
at AdviceClient.main(AdviceClient.java:12)

Quang
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Quang,

Looks like other people on this forum already wrestled with this beast :-) Check this thread it might help you:

https://coderanch.com/t/160749/java-EJB-SCBCD/certification/hd-first-SCBD-NoClassDefFoundError-util

Regards.
 
Quang Pham
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Valentin Tanase:
Hi Quang,

Looks like other people on this forum already wrestled with this beast :-) Check this thread it might help you:

https://coderanch.com/t/160749/java-EJB-SCBCD/certification/hd-first-SCBD-NoClassDefFoundError-util

Regards.



Hi Valentin
This thread helps alot.
Here is all what I have done so far.
1. I removed all jre 5 in the sytem using add/remove program in the control panel.
2. Modified the Advice*.* to use the getTheMessage method.
3. Clean up server.
4. Recompiled, deployed the Bean.
5. Recompiled and ran AdviceClient.

And it works.

Thank you so much for your helps
Quang
[ December 03, 2005: Message edited by: Quang Pham ]
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're very welcome Quang
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been messing with this same problem for the last three days. changing the classpath all around. thanks for your help valentin and quang

Keith
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're very welcome Keith
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic