-
1. Re: problem with setEntityContext in BMP EJB
rcotton Feb 2, 2003 8:51 AM (in response to javajohnson)I also have a null EntityContext but the bean is Container managed and is called from a session bean.
My enviroment is: W2K, JBoss-3.0.4_Tomcat-4.1.12, XDoclet 1.2, Ant 1.5.
I am getting WARNings in out.txt re jars ignored because they could not be opened, and improper ebj naming.
I would appreciate any clues or direction offered!
Thanks,
Rick -
2. Re: problem with setEntityContext in BMP EJB
jwin1 Feb 4, 2003 8:49 AM (in response to javajohnson)Similar problems here.
I think something is very wrong about JBoss's current state-of-affairs with BMP-EJB's (JBoss 3.0.4)
The exact same BMP-EJB's (with the exact same DD's) worked as expected with J2EE SDK 1.3.1 and 14. beta !
Would someone of the JBoss-Team please clarify this very important issue....?
Regards,
Joerg -
3. Re: problem with setEntityContext in BMP EJB
adrian.brock Feb 4, 2003 2:51 PM (in response to javajohnson)Can you post the stack trace or a simple example.
I don't see how you can get null for setEntityContext?
Regards,
Adrian -
4. Re: problem with setEntityContext in BMP EJB
rcotton Feb 5, 2003 7:43 PM (in response to javajohnson)Thanks for your interest...
Hope this helps...
2nd attempt to reply...
/**
* Store the data within the provided data object into this bean.
*
* @param pPooler The Value Object containing the Pooler values
*
* @ejb:interface-method view-type="both"
**/
public void setValueObject( PoolerData pPooler )
throws
InvalidValueException
{
System.out.println("set valObj 1");
// Check for Data Integrity in the Value Object
if( pPooler == null ) {
throw new InvalidValueException( "object.undefined", "Pooler" );
}
System.out.println("set valObj 2");
if( pPooler.getId() <= 0 ) {
throw new InvalidValueException( "pId.invalid", new String[] { "Pooler", "pId" } );
}
System.out.println("set valObj 3 " + mContext);
// Check if the Pooler is not already saved
try {
LocalPoolerHome lHome = (LocalPoolerHome) mContext.getEJBLocalHome();
System.out.println("set valObj 4");
LocalPooler lEntity = lHome.findAnotherByName( pPooler.getId(), pPooler.getFirstName(), pPooler.getAccountName() );
17:52:56,942 INFO [STDOUT] set valObj 3 null
17:52:56,942 ERROR [LogInterceptor] TransactionRolledbackLocalException, causedBy:
java.lang.NullPointerException
at peopool.entity.PoolerBean.setValueObject(PoolerBean.java:296)
at peopool.entity.PoolerBean.ejbCreate(PoolerBean.java:769)
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:324)
at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:221)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270)
at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:580)
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:324)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1119)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:206)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:90)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230)
at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
at $Proxy26.create(Unknown Source)
at peopool.session.PeopoolSessionBean.getPoolers(PeopoolSessionBean.java:132)
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:324)
at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:817)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:268)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:380)
at org.jboss.ejb.Container.invoke(Container.java:712)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
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:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:536) -
5. Re: problem with setEntityContext in BMP EJB
rcotton Feb 5, 2003 7:46 PM (in response to javajohnson)3rd attempt at replying - trying this simple text as a test
-
6. Re: problem with setEntityContext in BMP EJB
rcotton Feb 5, 2003 7:53 PM (in response to javajohnson)4th attempt to reply to warjort...
hope this helps...
/**
* Store the data within the provided data object into this bean.
*
* @param pPooler The Value Object containing the Pooler values
*
* @ejb:interface-method view-type="both"
**/
public void setValueObject( PoolerData pPooler )
throws
InvalidValueException
{
System.out.println("set valObj 1");
// Check for Data Integrity in the Value Object
if( pPooler == null ) {
throw new InvalidValueException( "object.undefined", "Pooler" );
}
System.out.println("set valObj 2");
if( pPooler.getId() <= 0 ) {
throw new InvalidValueException( "pId.invalid", new String[] { "Pooler", "pId" } );
}
System.out.println("set valObj 3 " + mContext);
// Check if the Pooler is not already saved
try {
LocalPoolerHome lHome = (LocalPoolerHome) mContext.getEJBLocalHome();
System.out.println("set valObj 4");
LocalPooler lEntity = lHome.findAnotherByName( pPooler.getId(), pPooler.getFirstName(), pPooler.getAccountName() );
17:52:56,942 INFO [STDOUT] set valObj 3 null
17:52:56,942 ERROR [LogInterceptor] TransactionRolledbackLocalException, causedBy:
java.lang.NullPointerException
at peopool.entity.PoolerBean.setValueObject(PoolerBean.java:296)
at peopool.entity.PoolerBean.ejbCreate(PoolerBean.java:769)
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:324)
at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:221)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270)
at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:580)
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:324)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1119)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:206)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:90)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230)
at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
at $Proxy26.create(Unknown Source)
at peopool.session.PeopoolSessionBean.getPoolers(PeopoolSessionBean.java:132)
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:324)
at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:817)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:268)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:380)
at org.jboss.ejb.Container.invoke(Container.java:712)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
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:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:536) -
7. Re: problem with setEntityContext in BMP EJB
adrian.brock Feb 7, 2003 10:43 AM (in response to javajohnson)Hi,
I meant can you post the stacktrace when
setEntityContext is invoked with null
public void setEntityContext(EntityContext ctx)
{
if (ctx == null)
throw new NullPointerException("null context");
this.ctx = ctx;
}
Regards,
Adrian -
8. Re: problem with setEntityContext in BMP EJB
rcotton Feb 7, 2003 5:33 PM (in response to javajohnson)Adrian,
Thank-you very much!
Your instructions pointed out that I had somehow managed to rename my "setEntityContext" method to "setContext". Once renamed correctly it worked fine.
Thanks again,
Rick