"Can't find SerialContextProvider" - Distributd Flat Transaction


EJB programming & troubleshooting: "Can't find SerialContextProvider" - Distributd Flat Transaction

  1. Hi,

    A brief decription about my work:
    I have constructed two simple entity beans connecting to two different databases. Both of them were tested individually and working fine.My reqmnt is to create rows in both the referred tables of database in a single tarnsaction.

    I am using the following snippet of code to obtain reference to the UserTransaction to perform the lookup on the InitialContext.

        Context ctx = new InitialContext();
        UserTransaction utx = (UserTransaction)cx.lookup("java:comp/UserTransaction");
        BEGIN TRANSACTION with utx reference
           Lookup the first bean and create the same
           Lookup the second bean and create the same
        END TRANSACTION with utx reference

    Even at the first line of the above snippet I get an
    error "Can't find SerialContextProvider".

    I probed a little bit and found that there is a class
    com.sun.enterprise.SerialContextProvider and imported the same but got the same error

    Can anyone tell me where i have gone wrong?

    thanks in advance


  2. I've experienced the same problem.

    It occurs when creating the InitialContext, i.e.

    new InitialContext().

    I've not been able to resolve the problem, but I've read the Sun J2EE source code & established where the exception is being thrown.

    I believe it is because java.naming.*.* environment variables are set incorrectly ... but experimentation has not yet sorted the problem.

  3. hi
    thanks for the response bruce. i am also experimenting and once resolved shall share the same in the forum