users@glassfish.java.net

Problems with JGeometryConverter

From: <glassfish_at_javadesktop.org>
Date: Thu, 25 Feb 2010 04:09:03 PST

Hi all,

I'm working with JPA and an Oracle DB Spatial. No problems in gathering information from DB when dealing with all fields except SDO_GEOMETRY type. For this type I'm using a StructConverter:

@StructConverter(name = "JGeometry", converter = "org.eclipse.persistence.platform.database.oracle.converters.JGeometryConverter")

which is supposed to convert native type SDO_GEOMETRY into JGeometry. I got it worked with EclipseLink in Eclipse 3.5 (directly connecting with Oracle DB by ojdbc driver). But when I tried to deploy it in Glassfish v3, I got this exception:

[#|2010-02-25T12:21:00.177+0100|WARNING|glassfishv3.0|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=29;_ThreadName=Thread-1;|A system exception occurred during an invocation on EJB CellAreaManagerBean method public java.util.List com.italtel.caloader.CellAreaManagerBean.queryCellAreaFindAll()
javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean: java.lang.NoClassDefFoundError: [b]Could not initialize class org.eclipse.persistence.platform.database.oracle.converters.JGeometryConverter[/b]
        at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:4929)
        at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4761)
        at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1955)
        at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1906)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:198)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
        at $Proxy160.queryCellAreaFindAll(Unknown Source)
        at com.italtel.caloader.CellAreaLoaderBean.processNetworkData(CellAreaLoaderBean.java:99)
        at com.italtel.caloader.CellAreaLoaderBean.checkForUpdates(CellAreaLoaderBean.java:70)
        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:1052)
        at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)
        at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5243)
        at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
        at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:157)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundTimeout(SystemInterceptorProxy.java:144)
        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:858)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
        at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
        at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5215)
        at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5203)
        at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:3916)
        at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1667)
        at com.sun.ejb.containers.EJBTimerService.access$100(EJBTimerService.java:98)
        at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:2485)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)

It seems like the container is not able to find sdoapi.jar, that contains JGeometry class. I tried to put the jar almost everywhere inside the glassfish folders, but nothing changed. I guess it's somthing concerning with the classloader that works for the JPA Provider. Somehow it tries to loads class JGeometry before sdoapi has been loaded.

Any suggestion would be greatly appreciated.
[Message sent by forum member 'sgronky' (sgronky_at_gmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=388641