You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Luciano Resende <lu...@gmail.com> on 2008/08/11 22:53:27 UTC

Copying SDO objects that have ChangeSummary in SDO Databinding, was Re: das npe in PassByValueInterceptor

For the issue where you were having issues with the DataGraph, my
understanding is that this is happening because the Databinding
framework copy the DataObject using SDO CopyHelper, that is not
properly handling the copy, and this is probably related to the
following code snipet :

 protected void copyAttribute(EAttribute eAttribute, EObject eObject,
EObject copyEObject) {
            if(("ChangeSummaryType".equals(eAttribute.getEType().getName())
&& "commonj.sdo".equals(eAttribute.getEType().getEPackage().getNsURI())))
{
                throw new UnsupportedOperationException("This will be
implemented when change summary serialization/deserialization is in
place");
            } else {
                super.copyAttribute(eAttribute, eObject, copyEObject);
            }
        }

I think there are two options here :

   - Have a way to avoid to copy in the databinding
   - Fix the code in the SDO side

Does people have other suggestions ?


On Mon, Aug 11, 2008 at 9:52 AM, Abraham Washington
<ab...@yahoo.com> wrote:
> i created a new schema and ran the organization.sql.  still running into the
> same problems.  here's my schema def:
>
>
>
> $ sqlplus orgservice@xe
>
> SQL*Plus: Release 11.1.0.6.0 - Production on Mon Aug 11 10:34:49 2008
>
> Copyright (c) 1982, 2007, Oracle.  All rights reserved.
>
> Enter password:
>
> Connected to:
> Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
>
> SQL> describe account;
>  Name                                      Null?    Type
>  ----------------------------------------- --------
> ----------------------------
>  ACCOUNT_ID                                NOT NULL NUMBER(12)
>  ACCOUNTTYPE_CD                                     VARCHAR2(30)
>  ACCOUNT_NAME                                       VARCHAR2(30)
>  WEB_SITE_ADDRESS                                   VARCHAR2(30)
>  STREET_ADDRESS_1                                   VARCHAR2(30)
>  STREET_ADDRESS_2                                   VARCHAR2(30)
>  STREET_ADDRESS_3                                   VARCHAR2(30)
>  CITY                                               VARCHAR2(10)
>  STATE_CD                                           VARCHAR2(2)
>  POSTAL_CD                                          VARCHAR2(5)
>  COUNTRY_CD                                         VARCHAR2(3)
>  PHONE_NUMBER                                       VARCHAR2(15)
>  FAX_NUMBER                                         VARCHAR2(15)
>  NOTE                                               VARCHAR2(50)
>
>
>
> SQL> describe organizationtypelist;
>  Name                                      Null?    Type
>  ----------------------------------------- --------
> ----------------------------
>  ORGANIZATIONTYPEID                        NOT NULL NUMBER(12)
>  CODE                                               VARCHAR2(10)
>  DISPLAYVALUE                                       VARCHAR2(30)
>  DESCRIPTION                                        VARCHAR2(30)
>  ISEDITABLE                                         NUMBER(38)
>
> SQL>
>
>
>
>
>
> attached is the organization.sql (with a few small changes for oracle).
>
>
>
> thx abe
>
> ----- Original Message ----
> From: Luciano Resende <lu...@gmail.com>
> To: user@tuscany.apache.org
> Sent: Monday, August 11, 2008 9:53:25 AM
> Subject: Re: das npe in PassByValueInterceptor
>
> Please take a look at organization.sql and let me know if the database
> structure is different from what you have.
>
> https://svn.apache.org/repos/asf/tuscany/sandbox/lresende/sca/samples/organization-das/organization.sql
>
> On Mon, Aug 11, 2008 at 8:48 AM, Abraham Washington
> <ab...@yahoo.com> wrote:
>> hi Luciano,  i ran the test case and had a couple problems.  when running
>> with the code that's in svn, I get this error:
>>
>>
>>
>> java.lang.ClassCastException: The value of type 'class
>> java.math.BigDecimal'
>> must be of type 'class java.lang.Integer'
>>  at
>>
>> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleDataUnsettableStatic.validate(EStructuralFeatureImpl.java:2195)
>>  at
>>
>> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleDataUnsettable.dynamicSet(EStructuralFeatureImpl.java:2116)
>>  at
>>
>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicSet(BasicEObjectImpl.java:709)
>>  at
>>
>> org.apache.tuscany.sdo.impl.DynamicDataObjectImpl.eDynamicSet(DynamicDataObjectImpl.java:160)
>>  at
>> org.apache.tuscany.sdo.impl.DataObjectImpl.eSet(DataObjectImpl.java:1459)
>>  at
>>
>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:654)
>>  at
>> org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java:142)
>>  at
>>
>> org.apache.tuscany.das.rdb.graphbuilder.impl.DataObjectMaker.createAndAddDataObject(DataObjectMaker.java:90)
>>  at
>>
>> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.addRowToGraph(ResultSetProcessor.java:127)
>>  at
>>
>> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResultSet(ResultSetProcessor.java:91)
>>  at
>>
>> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResults(ResultSetProcessor.java:77)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ReadCommandImpl.buildGraph(ReadCommandImpl.java:309)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ReadCommandImpl.executeQuery(ReadCommandImpl.java:277)
>>  at
>>
>> organization.OrganizationTestCase.testRetrieveOrganizationDAS(OrganizationTestCase.java:61)
>>
>>  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:585)
>>  at
>>
>> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
>>  at
>>
>> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
>>  at
>>
>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>  at
>>
>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
>>  at
>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
>>  at
>>
>> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:75)
>>  at
>>
>> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:36)
>>  at
>>
>> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
>>  at
>>
>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>  at
>> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
>>  at
>>
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>>
>>
>>
>> OrganizationTestcase.java:61 is
>>
>> root = read.executeQuery();
>>
>>
>>
>> So, in the organizationConfiguration.xml, I changed the type of the
>> ResultDescriptor from commonj.sdo.Integer to commonj.sdo.Decimal (line
>> 46).
>> that seems to have worked when running the query (executeQuery), but when
>> performing the update (line 74:  das.applyChanges(root)) the following
>> error
>> is thrown:
>>
>>
>>
>> java.lang.RuntimeException: Not a valid SDO Type
>> org.apache.tuscany.sdo.impl.DataTypeImpl@9d686c1 (name: Decimal)
>> (instanceClassName: java.math.BigDecimal) (serializable: true)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.SDODataTypeHelper.columnTypeForSDOType(SDODataTypeHelper.java:105)
>>  at
>>
>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.fillExtendedParameter(UpdateGenerator.java:211)
>>  at
>>
>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.createParameter(UpdateGenerator.java:226)
>>  at
>>
>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.getUpdateCommand(UpdateGenerator.java:104)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ChangeFactory.getUpdateCommand(ChangeFactory.java:154)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ChangeFactory.createUpdateOperation(ChangeFactory.java:69)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.createChange(ChangeSummarizer.java:115)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.loadChanges(ChangeSummarizer.java:80)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(ApplyChangesCommandImpl.java:64)
>>
>>  at org.apache.tuscany.das.rdb.impl.DASImpl.applyChanges(DASImpl.java:310)
>>  at
>>
>> organization.OrganizationTestCase.testRetrieveOrganizationDAS(OrganizationTestCase.java:74)
>>  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:585)
>>  at
>>
>> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
>>  at
>>
>> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
>>  at
>>
>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>  at
>>
>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
>>  at
>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
>>  at
>>
>> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:75)
>>  at
>>
>> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:36)
>>  at
>>
>> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
>>  at
>>
>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>  at
>> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
>>  at
>>
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>>
>>
>>
>>
>>
>> The second test case throws the following error (the ACCOUNT_ID is type
>> commonj.sdo.Decimal):
>>
>>
>>
>> java.lang.reflect.UndeclaredThrowableException
>>  at $Proxy5.findOrganizationBugOne(Unknown Source)
>>  at
>>
>> organization.OrganizationTestCase.testRetrieveOrganizationSCA(OrganizationTestCase.java:105)
>>
>>  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:585)
>>  at
>>
>> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
>>  at
>>
>> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
>>  at
>>
>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>  at
>>
>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
>>  at
>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
>>  at
>>
>> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:75)
>>  at
>>
>> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:36)
>>  at
>>
>> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
>>  at
>>
>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>  at
>> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
>>  at
>>
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>  at
>>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>> Caused by: java.lang.reflect.InvocationTargetException
>>  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:585)
>>  at
>>
>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.doInvoke(SpringInvoker.java:100)
>>  at
>>
>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.invoke(SpringInvoker.java:116)
>>  at
>>
>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
>>  at
>>
>> org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
>>  at
>>
>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
>>  at
>>
>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
>>  at
>>
>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
>>  ... 22 more
>> Caused by: java.lang.RuntimeException: Not a valid SDO Type
>> org.apache.tuscany.sdo.impl.DataTypeImpl@3aca5e2 (name: Decimal)
>> (instanceClassName: java.math.BigDecimal) (serializable: true)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.SDODataTypeHelper.columnTypeForSDOType(SDODataTypeHelper.java:105)
>>  at
>>
>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.fillExtendedParameter(UpdateGenerator.java:211)
>>  at
>>
>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.createParameter(UpdateGenerator.java:226)
>>  at
>>
>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.getUpdateCommand(UpdateGenerator.java:104)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ChangeFactory.getUpdateCommand(ChangeFactory.java:154)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ChangeFactory.createUpdateOperation(ChangeFactory.java:69)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.createChange(ChangeSummarizer.java:115)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.loadChanges(ChangeSummarizer.java:80)
>>  at
>>
>> org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(ApplyChangesCommandImpl.java:64)
>>  at org.apache.tuscany.das.rdb.impl.DASImpl.applyChanges(DASImpl.java:310)
>>  at
>>
>> organization.das.OrganizationDataServiceImpl.findOrganizationBugOne(OrganizationDataServiceImpl.java:72)
>>  at
>>
>> organization.services.OrganizationServiceImpl.findOrganizationBugOne(OrganizationServiceImpl.java:47)
>>  ... 33 more
>>
>>
>>
>>
>>
>> let me know if you need more info..abe
>>
>> ----- Original Message ----
>> From: Luciano Resende <lu...@gmail.com>
>> To: user@tuscany.apache.org
>> Sent: Saturday, August 9, 2008 5:14:30 PM
>> Subject: Re: das npe in PassByValueInterceptor
>>
>> Hi Abraham
>>
>>  From your initial post, looks like you are having two problems :
>>
>>      - Using DAS, a call to applyChanges succedds, but the account
>> row does not get updated.
>>      - When you use SCA to create a DAS component, you are having a
>> PassByValueInterceptor exception
>>
>>  I have committed a organization-das sample, all based on the
>> application you provided under TUSCANY-2525, under svn revision
>> 684376.
>>
>>  Note that I'm building the sample im multiple steps, isolating the
>> areas involved in each issue. Also, note that I'm using derby, but
>> changing back to Oracle should be easy, just change the
>> ConnectionHelper to create the proper Oracle connection.
>>
>>  Right now, I have the DAS piece working ok, and it would be good if
>> you could verify this in your Oracle environment by running the
>> OrganizationTestCase. While I wait for your feedback, I'm going to
>> move to incorporate the SCA into the sample.
>>
>> Thanks
>>
>>
>> On Mon, Aug 4, 2008 at 12:51 PM, Abraham Washington
>> <ab...@yahoo.com> wrote:
>>> thanks all for the help.  created issue tuscany-2525
>>>
>>> ----- Original Message ----
>>> From: Luciano Resende <lu...@gmail.com>
>>> To: user@tuscany.apache.org
>>> Sent: Sunday, August 3, 2008 11:09:49 PM
>>> Subject: Re: das npe in PassByValueInterceptor
>>>
>>> On Tue, Jul 29, 2008 at 1:05 PM, Jean Madson <je...@gmail.com>
>>> wrote:
>>>> For sure, it´s really very interesting.
>>>> Can you put as an attachment the code from the class that implements
>>>> findOrganization and
>>>> the class code that implements the testRunner?
>>>> Who knows someone else could help us...
>>>
>>> Yes, please raise a JIRA with your code or a unit test that allows us
>>> to reproduce your problem and we can definetly take a look and provide
>>> some help.
>>>
>>>>
>>>> --
>>>> Jean Madson
>>>>
>>>>
>>>>
>>>> 2008/7/29 Abraham Washington <ab...@yahoo.com>
>>>>>
>>>>> here's more info.
>>>>>
>>>>>
>>>>>
>>>>> this is from findOrganization
>>>>>
>>>>> findOrganization data graph ->
>>>>> org.apache.tuscany.sdo.impl.DataGraphImpl@1d87b360 (resourceSet:
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl@381172c5
>>>>>
>>>>>
>>>>>
>>>>> resources=[org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl@1860045
>>>>> uri='root.xml',
>>>>> org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl$1@47bb2cb
>>>>> uri='http:///org.apache.tuscany.das.rdb/das',
>>>>> org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl$1@55172fb9
>>>>> uri='http:///org.apache.tuscany.das.rdb/das',
>>>>> org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl@653e4653
>>>>> uri='change-summary.xml'])
>>>>>
>>>>> findOrganization data graph root ->
>>>>> org.apache.tuscany.sdo.impl.DynamicDataObjectImpl@5b7b2712 (eClass:
>>>>> org.apache.tuscany.sdo.impl.ClassImpl@72423da9 (name: DataGraphRoot)
>>>>> (instanceClassName: null) (abstract: false, interface: false))
>>>>>
>>>>>
>>>>>
>>>>> // this debug came from the test runner
>>>>>
>>>>> data graph -> null
>>>>>
>>>>> account -> org.apache.tuscany.sdo.impl.DynamicDataObjectImpl@70a6aa31
>>>>> (eClass: org.apache.tuscany.sdo.impl.ClassImpl@4defb0be (name: ACCOUNT)
>>>>> (instanceClassName: null) (abstract: false, interface: false))
>>>>>
>>>>> Testrunner accountName -> TestNode1
>>>>>
>>>>>
>>>>>
>>>>> update account now...
>>>>>
>>>>> java.lang.NullPointerException
>>>>>
>>>>> at org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(
>>>>>
>>>>> ApplyChangesCommandImpl.java:58)
>>>>>
>>>>>
>>>>> the call to:
>>>>>
>>>>> root.
>>>>>
>>>>> getDataGraph()
>>>>>
>>>>>
>>>>>
>>>>> is what's outputting: data graph -> null
>>>>>
>>>>>
>>>>>
>>>>> seems odd that the call works fine in the operation findOrganization,
>>>>> but
>>>>> it's null inside the testRunner
>>>>>
>>>>>
>>>>>
>>>>> thanks
>>>>>
>>>>>
>>>>>
>>>>> ----- Original Message ----
>>>>> From: Jean Madson <je...@gmail.com>
>>>>> To: user@tuscany.apache.org
>>>>> Sent: Tuesday, July 29, 2008 10:16:20 AM
>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>
>>>>> It's exactly what you did for dataGraph, showing its internal
>>>>> representation.
>>>>> --
>>>>> Jean Madson
>>>>>
>>>>>
>>>>>
>>>>> 2008/7/29 Abraham Washington <ab...@yahoo.com>
>>>>>>
>>>>>> what do you mean by dump?
>>>>>>
>>>>>> ----- Original Message ----
>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>> To: user@tuscany.apache.org
>>>>>> Sent: Tuesday, July 29, 2008 9:04:06 AM
>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>
>>>>>> Can you dump "account"? So we can see what is inside it...
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Jean Madson
>>>>>> http://bit-zen.blogspot.com/
>>>>>> MSN: jeanmadson@gmail.com
>>>>>> -----
>>>>>> HI LI KO KEN TEN
>>>>>> Be grass, don't eat grass
>>>>>> "É preciso esvaziar a xícara para ver o fundo tal como ele é, caso
>>>>>> contrário,
>>>>>> o fundo parecerá turvo, e idéias precipitadas acerca do que seja o
>>>>>> fundo límpido emergirão."
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2008/7/29 Abraham Washington <ab...@yahoo.com>
>>>>>>>
>>>>>>> this is where it's failing:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> if (!root.equals(root.getDataGraph().getRootObject())) {
>>>>>>>            throw new RuntimeException("'root' argument must be the
>>>>>>> root
>>>>>>> of the datagraph");
>>>>>>>        }
>>>>>>>
>>>>>>>
>>>>>>> in org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl at line 58
>>>>>>> (looking at the source code).  i printed out the same thing and can
>>>>>>> reproduce the problem.
>>>>>>>
>>>>>>> the problem is the call to root.getDataGraph() is returning null,
>>>>>>> thus
>>>>>>> the call to root.getDataGraph().getRootObject() throws the npe.
>>>>>>>
>>>>>>> when i make the call to find the organization, the dataGraph is null
>>>>>>> as
>>>>>>> well.  here's my call to findOrganization:
>>>>>>>
>>>>>>>
>>>>>>> public
>>>>>>>
>>>>>>> DataObject findOrganization(String id) {
>>>>>>>
>>>>>>> DataObject root =
>>>>>>>
>>>>>>> null
>>>>>>> ;
>>>>>>>
>>>>>>> InputStream in =
>>>>>>>
>>>>>>> getClass().getClassLoader().getResourceAsStream(
>>>>>>>
>>>>>>> "dasConfiguration.xml");
>>>>>>>
>>>>>>> DAS das = DAS.
>>>>>>>
>>>>>>> FACTORY.createDAS(in, getConnection());
>>>>>>>
>>>>>>> Command read = das.getCommand(
>>>>>>>
>>>>>>> "getAccountByID");
>>>>>>>
>>>>>>> read.setParameter(1, Integer.valueOf(id));
>>>>>>>
>>>>>>> root = read.executeQuery();
>>>>>>>
>>>>>>> DataObject account = root.getDataObject(
>>>>>>>
>>>>>>> "ACCOUNT[1]");
>>>>>>>
>>>>>>> System.
>>>>>>>
>>>>>>> out.println("account dataGraph -> " + account.getDataGraph());
>>>>>>>
>>>>>>> System.
>>>>>>>
>>>>>>> out.println("account dataObject -> " +
>>>>>>> account.getDataGraph().getRootObject());
>>>>>>>
>>>>>>> return account;
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Output:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> data graph -> null
>>>>>>>
>>>>>>>
>>>>>>> then a npe this thrown on the call to:
>>>>>>> System.out.println("account dataObject -> " +
>>>>>>> account.getDataGraph().getRootObject());
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> why would the dataGraph be null ?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> thx abe
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ----- Original Message ----
>>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>>> To: user@tuscany.apache.org
>>>>>>> Sent: Tuesday, July 29, 2008 7:31:18 AM
>>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>>
>>>>>>> It throws NullPointerException.
>>>>>>> Does the organizationService variable have a valid reference to the
>>>>>>> service?
>>>>>>> Try to test this.
>>>>>>> You can try to do a dump from organizationService.
>>>>>>> Perhaps, organizationService can't find an organization with that id,
>>>>>>> thus, returning a null reference.
>>>>>>> Check this too.
>>>>>>>
>>>>>>> --
>>>>>>> Jean Madson
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 2008/7/28 Abraham Washington <ab...@yahoo.com>
>>>>>>>>
>>>>>>>> i put the call to das.applyChanges in a try/catch block which gives
>>>>>>>> a
>>>>>>>> little more info:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> java.lang.NullPointerException
>>>>>>>>
>>>>>>>> at org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(
>>>>>>>>
>>>>>>>> ApplyChangesCommandImpl.java:58)
>>>>>>>>
>>>>>>>> at org.apache.tuscany.das.rdb.impl.DASImpl.applyChanges(
>>>>>>>>
>>>>>>>> DASImpl.java:310)
>>>>>>>>
>>>>>>>> at org.soa.services.OrganizationDataServiceImpl.updateOrganization(
>>>>>>>>
>>>>>>>> OrganizationDataServiceImpl.java:188)
>>>>>>>>
>>>>>>>> at org.soa.services.OrganizationServiceImpl.updateOrganization(
>>>>>>>>
>>>>>>>> OrganizationServiceImpl.java:60)
>>>>>>>>
>>>>>>>> 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:585)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.doInvoke(
>>>>>>>>
>>>>>>>> SpringInvoker.java:100)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.invoke(
>>>>>>>>
>>>>>>>> SpringInvoker.java:116)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>
>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>
>>>>>>>> at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(
>>>>>>>>
>>>>>>>> SCABindingInvoker.java:61)
>>>>>>>>
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>
>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>
>>>>>>>> JDKInvocationHandler.java:286)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>
>>>>>>>> JDKInvocationHandler.java:154)
>>>>>>>>
>>>>>>>> at $Proxy7.updateOrganization(Unknown Source)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> here's line 63 from my test runner:
>>>>>>>>
>>>>>>>>
>>>>>>>> commonj.sdo.DataObject account =
>>>>>>>> organizationService.getOrganization(organizationId
>>>>>>>>
>>>>>>>> );
>>>>>>>>
>>>>>>>> organizationService.updateOrganization(account);
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> line 63 is organizationService.updateOrganization(organizationId);
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> thx...hope this helps...all i'm doing is grabbing the org (just a
>>>>>>>> simple find) in getOrganization, then passing that org to update.
>>>>>>>> no
>>>>>>>> changes are made.  maybe i'm not closing a connection ?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ----- Original Message ----
>>>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>>>> To: user@tuscany.apache.org
>>>>>>>> Sent: Monday, July 28, 2008 4:37:34 PM
>>>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>>>
>>>>>>>> OK, Abraham.
>>>>>>>> It seems like an invalid reference object in line 63.
>>>>>>>> What is there?
>>>>>>>> Can you put here a numbered excerpt of the code around 63 line?
>>>>>>>>
>>>>>>>>
>>>>>>>> 2008/7/28 Abraham Washington <ab...@yahoo.com>
>>>>>>>>>
>>>>>>>>> hi jean...that is the entire stack trace.  i'm running within
>>>>>>>>> eclipse
>>>>>>>>> and that's all that's given.  i'm using oracle if that helps.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> update account now...
>>>>>>>>>
>>>>>>>>> Exception in thread "main"
>>>>>>>>>
>>>>>>>>> java.lang.NullPointerException
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.copyFault(
>>>>>>>>>
>>>>>>>>> PassByValueInterceptor.java:125)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>
>>>>>>>>> PassByValueInterceptor.java:115)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(
>>>>>>>>>
>>>>>>>>> SCABindingInvoker.java:61)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>
>>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>
>>>>>>>>> JDKInvocationHandler.java:286)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>
>>>>>>>>> JDKInvocationHandler.java:154
>>>>>>>>> )
>>>>>>>>>
>>>>>>>>> at $Proxy7.updateOrganization(Unknown Source)
>>>>>>>>>
>>>>>>>>> at helloworld.OrganizationServiceCompositeRunner.main(
>>>>>>>>>
>>>>>>>>> OrganizationServiceCompositeRunner.java:63)
>>>>>>>>>
>>>>>>>>> let me know if you need more info...abe
>>>>>>>>>
>>>>>>>>> ----- Original Message ----
>>>>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>>>>> To: user@tuscany.apache.org
>>>>>>>>> Sent: Monday, July 28, 2008 3:52:49 PM
>>>>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>>>>
>>>>>>>>> Can you put here all stack trace?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2008/7/28 Abraham Washington <ab...@yahoo.com>
>>>>>>>>>>
>>>>>>>>>> hi,  i'm trying to get DAS to work for my service.  i'm able to
>>>>>>>>>> query
>>>>>>>>>> and get results back no problem.  below is my code for updating.
>>>>>>>>>> if
>>>>>>>>>> i take
>>>>>>>>>> out the call to account.set(....), then the apply works (but there
>>>>>>>>>> were no
>>>>>>>>>> changes to the DataObject).  with the account.set(...) call, the
>>>>>>>>>> exception
>>>>>>>>>> is thrown.  ideas? thx abe
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Command read = das.getCommand(
>>>>>>>>>>
>>>>>>>>>> "getAccountByID");
>>>>>>>>>>
>>>>>>>>>> read.setParameter(1, Integer.valueOf(organizationId));
>>>>>>>>>>
>>>>>>>>>> root = read.executeQuery();
>>>>>>>>>>
>>>>>>>>>> DataObject account = root.getDataObject(
>>>>>>>>>>
>>>>>>>>>> "ACCOUNT[1]");
>>>>>>>>>>
>>>>>>>>>> System.
>>>>>>>>>>
>>>>>>>>>> out.println("accountName before change -> " +
>>>>>>>>>> account.getString("ACCOUNT_NAME"));
>>>>>>>>>>
>>>>>>>>>> account.set(
>>>>>>>>>>
>>>>>>>>>> "ACCOUNT_NAME", "TestAccount");
>>>>>>>>>>
>>>>>>>>>> System.
>>>>>>>>>>
>>>>>>>>>> out.println("apply changes...");
>>>>>>>>>>
>>>>>>>>>> das.applyChanges(root);
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> apply changes...
>>>>>>>>>>
>>>>>>>>>> Exception in thread "main"
>>>>>>>>>>
>>>>>>>>>> java.lang.NullPointerException
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.copyFault(
>>>>>>>>>>
>>>>>>>>>> PassByValueInterceptor.java:125)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>>
>>>>>>>>>> PassByValueInterceptor.java:115)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(
>>>>>>>>>>
>>>>>>>>>> SCABindingInvoker.java:61)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>>
>>>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>>
>>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>>
>>>>>>>>>> JDKInvocationHandler.java:286)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>>
>>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>>
>>>>>>>>>> JDKInvocationHandler.java:154)
>>>>>>>>>>
>>>>>>>>>> at $Proxy7.updateOrganization(Unknown Source)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Luciano Resende
>>> Apache Tuscany Committer
>>> http://people.apache.org/~lresende
>>> http://lresende.blogspot.com/
>>>
>>>
>>
>>
>>
>> --
>> Luciano Resende
>> Apache Tuscany Committer
>> http://people.apache.org/~lresende
>> http://lresende.blogspot.com/
>>
>>
>
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Re: Copying SDO objects that have ChangeSummary in SDO Databinding, was Re: das npe in PassByValueInterceptor

Posted by Luciano Resende <lu...@gmail.com>.
I have just updated my sanbox, and removed the @Remotable to avoid the
Databinding framework to intercept the invocation and make the copy.
By doing that, all test cases seems to pass now using Derby. You might
need to tweak the organization.swl and organizationConfiguration.xml
In order to tweak to expected Oracle schema.

Please let me know if this helps.

On Mon, Aug 11, 2008 at 1:53 PM, Luciano Resende <lu...@gmail.com> wrote:
> For the issue where you were having issues with the DataGraph, my
> understanding is that this is happening because the Databinding
> framework copy the DataObject using SDO CopyHelper, that is not
> properly handling the copy, and this is probably related to the
> following code snipet :
>
>  protected void copyAttribute(EAttribute eAttribute, EObject eObject,
> EObject copyEObject) {
>            if(("ChangeSummaryType".equals(eAttribute.getEType().getName())
> && "commonj.sdo".equals(eAttribute.getEType().getEPackage().getNsURI())))
> {
>                throw new UnsupportedOperationException("This will be
> implemented when change summary serialization/deserialization is in
> place");
>            } else {
>                super.copyAttribute(eAttribute, eObject, copyEObject);
>            }
>        }
>
> I think there are two options here :
>
>   - Have a way to avoid to copy in the databinding
>   - Fix the code in the SDO side
>
> Does people have other suggestions ?
>
>
-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Re: Copying SDO objects that have ChangeSummary in SDO Databinding, was Re: das npe in PassByValueInterceptor

Posted by Luciano Resende <lu...@gmail.com>.
I have just updated my sanbox, and removed the @Remotable to avoid the
Databinding framework to intercept the invocation and make the copy.
By doing that, all test cases seems to pass now using Derby. You might
need to tweak the organization.swl and organizationConfiguration.xml
In order to tweak to expected Oracle schema.

Please let me know if this helps.

On Mon, Aug 11, 2008 at 1:53 PM, Luciano Resende <lu...@gmail.com> wrote:
> For the issue where you were having issues with the DataGraph, my
> understanding is that this is happening because the Databinding
> framework copy the DataObject using SDO CopyHelper, that is not
> properly handling the copy, and this is probably related to the
> following code snipet :
>
>  protected void copyAttribute(EAttribute eAttribute, EObject eObject,
> EObject copyEObject) {
>            if(("ChangeSummaryType".equals(eAttribute.getEType().getName())
> && "commonj.sdo".equals(eAttribute.getEType().getEPackage().getNsURI())))
> {
>                throw new UnsupportedOperationException("This will be
> implemented when change summary serialization/deserialization is in
> place");
>            } else {
>                super.copyAttribute(eAttribute, eObject, copyEObject);
>            }
>        }
>
> I think there are two options here :
>
>   - Have a way to avoid to copy in the databinding
>   - Fix the code in the SDO side
>
> Does people have other suggestions ?
>
>
> On Mon, Aug 11, 2008 at 9:52 AM, Abraham Washington
> <ab...@yahoo.com> wrote:
>> i created a new schema and ran the organization.sql.  still running into the
>> same problems.  here's my schema def:
>>
>>
>>
>> $ sqlplus orgservice@xe
>>
>> SQL*Plus: Release 11.1.0.6.0 - Production on Mon Aug 11 10:34:49 2008
>>
>> Copyright (c) 1982, 2007, Oracle.  All rights reserved.
>>
>> Enter password:
>>
>> Connected to:
>> Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
>>
>> SQL> describe account;
>>  Name                                      Null?    Type
>>  ----------------------------------------- --------
>> ----------------------------
>>  ACCOUNT_ID                                NOT NULL NUMBER(12)
>>  ACCOUNTTYPE_CD                                     VARCHAR2(30)
>>  ACCOUNT_NAME                                       VARCHAR2(30)
>>  WEB_SITE_ADDRESS                                   VARCHAR2(30)
>>  STREET_ADDRESS_1                                   VARCHAR2(30)
>>  STREET_ADDRESS_2                                   VARCHAR2(30)
>>  STREET_ADDRESS_3                                   VARCHAR2(30)
>>  CITY                                               VARCHAR2(10)
>>  STATE_CD                                           VARCHAR2(2)
>>  POSTAL_CD                                          VARCHAR2(5)
>>  COUNTRY_CD                                         VARCHAR2(3)
>>  PHONE_NUMBER                                       VARCHAR2(15)
>>  FAX_NUMBER                                         VARCHAR2(15)
>>  NOTE                                               VARCHAR2(50)
>>
>>
>>
>> SQL> describe organizationtypelist;
>>  Name                                      Null?    Type
>>  ----------------------------------------- --------
>> ----------------------------
>>  ORGANIZATIONTYPEID                        NOT NULL NUMBER(12)
>>  CODE                                               VARCHAR2(10)
>>  DISPLAYVALUE                                       VARCHAR2(30)
>>  DESCRIPTION                                        VARCHAR2(30)
>>  ISEDITABLE                                         NUMBER(38)
>>
>> SQL>
>>
>>
>>
>>
>>
>> attached is the organization.sql (with a few small changes for oracle).
>>
>>
>>
>> thx abe
>>
>> ----- Original Message ----
>> From: Luciano Resende <lu...@gmail.com>
>> To: user@tuscany.apache.org
>> Sent: Monday, August 11, 2008 9:53:25 AM
>> Subject: Re: das npe in PassByValueInterceptor
>>
>> Please take a look at organization.sql and let me know if the database
>> structure is different from what you have.
>>
>> https://svn.apache.org/repos/asf/tuscany/sandbox/lresende/sca/samples/organization-das/organization.sql
>>
>> On Mon, Aug 11, 2008 at 8:48 AM, Abraham Washington
>> <ab...@yahoo.com> wrote:
>>> hi Luciano,  i ran the test case and had a couple problems.  when running
>>> with the code that's in svn, I get this error:
>>>
>>>
>>>
>>> java.lang.ClassCastException: The value of type 'class
>>> java.math.BigDecimal'
>>> must be of type 'class java.lang.Integer'
>>>  at
>>>
>>> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleDataUnsettableStatic.validate(EStructuralFeatureImpl.java:2195)
>>>  at
>>>
>>> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleDataUnsettable.dynamicSet(EStructuralFeatureImpl.java:2116)
>>>  at
>>>
>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicSet(BasicEObjectImpl.java:709)
>>>  at
>>>
>>> org.apache.tuscany.sdo.impl.DynamicDataObjectImpl.eDynamicSet(DynamicDataObjectImpl.java:160)
>>>  at
>>> org.apache.tuscany.sdo.impl.DataObjectImpl.eSet(DataObjectImpl.java:1459)
>>>  at
>>>
>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:654)
>>>  at
>>> org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java:142)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.graphbuilder.impl.DataObjectMaker.createAndAddDataObject(DataObjectMaker.java:90)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.addRowToGraph(ResultSetProcessor.java:127)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResultSet(ResultSetProcessor.java:91)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResults(ResultSetProcessor.java:77)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ReadCommandImpl.buildGraph(ReadCommandImpl.java:309)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ReadCommandImpl.executeQuery(ReadCommandImpl.java:277)
>>>  at
>>>
>>> organization.OrganizationTestCase.testRetrieveOrganizationDAS(OrganizationTestCase.java:61)
>>>
>>>  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:585)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
>>>  at
>>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:75)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:36)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>>>
>>>
>>>
>>> OrganizationTestcase.java:61 is
>>>
>>> root = read.executeQuery();
>>>
>>>
>>>
>>> So, in the organizationConfiguration.xml, I changed the type of the
>>> ResultDescriptor from commonj.sdo.Integer to commonj.sdo.Decimal (line
>>> 46).
>>> that seems to have worked when running the query (executeQuery), but when
>>> performing the update (line 74:  das.applyChanges(root)) the following
>>> error
>>> is thrown:
>>>
>>>
>>>
>>> java.lang.RuntimeException: Not a valid SDO Type
>>> org.apache.tuscany.sdo.impl.DataTypeImpl@9d686c1 (name: Decimal)
>>> (instanceClassName: java.math.BigDecimal) (serializable: true)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.SDODataTypeHelper.columnTypeForSDOType(SDODataTypeHelper.java:105)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.fillExtendedParameter(UpdateGenerator.java:211)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.createParameter(UpdateGenerator.java:226)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.getUpdateCommand(UpdateGenerator.java:104)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeFactory.getUpdateCommand(ChangeFactory.java:154)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeFactory.createUpdateOperation(ChangeFactory.java:69)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.createChange(ChangeSummarizer.java:115)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.loadChanges(ChangeSummarizer.java:80)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(ApplyChangesCommandImpl.java:64)
>>>
>>>  at org.apache.tuscany.das.rdb.impl.DASImpl.applyChanges(DASImpl.java:310)
>>>  at
>>>
>>> organization.OrganizationTestCase.testRetrieveOrganizationDAS(OrganizationTestCase.java:74)
>>>  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:585)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
>>>  at
>>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:75)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:36)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>>>
>>>
>>>
>>>
>>>
>>> The second test case throws the following error (the ACCOUNT_ID is type
>>> commonj.sdo.Decimal):
>>>
>>>
>>>
>>> java.lang.reflect.UndeclaredThrowableException
>>>  at $Proxy5.findOrganizationBugOne(Unknown Source)
>>>  at
>>>
>>> organization.OrganizationTestCase.testRetrieveOrganizationSCA(OrganizationTestCase.java:105)
>>>
>>>  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:585)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
>>>  at
>>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:75)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:36)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>>> Caused by: java.lang.reflect.InvocationTargetException
>>>  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:585)
>>>  at
>>>
>>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.doInvoke(SpringInvoker.java:100)
>>>  at
>>>
>>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.invoke(SpringInvoker.java:116)
>>>  at
>>>
>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
>>>  at
>>>
>>> org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
>>>  at
>>>
>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
>>>  at
>>>
>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
>>>  at
>>>
>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
>>>  ... 22 more
>>> Caused by: java.lang.RuntimeException: Not a valid SDO Type
>>> org.apache.tuscany.sdo.impl.DataTypeImpl@3aca5e2 (name: Decimal)
>>> (instanceClassName: java.math.BigDecimal) (serializable: true)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.SDODataTypeHelper.columnTypeForSDOType(SDODataTypeHelper.java:105)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.fillExtendedParameter(UpdateGenerator.java:211)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.createParameter(UpdateGenerator.java:226)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.getUpdateCommand(UpdateGenerator.java:104)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeFactory.getUpdateCommand(ChangeFactory.java:154)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeFactory.createUpdateOperation(ChangeFactory.java:69)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.createChange(ChangeSummarizer.java:115)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.loadChanges(ChangeSummarizer.java:80)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(ApplyChangesCommandImpl.java:64)
>>>  at org.apache.tuscany.das.rdb.impl.DASImpl.applyChanges(DASImpl.java:310)
>>>  at
>>>
>>> organization.das.OrganizationDataServiceImpl.findOrganizationBugOne(OrganizationDataServiceImpl.java:72)
>>>  at
>>>
>>> organization.services.OrganizationServiceImpl.findOrganizationBugOne(OrganizationServiceImpl.java:47)
>>>  ... 33 more
>>>
>>>
>>>
>>>
>>>
>>> let me know if you need more info..abe
>>>
>>> ----- Original Message ----
>>> From: Luciano Resende <lu...@gmail.com>
>>> To: user@tuscany.apache.org
>>> Sent: Saturday, August 9, 2008 5:14:30 PM
>>> Subject: Re: das npe in PassByValueInterceptor
>>>
>>> Hi Abraham
>>>
>>>  From your initial post, looks like you are having two problems :
>>>
>>>      - Using DAS, a call to applyChanges succedds, but the account
>>> row does not get updated.
>>>      - When you use SCA to create a DAS component, you are having a
>>> PassByValueInterceptor exception
>>>
>>>  I have committed a organization-das sample, all based on the
>>> application you provided under TUSCANY-2525, under svn revision
>>> 684376.
>>>
>>>  Note that I'm building the sample im multiple steps, isolating the
>>> areas involved in each issue. Also, note that I'm using derby, but
>>> changing back to Oracle should be easy, just change the
>>> ConnectionHelper to create the proper Oracle connection.
>>>
>>>  Right now, I have the DAS piece working ok, and it would be good if
>>> you could verify this in your Oracle environment by running the
>>> OrganizationTestCase. While I wait for your feedback, I'm going to
>>> move to incorporate the SCA into the sample.
>>>
>>> Thanks
>>>
>>>
>>> On Mon, Aug 4, 2008 at 12:51 PM, Abraham Washington
>>> <ab...@yahoo.com> wrote:
>>>> thanks all for the help.  created issue tuscany-2525
>>>>
>>>> ----- Original Message ----
>>>> From: Luciano Resende <lu...@gmail.com>
>>>> To: user@tuscany.apache.org
>>>> Sent: Sunday, August 3, 2008 11:09:49 PM
>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>
>>>> On Tue, Jul 29, 2008 at 1:05 PM, Jean Madson <je...@gmail.com>
>>>> wrote:
>>>>> For sure, it´s really very interesting.
>>>>> Can you put as an attachment the code from the class that implements
>>>>> findOrganization and
>>>>> the class code that implements the testRunner?
>>>>> Who knows someone else could help us...
>>>>
>>>> Yes, please raise a JIRA with your code or a unit test that allows us
>>>> to reproduce your problem and we can definetly take a look and provide
>>>> some help.
>>>>
>>>>>
>>>>> --
>>>>> Jean Madson
>>>>>
>>>>>
>>>>>
>>>>> 2008/7/29 Abraham Washington <ab...@yahoo.com>
>>>>>>
>>>>>> here's more info.
>>>>>>
>>>>>>
>>>>>>
>>>>>> this is from findOrganization
>>>>>>
>>>>>> findOrganization data graph ->
>>>>>> org.apache.tuscany.sdo.impl.DataGraphImpl@1d87b360 (resourceSet:
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl@381172c5
>>>>>>
>>>>>>
>>>>>>
>>>>>> resources=[org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl@1860045
>>>>>> uri='root.xml',
>>>>>> org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl$1@47bb2cb
>>>>>> uri='http:///org.apache.tuscany.das.rdb/das',
>>>>>> org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl$1@55172fb9
>>>>>> uri='http:///org.apache.tuscany.das.rdb/das',
>>>>>> org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl@653e4653
>>>>>> uri='change-summary.xml'])
>>>>>>
>>>>>> findOrganization data graph root ->
>>>>>> org.apache.tuscany.sdo.impl.DynamicDataObjectImpl@5b7b2712 (eClass:
>>>>>> org.apache.tuscany.sdo.impl.ClassImpl@72423da9 (name: DataGraphRoot)
>>>>>> (instanceClassName: null) (abstract: false, interface: false))
>>>>>>
>>>>>>
>>>>>>
>>>>>> // this debug came from the test runner
>>>>>>
>>>>>> data graph -> null
>>>>>>
>>>>>> account -> org.apache.tuscany.sdo.impl.DynamicDataObjectImpl@70a6aa31
>>>>>> (eClass: org.apache.tuscany.sdo.impl.ClassImpl@4defb0be (name: ACCOUNT)
>>>>>> (instanceClassName: null) (abstract: false, interface: false))
>>>>>>
>>>>>> Testrunner accountName -> TestNode1
>>>>>>
>>>>>>
>>>>>>
>>>>>> update account now...
>>>>>>
>>>>>> java.lang.NullPointerException
>>>>>>
>>>>>> at org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(
>>>>>>
>>>>>> ApplyChangesCommandImpl.java:58)
>>>>>>
>>>>>>
>>>>>> the call to:
>>>>>>
>>>>>> root.
>>>>>>
>>>>>> getDataGraph()
>>>>>>
>>>>>>
>>>>>>
>>>>>> is what's outputting: data graph -> null
>>>>>>
>>>>>>
>>>>>>
>>>>>> seems odd that the call works fine in the operation findOrganization,
>>>>>> but
>>>>>> it's null inside the testRunner
>>>>>>
>>>>>>
>>>>>>
>>>>>> thanks
>>>>>>
>>>>>>
>>>>>>
>>>>>> ----- Original Message ----
>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>> To: user@tuscany.apache.org
>>>>>> Sent: Tuesday, July 29, 2008 10:16:20 AM
>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>
>>>>>> It's exactly what you did for dataGraph, showing its internal
>>>>>> representation.
>>>>>> --
>>>>>> Jean Madson
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2008/7/29 Abraham Washington <ab...@yahoo.com>
>>>>>>>
>>>>>>> what do you mean by dump?
>>>>>>>
>>>>>>> ----- Original Message ----
>>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>>> To: user@tuscany.apache.org
>>>>>>> Sent: Tuesday, July 29, 2008 9:04:06 AM
>>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>>
>>>>>>> Can you dump "account"? So we can see what is inside it...
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Jean Madson
>>>>>>> http://bit-zen.blogspot.com/
>>>>>>> MSN: jeanmadson@gmail.com
>>>>>>> -----
>>>>>>> HI LI KO KEN TEN
>>>>>>> Be grass, don't eat grass
>>>>>>> "É preciso esvaziar a xícara para ver o fundo tal como ele é, caso
>>>>>>> contrário,
>>>>>>> o fundo parecerá turvo, e idéias precipitadas acerca do que seja o
>>>>>>> fundo límpido emergirão."
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 2008/7/29 Abraham Washington <ab...@yahoo.com>
>>>>>>>>
>>>>>>>> this is where it's failing:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> if (!root.equals(root.getDataGraph().getRootObject())) {
>>>>>>>>            throw new RuntimeException("'root' argument must be the
>>>>>>>> root
>>>>>>>> of the datagraph");
>>>>>>>>        }
>>>>>>>>
>>>>>>>>
>>>>>>>> in org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl at line 58
>>>>>>>> (looking at the source code).  i printed out the same thing and can
>>>>>>>> reproduce the problem.
>>>>>>>>
>>>>>>>> the problem is the call to root.getDataGraph() is returning null,
>>>>>>>> thus
>>>>>>>> the call to root.getDataGraph().getRootObject() throws the npe.
>>>>>>>>
>>>>>>>> when i make the call to find the organization, the dataGraph is null
>>>>>>>> as
>>>>>>>> well.  here's my call to findOrganization:
>>>>>>>>
>>>>>>>>
>>>>>>>> public
>>>>>>>>
>>>>>>>> DataObject findOrganization(String id) {
>>>>>>>>
>>>>>>>> DataObject root =
>>>>>>>>
>>>>>>>> null
>>>>>>>> ;
>>>>>>>>
>>>>>>>> InputStream in =
>>>>>>>>
>>>>>>>> getClass().getClassLoader().getResourceAsStream(
>>>>>>>>
>>>>>>>> "dasConfiguration.xml");
>>>>>>>>
>>>>>>>> DAS das = DAS.
>>>>>>>>
>>>>>>>> FACTORY.createDAS(in, getConnection());
>>>>>>>>
>>>>>>>> Command read = das.getCommand(
>>>>>>>>
>>>>>>>> "getAccountByID");
>>>>>>>>
>>>>>>>> read.setParameter(1, Integer.valueOf(id));
>>>>>>>>
>>>>>>>> root = read.executeQuery();
>>>>>>>>
>>>>>>>> DataObject account = root.getDataObject(
>>>>>>>>
>>>>>>>> "ACCOUNT[1]");
>>>>>>>>
>>>>>>>> System.
>>>>>>>>
>>>>>>>> out.println("account dataGraph -> " + account.getDataGraph());
>>>>>>>>
>>>>>>>> System.
>>>>>>>>
>>>>>>>> out.println("account dataObject -> " +
>>>>>>>> account.getDataGraph().getRootObject());
>>>>>>>>
>>>>>>>> return account;
>>>>>>>>
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Output:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> data graph -> null
>>>>>>>>
>>>>>>>>
>>>>>>>> then a npe this thrown on the call to:
>>>>>>>> System.out.println("account dataObject -> " +
>>>>>>>> account.getDataGraph().getRootObject());
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> why would the dataGraph be null ?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> thx abe
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ----- Original Message ----
>>>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>>>> To: user@tuscany.apache.org
>>>>>>>> Sent: Tuesday, July 29, 2008 7:31:18 AM
>>>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>>>
>>>>>>>> It throws NullPointerException.
>>>>>>>> Does the organizationService variable have a valid reference to the
>>>>>>>> service?
>>>>>>>> Try to test this.
>>>>>>>> You can try to do a dump from organizationService.
>>>>>>>> Perhaps, organizationService can't find an organization with that id,
>>>>>>>> thus, returning a null reference.
>>>>>>>> Check this too.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Jean Madson
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2008/7/28 Abraham Washington <ab...@yahoo.com>
>>>>>>>>>
>>>>>>>>> i put the call to das.applyChanges in a try/catch block which gives
>>>>>>>>> a
>>>>>>>>> little more info:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> java.lang.NullPointerException
>>>>>>>>>
>>>>>>>>> at org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(
>>>>>>>>>
>>>>>>>>> ApplyChangesCommandImpl.java:58)
>>>>>>>>>
>>>>>>>>> at org.apache.tuscany.das.rdb.impl.DASImpl.applyChanges(
>>>>>>>>>
>>>>>>>>> DASImpl.java:310)
>>>>>>>>>
>>>>>>>>> at org.soa.services.OrganizationDataServiceImpl.updateOrganization(
>>>>>>>>>
>>>>>>>>> OrganizationDataServiceImpl.java:188)
>>>>>>>>>
>>>>>>>>> at org.soa.services.OrganizationServiceImpl.updateOrganization(
>>>>>>>>>
>>>>>>>>> OrganizationServiceImpl.java:60)
>>>>>>>>>
>>>>>>>>> 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:585)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.doInvoke(
>>>>>>>>>
>>>>>>>>> SpringInvoker.java:100)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.invoke(
>>>>>>>>>
>>>>>>>>> SpringInvoker.java:116)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>
>>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>>
>>>>>>>>> at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(
>>>>>>>>>
>>>>>>>>> SCABindingInvoker.java:61)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>
>>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>
>>>>>>>>> JDKInvocationHandler.java:286)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>
>>>>>>>>> JDKInvocationHandler.java:154)
>>>>>>>>>
>>>>>>>>> at $Proxy7.updateOrganization(Unknown Source)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> here's line 63 from my test runner:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> commonj.sdo.DataObject account =
>>>>>>>>> organizationService.getOrganization(organizationId
>>>>>>>>>
>>>>>>>>> );
>>>>>>>>>
>>>>>>>>> organizationService.updateOrganization(account);
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> line 63 is organizationService.updateOrganization(organizationId);
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> thx...hope this helps...all i'm doing is grabbing the org (just a
>>>>>>>>> simple find) in getOrganization, then passing that org to update.
>>>>>>>>> no
>>>>>>>>> changes are made.  maybe i'm not closing a connection ?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ----- Original Message ----
>>>>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>>>>> To: user@tuscany.apache.org
>>>>>>>>> Sent: Monday, July 28, 2008 4:37:34 PM
>>>>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>>>>
>>>>>>>>> OK, Abraham.
>>>>>>>>> It seems like an invalid reference object in line 63.
>>>>>>>>> What is there?
>>>>>>>>> Can you put here a numbered excerpt of the code around 63 line?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2008/7/28 Abraham Washington <ab...@yahoo.com>
>>>>>>>>>>
>>>>>>>>>> hi jean...that is the entire stack trace.  i'm running within
>>>>>>>>>> eclipse
>>>>>>>>>> and that's all that's given.  i'm using oracle if that helps.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> update account now...
>>>>>>>>>>
>>>>>>>>>> Exception in thread "main"
>>>>>>>>>>
>>>>>>>>>> java.lang.NullPointerException
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.copyFault(
>>>>>>>>>>
>>>>>>>>>> PassByValueInterceptor.java:125)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>>
>>>>>>>>>> PassByValueInterceptor.java:115)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(
>>>>>>>>>>
>>>>>>>>>> SCABindingInvoker.java:61)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>>
>>>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>>
>>>>>>>>>> JDKInvocationHandler.java:286)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>>
>>>>>>>>>> JDKInvocationHandler.java:154
>>>>>>>>>> )
>>>>>>>>>>
>>>>>>>>>> at $Proxy7.updateOrganization(Unknown Source)
>>>>>>>>>>
>>>>>>>>>> at helloworld.OrganizationServiceCompositeRunner.main(
>>>>>>>>>>
>>>>>>>>>> OrganizationServiceCompositeRunner.java:63)
>>>>>>>>>>
>>>>>>>>>> let me know if you need more info...abe
>>>>>>>>>>
>>>>>>>>>> ----- Original Message ----
>>>>>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>>>>>> To: user@tuscany.apache.org
>>>>>>>>>> Sent: Monday, July 28, 2008 3:52:49 PM
>>>>>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>>>>>
>>>>>>>>>> Can you put here all stack trace?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 2008/7/28 Abraham Washington <ab...@yahoo.com>
>>>>>>>>>>>
>>>>>>>>>>> hi,  i'm trying to get DAS to work for my service.  i'm able to
>>>>>>>>>>> query
>>>>>>>>>>> and get results back no problem.  below is my code for updating.
>>>>>>>>>>> if
>>>>>>>>>>> i take
>>>>>>>>>>> out the call to account.set(....), then the apply works (but there
>>>>>>>>>>> were no
>>>>>>>>>>> changes to the DataObject).  with the account.set(...) call, the
>>>>>>>>>>> exception
>>>>>>>>>>> is thrown.  ideas? thx abe
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Command read = das.getCommand(
>>>>>>>>>>>
>>>>>>>>>>> "getAccountByID");
>>>>>>>>>>>
>>>>>>>>>>> read.setParameter(1, Integer.valueOf(organizationId));
>>>>>>>>>>>
>>>>>>>>>>> root = read.executeQuery();
>>>>>>>>>>>
>>>>>>>>>>> DataObject account = root.getDataObject(
>>>>>>>>>>>
>>>>>>>>>>> "ACCOUNT[1]");
>>>>>>>>>>>
>>>>>>>>>>> System.
>>>>>>>>>>>
>>>>>>>>>>> out.println("accountName before change -> " +
>>>>>>>>>>> account.getString("ACCOUNT_NAME"));
>>>>>>>>>>>
>>>>>>>>>>> account.set(
>>>>>>>>>>>
>>>>>>>>>>> "ACCOUNT_NAME", "TestAccount");
>>>>>>>>>>>
>>>>>>>>>>> System.
>>>>>>>>>>>
>>>>>>>>>>> out.println("apply changes...");
>>>>>>>>>>>
>>>>>>>>>>> das.applyChanges(root);
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> apply changes...
>>>>>>>>>>>
>>>>>>>>>>> Exception in thread "main"
>>>>>>>>>>>
>>>>>>>>>>> java.lang.NullPointerException
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.copyFault(
>>>>>>>>>>>
>>>>>>>>>>> PassByValueInterceptor.java:125)
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>>>
>>>>>>>>>>> PassByValueInterceptor.java:115)
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>> org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(
>>>>>>>>>>>
>>>>>>>>>>> SCABindingInvoker.java:61)
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>>>
>>>>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>>>
>>>>>>>>>>> JDKInvocationHandler.java:286)
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>>>
>>>>>>>>>>> JDKInvocationHandler.java:154)
>>>>>>>>>>>
>>>>>>>>>>> at $Proxy7.updateOrganization(Unknown Source)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Luciano Resende
>>>> Apache Tuscany Committer
>>>> http://people.apache.org/~lresende
>>>> http://lresende.blogspot.com/
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Luciano Resende
>>> Apache Tuscany Committer
>>> http://people.apache.org/~lresende
>>> http://lresende.blogspot.com/
>>>
>>>
>>
>>
>>
>> --
>> Luciano Resende
>> Apache Tuscany Committer
>> http://people.apache.org/~lresende
>> http://lresende.blogspot.com/
>>
>>
>
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Re: Copying SDO objects that have ChangeSummary in SDO Databinding, was Re: das npe in PassByValueInterceptor

Posted by Luciano Resende <lu...@gmail.com>.
I have just updated my sanbox, and removed the @Remotable to avoid the
Databinding framework to intercept the invocation and make the copy.
By doing that, all test cases seems to pass now using Derby. You might
need to tweak the organization.swl and organizationConfiguration.xml
In order to tweak to expected Oracle schema.

Please let me know if this helps.

On Mon, Aug 11, 2008 at 1:53 PM, Luciano Resende <lu...@gmail.com> wrote:
> For the issue where you were having issues with the DataGraph, my
> understanding is that this is happening because the Databinding
> framework copy the DataObject using SDO CopyHelper, that is not
> properly handling the copy, and this is probably related to the
> following code snipet :
>
>  protected void copyAttribute(EAttribute eAttribute, EObject eObject,
> EObject copyEObject) {
>            if(("ChangeSummaryType".equals(eAttribute.getEType().getName())
> && "commonj.sdo".equals(eAttribute.getEType().getEPackage().getNsURI())))
> {
>                throw new UnsupportedOperationException("This will be
> implemented when change summary serialization/deserialization is in
> place");
>            } else {
>                super.copyAttribute(eAttribute, eObject, copyEObject);
>            }
>        }
>
> I think there are two options here :
>
>   - Have a way to avoid to copy in the databinding
>   - Fix the code in the SDO side
>
> Does people have other suggestions ?
>
>
> On Mon, Aug 11, 2008 at 9:52 AM, Abraham Washington
> <ab...@yahoo.com> wrote:
>> i created a new schema and ran the organization.sql.  still running into the
>> same problems.  here's my schema def:
>>
>>
>>
>> $ sqlplus orgservice@xe
>>
>> SQL*Plus: Release 11.1.0.6.0 - Production on Mon Aug 11 10:34:49 2008
>>
>> Copyright (c) 1982, 2007, Oracle.  All rights reserved.
>>
>> Enter password:
>>
>> Connected to:
>> Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
>>
>> SQL> describe account;
>>  Name                                      Null?    Type
>>  ----------------------------------------- --------
>> ----------------------------
>>  ACCOUNT_ID                                NOT NULL NUMBER(12)
>>  ACCOUNTTYPE_CD                                     VARCHAR2(30)
>>  ACCOUNT_NAME                                       VARCHAR2(30)
>>  WEB_SITE_ADDRESS                                   VARCHAR2(30)
>>  STREET_ADDRESS_1                                   VARCHAR2(30)
>>  STREET_ADDRESS_2                                   VARCHAR2(30)
>>  STREET_ADDRESS_3                                   VARCHAR2(30)
>>  CITY                                               VARCHAR2(10)
>>  STATE_CD                                           VARCHAR2(2)
>>  POSTAL_CD                                          VARCHAR2(5)
>>  COUNTRY_CD                                         VARCHAR2(3)
>>  PHONE_NUMBER                                       VARCHAR2(15)
>>  FAX_NUMBER                                         VARCHAR2(15)
>>  NOTE                                               VARCHAR2(50)
>>
>>
>>
>> SQL> describe organizationtypelist;
>>  Name                                      Null?    Type
>>  ----------------------------------------- --------
>> ----------------------------
>>  ORGANIZATIONTYPEID                        NOT NULL NUMBER(12)
>>  CODE                                               VARCHAR2(10)
>>  DISPLAYVALUE                                       VARCHAR2(30)
>>  DESCRIPTION                                        VARCHAR2(30)
>>  ISEDITABLE                                         NUMBER(38)
>>
>> SQL>
>>
>>
>>
>>
>>
>> attached is the organization.sql (with a few small changes for oracle).
>>
>>
>>
>> thx abe
>>
>> ----- Original Message ----
>> From: Luciano Resende <lu...@gmail.com>
>> To: user@tuscany.apache.org
>> Sent: Monday, August 11, 2008 9:53:25 AM
>> Subject: Re: das npe in PassByValueInterceptor
>>
>> Please take a look at organization.sql and let me know if the database
>> structure is different from what you have.
>>
>> https://svn.apache.org/repos/asf/tuscany/sandbox/lresende/sca/samples/organization-das/organization.sql
>>
>> On Mon, Aug 11, 2008 at 8:48 AM, Abraham Washington
>> <ab...@yahoo.com> wrote:
>>> hi Luciano,  i ran the test case and had a couple problems.  when running
>>> with the code that's in svn, I get this error:
>>>
>>>
>>>
>>> java.lang.ClassCastException: The value of type 'class
>>> java.math.BigDecimal'
>>> must be of type 'class java.lang.Integer'
>>>  at
>>>
>>> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleDataUnsettableStatic.validate(EStructuralFeatureImpl.java:2195)
>>>  at
>>>
>>> org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleDataUnsettable.dynamicSet(EStructuralFeatureImpl.java:2116)
>>>  at
>>>
>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicSet(BasicEObjectImpl.java:709)
>>>  at
>>>
>>> org.apache.tuscany.sdo.impl.DynamicDataObjectImpl.eDynamicSet(DynamicDataObjectImpl.java:160)
>>>  at
>>> org.apache.tuscany.sdo.impl.DataObjectImpl.eSet(DataObjectImpl.java:1459)
>>>  at
>>>
>>> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:654)
>>>  at
>>> org.apache.tuscany.sdo.impl.DataObjectImpl.set(DataObjectImpl.java:142)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.graphbuilder.impl.DataObjectMaker.createAndAddDataObject(DataObjectMaker.java:90)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.addRowToGraph(ResultSetProcessor.java:127)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResultSet(ResultSetProcessor.java:91)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor.processResults(ResultSetProcessor.java:77)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ReadCommandImpl.buildGraph(ReadCommandImpl.java:309)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ReadCommandImpl.executeQuery(ReadCommandImpl.java:277)
>>>  at
>>>
>>> organization.OrganizationTestCase.testRetrieveOrganizationDAS(OrganizationTestCase.java:61)
>>>
>>>  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:585)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
>>>  at
>>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:75)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:36)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>>>
>>>
>>>
>>> OrganizationTestcase.java:61 is
>>>
>>> root = read.executeQuery();
>>>
>>>
>>>
>>> So, in the organizationConfiguration.xml, I changed the type of the
>>> ResultDescriptor from commonj.sdo.Integer to commonj.sdo.Decimal (line
>>> 46).
>>> that seems to have worked when running the query (executeQuery), but when
>>> performing the update (line 74:  das.applyChanges(root)) the following
>>> error
>>> is thrown:
>>>
>>>
>>>
>>> java.lang.RuntimeException: Not a valid SDO Type
>>> org.apache.tuscany.sdo.impl.DataTypeImpl@9d686c1 (name: Decimal)
>>> (instanceClassName: java.math.BigDecimal) (serializable: true)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.SDODataTypeHelper.columnTypeForSDOType(SDODataTypeHelper.java:105)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.fillExtendedParameter(UpdateGenerator.java:211)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.createParameter(UpdateGenerator.java:226)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.getUpdateCommand(UpdateGenerator.java:104)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeFactory.getUpdateCommand(ChangeFactory.java:154)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeFactory.createUpdateOperation(ChangeFactory.java:69)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.createChange(ChangeSummarizer.java:115)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.loadChanges(ChangeSummarizer.java:80)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(ApplyChangesCommandImpl.java:64)
>>>
>>>  at org.apache.tuscany.das.rdb.impl.DASImpl.applyChanges(DASImpl.java:310)
>>>  at
>>>
>>> organization.OrganizationTestCase.testRetrieveOrganizationDAS(OrganizationTestCase.java:74)
>>>  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:585)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
>>>  at
>>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:75)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:36)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>>>
>>>
>>>
>>>
>>>
>>> The second test case throws the following error (the ACCOUNT_ID is type
>>> commonj.sdo.Decimal):
>>>
>>>
>>>
>>> java.lang.reflect.UndeclaredThrowableException
>>>  at $Proxy5.findOrganizationBugOne(Unknown Source)
>>>  at
>>>
>>> organization.OrganizationTestCase.testRetrieveOrganizationSCA(OrganizationTestCase.java:105)
>>>
>>>  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:585)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>>
>>> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
>>>  at
>>> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:75)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:36)
>>>  at
>>>
>>> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
>>>  at
>>>
>>> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
>>>  at
>>> org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>>>  at
>>>
>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
>>> Caused by: java.lang.reflect.InvocationTargetException
>>>  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:585)
>>>  at
>>>
>>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.doInvoke(SpringInvoker.java:100)
>>>  at
>>>
>>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.invoke(SpringInvoker.java:116)
>>>  at
>>>
>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
>>>  at
>>>
>>> org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
>>>  at
>>>
>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(PassByValueInterceptor.java:112)
>>>  at
>>>
>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:287)
>>>  at
>>>
>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
>>>  ... 22 more
>>> Caused by: java.lang.RuntimeException: Not a valid SDO Type
>>> org.apache.tuscany.sdo.impl.DataTypeImpl@3aca5e2 (name: Decimal)
>>> (instanceClassName: java.math.BigDecimal) (serializable: true)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.SDODataTypeHelper.columnTypeForSDOType(SDODataTypeHelper.java:105)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.fillExtendedParameter(UpdateGenerator.java:211)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.createParameter(UpdateGenerator.java:226)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.generator.impl.UpdateGenerator.getUpdateCommand(UpdateGenerator.java:104)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeFactory.getUpdateCommand(ChangeFactory.java:154)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeFactory.createUpdateOperation(ChangeFactory.java:69)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.createChange(ChangeSummarizer.java:115)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ChangeSummarizer.loadChanges(ChangeSummarizer.java:80)
>>>  at
>>>
>>> org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(ApplyChangesCommandImpl.java:64)
>>>  at org.apache.tuscany.das.rdb.impl.DASImpl.applyChanges(DASImpl.java:310)
>>>  at
>>>
>>> organization.das.OrganizationDataServiceImpl.findOrganizationBugOne(OrganizationDataServiceImpl.java:72)
>>>  at
>>>
>>> organization.services.OrganizationServiceImpl.findOrganizationBugOne(OrganizationServiceImpl.java:47)
>>>  ... 33 more
>>>
>>>
>>>
>>>
>>>
>>> let me know if you need more info..abe
>>>
>>> ----- Original Message ----
>>> From: Luciano Resende <lu...@gmail.com>
>>> To: user@tuscany.apache.org
>>> Sent: Saturday, August 9, 2008 5:14:30 PM
>>> Subject: Re: das npe in PassByValueInterceptor
>>>
>>> Hi Abraham
>>>
>>>  From your initial post, looks like you are having two problems :
>>>
>>>      - Using DAS, a call to applyChanges succedds, but the account
>>> row does not get updated.
>>>      - When you use SCA to create a DAS component, you are having a
>>> PassByValueInterceptor exception
>>>
>>>  I have committed a organization-das sample, all based on the
>>> application you provided under TUSCANY-2525, under svn revision
>>> 684376.
>>>
>>>  Note that I'm building the sample im multiple steps, isolating the
>>> areas involved in each issue. Also, note that I'm using derby, but
>>> changing back to Oracle should be easy, just change the
>>> ConnectionHelper to create the proper Oracle connection.
>>>
>>>  Right now, I have the DAS piece working ok, and it would be good if
>>> you could verify this in your Oracle environment by running the
>>> OrganizationTestCase. While I wait for your feedback, I'm going to
>>> move to incorporate the SCA into the sample.
>>>
>>> Thanks
>>>
>>>
>>> On Mon, Aug 4, 2008 at 12:51 PM, Abraham Washington
>>> <ab...@yahoo.com> wrote:
>>>> thanks all for the help.  created issue tuscany-2525
>>>>
>>>> ----- Original Message ----
>>>> From: Luciano Resende <lu...@gmail.com>
>>>> To: user@tuscany.apache.org
>>>> Sent: Sunday, August 3, 2008 11:09:49 PM
>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>
>>>> On Tue, Jul 29, 2008 at 1:05 PM, Jean Madson <je...@gmail.com>
>>>> wrote:
>>>>> For sure, it´s really very interesting.
>>>>> Can you put as an attachment the code from the class that implements
>>>>> findOrganization and
>>>>> the class code that implements the testRunner?
>>>>> Who knows someone else could help us...
>>>>
>>>> Yes, please raise a JIRA with your code or a unit test that allows us
>>>> to reproduce your problem and we can definetly take a look and provide
>>>> some help.
>>>>
>>>>>
>>>>> --
>>>>> Jean Madson
>>>>>
>>>>>
>>>>>
>>>>> 2008/7/29 Abraham Washington <ab...@yahoo.com>
>>>>>>
>>>>>> here's more info.
>>>>>>
>>>>>>
>>>>>>
>>>>>> this is from findOrganization
>>>>>>
>>>>>> findOrganization data graph ->
>>>>>> org.apache.tuscany.sdo.impl.DataGraphImpl@1d87b360 (resourceSet:
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl@381172c5
>>>>>>
>>>>>>
>>>>>>
>>>>>> resources=[org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl@1860045
>>>>>> uri='root.xml',
>>>>>> org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl$1@47bb2cb
>>>>>> uri='http:///org.apache.tuscany.das.rdb/das',
>>>>>> org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl$1@55172fb9
>>>>>> uri='http:///org.apache.tuscany.das.rdb/das',
>>>>>> org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl@653e4653
>>>>>> uri='change-summary.xml'])
>>>>>>
>>>>>> findOrganization data graph root ->
>>>>>> org.apache.tuscany.sdo.impl.DynamicDataObjectImpl@5b7b2712 (eClass:
>>>>>> org.apache.tuscany.sdo.impl.ClassImpl@72423da9 (name: DataGraphRoot)
>>>>>> (instanceClassName: null) (abstract: false, interface: false))
>>>>>>
>>>>>>
>>>>>>
>>>>>> // this debug came from the test runner
>>>>>>
>>>>>> data graph -> null
>>>>>>
>>>>>> account -> org.apache.tuscany.sdo.impl.DynamicDataObjectImpl@70a6aa31
>>>>>> (eClass: org.apache.tuscany.sdo.impl.ClassImpl@4defb0be (name: ACCOUNT)
>>>>>> (instanceClassName: null) (abstract: false, interface: false))
>>>>>>
>>>>>> Testrunner accountName -> TestNode1
>>>>>>
>>>>>>
>>>>>>
>>>>>> update account now...
>>>>>>
>>>>>> java.lang.NullPointerException
>>>>>>
>>>>>> at org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(
>>>>>>
>>>>>> ApplyChangesCommandImpl.java:58)
>>>>>>
>>>>>>
>>>>>> the call to:
>>>>>>
>>>>>> root.
>>>>>>
>>>>>> getDataGraph()
>>>>>>
>>>>>>
>>>>>>
>>>>>> is what's outputting: data graph -> null
>>>>>>
>>>>>>
>>>>>>
>>>>>> seems odd that the call works fine in the operation findOrganization,
>>>>>> but
>>>>>> it's null inside the testRunner
>>>>>>
>>>>>>
>>>>>>
>>>>>> thanks
>>>>>>
>>>>>>
>>>>>>
>>>>>> ----- Original Message ----
>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>> To: user@tuscany.apache.org
>>>>>> Sent: Tuesday, July 29, 2008 10:16:20 AM
>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>
>>>>>> It's exactly what you did for dataGraph, showing its internal
>>>>>> representation.
>>>>>> --
>>>>>> Jean Madson
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2008/7/29 Abraham Washington <ab...@yahoo.com>
>>>>>>>
>>>>>>> what do you mean by dump?
>>>>>>>
>>>>>>> ----- Original Message ----
>>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>>> To: user@tuscany.apache.org
>>>>>>> Sent: Tuesday, July 29, 2008 9:04:06 AM
>>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>>
>>>>>>> Can you dump "account"? So we can see what is inside it...
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Jean Madson
>>>>>>> http://bit-zen.blogspot.com/
>>>>>>> MSN: jeanmadson@gmail.com
>>>>>>> -----
>>>>>>> HI LI KO KEN TEN
>>>>>>> Be grass, don't eat grass
>>>>>>> "É preciso esvaziar a xícara para ver o fundo tal como ele é, caso
>>>>>>> contrário,
>>>>>>> o fundo parecerá turvo, e idéias precipitadas acerca do que seja o
>>>>>>> fundo límpido emergirão."
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 2008/7/29 Abraham Washington <ab...@yahoo.com>
>>>>>>>>
>>>>>>>> this is where it's failing:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> if (!root.equals(root.getDataGraph().getRootObject())) {
>>>>>>>>            throw new RuntimeException("'root' argument must be the
>>>>>>>> root
>>>>>>>> of the datagraph");
>>>>>>>>        }
>>>>>>>>
>>>>>>>>
>>>>>>>> in org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl at line 58
>>>>>>>> (looking at the source code).  i printed out the same thing and can
>>>>>>>> reproduce the problem.
>>>>>>>>
>>>>>>>> the problem is the call to root.getDataGraph() is returning null,
>>>>>>>> thus
>>>>>>>> the call to root.getDataGraph().getRootObject() throws the npe.
>>>>>>>>
>>>>>>>> when i make the call to find the organization, the dataGraph is null
>>>>>>>> as
>>>>>>>> well.  here's my call to findOrganization:
>>>>>>>>
>>>>>>>>
>>>>>>>> public
>>>>>>>>
>>>>>>>> DataObject findOrganization(String id) {
>>>>>>>>
>>>>>>>> DataObject root =
>>>>>>>>
>>>>>>>> null
>>>>>>>> ;
>>>>>>>>
>>>>>>>> InputStream in =
>>>>>>>>
>>>>>>>> getClass().getClassLoader().getResourceAsStream(
>>>>>>>>
>>>>>>>> "dasConfiguration.xml");
>>>>>>>>
>>>>>>>> DAS das = DAS.
>>>>>>>>
>>>>>>>> FACTORY.createDAS(in, getConnection());
>>>>>>>>
>>>>>>>> Command read = das.getCommand(
>>>>>>>>
>>>>>>>> "getAccountByID");
>>>>>>>>
>>>>>>>> read.setParameter(1, Integer.valueOf(id));
>>>>>>>>
>>>>>>>> root = read.executeQuery();
>>>>>>>>
>>>>>>>> DataObject account = root.getDataObject(
>>>>>>>>
>>>>>>>> "ACCOUNT[1]");
>>>>>>>>
>>>>>>>> System.
>>>>>>>>
>>>>>>>> out.println("account dataGraph -> " + account.getDataGraph());
>>>>>>>>
>>>>>>>> System.
>>>>>>>>
>>>>>>>> out.println("account dataObject -> " +
>>>>>>>> account.getDataGraph().getRootObject());
>>>>>>>>
>>>>>>>> return account;
>>>>>>>>
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Output:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> data graph -> null
>>>>>>>>
>>>>>>>>
>>>>>>>> then a npe this thrown on the call to:
>>>>>>>> System.out.println("account dataObject -> " +
>>>>>>>> account.getDataGraph().getRootObject());
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> why would the dataGraph be null ?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> thx abe
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ----- Original Message ----
>>>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>>>> To: user@tuscany.apache.org
>>>>>>>> Sent: Tuesday, July 29, 2008 7:31:18 AM
>>>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>>>
>>>>>>>> It throws NullPointerException.
>>>>>>>> Does the organizationService variable have a valid reference to the
>>>>>>>> service?
>>>>>>>> Try to test this.
>>>>>>>> You can try to do a dump from organizationService.
>>>>>>>> Perhaps, organizationService can't find an organization with that id,
>>>>>>>> thus, returning a null reference.
>>>>>>>> Check this too.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Jean Madson
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2008/7/28 Abraham Washington <ab...@yahoo.com>
>>>>>>>>>
>>>>>>>>> i put the call to das.applyChanges in a try/catch block which gives
>>>>>>>>> a
>>>>>>>>> little more info:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> java.lang.NullPointerException
>>>>>>>>>
>>>>>>>>> at org.apache.tuscany.das.rdb.impl.ApplyChangesCommandImpl.execute(
>>>>>>>>>
>>>>>>>>> ApplyChangesCommandImpl.java:58)
>>>>>>>>>
>>>>>>>>> at org.apache.tuscany.das.rdb.impl.DASImpl.applyChanges(
>>>>>>>>>
>>>>>>>>> DASImpl.java:310)
>>>>>>>>>
>>>>>>>>> at org.soa.services.OrganizationDataServiceImpl.updateOrganization(
>>>>>>>>>
>>>>>>>>> OrganizationDataServiceImpl.java:188)
>>>>>>>>>
>>>>>>>>> at org.soa.services.OrganizationServiceImpl.updateOrganization(
>>>>>>>>>
>>>>>>>>> OrganizationServiceImpl.java:60)
>>>>>>>>>
>>>>>>>>> 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:585)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.doInvoke(
>>>>>>>>>
>>>>>>>>> SpringInvoker.java:100)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.tuscany.sca.implementation.spring.SpringInvoker.invoke(
>>>>>>>>>
>>>>>>>>> SpringInvoker.java:116)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>
>>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>>
>>>>>>>>> at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(
>>>>>>>>>
>>>>>>>>> SCABindingInvoker.java:61)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>
>>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>
>>>>>>>>> JDKInvocationHandler.java:286)
>>>>>>>>>
>>>>>>>>> at
>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>
>>>>>>>>> JDKInvocationHandler.java:154)
>>>>>>>>>
>>>>>>>>> at $Proxy7.updateOrganization(Unknown Source)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> here's line 63 from my test runner:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> commonj.sdo.DataObject account =
>>>>>>>>> organizationService.getOrganization(organizationId
>>>>>>>>>
>>>>>>>>> );
>>>>>>>>>
>>>>>>>>> organizationService.updateOrganization(account);
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> line 63 is organizationService.updateOrganization(organizationId);
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> thx...hope this helps...all i'm doing is grabbing the org (just a
>>>>>>>>> simple find) in getOrganization, then passing that org to update.
>>>>>>>>> no
>>>>>>>>> changes are made.  maybe i'm not closing a connection ?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ----- Original Message ----
>>>>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>>>>> To: user@tuscany.apache.org
>>>>>>>>> Sent: Monday, July 28, 2008 4:37:34 PM
>>>>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>>>>
>>>>>>>>> OK, Abraham.
>>>>>>>>> It seems like an invalid reference object in line 63.
>>>>>>>>> What is there?
>>>>>>>>> Can you put here a numbered excerpt of the code around 63 line?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2008/7/28 Abraham Washington <ab...@yahoo.com>
>>>>>>>>>>
>>>>>>>>>> hi jean...that is the entire stack trace.  i'm running within
>>>>>>>>>> eclipse
>>>>>>>>>> and that's all that's given.  i'm using oracle if that helps.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> update account now...
>>>>>>>>>>
>>>>>>>>>> Exception in thread "main"
>>>>>>>>>>
>>>>>>>>>> java.lang.NullPointerException
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.copyFault(
>>>>>>>>>>
>>>>>>>>>> PassByValueInterceptor.java:125)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>>
>>>>>>>>>> PassByValueInterceptor.java:115)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(
>>>>>>>>>>
>>>>>>>>>> SCABindingInvoker.java:61)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>>
>>>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>>
>>>>>>>>>> JDKInvocationHandler.java:286)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>>
>>>>>>>>>> JDKInvocationHandler.java:154
>>>>>>>>>> )
>>>>>>>>>>
>>>>>>>>>> at $Proxy7.updateOrganization(Unknown Source)
>>>>>>>>>>
>>>>>>>>>> at helloworld.OrganizationServiceCompositeRunner.main(
>>>>>>>>>>
>>>>>>>>>> OrganizationServiceCompositeRunner.java:63)
>>>>>>>>>>
>>>>>>>>>> let me know if you need more info...abe
>>>>>>>>>>
>>>>>>>>>> ----- Original Message ----
>>>>>>>>>> From: Jean Madson <je...@gmail.com>
>>>>>>>>>> To: user@tuscany.apache.org
>>>>>>>>>> Sent: Monday, July 28, 2008 3:52:49 PM
>>>>>>>>>> Subject: Re: das npe in PassByValueInterceptor
>>>>>>>>>>
>>>>>>>>>> Can you put here all stack trace?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 2008/7/28 Abraham Washington <ab...@yahoo.com>
>>>>>>>>>>>
>>>>>>>>>>> hi,  i'm trying to get DAS to work for my service.  i'm able to
>>>>>>>>>>> query
>>>>>>>>>>> and get results back no problem.  below is my code for updating.
>>>>>>>>>>> if
>>>>>>>>>>> i take
>>>>>>>>>>> out the call to account.set(....), then the apply works (but there
>>>>>>>>>>> were no
>>>>>>>>>>> changes to the DataObject).  with the account.set(...) call, the
>>>>>>>>>>> exception
>>>>>>>>>>> is thrown.  ideas? thx abe
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Command read = das.getCommand(
>>>>>>>>>>>
>>>>>>>>>>> "getAccountByID");
>>>>>>>>>>>
>>>>>>>>>>> read.setParameter(1, Integer.valueOf(organizationId));
>>>>>>>>>>>
>>>>>>>>>>> root = read.executeQuery();
>>>>>>>>>>>
>>>>>>>>>>> DataObject account = root.getDataObject(
>>>>>>>>>>>
>>>>>>>>>>> "ACCOUNT[1]");
>>>>>>>>>>>
>>>>>>>>>>> System.
>>>>>>>>>>>
>>>>>>>>>>> out.println("accountName before change -> " +
>>>>>>>>>>> account.getString("ACCOUNT_NAME"));
>>>>>>>>>>>
>>>>>>>>>>> account.set(
>>>>>>>>>>>
>>>>>>>>>>> "ACCOUNT_NAME", "TestAccount");
>>>>>>>>>>>
>>>>>>>>>>> System.
>>>>>>>>>>>
>>>>>>>>>>> out.println("apply changes...");
>>>>>>>>>>>
>>>>>>>>>>> das.applyChanges(root);
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> apply changes...
>>>>>>>>>>>
>>>>>>>>>>> Exception in thread "main"
>>>>>>>>>>>
>>>>>>>>>>> java.lang.NullPointerException
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.copyFault(
>>>>>>>>>>>
>>>>>>>>>>> PassByValueInterceptor.java:125)
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>>>
>>>>>>>>>>> PassByValueInterceptor.java:115)
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>> org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(
>>>>>>>>>>>
>>>>>>>>>>> SCABindingInvoker.java:61)
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> org.apache.tuscany.sca.core.databinding.wire.PassByValueInterceptor.invoke(
>>>>>>>>>>>
>>>>>>>>>>> PassByValueInterceptor.java:108)
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>>>
>>>>>>>>>>> JDKInvocationHandler.java:286)
>>>>>>>>>>>
>>>>>>>>>>> at
>>>>>>>>>>>
>>>>>>>>>>> org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(
>>>>>>>>>>>
>>>>>>>>>>> JDKInvocationHandler.java:154)
>>>>>>>>>>>
>>>>>>>>>>> at $Proxy7.updateOrganization(Unknown Source)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Luciano Resende
>>>> Apache Tuscany Committer
>>>> http://people.apache.org/~lresende
>>>> http://lresende.blogspot.com/
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Luciano Resende
>>> Apache Tuscany Committer
>>> http://people.apache.org/~lresende
>>> http://lresende.blogspot.com/
>>>
>>>
>>
>>
>>
>> --
>> Luciano Resende
>> Apache Tuscany Committer
>> http://people.apache.org/~lresende
>> http://lresende.blogspot.com/
>>
>>
>
>
>
> --
> Luciano Resende
> Apache Tuscany Committer
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/