tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Gavlin <rgav...@yahoo.com>
Subject Re: Help...NPE at o.a.t.sdo.impl.ClassImpl.getProperty(ClassImpl.java:192) w/multiple threads
Date Thu, 31 Aug 2006 17:14:28 GMT
Hi Frank, 
 
I applied your patch and it had no affect. 
 
However, I did discover some interesting info during troubleshooting. The machine we are using
to load test is a Wintel dual-core PC running WinXP. This machine gets the NPE with or without
your patch. 
 
Just for kicks, I tried running the test on a single-processor Wintel PC running Win2K. This
machine DOES NOT get the NPE with or without your patch. 
 
We are using Sun JDK 1.4.2_11 in both environments. Any suggestions where to go from here?

 
- Ron 

----- Original Message ----
From: Ron Gavlin <rgavlin@yahoo.com>
To: tuscany-user@ws.apache.org
Sent: Thursday, August 31, 2006 10:56:28 AM
Subject: Re: Help...NPE at o.a.t.sdo.impl.ClassImpl.getProperty(ClassImpl.java:192) w/multiple
threads


Frank,

I'll try your suggestion and get back to you. FYI, I opened JIRA TUSCANY-682 to track the
problem. Thanks for the quick reply.

- Ron

----- Original Message ----
From: Frank Budinsky <frankb@ca.ibm.com>
To: tuscany-user@ws.apache.org
Sent: Thursday, August 31, 2006 10:47:14 AM
Subject: Re: Help...NPE at o.a.t.sdo.impl.ClassImpl.getProperty(ClassImpl.java:192) w/multiple
threads


Hi Ron,

Multiple threads eh .... The only way I can see this happing is when 
propertyNameToProperyMap is set back to null in getProperty(String). Could 
you try changing a couple of ClassImpl methods to the following and see if 
it fixes the problem?

  private void initAliasNames(boolean force) {
    if (propertyNameToPropertyMap == null || force)
    {
      Map result = new HashMap();
      for (Iterator i = getProperties().iterator(); i.hasNext(); )
      {
        Property property = (Property)i.next();
        result.put(property.getName(), property);

        List aliasNames = property.getAliasNames();
        for (int count = aliasNames.size(); count > 0; )
        {
          result.put(aliasNames.get(--count), property);
        }
      }
      propertyNameToPropertyMap = result;
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated NOT
   */
  public Property getProperty(String propertyName)
  {
    initAliasNames(false);
    Property property = 
(Property)propertyNameToPropertyMap.get(propertyName);
    if (property == null && !isOpen()) {
      //propertyNameToPropertyMap = null;
      initAliasNames(true);
      property = (Property)propertyNameToPropertyMap.get(propertyName);
    }
    return property;
  }

Thanks,
Frank.

Ron Gavlin <rgavlin@yahoo.com> wrote on 08/31/2006 10:08:04 AM:

> Hi,
> 
> I receive the following NPE when using Tuscany SDO in a multi-
> threaded environment. Here is the stack trace:
> 
> java.lang.NullPointerException
> at org.apache.tuscany.sdo.impl.ClassImpl.getProperty(ClassImpl.java:192)
> at org.apache.tuscany.sdo.util.DataObjectUtil.
> getProperty(DataObjectUtil.java:2342)
> at org.apache.tuscany.sdo.util.DataObjectUtil.
> getProperty(DataObjectUtil.java:1284)
> at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.
> setFeatureName(DataObjectUtil.java:2032)
> at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.
> process(DataObjectUtil.java:2139)
> at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.
> init(DataObjectUtil.java:1918)
> at org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.
> create(DataObjectUtil.java:1838)
> at 
org.apache.tuscany.sdo.util.DataObjectUtil.get(DataObjectUtil.java:739)
> at 
org.apache.tuscany.sdo.util.DataObjectUtil.get(DataObjectUtil.java:213)
> ...
> 
> I suspect the NPE is due to synchronization problems with the 
> ClassImpl.propertyNameToPropertyMap. This problem occurs during load
> testing of our application. Thanks in advance for your assistance. 
> This is a show-stopper for us.
> 
> - Ron
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Mime
View raw message