John and all other users of my book-

If you have a question about my book, please send support emails to the
address listed on the book's web site (http://www.middleware-company.com).
It is not appropriate to send emails to EJB-INTEREST for this.

PS: On this note, John, please read the README file in the book's CD-ROM.
In the README file it states very clearly a step-by-step guide for getting
examples to work, and that means not renaming files, loading stuff into
JBuilder, or using the wrong JDK.  There is a very specific way to get these
examples to work, and an immense amount of time has been spent getting that
setup debugged and working for you.  Once you've gotten them working as
intended, then the best strategy is to use those working examples as a
reference platform you can debug against when loading beans into whatever
environment you choose.

-Ed

--

From: John McDonald <[EMAIL PROTECTED]>
Subject: WebLogic - Almost there
Date: Wed, 19 Apr 2000 09:33:00 -0700

Alright, first and foremost I want to thank all of you who helped me get
this far. We're almost there.

I'm now getting a semi-unusual error. A class cast exception, which tells me
that I am somehow casting incorerectly which strikes me as odd, since this
is an example from a book(Mastering EJB and the J2EE by Ed Roman). Heres the
exception and the code.

--------- EXCEPTION -------------
C:\JBuilder3\java\bin\javaw.exe -classpath
"D:\WebLogic\myserver\clientclasses;C:\JBuilder3\lib\dx3.0.jar;C:\JBuilder3\
lib\dx3.0-res.jar;C:\JBuilder3\lib\jbcl3.0.jar;C:\JBuilder3\lib\jbcl3.0-res.
jar;C:\JBuilder3\lib\jgl3.1.0.jar;C:\JBuilder3\lib\dbswing3.0.jar;C:\JBuilde
r3\lib\dbswing3.0-res.jar;C:\JBuilder3\lib\pop3.jar;C:\JBuilder3\dependency\
~pop3;C:\JBuilder3\lib\activation.jar;C:\JBuilder3\dependency\~Activation;C:
\JBuilder3\lib\j2ee.jar;C:\JBuilder3\dependency\~j2ee;C:\JBuilder3\dependenc
y\~WebAux;D:\WebLogic\classes;C:\JBuilder3\dependency\~WebLogic;C:\JBuilder3
\java\lib\jdkdep.jar;C:\JBuilder3\java\jre\lib\rt.jar;C:\JBuilder3\java\lib\
dt.jar;C:\JBuilder3\java\jre\lib\i18n.jar;C:\JBuilder3\java\lib\tools.jar" -
Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory -Djava.na
ming.provider.url=t3://localhost:7001 bean.HelloClient
AppAccelerator(tm) 1.2.010 for Java (JDK 1.2), x86 version.
Copyright (c) 1997-1999 Inprise Corporation. All Rights Reserved.

java.lang.ClassCastException:
com.wiley.compBooks.roman.session.helloworld.HelloBeanHomeImpl_ServiceStub
at bean.HelloClient.main(HelloClient.java:30)
 --------- END EXCEPTION ------------------

------------ CODE ------------------------
package bean;

import javax.ejb.*;
import javax.naming.*;
import java.rmi.*;
import java.util.Properties;

/**
 * This class is an example of client code which invokes
 * methods on a simple stateless session bean.
 */
public class HelloClient {

 public static void main(String[] args) {

  try {
   /*
    * Get System properties for JNDI initialization
    */
      Properties props = System.getProperties();

   /*
    * Get a reference to the HelloHome Object - the
    * factory for Hello EJB Objects
    */
   Context ctx = new InitialContext(props);
   HelloHome home = (HelloHome) ctx.lookup("Hello");         ///This is the
line which throws the exception

   /*
    * Use the factory to create the Hello EJB Object
    */
   Hello hello = home.create();

   /*
    * Call the hello() method, and print it
    */
   System.out.println(hello.hello());

   /*
    * Done with EJB Object, so remove it
    */
   hello.remove();
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
}

-------------- END CODE ---------------------------

Any ideas? Once again, thank you for all your help thus far.

-jdm-
web app guru
ClientScience.com, Inc.
p 925.373.8700
f  413.793.6603
e [EMAIL PROTECTED]

--
Ed Roman
CEO, The Middleware Company
Author, "Mastering Enterprise JavaBeans and the Java 2 Platform, Enterprise
Edition"
http://www.middleware-company.com
[EMAIL PROTECTED]
512-784-7840

Need help with EJB / J2EE?  Ask about our on-site training and consulting
services.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to