Would some one please throw some light on this?

In the design, a stateless session bean passes a persistence broker instance
to an OJB component that does the CRUD functions. EJB was deployed to  JBoss
successfully, but when envoking the OJB component, application throws
ClassNotFoundException. So I included ojb.jar inside myejb.jar.
ClassNotFoundException was fixed and the retrieval of objects works. 

But when save or store object, a ClassCastException throws. 

Questions 1) Is it right to include ojb.jar in myejb.jar file?

                2) What causes the ClassCastException?

OJB 0.9.9 / Oracle 9i (ojdbc14.jar 4/26/2002 11:47AM) /  JDK 1.4.1_01 /
JBoss 3.0.4

18:51:54,729 ERROR [LogInterceptor] RuntimeException:
java.lang.ClassCastException
        at
oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement
.java:2793)
        at
oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement
.java:2905)
        at
org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.setObject(Local
PreparedStatement.java:607)
        at
org.apache.ojb.broker.platforms.PlatformDefaultImpl.setObjectForStatement(Un
known Source)
        at
org.apache.ojb.broker.platforms.PlatformOracleImpl.setObjectForStatement(Unk
nown Source)
        at
org.apache.ojb.broker.accesslayer.StatementManager.bindInsert(Unknown
Source)
        at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown
Source)
        at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.storeToDb(Unknown
Source)
        at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(Unknown Source)
        at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(Unknown Source)
        at
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.store(Unknown
Source)
        ......
       
18:51:54,749 WARN  [RequestProcessor] Unhandled Exception thrown: class
java.rmi
.ServerException
18:51:54,749 WARN  [jbossweb] WARNING: Exception for
/edispatch/updateSiteType.do: java.rmi.ServerException: RuntimeException;
nested exception is:
        java.lang.ClassCastException

Lucy

Reply via email to