You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F. Da Costa" <da...@xs4all.nl> on 2004/01/06 21:10:48 UTC

Tapestry helps in: Cannot cast RootClass (id=59) to RootClass

Hi all,

After some code cleaning and making it Spindle proper I ran some db filling 
prgs prior to starting up Tapestry (3.0b3).I do that using the Global class 
as defined below.
These three runs go fine. no worries at all.

Now I start up Tapestry and it comes back with:
*HTTP ERROR: 500 Unable to instantiate global object from class 
org.dcg.platform.Global.*

Definitely a worry because this used to work pre-cleanup and there are no 
Spindle nor compilation errors.

Whislt debugging I noted something peculiar. Remember that i used the 
Global class 3 times prior to starting it up via Tapestry and every time it 
  opened and closed ok.
*ClassCastException: Cannot cast org.dcg.model.RootClass (id=59) to 
org.dcg.model.RootClass *

The *only* difference between the non- & tapestry instantiation of the 
Global is that i use *new Global()* to create an instance and using Tap 
some magical Tap call is used to end up *in* the Global constructor (shown 
below).

I'm slowly but surely getting a tad confused here.

Does anybody has any suggestions whatsoever (or is more info required?).

T(a lot)IA

Fermin DCG


.application snip
<property name="org.apache.tapestry.global-class" 
value="org.dcg.platform.Global"/>

public class Global {
   private static Storage _db;
   public static RootClass _root;

   public Global() {
     _db = StorageFactory.getInstance().createStorage();
     _db.open("c://temp//alfatest.dbs");
     _root = (RootClass) _db.getRoot(); *Choke location*

     if (_root == null) {
       _root = new RootClass(_db);
       _db.setRoot(_root);
       _db.commit();
     }
   }
}


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org