My guess 

You cannot create a Thread object from an EJB. This is why you get
ClassCastException because the Thread class cannot be in the namespace. 

Calling run will act as just a standard method.

-----Original Message-----
From: Rickard Öberg [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 22, 1999 3:10 PM
To: Orion-Interest
Subject: Bug /w multithreading+EJB?


Hey

Possible bug:
We have a EntityBean. We first call create, and then invoke a method on
the newly created instance. We then spawn off a thread that calls
another method on the bean. From this second call in the newly created
thread we get the following error msg:
java.lang.ClassCastException: java.lang.Thread
        at EntityBeanWrapper0.doSomething(EntityBeanWrapper0.java:xxx

        at web.MyServlet$1.run(MyServlet.java:xxx)
        at java.lang.Thread.run(Thread.java:479)

We accidentally called run() and not start() on the thread first, and
then it worked. When we did it "the right way" it stopped working with
the above situation.

Any clues?

/Rickard

-- 
Rickard Öberg

@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

Reply via email to