Bugs item #901165, was opened at 2004-02-20 17:45
Message generated for change (Comment added) made by loubyansky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=901165&group_id=22866

Category: JBossCMP
Group: CVS HEAD
Status: Open
Resolution: Accepted
Priority: 5
Submitted By: Andrew Thorn (sigbur)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: CMR Setter throws IllegalStateException

Initial Comment:
I have been getting this quite a lot lately, with JBoss
3.2.4RC1 from CVS (about a month old). The exception is
thrown from the following code:

    public void linkExpressionProbesAndAnnotations()
throws AnalysisException {
        try {
            // Load all of the ExpressionProbe records
and process them so that their one-to-one
            // relations with the
ExpressionProbeAnnotation database are correct.
            // This could take a long time, and with
CMP, also a lot of memory, unfortunately.
            Collection probes =
ExpressionProbeUtil.getLocalHome().findAll();
            for (Iterator i = probes.iterator();
i.hasNext();) {
                ExpressionProbeLocal probe =
(ExpressionProbeLocal)i.next();
                String probeName = probe.getName();
                String chipName =
probe.getChipType().getName();
                Collection annotations =
ExpressionProbeAnnotationUtil.getLocalHome().findByProbeNameAndChipName(probeName,
chipName);
                if (!annotations.isEmpty() &&
annotations.size() > 0) {
                   
probe.setAnnotation((ExpressionProbeAnnotationLocal)annotations.iterator().next());
                } else {
                        log.warn("Empty Annotations!
"+annotations.size());
                }
                probe = null;
                annotations.clear();
            }
        } catch(Exception e) {
            e.printStackTrace();
            throw new AnalysisException("Unable to link
expression annotations.", e);
        }
    }

The line that it is thrown from is the line which
begins 'probe.setAnnotation'. Since there is no
EJBCreate actually ocurring (unless it's somewhere in
the container) -- all I'm doing is finding objects
using a finder -- I think this is a bug in the container.

Thanks.

-S


10:25:50,446 ERROR [LogInterceptor]
TransactionRolledbackLocalException in metho
d: public abstract void
ca.scgp.stembase.ejb.ExpressionProbeLocal.setAnnotation(
ca.scgp.stembase.ejb.ExpressionProbeAnnotationLocal),
causedBy:
java.lang.IllegalStateException: A CMR field cannot be
set in ejbCreate; this sh
ould be done in the ejbPostCreate method instead [EJB
2.0 Spec. 10.5.2].
        at
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setValue(JDB
CCMRFieldBridge.java:604)
        at
org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke
(EntityBridgeInvocationHandler.java:121)
        at
org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
        at
ca.scgp.stembase.ejb.ExpressionProbeCMP$Proxy.setAnnotation(<generate
d>)
        at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityConta
iner.java:1096)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRel
ationInterceptor.java:72)
        at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntityS
ynchronizationInterceptor.java:282)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
ke(CachedConnectionInterceptor.java:185)
        at
org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentr
anceInterceptor.java:114)
        at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstance
Interceptor.java:175)
        at
org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockIntercep
tor.java:89)
        at
org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreation
Interceptor.java:54)
        at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:84)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:305)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
47)
        at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:118)
        at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
        at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
ryFinderInterceptor.java:122)
        at
org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:489
)
        at
org.jboss.ejb.Container.invoke(Container.java:700)
        at
org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalPro
xyFactory.java:375)
        at
org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)

----------------------------------------------------------------------

>Comment By: Alexey Loubyansky (loubyansky)
Date: 2004-02-21 06:14

Message:
Logged In: YES 
user_id=543482

In JDBCStoreManager, does the following method look like this?
   public void activateEntity(EntityEnterpriseContext ctx)
   {
      activateEntityCommand.execute(ctx);

      // looad at the cache for preloaded data
      boolean loaded = readAheadCache.load(ctx);

      // if there was some preloaded (in this current tx)
data, we can set valid to true
      // and avoid executing load command when the instance
is accessed.
      if(loaded)
      {
         ctx.setValid(true);
         entityBridge.setCreated(ctx);
      }
   }

Please, try it with fresh 3.2.4 copy from CVS. Thanks.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=901165&group_id=22866


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to