quality@glassfish.java.net

Re: b65: suddenly ClassNotFoundException: oracle.sql.TIMESTAMP

From: Richard Kolb <rjdkolb_at_gmail.com>
Date: Wed, 30 Sep 2009 14:14:04 +0200

Hi Wouter

Does this also happen on Glassfish 2.1 ?

Also does toplink not have a Dialect setting like in Hibernate ?
i.e. from Hibernate :
    <property name="dialect">
        org.hibernate.dialect.Oracle10gDialect
    </property>


regards
Richard.

2009/9/30 Wouter van Reeven <wouter_at_van.reeven.nl>

> Hi Matthias,
>
>
> The issue you are encountering is one I have encountered a few times
> myself when using Oracle databases >= 10g, both "regular" databases and
> XE. The same issue was there with Toplink. Apparently
> EclipseLink/Toplink assumes an Oracle 9i database. IMHO this is a flaw
> with EclipseLink/Toplink.
>
>
> Thanks, Wouter
>
> On Wed, Sep 30, 2009 at 02:00:13PM +0200, matthias.fraass_at_tricoder.netwrote:
> > Hi Everyone,
> >
> > @Wouter:
> > Changing the Lib from ojdbc14.jar to ojdbc6.jar didn't help, it just
> changed
> > the stack trace:
> > Caused by: java.lang.NoClassDefFoundError: Could not initialize class
> > org.eclipse.persistence.internal.platform.database.oracle.TIMESTAMPTypes
> > at
> >
> org.eclipse.persistence.platform.database.oracle.Oracle9Platform.convertObject
> > (Oracle9Platform.java:280)
> > at
> >
> org.eclipse.persistence.mappings.foundation.AbstractDirectMapping.getAttributeValue
> > (AbstractDirectMapping.java:642)
> > at
> >
> org.eclipse.persistence.mappings.foundation.AbstractDirectMapping.valueFromRow
> > (AbstractDirectMapping.java:1185)
> > at org.eclipse.persistence.mappings.DatabaseMapping.readFromRowIntoObject
> > (DatabaseMapping.java:1219)
> > ...
> > Thank you anyway.
> >
> > @Sherry: Adding that property did work, thank you!
> > I still don't think that this going into the right direction,
> Eclipselink-wise.
> > I left a comment at the bug you linked.
> >
> > Also,
> > http://docs.sun.com/app/docs/doc/820-7695/gbxjh?a=view
> > states:
> > "If you do not want to take advantage of Oracle-specific extensions from
> > EclipseLink or you cannot put JDBC driver JAR files in
> domain-dir/lib/ext, set
> > the eclipselink.target-database property to the value
> > org.eclipse.persistence.platform.database.OraclePlatform."
> >
> > Sounds like a disadvantage to me.
> >
> > Is this really the right way to do this or is this a classpath issue?
> > EclipseLink *should* see these classes, if they're in the classpath,
> shouldn't
> > it?
> >
> > Best regards,
> >
> > Matthias
> >
> > 2009/9/29 Sherry Shen <Sherry.Shen_at_sun.com>
> >
> > Hi Matthias,
> >
> > Does it work on v3 b64?
> >
> > I have seen similar problems for a while, e.g.
> > https://glassfish.dev.java.net/issues/show_bug.cgi?id=8696
> > The issue mentioned a workaround by specifying database platform
> > explicitly in persistence.xml, i.e.
> > <property name="eclipselink.target-database"
> >
> value="org.eclipse.persistence.platform.database.OraclePlatform"/>
> > Would you please give a try and let me know if it helps.
> > Thanks!
> >
> > Sherry
> >
> > matthias.fraass_at_tricoder.net wrote, On 9/29/2009 8:38 AM:
> >
> >
> > Hi everyone,
> >
> > (I think) after upgrading via Update-Tool to b65, my Entities
> stopped
> > working: Apparently there's a Problem with Oracle DB driver
> classes?
> > I've debugged a bit: the results are returned by the DB, but when
> > converting the data types, oracle.sql.TIMESTAMP cannot be found.
> > I setup GF in debugging mode and hooked on the
> ClassNotFoundException.
> > When it was caught, not even Class.forName
> > ("oracle.jdbc.driver.OracleDriver") was successful. But it *has*
> to be
> > loaded by JPA/EclipseLink - otherwise Eclipselink woudln't start
> to
> > parse the DB reply in
> >
> "org.eclipse.persistence.platform.database.oracle.Oracle9Platform.convertObject
> > (Oracle9Platform.java:280)", wouldn't it?
> > Is this a felix classloader problem?
> > Or did I miss some changes about lib/ext?
> >
> > I've deployed that successfully for weeks. It still works in my
> > parallel GF v2 setup.
> > The oracle classes are in glassfish\domains\domain1\lib\ext\
> > ojdbc14.jar.
> >
> > Here's the stacktrace:
> >
> > javax.ejb.EJBException
> > at com.sun.ejb.containers.BaseContainer.processSystemException
> > (BaseContainer.java:4943)
> > at com.sun.ejb.containers.BaseContainer.completeNewTx
> > (BaseContainer.java:4841)
> > at com.sun.ejb.containers.BaseContainer.postInvokeTx
> > (BaseContainer.java:4629)
> > at com.sun.ejb.containers.BaseContainer.postInvoke
> > (BaseContainer.java:1867)
> > at com.sun.ejb.containers.BaseContainer.postInvoke
> > (BaseContainer.java:1823)
> > at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke
> > (EJBObjectInvocationHandler.java:208)
> > at
> com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke
> > (EJBObjectInvocationHandlerDelegate.java:75)
> > at $Proxy182.findItemoptioneffortById(Unknown Source)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at sun.reflect.NativeMethodAccessorImpl.invoke
> > (NativeMethodAccessorImpl.java:39)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke
> > (DelegatingMethodAccessorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke
> > (ReflectiveTie.java:156)
> > at
> >
> com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant
> > (CorbaServerRequestDispatcherImpl.java:682)
> > at
> >
> com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch
> > (CorbaServerRequestDispatcherImpl.java:216)
> > at
> >
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest
> > (CorbaMessageMediatorImpl.java:1831)
> > at
> >
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest
> > (CorbaMessageMediatorImpl.java:1685)
> > at
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput
> > (CorbaMessageMediatorImpl.java:1068)
> > at
> >
> com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback
> > (RequestMessage_1_2.java:221)
> > at
> >
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest
> > (CorbaMessageMediatorImpl.java:787)
> > at
> com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch
> > (CorbaMessageMediatorImpl.java:551)
> > at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork
> > (CorbaMessageMediatorImpl.java:2548)
> > at
> >
> com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork
> > (ThreadPoolImpl.java:492)
> > at
> >
> com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run
> > (ThreadPoolImpl.java:527)
> > Caused by: java.lang.NoClassDefFoundError: oracle/sql/TIMESTAMP
> > at
> >
> org.eclipse.persistence.internal.platform.database.oracle.TIMESTAMPTypes.
> > <clinit>(TIMESTAMPTypes.java:22)
> > at
> >
> org.eclipse.persistence.platform.database.oracle.Oracle9Platform.convertObject
> > (Oracle9Platform.java:280)
> > at
> >
> org.eclipse.persistence.mappings.foundation.AbstractDirectMapping.getAttributeValue
> > (AbstractDirectMapping.java:642)
> > at
> >
> org.eclipse.persistence.mappings.foundation.AbstractDirectMapping.valueFromRow
> > (AbstractDirectMapping.java:1185)
> > at
> >
> org.eclipse.persistence.mappings.DatabaseMapping.readFromRowIntoObject
> > (DatabaseMapping.java:1219)
> > at
> >
> org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoObject
> > (ObjectBuilder.java:329)
> > at
> >
> org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject
> > (ObjectBuilder.java:658)
> > at
> >
> org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally
> > (ObjectBuilder.java:580)
> > at
> >
> org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork
> > (ObjectBuilder.java:549)
> > at
> >
> org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject
> > (ObjectBuilder.java:489)
> > at
> >
> org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject
> > (ObjectBuilder.java:441)
> > at
> org.eclipse.persistence.queries.ObjectLevelReadQuery.buildObject
> > (ObjectLevelReadQuery.java:635)
> > at
> >
> org.eclipse.persistence.queries.ObjectLevelReadQuery.conformIndividualResult
> > (ObjectLevelReadQuery.java:799)
> > at org.eclipse.persistence.queries.ReadObjectQuery.conformResult
> > (ReadObjectQuery.java:346)
> > at
> >
> org.eclipse.persistence.queries.ReadObjectQuery.registerResultInUnitOfWork
> > (ReadObjectQuery.java:720)
> > at
> >
> org.eclipse.persistence.queries.ReadObjectQuery.executeObjectLevelReadQuery
> > (ReadObjectQuery.java:438)
> > at
> >
> org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery
> > (ObjectLevelReadQuery.java:997)
> > at org.eclipse.persistence.queries.DatabaseQuery.execute
> > (DatabaseQuery.java:670)
> > at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute
> > (ObjectLevelReadQuery.java:958)
> > at org.eclipse.persistence.queries.ReadObjectQuery.execute
> > (ReadObjectQuery.java:399)
> > at
> >
> org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork
> > (ObjectLevelReadQuery.java:1021)
> > at
> >
> org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery
> > (UnitOfWorkImpl.java:2864)
> > at
> >
> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery
> > (AbstractSession.java:1208)
> > at
> >
> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery
> > (AbstractSession.java:1190)
> > at
> >
> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery
> > (AbstractSession.java:1150)
> > at
> org.eclipse.persistence.internal.jpa.EntityManagerImpl.executeQuery
> > (EntityManagerImpl.java:646)
> > at
> org.eclipse.persistence.internal.jpa.EntityManagerImpl.findInternal
> > (EntityManagerImpl.java:590)
> > at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find
> > (EntityManagerImpl.java:494)
> > at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find
> > (EntityManagerImpl.java:373)
> > at
> com.sun.enterprise.container.common.impl.EntityManagerWrapper.find
> > (EntityManagerWrapper.java:311)
> > at
> de.osp.test.jpa.SomeBean.findItemoptioneffortById(SomeBean.java:42)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at sun.reflect.NativeMethodAccessorImpl.invoke
> > (NativeMethodAccessorImpl.java:39)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke
> > (DelegatingMethodAccessorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> org.glassfish.ejb.security.application.EJBSecurityManager.runMethod
> > (EJBSecurityManager.java:1038)
> > at
> org.glassfish.ejb.security.application.EJBSecurityManager.invoke
> > (EJBSecurityManager.java:1110)
> > at com.sun.ejb.containers.BaseContainer.invokeBeanMethod
> > (BaseContainer.java:5116)
> > at
> com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:610)
> > at
> com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext
> > (InterceptorManager.java:775)
> > at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:562)
> > at
> com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround
> > (SystemInterceptorProxy.java:157)
> > at
> >
> com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke
> > (SystemInterceptorProxy.java:139)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at sun.reflect.NativeMethodAccessorImpl.invoke
> > (NativeMethodAccessorImpl.java:39)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke
> > (DelegatingMethodAccessorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> >
> com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept
> > (InterceptorManager.java:836)
> > at
> com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext
> > (InterceptorManager.java:775)
> > at
> com.sun.ejb.containers.interceptors.InterceptorManager.intercept
> > (InterceptorManager.java:349)
> > at com.sun.ejb.containers.BaseContainer.__intercept
> > (BaseContainer.java:5088)
> > at com.sun.ejb.containers.BaseContainer.intercept
> > (BaseContainer.java:5076)
> > at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke
> > (EJBObjectInvocationHandler.java:201)
> > ... 18 more
> > Caused by: java.lang.ClassNotFoundException: oracle.sql.TIMESTAMP
> > at
> >
> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation
> > (ModuleImpl.java:726)
> > at
> org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:60)
> > at
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass
> > (ModuleImpl.java:1631)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
> > ... 71 more
> >
> > Any suggestions?
> >
> > -Matthias
> >
> >
> >
> > ---------------------------------------------------------------------
> To
> > unsubscribe, e-mail: quality-unsubscribe_at_glassfish.dev.java.net For
> > additional commands, e-mail: quality-help_at_glassfish.dev.java.net
> >
> >
>
> --
> King Arthur: [after Arthur's cut off both of the Black Knight's arms] Look,
> you
> stupid Bastard. You've got no arms left.
> Black Knight: Yes I have.
> King Arthur: *Look*!
> Black Knight: It's just a flesh wound.
> [Monty Python and the Holy Grail]
>
> Skype: wvreeven
> Facebook: wvreeven
> Twitter: wvreeven
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: quality-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: quality-help_at_glassfish.dev.java.net
>
>