🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7575

ClassCastException

#7575
From: ct
Date: Fri, 08 Jun 2001 21:41
24 lines
1576 bytes
I had a problem with the following codes, which are called
in ejb component in app server.
StateHandler is interface and SigninHandler implements it.
If I include the line with System.out.println(), it will run OK.
But if I comment out System.out.println(), a 
ClassCastException error will be throwed in the next line 
(handler = (StateHandler)o),

    Class c1 = Class.forName(handlerName);
    Object o = c1.newInstance();
    System.out.println("StateMachine: o = " + (SigninHandler)o);
    handler = (StateHandler)o;  // exception throws

I am running jbuild4.0 Enterprise version.  My OS is NT4.0
I had created an small test program to test these pieces of
codes and used the same classpath used by appserver.  It works 
regardless the println statement.  

Any help is welcomed.

thanks!

ct
Technical Details
Message-ID: <3b214690$1_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,8a0377b4254bc1e1,start
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-06-08 14:45:29 PST
From: "ct" <cctang@yahoo.com>
Sender: "ct" <cctang@yahoo.com>
Reply-To: "ct" <cctang@yahoo.com>
Subject: ClassCastException
Newsgroups: borland.public.jbuilder.java.language
X-User-Info: 206.30.165.9 206.30.165.9    
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3b214690$1_1@dnews>
Date: 8 Jun 2001 14:41:36 -0700
X-Trace: dnews 992036496 207.105.83.65 (8 Jun 2001 14:41:36 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews