Are you sure that

> InputStream in =
>
> getClass().getClassLoader().getResourceAsStream(
> "dasConfiguration.xml");
>

is really loading the XML file?
It's a common point on null references.

And what about schemaInfo?  I couldn't see its declaration and
initialization.

-- 
Jean Madson




2008/7/29 Abraham Washington <[EMAIL PROTECTED]>

> i don't think the problem lies with my test runner.  it works fine using
> spring/hibernate. i'd prefer to use das, so i'm trying to get it to work.
> my test runner is:
>
>
>
> commonj.sdo.DataObject account = organizationService.getOrganization(
> organizationId
> );
>
> System.
> *out*.println("Testrunner accountName -> " + account.*getString*(
> "ACCOUNT_NAME"));
>
> organizationService.updateOrganization(account);
>
>
>
>
>
>
>
>
>
> Testrunner accountName -> TestNode1
>
>
>
> update account now...
> *
>
> 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.dcri.soa.services.OrganizationDataServiceImpl.updateOrganization(
> *OrganizationDataServiceImpl.java:235*)
>
> at org.dcri.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 the updateOrganization method:
>
>
> *
>
> public
> * *void* updateOrganization(commonj.sdo.DataObject organization) {
>
> System.
> *out*.println("\n\nupdate account now...");
>
> InputStream in =
>
> getClass().getClassLoader().getResourceAsStream(
> "dasConfiguration.xml");
>
> DAS das = DAS.
> *FACTORY*.createDAS(in, getConnection(schemaInfo));
>
> *try* {
>
> das.applyChanges(organization);
>
> }
>
> *catch* (Exception e) {
>
> e.printStackTrace();
>
> }
>
> }
>
>
>
> line 235 of OrganizationDataServiceImpl.java is:
> das.applyChanges(organization);
>
> the reference to the organizationService seems fine and it's returning a
> valid DataObject.  not sure where else to look.  there are no modifications
> to the DataObject, so i must be doing something wrong in my implementation,
> just not sure what...
>
>
>
>
>
> ----- Original Message ----
> From: Jean Madson <[EMAIL PROTECTED]>
> To: [email protected]
> 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 <[EMAIL PROTECTED]>
>
>>  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 <[EMAIL PROTECTED]>
>> To: [email protected]
>>  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 <[EMAIL PROTECTED]>
>>
>>>  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 <[EMAIL PROTECTED]>
>>> To: [email protected]
>>> 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 <[EMAIL PROTECTED]>
>>>
>>>>  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)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>>
>
>
>

Reply via email to