users@glassfish.java.net

NullPointerException in appendFromClauseForInformixOuterJoin(SQLSelectState

From: <glassfish_at_javadesktop.org>
Date: Sat, 01 Sep 2007 03:52:21 PDT

My Database is Informix 10.
I have mapped this class hierarchy:

.......
@Entity
@Table(name = "dbware")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="warartrid", discriminatorType=DiscriminatorType.INTEGER)
public class Dbware implements Serializable {
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "dbwarerid", nullable = false)
    private Integer dbwarerid;
.......
.......
@Entity
@Table(name = "mongrf")
@DiscriminatorValue(value="1")
@PrimaryKeyJoinColumn(name="dbwarerid")
public class Mongrf extends Dbware implements Serializable {
    @Column(name = "dbwarerid", nullable = false)
    private Integer dbwarerid;
.......


Reading the child entity Mongrf with "select o from Mongrf o" works fine.


Reading the parent entity Dbware with "select o from Dbware o"
results in a NullPointerException (stack trace below).

Is this a bug ?
Is there a chance to work-around it?
Informix 10 btw can handle ANSI joins and I assume it does not
need this special from clause handling.

Thanks for your ideas!
Bernd



START of public java.util.Collection ejb.ProductServiceBean.getDbwareAll(int,int)
getClassAll(class product.Dbware ,0 ,2147483647)
client acquired
TX binding to tx mgr, status=STATUS_ACTIVE
Execute query ReportQuery(product.Dbware)
java.lang.NullPointerException
        at oracle.toplink.essentials.internal.expressions.SQLSelectStatement.appendFromClauseForInformixOuterJoin(SQLSelectStatement.java:193)
        at oracle.toplink.essentials.internal.expressions.SQLSelectStatement.appendFromClauseToWriter(SQLSelectStatement.java:502)
        at oracle.toplink.essentials.internal.expressions.SQLSelectStatement.printSQL(SQLSelectStatement.java:1366)
        at oracle.toplink.essentials.internal.expressions.SQLSelectStatement.buildCall(SQLSelectStatement.java:735)
        at oracle.toplink.essentials.descriptors.ClassDescriptor.buildCallFromStatement(ClassDescriptor.java:563)
        at oracle.toplink.essentials.internal.queryframework.StatementQueryMechanism.setCallFromStatement(StatementQueryMechanism.java:408)
        at oracle.toplink.essentials.internal.queryframework.ExpressionQueryMechanism.prepareReportQuerySelectAllRows(ExpressionQueryMechanism.java:1480)
        at oracle.toplink.essentials.queryframework.ReportQuery.prepareSelectAllRows(ReportQuery.java:1069)
        at oracle.toplink.essentials.queryframework.ReadAllQuery.prepare(ReadAllQuery.java:434)
        at oracle.toplink.essentials.queryframework.ReportQuery.prepare(ReportQuery.java:932)
        at oracle.toplink.essentials.queryframework.DatabaseQuery.checkPrepare(DatabaseQuery.java:406)
        at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.checkPrepare(ObjectLevelReadQuery.java:484)
        at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:606)
        at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:692)
        at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:746)
        at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2233)
        at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:952)
        at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:924)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:367)
        at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:478)
        at ejb.AbstractGenericPersistenceMethods.getClassAll(AbstractGenericPersistenceMethods.java:71)
        at ejb.ProductServiceBean.getDbwareAll(ProductServiceBean.java:50)
        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.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
        at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
        at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4005)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:483)
        at com.sun.ejb.Invocation.proceed(Invocation.java:498)
        at ejb.AbstractGenericPersistenceMethods.myInterceptor(AbstractGenericPersistenceMethods.java:173)
        at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.ejb.containers.interceptors.BeanAroundInvokeInterceptor.intercept(InterceptorManager.java:620)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:483)
        at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:205)
        at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3978)
        at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:203)
        at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:117)
        at $Proxy50.getDbwareAll(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:154)
        at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:687)
        at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:227)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
        at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
        at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
END of public java.util.Collection<product.Dbware> ejb.ProductServiceBean.getDbwareAll(int,int) [0 msec]
[Message sent by forum member 'bernd_zedv' (bernd_zedv)]

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