You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by kelvin goodson <ke...@gmail.com> on 2007/07/02 18:54:21 UTC

Re: DataObject with contained DataGraph causes NullPointerException in ChangePackage$Literals

Hi Erich,

I generated code from your schema and tried the following lines of code,
which executed without failure ...


*public* *void* testErichsProblem() *throws* Exception {

  PublicationDataGraph pdg =
ServicesFactory.*INSTANCE*.createPublicationDataGraph();

  DataObject dob = (DataObject)pdg;
  ChangeSummary cs = dob.getChangeSummary();
  cs.beginLogging();
}

does this represent a distilled version of your scenario?

Regards,Kelvin
On 29/06/07, Erich Rueede <er...@yahoo.com> wrote:
>
> Hi
>
> I am testing with the SDO beta-1 code.
>
> I generated static SDO classes with an embedded
> datagraph by extending the BaseDataGraphType
> as described in the SDO 2.1 spec using the following
> XSD:
>
> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
>        targetNamespace="http://abc.com/services"
>        xmlns:tns="http://abc.com/services"
>        xmlns:sdo="commonj.sdo"
> xmlns:sdoJava="commonj.sdo/java"
> xmlns:sdoXml="commonj.sdo/xml"
>        sdoJava:package="com.abc.services"
>        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>
>        <xsd:complexType name="PublicationDataGraph">
>                <complexContent>
>                        <extension base="sdo:BaseDataGraphType">
>                                <xsd:sequence>
>                                                <xsd:element name="test"
> type="xsd:string" />
>                                </xsd:sequence>
>                        </extension>
>                </complexContent>
>        </xsd:complexType>
>
>        <xsd:complexType name="ModifyPublicationInput"
>                <xsd:sequence>
>                        <xsd:element name="PublicationDataGraph"
> type="tns:PublicationDataGraph" />
>                </xsd:sequence>
>        </xsd:complexType>
> </xsd:schema>
>
>
> After I instantiated the top level DataObject
> (ModifyPubicationInput) containing the embedded
> Datagraph,
> I tried to beginLogging which causes the following
> exception in
> org.eclipse.emf.ecore.change.ChangePackage$Literals.<clinit>(
> ChangePackage.java:903).
>
> The same exception also happens when I try to
> serialize the toplevel DataObject to XML or when I try
> to
> send it via RMI/IIOP to an EJB.
>
>
> [6/29/07 11:32:31:898 CEST] 7dec7dec WebGroup      E
> SRVE0026E: [Servlet Error]-[]:
> java.lang.ExceptionInInitializerError
>        at java.lang.Class.initialize(Class.java:345)
>        at
> org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl.getObjectChanges(
> ChangeDescriptionImpl.java:141)
>        at
> org.apache.tuscany.sdo.impl.ChangeSummaryImpl.beginLogging(
> ChangeSummaryImpl.java:190)
>        at
> com.abc.servlet.TestServlet.doPost(TestServlet.java:156)
>        at
> com.abc.servlet.TestServlet.doGet(TestServlet.java:127)
>        at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>        at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
> com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(
> StrictServletInstance.java:110)
>        at
> com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(
> StrictLifecycleServlet.java:174)
>        at
> com.ibm.ws.webcontainer.servlet.IdleServletState.service(
> StrictLifecycleServlet.java:313)
>        at
> com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(
> StrictLifecycleServlet.java:116)
>        at
> com.ibm.ws.webcontainer.servlet.ServletInstance.service(
> ServletInstance.java:283)
>        at
> com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(
> ValidServletReferenceState.java:42)
>        at
> com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(
> ServletInstanceReference.java:40)
>        at
>
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch
> (WebAppRequestDispatcher.java:1018)
>        at
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(
> WebAppRequestDispatcher.java:529)
>        at
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(
> WebAppRequestDispatcher.java:208)
>        at
> com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java
> :134)
>        at
> com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(
> WebAppInvoker.java:321)
>        at
> com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation
> (CachedInvocation.java:71)
>        at
> com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(
> ServletRequestProcessor.java:246)
>        at
> com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(
> OSEListener.java:334)
>        at
> com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(
> HttpConnection.java:56)
>        at
> com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java
> :652)
>        at
> com.ibm.ws.http.HttpConnection.run(HttpConnection.java:448)
>        at
> com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:937)
> Caused by: java.lang.NullPointerException
>        at
> org.eclipse.emf.ecore.change.ChangePackage$Literals.<clinit>(
> ChangePackage.java:903)
>        at java.lang.Class.initializeImpl(Native Method)
>        at java.lang.Class.initialize(Class.java:339)
>        at
> org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl.getObjectChanges(
> ChangeDescriptionImpl.java:141)
>        at
> org.apache.tuscany.sdo.impl.ChangeSummaryImpl.beginLogging(
> ChangeSummaryImpl.java:190)
>
>
> Hope you can help me with some hints.
>
> Thanks Erich
>
>
>
> ____________________________________________________________________________________
> Luggage? GPS? Comic books?
> Check out fitting gifts for grads at Yahoo! Search
> http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>

Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by kelvin goodson <ke...@gmail.com>.
There's a sample that shows the two approaches at [1].  This sample has
changed a lot since the beta1 release,  so I include the output of the
sample below in case its not so easy for you to build from the trunk.

Kelvin

[1]
http://svn.apache.org/repos/asf/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/ObtainingDataGraphFromXml.java


-----------------------------------------------------------------------------------------------------
-     Tuscany SDO Java Sample
org.apache.tuscany.samples.sdo.advanced.ObtainingDataGraphFromXml     -
-     This sample is aimed at a advanced
user                                                       -
-----------------------------------------------------------------------------------------------------

**********************************************************************************************************
* SDO Sample
org.apache.tuscany.samples.sdo.advanced.ObtainingDataGraphFromXml
*
*
*
* This sample touches an area of the SDO API where the emphasis has changed
over the various             *
* version of the specification,  and so it's important to be clear what's
going on                       *
* First off lets be sure of our terminology
...                                                          *
* 1) A "data graph" is a just collection of DataObjects, all contained
within a single                   *
* containment hierarchy, with a single root object, and possibly having some
non-containment             *
*
references
*
* 2) A "DataGraph" is an instance of the SDO DataGraph class, used as a
container for the root           *
* DataObject of a data graph, and providing a means to access a change
summary for the data graph.       *
*
*
* More recent versions of the SDO specification have provided alternative
means of containment           *
* of a data graph
...
*
* 3) The graph can be contained in a DataObject of a built-in SDO Type  with
namespace URI "commonj.sdo" *
* and name "DataGraph":  so this is a modeled version of the special
DataGraph class.                    *
* 4) The Graph can be contained in an XMLDocument instance,  which provides
for things such as           *
* naming the root element of an XML instance
document                                                    *
**********************************************************************************************************

----------------------------------------------------------------------------------------------------
- Here we see the specification's example for obtaining dealing
with                               -
- loading a data graph which uses a method, XMLHelper.load().  This loads an
XML instance document -
- into an instance of XMLDocument
...                                                              -
-
-
- XMLDocument doc = scope.getXMLHelper().load(
-
- ClassLoader.getSystemResourceAsStream(
SdoSampleConstants.COMPANY_DATAGRAPH_XML));                -
----------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<!--
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 -->

<sdo:datagraph xmlns:company="company.xsd" xmlns:sdo="commonj.sdo">
  <company:company employeeOfTheMonth="E0002"
      name="ACME">
    <departments location="NY" name="Advanced Technologies" number="123">
      <employees name="John Jones" SN="E0001"/>
      <employees name="Jane Doe" SN="E0003"/>
      <employees manager="true" name="Al Smith" SN="E0004"/>
    </departments>
  </company:company>
</sdo:datagraph>

---------------------------------------------------------------------------------------------------
- Now we can get the wrapper for the data graph, which in this case is the
DataObject             -
- of type commonj.sdo#DataGraph.  Note how there's no magic here;  no
special class for           -
- DataGraph,  no special handling,  this is just a standard pattern of using
a built in SDO Type. -
- The wrapper is there purely because it was
serialized                                           -
- into the XML document, using the standard serialization
technique.                              -
-
-
- DataObject dataObjectRepresentingDataGraph = doc.getRootObject();
-
---------------------------------------------------------------------------------------------------

org.apache.tuscany.sdo.model.impl.DataGraphTypeImpl@6ade6ade (changeSummary:
org.apache.tuscany.sdo.impl.ChangeSummaryImpl@21042104, anyAttribute: null)
(any: [company:company=
org.apache.tuscany.sdo.impl.DynamicDataObjectImpl@a660a66 (eClass:
org.apache.tuscany.sdo.impl.ClassImpl@4ea24ea2 (name: CompanyType)
(instanceClassName: null) (abstract: false, interface: false))])
-----------------------------------------------------------------------------------------------
- If you are confused by the fact that what we really get is an instance of
DataGraphTypeImpl -
- This really is a DataObject,  but it is a generated class extending
DataObjectImpl          -
- +representing the DataGraph
model.                                                          -
-----------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------
- We've obtained a DataObject representing the data graph, and from that we
have obtained -
- the true root object of the business
data                                               -
-------------------------------------------------------------------------------------------

org.apache.tuscany.sdo.impl.DynamicDataObjectImpl@a660a66 (eClass:
org.apache.tuscany.sdo.impl.ClassImpl@4ea24ea2 (name: CompanyType)
(instanceClassName: null) (abstract: false, interface: false))

---------------------------------------------------------------------------------------------------------
- Using an instance of DataGraph can perhaps be seen as an older style
pattern of wrapping a data graph -
- and the first approach is likely to get more emphaissi and attention in
future revisions of the spec. -
- The SDO API has some limitations in the area of saving and loading
instances of the                   -
- Java DataGraph type, so Tuscany has an API for doing this
...                                         -
-
-
- DataGraph datagraph = SDOUtil.loadDataGraph(
-
-       ClassLoader.getSystemResourceAsStream(
SdoSampleConstants.COMPANY_DATAGRAPH_XML), null);         -
---------------------------------------------------------------------------------------------------------

org.apache.tuscany.sdo.impl.DataGraphImpl@23b023b0 (resourceSet:
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl@2e842e84 resources=[
org.apache.tuscany.sdo.util.DataGraphResourceFactoryImpl$DataGraphResourceImpl@2f4e2f4euri='
all.datagraph',
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl@27c827c8 uri='
root.xml'])
---------------------------------------------------------------------------------------
- In this case we directly receive an instance of DataGraph and can retrieve
the root -
- business object from the
DataGraph                                                  -
-
-
- DataObject company = datagraph.getRootObject();
-
---------------------------------------------------------------------------------------

org.apache.tuscany.sdo.impl.DynamicDataObjectImpl@24642464 (eClass:
org.apache.tuscany.sdo.impl.ClassImpl@4ea24ea2 (name: CompanyType)
(instanceClassName: null) (abstract: false, interface: false))

-------------------------------------------------------------------------------------------
-     End of sample
org.apache.tuscany.samples.sdo.advanced.ObtainingDataGraphFromXml     -
-------------------------------------------------------------------------------------------





On 06/07/07, Frank Budinsky <fr...@ca.ibm.com> wrote:
>
> Hi Erich,
>
> This sounds like a little fishy to me, since it looks like you are
> serializing your specialized DataGraph inside another DataGraph. The SDO
> spec says that you can't nest change summaries, which could be the
> problem. Note that in SDO 2.1, commonj.sdo.DataGraph and a DataObject-type
> DataGraph are two alternative ways of creating a graph of dataobjects.This
> is something that we'd like to clean up in SDO3. I think tere may be a
> Tuscany sample that explains the two approaches: is that right Kelvin?
>
> For your specialized DataObject-type MyDataGraph you should just
> serialize it using XMLHelper.save(). You shouldn't use a
> commonj.sdo.DataGraph in this case. This may be the problem, but then
> again, there may also be a bug. You say below, that you attached a test
> case, but I don't see any attachments?
>
> Thanks,
> Frank.
>
> Erich Rueede <er...@yahoo.com> wrote on 07/06/2007 10:21:26 AM:
>
> > Hi all
> >
> > I have created an XML Schema with a toplevel
> > dataobject and a contained datagraph as specified in
> > the webservice sample part of the SDO 2.1 spec (page
> > 132).
> >
> > I then generated static SDO code from the XML schema
> > which resulted in implementations for the toplevel
> > dataobject and the contained datagraph.
> >
> > The generated code for the static datagraph somehow
> > differs quite a lot from the dynamic programming model
> > using the commonj.sdo.DataGraph.
> >
> > When I turn on logging on the generated static
> > datagraph, I notice that no changes are getting
> > recorded. It contains a partial change summary without
> > any changes:
> >
> > <?xml version="1.0" encoding="ASCII"?>
> > <datagraph
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:tns="http://abc.com/services"
> > xsi:type="tns:MyDataGraph">
> >   <changeSummary logging="true" />
> >   <NestedType>
> >     <test1>test1_modified</test1>
> >     <test2>test2_modified</test2>
> >   </NestedType>
> > </datagraph>
> >
> > Using the dynamic programming model, it contains a
> > full change summary with recorded changes:
> >
> > <?xml version="1.0" encoding="ASCII"?>
> > <sdo:datagraph
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:sdo="commonj.sdo"
> >
> > xmlns:sdo_1="http://www.apache.org/tuscany/2005/SDO"
> > xmlns:tns="http://abc.com/services">
> >   <changeSummary xmlns=""
> >       logging="true">
> >     <objectChanges key="#//@eRootObject">
> >       <value xsi:type="sdo_1:ChangeSummarySetting"
> > featureName="test2" dataValue="test2"/>
> >       <value xsi:type="sdo_1:ChangeSummarySetting"
> > featureName="test1" dataValue="test1"/>
> >     </objectChanges>
> >   </changeSummary>
> >   <tns:NestedType>
> >     <test1>test1_modified</test1>
> >     <test2>test2_modified</test2>
> >   </tns:NestedType>
> > </sdo:datagraph>
> >
> > Is the static approach of modelling a datagraph within
> > an XSD basically supported with the current TUSCANY
> > implementation?
> >
> > I attached a sample XSD and test implementation.
> >
> > Thanks
> > Erich
> >
> >
> >
> >
> >
>
> ____________________________________________________________________________________
> > Choose the right car based on your needs.  Check out Yahoo! Autos
> > new Car Finder tool.
> > http://autos.yahoo.com/carfinder/
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>

Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Hi Erich,

It should be fixed now 
(https://issues.apache.org/jira/browse/TUSCANY-1430). 

Please let me know if it's working for you.

Thanks,
Frank.




Erich Rueede <er...@yahoo.com> 
07/11/2007 10:58 AM
Please respond to
tuscany-user@ws.apache.org


To
tuscany-user@ws.apache.org
cc

Subject
Re: static DataObject with contained static DataGraph doesn't record 
changes in summary






Hi Frank

I would like to go down the path of the modelled
graph.  I am happy to test this path and help you
identify upcoming bugs.

Please let me know when the current bugs are fixed and
the SVN head is ready to take another snapshot.

Thanks
Erich
--- Frank Budinsky <fr...@ca.ibm.com> wrote:

> Hi Erich,
> 
> You're sample should work. It shouldn't take long to
> fix the bug that's 
> causing it to fail, but unfortunately I've been tied
> up with other things 
> for the last couple of days. I'll try to check in
> the fix by tomorrow. By 
> the way, the reason it's behaving differently in the
> current SVN Head vs 
> the last release is because there was another
> similar bug (related to 
> hiding EMF internal properties) which we fixed since
> the last release, and 
> now it's breaking with the change summary bug I
> mentioned below.
> 
> As far as using the "modeled datagraph" approach
> instead of a dynamic 
> DataGraph for your client application, I would say
> that either should work 
> fine, but using the static (modeled) DataGraph will
> likely turn up more 
> bugs, since it's new (not very well tested) code.
> The dynamic DataGraph, 
> has been around and used for a while so using it
> would probably go more 
> smoothly, but that approach requires you to use
> non-standard (Tuscany 
> SDOUtil) APIs, since the SDO 2.1 spec hasn't defined
> the DataGraph 
> creation and some other DataGraph-related APIs yet. 
> 
> We do want to get the bugs out of the new stuff, so
> if you go that route, 
> we will appreciate the help with testing it, and
> will try to fix problems 
> that you uncover as quickly as possible.
> 
> Thanks,
> Frank.
> 
> Erich Rueede <er...@yahoo.com> wrote on 07/11/2007
> 05:36:43 AM:
> 
> > Hi Frank and Kelvin
> > 
> > saying this, I am still unsure whether Tuscany SDO
> > will support the static approach as outline in the
> > previously documented sample (modelling the
> datagraph
> > with XSD and then generate static code).
> > 
> > If it does support the static approach, how long
> will
> > it take to fix the current bugs? I need to decide
> > whether a client project can build upon this
> > approach..
> > 
> > Thanks for your help
> > Erich
> > 
> > 
> > --- Frank Budinsky <fr...@ca.ibm.com> wrote:
> > 
> > > Hi Kelvin and Erich,
> > > 
> > > I just debugged through this, and it's
> definitely a
> > > bug in the change 
> > > summary code. It's another one in the line of
> bugs
> > > we've been finding 
> > > related to the change we made when we separated
> SDO
> > > user properties from 
> > > the internal EMF ones. It's another example of
> where
> > > the wrong index (SDO 
> > > property index) is being used when it should be
> the
> > > internal EMF feature 
> > > index. I'll look at it a little more tomorrow to
> > > figure out what the 
> > > cleanest fix is.
> > > 
> > > Frank.
> > > 
> > > 
> > > 
> > > 
> > > Erich Rueede <er...@yahoo.com> 
> > > 07/09/2007 08:45 AM
> > > Please respond to
> > > tuscany-user@ws.apache.org
> > > 
> > > 
> > > To
> > > tuscany-user@ws.apache.org,
> > > kelvin@thegoodsons.org.uk
> > > cc
> > > 
> > > Subject
> > > Re: static DataObject with contained static
> > > DataGraph doesn't record 
> > > changes in summary
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Hi Kelvin
> > > 
> > > I did not get the exception you mentioned. I
> guess
> > > this might be due to different versions of the
> > > SDO/EMF
> > > implementation we are using.
> > > 
> > > Regards,
> > > Erich
> > > --- kelvin goodson <ke...@gmail.com>
> wrote:
> > > 
> > > > Hi Erich,
> > > >    I'm looking at this but currently I am
> getting
> > > an
> > > > exception generated
> > > > here ...
> > > > 
> > > >     saveGraph(staticGraph);
> > > > 
> > > > I'll investigate why this might be.  Have you
> seen
> > > > anything like this?  I
> > > > noticed I had to do some changes to your code
> to
> > > > make it compile,  which
> > > > implies you are using some generator options.
> For
> > > > completeness, can you let
> > > > me know what generator options you are using.
> > > > 
> > > > Regards, Kelvin.
> > > > 
> > > > **************** static graph
> > > **********************
> > > > 
> > > > Exception in thread "main"
> > > > java.lang.IllegalStateException: The
> containment
> > > > feature could not be located
> > > >     at
> > > >
> > >
> >
>
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> > > > BasicEObjectImpl.java:475)
> > > >     at
> > > >
> > >
> >
>
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> > > > BasicEObjectImpl.java:439)
> > > >     at
> > > >
> > >
> >
>
org.apache.tuscany.sdo.impl.DataObjectImpl.getContainmentProperty(
> > > > DataObjectImpl.java:182)
> > > >     at
> > > >
> > >
> >
>
org.apache.tuscany.sdo.util.resource.ChangeSummaryStreamSerializer.
> > saveChangeSummary
> > > > (ChangeSummaryStreamSerializer.java:609)
> > > >     at
> > > >
> > >
> > org.apache.tuscany.sdo.util.resource.
> >
> SDOXMLResourceImpl$SDOXMLSaveImpl.saveChangeSummary
> > > > (SDOXMLResourceImpl.java:806)
> > > >     at
> > > >
> > >
> > org.apache.tuscany.sdo.util.resource.
> >
>
SDOXMLResourceImpl$SDOXMLSaveImpl.saveDataTypeElementSingle
> > > > (SDOXMLResourceImpl.java:816)
> > > >     at
> > > >
> > >
> >
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
> > > > XMLSaveImpl.java:1370)
> > > >     at
> > > >
> 
=== message truncated ===



 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html

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




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


Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by Erich Rueede <er...@yahoo.com>.
Hi Frank

I would like to go down the path of the modelled
graph.  I am happy to test this path and help you
identify upcoming bugs.

Please let me know when the current bugs are fixed and
the SVN head is ready to take another snapshot.

Thanks
Erich
--- Frank Budinsky <fr...@ca.ibm.com> wrote:

> Hi Erich,
> 
> You're sample should work. It shouldn't take long to
> fix the bug that's 
> causing it to fail, but unfortunately I've been tied
> up with other things 
> for the last couple of days. I'll try to check in
> the fix by tomorrow. By 
> the way, the reason it's behaving differently in the
> current SVN Head vs 
> the last release is because there was another
> similar bug (related to 
> hiding EMF internal properties) which we fixed since
> the last release, and 
> now it's breaking with the change summary bug I
> mentioned below.
> 
> As far as using the "modeled datagraph" approach
> instead of a dynamic 
> DataGraph for your client application, I would say
> that either should work 
> fine, but using the static (modeled) DataGraph will
> likely turn up more 
> bugs, since it's new (not very well tested) code.
> The dynamic DataGraph, 
> has been around and used for a while so using it
> would probably go more 
> smoothly, but that approach requires you to use
> non-standard (Tuscany 
> SDOUtil) APIs, since the SDO 2.1 spec hasn't defined
> the DataGraph 
> creation and some other DataGraph-related APIs yet. 
> 
> We do want to get the bugs out of the new stuff, so
> if you go that route, 
> we will appreciate the help with testing it, and
> will try to fix problems 
> that you uncover as quickly as possible.
> 
> Thanks,
> Frank.
> 
> Erich Rueede <er...@yahoo.com> wrote on 07/11/2007
> 05:36:43 AM:
> 
> > Hi Frank and Kelvin
> > 
> > saying this, I am still unsure whether Tuscany SDO
> > will support the static approach as outline in the
> > previously documented sample (modelling the
> datagraph
> > with XSD and then generate static code).
> > 
> > If it does support the static approach, how long
> will
> > it take to fix the current bugs? I need to decide
> > whether a client project can build upon this
> > approach..
> > 
> > Thanks for your help
> > Erich
> > 
> > 
> > --- Frank Budinsky <fr...@ca.ibm.com> wrote:
> > 
> > > Hi Kelvin and Erich,
> > > 
> > > I just debugged through this, and it's
> definitely a
> > > bug in the change 
> > > summary code. It's another one in the line of
> bugs
> > > we've been finding 
> > > related to the change we made when we separated
> SDO
> > > user properties from 
> > > the internal EMF ones. It's another example of
> where
> > > the wrong index (SDO 
> > > property index) is being used when it should be
> the
> > > internal EMF feature 
> > > index. I'll look at it a little more tomorrow to
> > > figure out what the 
> > > cleanest fix is.
> > > 
> > > Frank.
> > > 
> > > 
> > > 
> > > 
> > > Erich Rueede <er...@yahoo.com> 
> > > 07/09/2007 08:45 AM
> > > Please respond to
> > > tuscany-user@ws.apache.org
> > > 
> > > 
> > > To
> > > tuscany-user@ws.apache.org,
> > > kelvin@thegoodsons.org.uk
> > > cc
> > > 
> > > Subject
> > > Re: static DataObject with contained static
> > > DataGraph doesn't record 
> > > changes in summary
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Hi Kelvin
> > > 
> > > I did not get the exception you mentioned. I
> guess
> > > this might be due to different versions of the
> > > SDO/EMF
> > > implementation we are using.
> > > 
> > > Regards,
> > > Erich
> > > --- kelvin goodson <ke...@gmail.com>
> wrote:
> > > 
> > > > Hi Erich,
> > > >    I'm looking at this but currently I am
> getting
> > > an
> > > > exception generated
> > > > here ...
> > > > 
> > > >     saveGraph(staticGraph);
> > > > 
> > > > I'll investigate why this might be.  Have you
> seen
> > > > anything like this?  I
> > > > noticed I had to do some changes to your code
> to
> > > > make it compile,  which
> > > > implies you are using some generator options.
> For
> > > > completeness, can you let
> > > > me know what generator options you are using.
> > > > 
> > > > Regards, Kelvin.
> > > > 
> > > > **************** static graph
> > > **********************
> > > > 
> > > > Exception in thread "main"
> > > > java.lang.IllegalStateException: The
> containment
> > > > feature could not be located
> > > >     at
> > > >
> > >
> >
>
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> > > > BasicEObjectImpl.java:475)
> > > >     at
> > > >
> > >
> >
>
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> > > > BasicEObjectImpl.java:439)
> > > >     at
> > > >
> > >
> >
>
org.apache.tuscany.sdo.impl.DataObjectImpl.getContainmentProperty(
> > > > DataObjectImpl.java:182)
> > > >     at
> > > >
> > >
> >
>
org.apache.tuscany.sdo.util.resource.ChangeSummaryStreamSerializer.
> > saveChangeSummary
> > > > (ChangeSummaryStreamSerializer.java:609)
> > > >     at
> > > >
> > >
> > org.apache.tuscany.sdo.util.resource.
> >
> SDOXMLResourceImpl$SDOXMLSaveImpl.saveChangeSummary
> > > > (SDOXMLResourceImpl.java:806)
> > > >     at
> > > >
> > >
> > org.apache.tuscany.sdo.util.resource.
> >
>
SDOXMLResourceImpl$SDOXMLSaveImpl.saveDataTypeElementSingle
> > > > (SDOXMLResourceImpl.java:816)
> > > >     at
> > > >
> > >
> >
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
> > > > XMLSaveImpl.java:1370)
> > > >     at
> > > >
> 
=== message truncated ===



 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html

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


Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Hi Erich,

You're sample should work. It shouldn't take long to fix the bug that's 
causing it to fail, but unfortunately I've been tied up with other things 
for the last couple of days. I'll try to check in the fix by tomorrow. By 
the way, the reason it's behaving differently in the current SVN Head vs 
the last release is because there was another similar bug (related to 
hiding EMF internal properties) which we fixed since the last release, and 
now it's breaking with the change summary bug I mentioned below.

As far as using the "modeled datagraph" approach instead of a dynamic 
DataGraph for your client application, I would say that either should work 
fine, but using the static (modeled) DataGraph will likely turn up more 
bugs, since it's new (not very well tested) code. The dynamic DataGraph, 
has been around and used for a while so using it would probably go more 
smoothly, but that approach requires you to use non-standard (Tuscany 
SDOUtil) APIs, since the SDO 2.1 spec hasn't defined the DataGraph 
creation and some other DataGraph-related APIs yet. 

We do want to get the bugs out of the new stuff, so if you go that route, 
we will appreciate the help with testing it, and will try to fix problems 
that you uncover as quickly as possible.

Thanks,
Frank.

Erich Rueede <er...@yahoo.com> wrote on 07/11/2007 05:36:43 AM:

> Hi Frank and Kelvin
> 
> saying this, I am still unsure whether Tuscany SDO
> will support the static approach as outline in the
> previously documented sample (modelling the datagraph
> with XSD and then generate static code).
> 
> If it does support the static approach, how long will
> it take to fix the current bugs? I need to decide
> whether a client project can build upon this
> approach..
> 
> Thanks for your help
> Erich
> 
> 
> --- Frank Budinsky <fr...@ca.ibm.com> wrote:
> 
> > Hi Kelvin and Erich,
> > 
> > I just debugged through this, and it's definitely a
> > bug in the change 
> > summary code. It's another one in the line of bugs
> > we've been finding 
> > related to the change we made when we separated SDO
> > user properties from 
> > the internal EMF ones. It's another example of where
> > the wrong index (SDO 
> > property index) is being used when it should be the
> > internal EMF feature 
> > index. I'll look at it a little more tomorrow to
> > figure out what the 
> > cleanest fix is.
> > 
> > Frank.
> > 
> > 
> > 
> > 
> > Erich Rueede <er...@yahoo.com> 
> > 07/09/2007 08:45 AM
> > Please respond to
> > tuscany-user@ws.apache.org
> > 
> > 
> > To
> > tuscany-user@ws.apache.org,
> > kelvin@thegoodsons.org.uk
> > cc
> > 
> > Subject
> > Re: static DataObject with contained static
> > DataGraph doesn't record 
> > changes in summary
> > 
> > 
> > 
> > 
> > 
> > 
> > Hi Kelvin
> > 
> > I did not get the exception you mentioned. I guess
> > this might be due to different versions of the
> > SDO/EMF
> > implementation we are using.
> > 
> > Regards,
> > Erich
> > --- kelvin goodson <ke...@gmail.com> wrote:
> > 
> > > Hi Erich,
> > >    I'm looking at this but currently I am getting
> > an
> > > exception generated
> > > here ...
> > > 
> > >     saveGraph(staticGraph);
> > > 
> > > I'll investigate why this might be.  Have you seen
> > > anything like this?  I
> > > noticed I had to do some changes to your code to
> > > make it compile,  which
> > > implies you are using some generator options. For
> > > completeness, can you let
> > > me know what generator options you are using.
> > > 
> > > Regards, Kelvin.
> > > 
> > > **************** static graph
> > **********************
> > > 
> > > Exception in thread "main"
> > > java.lang.IllegalStateException: The containment
> > > feature could not be located
> > >     at
> > >
> >
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> > > BasicEObjectImpl.java:475)
> > >     at
> > >
> >
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> > > BasicEObjectImpl.java:439)
> > >     at
> > >
> >
> org.apache.tuscany.sdo.impl.DataObjectImpl.getContainmentProperty(
> > > DataObjectImpl.java:182)
> > >     at
> > >
> >
> org.apache.tuscany.sdo.util.resource.ChangeSummaryStreamSerializer.
> saveChangeSummary
> > > (ChangeSummaryStreamSerializer.java:609)
> > >     at
> > >
> >
> org.apache.tuscany.sdo.util.resource.
> SDOXMLResourceImpl$SDOXMLSaveImpl.saveChangeSummary
> > > (SDOXMLResourceImpl.java:806)
> > >     at
> > >
> >
> org.apache.tuscany.sdo.util.resource.
> SDOXMLResourceImpl$SDOXMLSaveImpl.saveDataTypeElementSingle
> > > (SDOXMLResourceImpl.java:816)
> > >     at
> > >
> >
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
> > > XMLSaveImpl.java:1370)
> > >     at
> > >
> >
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(
> > > XMLSaveImpl.java:2462)
> > >     at
> > >
> >
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(
> > > XMLSaveImpl.java:1036)
> > >     at
> > >
> >
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(
> > > XMLSaveImpl.java:922)
> > >     at
> > >
> >
> org.apache.tuscany.sdo.util.resource.
> SDOXMLResourceImpl$SDOXMLSaveImpl.saveElementFeatureMap
> > > (SDOXMLResourceImpl.java:844)
> > >     at
> > >
> >
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
> > > XMLSaveImpl.java:1355)
> > >     at
> > >
> >
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(
> > > XMLSaveImpl.java:627)
> > >     at
> > >
> >
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java
> > > :552)
> > >     at
> > >
> >
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:233)
> > >     at
> > >
> >
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(
> > > XMLResourceImpl.java:203)
> > >     at
> > >
> >
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(
> > > ResourceImpl.java:993)
> > >     at
> > >
> > org.apache.tuscany.sdo.helper.XMLDocumentImpl.save(
> > > XMLDocumentImpl.java:205)
> > >     at
> > >
> > org.apache.tuscany.sdo.helper.XMLDocumentImpl.save(
> > > XMLDocumentImpl.java:159)
> > >     at
> > >
> >
> org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java
> > > :139)
> > >     at
> > >
> >
> org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java
> > > :134)
> > >     at
> > >
> >
> t_user.erich_rueede.DgExtended.saveGraph(DgExtended.java:69)
> > >     at
> > >
> >
> t_user.erich_rueede.DgExtended.main(DgExtended.java:42)
> > > 
> > > 
> > > 
> > > On 07/07/07, Erich Rueede <er...@yahoo.com>
> > wrote:
> > > >
> > > > Hi Frank and Kelvin
> > > >
> > > > since I don't know how to make attachments work
> > > for
> > > > the mailing list, here's a text copy of its
> > > content:
> > > >
> > > > The XSD:
> > > > ========
> > > > <xsd:schema
> > > xmlns="http://www.w3.org/2001/XMLSchema"
> > > > 
> > targetNamespace="http://abc.com/services"
> > > >         xmlns:tns="http://abc.com/services"
> > > >         xmlns:sdo="commonj.sdo"
> > > > xmlns:sdoJava="commonj.sdo/java"
> > > > xmlns:sdoXml="commonj.sdo/xml"
> > > >         sdoJava:package="com.abc.services"
> > > > 
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> > > >
> > > >         <xsd:import namespace="commonj.sdo"
> > > > schemaLocation="datagraph.xsd" />
> > > >
> > > >         <xsd:complexType name="NestedType">
> > > >                                 <xsd:sequence>
> > > > 
> > > <xsd:element name="test1"
> > > > type="xsd:string" />
> > 
> === message truncated ===
> 
> 
> 
> 
> 
____________________________________________________________________________________
> Get the Yahoo! toolbar and be alerted to new email wherever you're 
surfing.
> http://new.toolbar.yahoo.com/toolbar/features/mail/index.php
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
> 


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


Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by Erich Rueede <er...@yahoo.com>.
Hi Frank and Kelvin

saying this, I am still unsure whether Tuscany SDO
will support the static approach as outline in the
previously documented sample (modelling the datagraph
with XSD and then generate static code).

If it does support the static approach, how long will
it take to fix the current bugs? I need to decide
whether a client project can build upon this
approach..

Thanks for your help
Erich


--- Frank Budinsky <fr...@ca.ibm.com> wrote:

> Hi Kelvin and Erich,
> 
> I just debugged through this, and it's definitely a
> bug in the change 
> summary code. It's another one in the line of bugs
> we've been finding 
> related to the change we made when we separated SDO
> user properties from 
> the internal EMF ones. It's another example of where
> the wrong index (SDO 
> property index) is being used when it should be the
> internal EMF feature 
> index. I'll look at it a little more tomorrow to
> figure out what the 
> cleanest fix is.
> 
> Frank.
> 
> 
> 
> 
> Erich Rueede <er...@yahoo.com> 
> 07/09/2007 08:45 AM
> Please respond to
> tuscany-user@ws.apache.org
> 
> 
> To
> tuscany-user@ws.apache.org,
> kelvin@thegoodsons.org.uk
> cc
> 
> Subject
> Re: static DataObject with contained static
> DataGraph doesn't record 
> changes in summary
> 
> 
> 
> 
> 
> 
> Hi Kelvin
> 
> I did not get the exception you mentioned. I guess
> this might be due to different versions of the
> SDO/EMF
> implementation we are using.
> 
> Regards,
> Erich
> --- kelvin goodson <ke...@gmail.com> wrote:
> 
> > Hi Erich,
> >    I'm looking at this but currently I am getting
> an
> > exception generated
> > here ...
> > 
> >     saveGraph(staticGraph);
> > 
> > I'll investigate why this might be.  Have you seen
> > anything like this?  I
> > noticed I had to do some changes to your code to
> > make it compile,  which
> > implies you are using some generator options. For
> > completeness, can you let
> > me know what generator options you are using.
> > 
> > Regards, Kelvin.
> > 
> > **************** static graph
> **********************
> > 
> > Exception in thread "main"
> > java.lang.IllegalStateException: The containment
> > feature could not be located
> >     at
> >
>
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> > BasicEObjectImpl.java:475)
> >     at
> >
>
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> > BasicEObjectImpl.java:439)
> >     at
> >
>
org.apache.tuscany.sdo.impl.DataObjectImpl.getContainmentProperty(
> > DataObjectImpl.java:182)
> >     at
> >
>
org.apache.tuscany.sdo.util.resource.ChangeSummaryStreamSerializer.saveChangeSummary
> > (ChangeSummaryStreamSerializer.java:609)
> >     at
> >
>
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveChangeSummary
> > (SDOXMLResourceImpl.java:806)
> >     at
> >
>
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveDataTypeElementSingle
> > (SDOXMLResourceImpl.java:816)
> >     at
> >
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
> > XMLSaveImpl.java:1370)
> >     at
> >
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(
> > XMLSaveImpl.java:2462)
> >     at
> >
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(
> > XMLSaveImpl.java:1036)
> >     at
> >
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(
> > XMLSaveImpl.java:922)
> >     at
> >
>
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveElementFeatureMap
> > (SDOXMLResourceImpl.java:844)
> >     at
> >
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
> > XMLSaveImpl.java:1355)
> >     at
> >
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(
> > XMLSaveImpl.java:627)
> >     at
> >
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java
> > :552)
> >     at
> >
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:233)
> >     at
> >
>
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(
> > XMLResourceImpl.java:203)
> >     at
> >
>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(
> > ResourceImpl.java:993)
> >     at
> >
> org.apache.tuscany.sdo.helper.XMLDocumentImpl.save(
> > XMLDocumentImpl.java:205)
> >     at
> >
> org.apache.tuscany.sdo.helper.XMLDocumentImpl.save(
> > XMLDocumentImpl.java:159)
> >     at
> >
>
org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java
> > :139)
> >     at
> >
>
org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java
> > :134)
> >     at
> >
>
t_user.erich_rueede.DgExtended.saveGraph(DgExtended.java:69)
> >     at
> >
>
t_user.erich_rueede.DgExtended.main(DgExtended.java:42)
> > 
> > 
> > 
> > On 07/07/07, Erich Rueede <er...@yahoo.com>
> wrote:
> > >
> > > Hi Frank and Kelvin
> > >
> > > since I don't know how to make attachments work
> > for
> > > the mailing list, here's a text copy of its
> > content:
> > >
> > > The XSD:
> > > ========
> > > <xsd:schema
> > xmlns="http://www.w3.org/2001/XMLSchema"
> > >        
> targetNamespace="http://abc.com/services"
> > >         xmlns:tns="http://abc.com/services"
> > >         xmlns:sdo="commonj.sdo"
> > > xmlns:sdoJava="commonj.sdo/java"
> > > xmlns:sdoXml="commonj.sdo/xml"
> > >         sdoJava:package="com.abc.services"
> > > 
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> > >
> > >         <xsd:import namespace="commonj.sdo"
> > > schemaLocation="datagraph.xsd" />
> > >
> > >         <xsd:complexType name="NestedType">
> > >                                 <xsd:sequence>
> > > 
> > <xsd:element name="test1"
> > > type="xsd:string" />
> 
=== message truncated ===



       
____________________________________________________________________________________
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php

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


Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Hi Kelvin and Erich,

I just debugged through this, and it's definitely a bug in the change 
summary code. It's another one in the line of bugs we've been finding 
related to the change we made when we separated SDO user properties from 
the internal EMF ones. It's another example of where the wrong index (SDO 
property index) is being used when it should be the internal EMF feature 
index. I'll look at it a little more tomorrow to figure out what the 
cleanest fix is.

Frank.




Erich Rueede <er...@yahoo.com> 
07/09/2007 08:45 AM
Please respond to
tuscany-user@ws.apache.org


To
tuscany-user@ws.apache.org, kelvin@thegoodsons.org.uk
cc

Subject
Re: static DataObject with contained static DataGraph doesn't record 
changes in summary






Hi Kelvin

I did not get the exception you mentioned. I guess
this might be due to different versions of the SDO/EMF
implementation we are using.

Regards,
Erich
--- kelvin goodson <ke...@gmail.com> wrote:

> Hi Erich,
>    I'm looking at this but currently I am getting an
> exception generated
> here ...
> 
>     saveGraph(staticGraph);
> 
> I'll investigate why this might be.  Have you seen
> anything like this?  I
> noticed I had to do some changes to your code to
> make it compile,  which
> implies you are using some generator options. For
> completeness, can you let
> me know what generator options you are using.
> 
> Regards, Kelvin.
> 
> **************** static graph **********************
> 
> Exception in thread "main"
> java.lang.IllegalStateException: The containment
> feature could not be located
>     at
>
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> BasicEObjectImpl.java:475)
>     at
>
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> BasicEObjectImpl.java:439)
>     at
>
org.apache.tuscany.sdo.impl.DataObjectImpl.getContainmentProperty(
> DataObjectImpl.java:182)
>     at
>
org.apache.tuscany.sdo.util.resource.ChangeSummaryStreamSerializer.saveChangeSummary
> (ChangeSummaryStreamSerializer.java:609)
>     at
>
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveChangeSummary
> (SDOXMLResourceImpl.java:806)
>     at
>
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveDataTypeElementSingle
> (SDOXMLResourceImpl.java:816)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
> XMLSaveImpl.java:1370)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(
> XMLSaveImpl.java:2462)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(
> XMLSaveImpl.java:1036)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(
> XMLSaveImpl.java:922)
>     at
>
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveElementFeatureMap
> (SDOXMLResourceImpl.java:844)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
> XMLSaveImpl.java:1355)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(
> XMLSaveImpl.java:627)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java
> :552)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:233)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(
> XMLResourceImpl.java:203)
>     at
>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(
> ResourceImpl.java:993)
>     at
> org.apache.tuscany.sdo.helper.XMLDocumentImpl.save(
> XMLDocumentImpl.java:205)
>     at
> org.apache.tuscany.sdo.helper.XMLDocumentImpl.save(
> XMLDocumentImpl.java:159)
>     at
>
org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java
> :139)
>     at
>
org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java
> :134)
>     at
>
t_user.erich_rueede.DgExtended.saveGraph(DgExtended.java:69)
>     at
>
t_user.erich_rueede.DgExtended.main(DgExtended.java:42)
> 
> 
> 
> On 07/07/07, Erich Rueede <er...@yahoo.com> wrote:
> >
> > Hi Frank and Kelvin
> >
> > since I don't know how to make attachments work
> for
> > the mailing list, here's a text copy of its
> content:
> >
> > The XSD:
> > ========
> > <xsd:schema
> xmlns="http://www.w3.org/2001/XMLSchema"
> >         targetNamespace="http://abc.com/services"
> >         xmlns:tns="http://abc.com/services"
> >         xmlns:sdo="commonj.sdo"
> > xmlns:sdoJava="commonj.sdo/java"
> > xmlns:sdoXml="commonj.sdo/xml"
> >         sdoJava:package="com.abc.services"
> > 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >
> >         <xsd:import namespace="commonj.sdo"
> > schemaLocation="datagraph.xsd" />
> >
> >         <xsd:complexType name="NestedType">
> >                                 <xsd:sequence>
> > 
> <xsd:element name="test1"
> > type="xsd:string" />
> > 
> <xsd:element name="test2"
> > type="xsd:string" />
> >                                 </xsd:sequence>
> >         </xsd:complexType>
> >
> >         <xsd:complexType name="MyDataGraph">
> >                 <complexContent>
> >                         <extension
> base="sdo:BaseDataGraphType">
> >                                 <xsd:sequence>
> > 
> <xsd:element
> > name="NestedType"
> > type="tns:NestedType" />
> >                                 </xsd:sequence>
> >                         </extension>
> >                 </complexContent>
> >         </xsd:complexType>
> >
> >         <xsd:complexType name="Input">
> >                 <xsd:sequence>
> >                   <xsd:element name="MyDataGraph"
> > type="tns:MyDataGraph"/>
> >                 </xsd:sequence>
> >         </xsd:complexType>
> > </xsd:schema>
> >
> > The Java Test:
> > ==============
> >
> > package com.abc.services;
> >
> > import java.io.ByteArrayOutputStream;
> > import java.io.IOException;
> >
> > import org.apache.tuscany.sdo.util.SDOUtil;
> >
> > import com.abc.services.impl.TestFactoryImpl;
> > import commonj.sdo.DataGraph;
> > import commonj.sdo.DataObject;
> > import commonj.sdo.Type;
> > import commonj.sdo.helper.XMLHelper;
> > import commonj.sdo.impl.HelperProvider;
> >
> >
> > public class TestABC {
> >
> >     public static void main(String[] args) {
> >
> >
> >
>
TestFactory.INSTANCE.register(HelperProvider.getDefaultContext());
> >         NestedType nested;
> >
> >         System.out.println("****************
> static
> > graph **********************\n");
> >
> >         Input input =
> > TestFactory.INSTANCE.createInput();
> >
> >         MyDataGraph staticGraph =
> > TestFactory.INSTANCE.createMyDataGraph();
> >         nested =
> > TestFactory.INSTANCE.createNestedType();
> >         staticGraph.setNestedType(nested);
> >         ((DataObject)nested).set("test1",
> "test1");
> >         ((DataObject)nested).set("test2",
> "test2");
> > 
> staticGraph.getChangeSummary().beginLogging();
> >         ((DataObject)nested).set("test2",
> > "test2_modified");
> >         nested.setTest1("test1_modified");
> >
> >         input.setMyDataGraph(staticGraph);
> >
> >             saveGraph(staticGraph);
> 
=== message truncated ===



 
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.
http://farechase.yahoo.com/

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




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


Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by Erich Rueede <er...@yahoo.com>.
Hi Kelvin

I did not get the exception you mentioned. I guess
this might be due to different versions of the SDO/EMF
implementation we are using.

Regards,
Erich
--- kelvin goodson <ke...@gmail.com> wrote:

> Hi Erich,
>    I'm looking at this but currently I am getting an
> exception generated
> here ...
> 
>     saveGraph(staticGraph);
> 
> I'll investigate why this might be.  Have you seen
> anything like this?  I
> noticed I had to do some changes to your code to
> make it compile,  which
> implies you are using some generator options. For
> completeness, can you let
> me know what generator options you are using.
> 
> Regards, Kelvin.
> 
> **************** static graph **********************
> 
> Exception in thread "main"
> java.lang.IllegalStateException: The containment
> feature could not be located
>     at
>
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> BasicEObjectImpl.java:475)
>     at
>
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
> BasicEObjectImpl.java:439)
>     at
>
org.apache.tuscany.sdo.impl.DataObjectImpl.getContainmentProperty(
> DataObjectImpl.java:182)
>     at
>
org.apache.tuscany.sdo.util.resource.ChangeSummaryStreamSerializer.saveChangeSummary
> (ChangeSummaryStreamSerializer.java:609)
>     at
>
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveChangeSummary
> (SDOXMLResourceImpl.java:806)
>     at
>
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveDataTypeElementSingle
> (SDOXMLResourceImpl.java:816)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
> XMLSaveImpl.java:1370)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(
> XMLSaveImpl.java:2462)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(
> XMLSaveImpl.java:1036)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(
> XMLSaveImpl.java:922)
>     at
>
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveElementFeatureMap
> (SDOXMLResourceImpl.java:844)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
> XMLSaveImpl.java:1355)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(
> XMLSaveImpl.java:627)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java
> :552)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:233)
>     at
>
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(
> XMLResourceImpl.java:203)
>     at
>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(
> ResourceImpl.java:993)
>     at
> org.apache.tuscany.sdo.helper.XMLDocumentImpl.save(
> XMLDocumentImpl.java:205)
>     at
> org.apache.tuscany.sdo.helper.XMLDocumentImpl.save(
> XMLDocumentImpl.java:159)
>     at
>
org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java
> :139)
>     at
>
org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java
> :134)
>     at
>
t_user.erich_rueede.DgExtended.saveGraph(DgExtended.java:69)
>     at
>
t_user.erich_rueede.DgExtended.main(DgExtended.java:42)
> 
> 
> 
> On 07/07/07, Erich Rueede <er...@yahoo.com> wrote:
> >
> > Hi Frank and Kelvin
> >
> > since I don't know how to make attachments work
> for
> > the mailing list, here's a text copy of its
> content:
> >
> > The XSD:
> > ========
> > <xsd:schema
> xmlns="http://www.w3.org/2001/XMLSchema"
> >         targetNamespace="http://abc.com/services"
> >         xmlns:tns="http://abc.com/services"
> >         xmlns:sdo="commonj.sdo"
> > xmlns:sdoJava="commonj.sdo/java"
> > xmlns:sdoXml="commonj.sdo/xml"
> >         sdoJava:package="com.abc.services"
> >        
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >
> >         <xsd:import namespace="commonj.sdo"
> > schemaLocation="datagraph.xsd" />
> >
> >         <xsd:complexType name="NestedType">
> >                                 <xsd:sequence>
> >                                                
> <xsd:element name="test1"
> > type="xsd:string" />
> >                                                
> <xsd:element name="test2"
> > type="xsd:string" />
> >                                 </xsd:sequence>
> >         </xsd:complexType>
> >
> >         <xsd:complexType name="MyDataGraph">
> >                 <complexContent>
> >                         <extension
> base="sdo:BaseDataGraphType">
> >                                 <xsd:sequence>
> >                                                
> <xsd:element
> > name="NestedType"
> > type="tns:NestedType" />
> >                                 </xsd:sequence>
> >                         </extension>
> >                 </complexContent>
> >         </xsd:complexType>
> >
> >         <xsd:complexType name="Input">
> >                 <xsd:sequence>
> >                   <xsd:element name="MyDataGraph"
> > type="tns:MyDataGraph"/>
> >                 </xsd:sequence>
> >         </xsd:complexType>
> > </xsd:schema>
> >
> > The Java Test:
> > ==============
> >
> > package com.abc.services;
> >
> > import java.io.ByteArrayOutputStream;
> > import java.io.IOException;
> >
> > import org.apache.tuscany.sdo.util.SDOUtil;
> >
> > import com.abc.services.impl.TestFactoryImpl;
> > import commonj.sdo.DataGraph;
> > import commonj.sdo.DataObject;
> > import commonj.sdo.Type;
> > import commonj.sdo.helper.XMLHelper;
> > import commonj.sdo.impl.HelperProvider;
> >
> >
> > public class TestABC {
> >
> >     public static void main(String[] args) {
> >
> >
> >
>
TestFactory.INSTANCE.register(HelperProvider.getDefaultContext());
> >         NestedType nested;
> >
> >         System.out.println("****************
> static
> > graph **********************\n");
> >
> >         Input input =
> > TestFactory.INSTANCE.createInput();
> >
> >         MyDataGraph staticGraph =
> > TestFactory.INSTANCE.createMyDataGraph();
> >         nested =
> > TestFactory.INSTANCE.createNestedType();
> >         staticGraph.setNestedType(nested);
> >         ((DataObject)nested).set("test1",
> "test1");
> >         ((DataObject)nested).set("test2",
> "test2");
> >        
> staticGraph.getChangeSummary().beginLogging();
> >         ((DataObject)nested).set("test2",
> > "test2_modified");
> >         nested.setTest1("test1_modified");
> >
> >         input.setMyDataGraph(staticGraph);
> >
> >             saveGraph(staticGraph);
> 
=== message truncated ===



       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/

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


Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by kelvin goodson <ke...@gmail.com>.
Hi Erich,
   I'm looking at this but currently I am getting an exception generated
here ...

    saveGraph(staticGraph);

I'll investigate why this might be.  Have you seen anything like this?  I
noticed I had to do some changes to your code to make it compile,  which
implies you are using some generator options. For completeness, can you let
me know what generator options you are using.

Regards, Kelvin.

**************** static graph **********************

Exception in thread "main" java.lang.IllegalStateException: The containment
feature could not be located
    at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
BasicEObjectImpl.java:475)
    at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eContainmentFeature(
BasicEObjectImpl.java:439)
    at org.apache.tuscany.sdo.impl.DataObjectImpl.getContainmentProperty(
DataObjectImpl.java:182)
    at
org.apache.tuscany.sdo.util.resource.ChangeSummaryStreamSerializer.saveChangeSummary
(ChangeSummaryStreamSerializer.java:609)
    at
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveChangeSummary
(SDOXMLResourceImpl.java:806)
    at
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveDataTypeElementSingle
(SDOXMLResourceImpl.java:816)
    at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
XMLSaveImpl.java:1370)
    at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(
XMLSaveImpl.java:2462)
    at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(
XMLSaveImpl.java:1036)
    at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(
XMLSaveImpl.java:922)
    at
org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl$SDOXMLSaveImpl.saveElementFeatureMap
(SDOXMLResourceImpl.java:844)
    at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(
XMLSaveImpl.java:1355)
    at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(
XMLSaveImpl.java:627)
    at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java
:552)
    at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:233)
    at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(
XMLResourceImpl.java:203)
    at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(
ResourceImpl.java:993)
    at org.apache.tuscany.sdo.helper.XMLDocumentImpl.save(
XMLDocumentImpl.java:205)
    at org.apache.tuscany.sdo.helper.XMLDocumentImpl.save(
XMLDocumentImpl.java:159)
    at org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java
:139)
    at org.apache.tuscany.sdo.helper.XMLHelperImpl.save(XMLHelperImpl.java
:134)
    at t_user.erich_rueede.DgExtended.saveGraph(DgExtended.java:69)
    at t_user.erich_rueede.DgExtended.main(DgExtended.java:42)



On 07/07/07, Erich Rueede <er...@yahoo.com> wrote:
>
> Hi Frank and Kelvin
>
> since I don't know how to make attachments work for
> the mailing list, here's a text copy of its content:
>
> The XSD:
> ========
> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://abc.com/services"
>         xmlns:tns="http://abc.com/services"
>         xmlns:sdo="commonj.sdo"
> xmlns:sdoJava="commonj.sdo/java"
> xmlns:sdoXml="commonj.sdo/xml"
>         sdoJava:package="com.abc.services"
>         xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>
>         <xsd:import namespace="commonj.sdo"
> schemaLocation="datagraph.xsd" />
>
>         <xsd:complexType name="NestedType">
>                                 <xsd:sequence>
>                                                 <xsd:element name="test1"
> type="xsd:string" />
>                                                 <xsd:element name="test2"
> type="xsd:string" />
>                                 </xsd:sequence>
>         </xsd:complexType>
>
>         <xsd:complexType name="MyDataGraph">
>                 <complexContent>
>                         <extension base="sdo:BaseDataGraphType">
>                                 <xsd:sequence>
>                                                 <xsd:element
> name="NestedType"
> type="tns:NestedType" />
>                                 </xsd:sequence>
>                         </extension>
>                 </complexContent>
>         </xsd:complexType>
>
>         <xsd:complexType name="Input">
>                 <xsd:sequence>
>                   <xsd:element name="MyDataGraph"
> type="tns:MyDataGraph"/>
>                 </xsd:sequence>
>         </xsd:complexType>
> </xsd:schema>
>
> The Java Test:
> ==============
>
> package com.abc.services;
>
> import java.io.ByteArrayOutputStream;
> import java.io.IOException;
>
> import org.apache.tuscany.sdo.util.SDOUtil;
>
> import com.abc.services.impl.TestFactoryImpl;
> import commonj.sdo.DataGraph;
> import commonj.sdo.DataObject;
> import commonj.sdo.Type;
> import commonj.sdo.helper.XMLHelper;
> import commonj.sdo.impl.HelperProvider;
>
>
> public class TestABC {
>
>     public static void main(String[] args) {
>
>
> TestFactory.INSTANCE.register(HelperProvider.getDefaultContext());
>         NestedType nested;
>
>         System.out.println("**************** static
> graph **********************\n");
>
>         Input input =
> TestFactory.INSTANCE.createInput();
>
>         MyDataGraph staticGraph =
> TestFactory.INSTANCE.createMyDataGraph();
>         nested =
> TestFactory.INSTANCE.createNestedType();
>         staticGraph.setNestedType(nested);
>         ((DataObject)nested).set("test1", "test1");
>         ((DataObject)nested).set("test2", "test2");
>         staticGraph.getChangeSummary().beginLogging();
>         ((DataObject)nested).set("test2",
> "test2_modified");
>         nested.setTest1("test1_modified");
>
>         input.setMyDataGraph(staticGraph);
>
>             saveGraph(staticGraph);
>
>             System.out.println("\n\n");
>             System.out.println("**************** dynamic
> graph **********************\n");
>
>         DataGraph dynamicGraph =
> SDOUtil.createDataGraph();
>
>         Type type =
> ((TestFactoryImpl)TestFactory.INSTANCE).getNestedType();
>         nested =
> (NestedType)dynamicGraph.createRootObject(type);
>         ((DataObject)nested).set("test1", "test1");
>         ((DataObject)nested).set("test2", "test2");
>
> dynamicGraph.getChangeSummary().beginLogging();
>         ((DataObject)nested).set("test2",
> "test2_modified");
>         nested.setTest1("test1_modified");
>
>         saveGraph(dynamicGraph);
>
>
>     }
>
>     /**
>      * @param dataobject
>      */
>     private static void saveGraph(MyDataGraph
> dataobject) {
>         ByteArrayOutputStream os = new
> ByteArrayOutputStream();
>         try {
>             XMLHelper.INSTANCE.save((DataObject)
> dataobject, null, "datagraph", os);
>             System.out.println(os.toString());
>         } catch (IOException e) {
>             e.printStackTrace();
>         }
>     }
>
>     /**
>      * @param datagraph
>      */
>     private static void saveGraph(DataGraph datagraph)
> {
>         try {
>             ByteArrayOutputStream os = new
> ByteArrayOutputStream();
>             SDOUtil.saveDataGraph(datagraph, os,
> null);
>             System.out.println(os.toString());
>         } catch (IOException e1) {
>             e1.printStackTrace();
>         }
>     }
> }
>
> Please note, it's the static graph approach which
> doesn't seem to record the summary. The dynamic
> approach using the commonj.sdo.DataGraph works fine.
>
> Thanks Erich
> --- Frank Budinsky <fr...@ca.ibm.com> wrote:
>
> > Hi Erich,
> >
> > This sounds like a little fishy to me, since it
> > looks like you are
> > serializing your specialized DataGraph inside
> > another DataGraph. The SDO
> > spec says that you can't nest change summaries,
> > which could be the
> > problem. Note that in SDO 2.1, commonj.sdo.DataGraph
> > and a DataObject-type
> > DataGraph are two alternative ways of creating a
> > graph of dataobjects.This
> > is something that we'd like to clean up in SDO3. I
> > think tere may be a
> > Tuscany sample that explains the two approaches: is
> > that right Kelvin?
> >
> >  For your specialized DataObject-type MyDataGraph
> > you should just
> > serialize it using XMLHelper.save(). You shouldn't
> > use a
> > commonj.sdo.DataGraph in this case. This may be the
> > problem, but then
> > again, there may also be a bug. You say below, that
> > you attached a test
> > case, but I don't see any attachments?
> >
> > Thanks,
> > Frank.
> >
> > Erich Rueede <er...@yahoo.com> wrote on 07/06/2007
> > 10:21:26 AM:
> >
> > > Hi all
> > >
> > > I have created an XML Schema with a toplevel
> > > dataobject and a contained datagraph as specified
> > in
> > > the webservice sample part of the SDO 2.1 spec
> > (page
> > > 132).
> > >
> > > I then generated static SDO code from the XML
> > schema
> > > which resulted in implementations for the toplevel
> > > dataobject and the contained datagraph.
> > >
> > > The generated code for the static datagraph
> > somehow
> > > differs quite a lot from the dynamic programming
> > model
> > > using the commonj.sdo.DataGraph.
> > >
> > > When I turn on logging on the generated static
> > > datagraph, I notice that no changes are getting
> > > recorded. It contains a partial change summary
> > without
> > > any changes:
> > >
> > > <?xml version="1.0" encoding="ASCII"?>
> > > <datagraph
> > >
> >
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > xmlns:tns="http://abc.com/services"
> > > xsi:type="tns:MyDataGraph">
> > >   <changeSummary logging="true" />
> > >   <NestedType>
> > >     <test1>test1_modified</test1>
> > >     <test2>test2_modified</test2>
> > >   </NestedType>
> > > </datagraph>
> > >
> > > Using the dynamic programming model, it contains a
> > > full change summary with recorded changes:
> > >
> > > <?xml version="1.0" encoding="ASCII"?>
> > > <sdo:datagraph
> > >
> >
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > xmlns:sdo="commonj.sdo"
> > >
> > >
> > xmlns:sdo_1="http://www.apache.org/tuscany/2005/SDO"
> > > xmlns:tns="http://abc.com/services">
> > >   <changeSummary xmlns=""
> > >       logging="true">
> > >     <objectChanges key="#//@eRootObject">
> > >       <value xsi:type="sdo_1:ChangeSummarySetting"
> > > featureName="test2" dataValue="test2"/>
> > >       <value xsi:type="sdo_1:ChangeSummarySetting"
> > > featureName="test1" dataValue="test1"/>
> > >     </objectChanges>
> > >   </changeSummary>
> > >   <tns:NestedType>
> > >     <test1>test1_modified</test1>
> > >     <test2>test2_modified</test2>
> > >   </tns:NestedType>
> > > </sdo:datagraph>
> > >
> > > Is the static approach of modelling a datagraph
> > within
> > > an XSD basically supported with the current
> > TUSCANY
> > > implementation?
> > >
> > > I attached a sample XSD and test implementation.
> > >
> > > Thanks
> > > Erich
> > >
> > >
> > >
> > >
> > >
> >
>
> ____________________________________________________________________________________
> > > Choose the right car based on your needs.  Check
> > out Yahoo! Autos
> > > new Car Finder tool.
> > > http://autos.yahoo.com/carfinder/
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > tuscany-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail:
> > tuscany-user-help@ws.apache.org
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail:
> > tuscany-user-help@ws.apache.org
> >
> >
>
>
>
>
>
> ____________________________________________________________________________________
> Looking for a deal? Find great prices on flights and hotels with Yahoo!
> FareChase.
> http://farechase.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>

Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by Erich Rueede <er...@yahoo.com>.
Hi Kelvin

I am using version SDO-Java M3-RC3 with an additional
patch TUSCANY-1250 for the generator.

The following ANT snippets demonstrate the used
generator options:

<target name="generate-sdo-prefix">
<property name="argline" value="-prefix ${prefix}
-targetDirectory
 ${targetDirectory} ${xsdFile}"/>
<java
classname="org.apache.tuscany.sdo.generate.XSD2JavaGenerator"
 fork="true">
<arg line="${argline}"/>
<classpath refid="generation-classpath"/>
</java>
</target>

<target name="TestABC">
<antcall target="generate-sdo-prefix">
<param name="prefix" value="Test"/>
<param name="xsdFile"
value="${basedir}/xsd/abc.xsd"/>  
</antcall>
</target>


Regards,
Erich

--- kelvin goodson <ke...@gmail.com> wrote:

> Erich,
>   can you also let me know what version of SDO you
> are using -- is this the
> beta1 or the trunk?
> Regards, Kelvin.
> 
> On 07/07/07, Erich Rueede <er...@yahoo.com> wrote:
> >
> > Hi Frank and Kelvin
> >
> > since I don't know how to make attachments work
> for
> > the mailing list, here's a text copy of its
> content:
> >
> > The XSD:
> > ========
> > <xsd:schema
> xmlns="http://www.w3.org/2001/XMLSchema"
> >         targetNamespace="http://abc.com/services"
> >         xmlns:tns="http://abc.com/services"
> >         xmlns:sdo="commonj.sdo"
> > xmlns:sdoJava="commonj.sdo/java"
> > xmlns:sdoXml="commonj.sdo/xml"
> >         sdoJava:package="com.abc.services"
> >        
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >
> >         <xsd:import namespace="commonj.sdo"
> > schemaLocation="datagraph.xsd" />
> >
> >         <xsd:complexType name="NestedType">
> >                                 <xsd:sequence>
> >                                                
> <xsd:element name="test1"
> > type="xsd:string" />
> >                                                
> <xsd:element name="test2"
> > type="xsd:string" />
> >                                 </xsd:sequence>
> >         </xsd:complexType>
> >
> >         <xsd:complexType name="MyDataGraph">
> >                 <complexContent>
> >                         <extension
> base="sdo:BaseDataGraphType">
> >                                 <xsd:sequence>
> >                                                
> <xsd:element
> > name="NestedType"
> > type="tns:NestedType" />
> >                                 </xsd:sequence>
> >                         </extension>
> >                 </complexContent>
> >         </xsd:complexType>
> >
> >         <xsd:complexType name="Input">
> >                 <xsd:sequence>
> >                   <xsd:element name="MyDataGraph"
> > type="tns:MyDataGraph"/>
> >                 </xsd:sequence>
> >         </xsd:complexType>
> > </xsd:schema>
> >
> > The Java Test:
> > ==============
> >
> > package com.abc.services;
> >
> > import java.io.ByteArrayOutputStream;
> > import java.io.IOException;
> >
> > import org.apache.tuscany.sdo.util.SDOUtil;
> >
> > import com.abc.services.impl.TestFactoryImpl;
> > import commonj.sdo.DataGraph;
> > import commonj.sdo.DataObject;
> > import commonj.sdo.Type;
> > import commonj.sdo.helper.XMLHelper;
> > import commonj.sdo.impl.HelperProvider;
> >
> >
> > public class TestABC {
> >
> >     public static void main(String[] args) {
> >
> >
> >
>
TestFactory.INSTANCE.register(HelperProvider.getDefaultContext());
> >         NestedType nested;
> >
> >         System.out.println("****************
> static
> > graph **********************\n");
> >
> >         Input input =
> > TestFactory.INSTANCE.createInput();
> >
> >         MyDataGraph staticGraph =
> > TestFactory.INSTANCE.createMyDataGraph();
> >         nested =
> > TestFactory.INSTANCE.createNestedType();
> >         staticGraph.setNestedType(nested);
> >         ((DataObject)nested).set("test1",
> "test1");
> >         ((DataObject)nested).set("test2",
> "test2");
> >        
> staticGraph.getChangeSummary().beginLogging();
> >         ((DataObject)nested).set("test2",
> > "test2_modified");
> >         nested.setTest1("test1_modified");
> >
> >         input.setMyDataGraph(staticGraph);
> >
> >             saveGraph(staticGraph);
> >
> >             System.out.println("\n\n");
> >             System.out.println("****************
> dynamic
> > graph **********************\n");
> >
> >         DataGraph dynamicGraph =
> > SDOUtil.createDataGraph();
> >
> >         Type type =
> >
>
((TestFactoryImpl)TestFactory.INSTANCE).getNestedType();
> >         nested =
> > (NestedType)dynamicGraph.createRootObject(type);
> >         ((DataObject)nested).set("test1",
> "test1");
> >         ((DataObject)nested).set("test2",
> "test2");
> >
> > dynamicGraph.getChangeSummary().beginLogging();
> >         ((DataObject)nested).set("test2",
> > "test2_modified");
> >         nested.setTest1("test1_modified");
> >
> >         saveGraph(dynamicGraph);
> >
> >
> >     }
> >
> >     /**
> >      * @param dataobject
> >      */
> >     private static void saveGraph(MyDataGraph
> > dataobject) {
> >         ByteArrayOutputStream os = new
> > ByteArrayOutputStream();
> >         try {
> >             XMLHelper.INSTANCE.save((DataObject)
> > dataobject, null, "datagraph", os);
> >             System.out.println(os.toString());
> >         } catch (IOException e) {
> >             e.printStackTrace();
> >         }
> >     }
> >
> >     /**
> >      * @param datagraph
> >      */
> >     private static void saveGraph(DataGraph
> datagraph)
> > {
> >         try {
> >             ByteArrayOutputStream os = new
> > ByteArrayOutputStream();
> >             SDOUtil.saveDataGraph(datagraph, os,
> > null);
> >             System.out.println(os.toString());
> >         } catch (IOException e1) {
> >             e1.printStackTrace();
> >         }
> >     }
> > }
> >
> > Please note, it's the static graph approach which
> > doesn't seem to record the summary. The dynamic
> > approach using the commonj.sdo.DataGraph works
> fine.
> >
> > Thanks Erich
> > --- Frank Budinsky <fr...@ca.ibm.com> wrote:
> >
> > > Hi Erich,
> > >
> > > This sounds like a little fishy to me, since it
> > > looks like you are
> > > serializing your specialized DataGraph inside
> > > another DataGraph. The SDO
> > > spec says that you can't nest change summaries,
> > > which could be the
> > > problem. Note that in SDO 2.1,
> commonj.sdo.DataGraph
> > > and a DataObject-type
> > > DataGraph are two alternative ways of creating a
> > > graph of dataobjects.This
> > > is something that we'd like to clean up in SDO3.
> I
> 
=== message truncated ===



       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting 

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


Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by kelvin goodson <ke...@gmail.com>.
Erich,
  can you also let me know what version of SDO you are using -- is this the
beta1 or the trunk?
Regards, Kelvin.

On 07/07/07, Erich Rueede <er...@yahoo.com> wrote:
>
> Hi Frank and Kelvin
>
> since I don't know how to make attachments work for
> the mailing list, here's a text copy of its content:
>
> The XSD:
> ========
> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://abc.com/services"
>         xmlns:tns="http://abc.com/services"
>         xmlns:sdo="commonj.sdo"
> xmlns:sdoJava="commonj.sdo/java"
> xmlns:sdoXml="commonj.sdo/xml"
>         sdoJava:package="com.abc.services"
>         xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>
>         <xsd:import namespace="commonj.sdo"
> schemaLocation="datagraph.xsd" />
>
>         <xsd:complexType name="NestedType">
>                                 <xsd:sequence>
>                                                 <xsd:element name="test1"
> type="xsd:string" />
>                                                 <xsd:element name="test2"
> type="xsd:string" />
>                                 </xsd:sequence>
>         </xsd:complexType>
>
>         <xsd:complexType name="MyDataGraph">
>                 <complexContent>
>                         <extension base="sdo:BaseDataGraphType">
>                                 <xsd:sequence>
>                                                 <xsd:element
> name="NestedType"
> type="tns:NestedType" />
>                                 </xsd:sequence>
>                         </extension>
>                 </complexContent>
>         </xsd:complexType>
>
>         <xsd:complexType name="Input">
>                 <xsd:sequence>
>                   <xsd:element name="MyDataGraph"
> type="tns:MyDataGraph"/>
>                 </xsd:sequence>
>         </xsd:complexType>
> </xsd:schema>
>
> The Java Test:
> ==============
>
> package com.abc.services;
>
> import java.io.ByteArrayOutputStream;
> import java.io.IOException;
>
> import org.apache.tuscany.sdo.util.SDOUtil;
>
> import com.abc.services.impl.TestFactoryImpl;
> import commonj.sdo.DataGraph;
> import commonj.sdo.DataObject;
> import commonj.sdo.Type;
> import commonj.sdo.helper.XMLHelper;
> import commonj.sdo.impl.HelperProvider;
>
>
> public class TestABC {
>
>     public static void main(String[] args) {
>
>
> TestFactory.INSTANCE.register(HelperProvider.getDefaultContext());
>         NestedType nested;
>
>         System.out.println("**************** static
> graph **********************\n");
>
>         Input input =
> TestFactory.INSTANCE.createInput();
>
>         MyDataGraph staticGraph =
> TestFactory.INSTANCE.createMyDataGraph();
>         nested =
> TestFactory.INSTANCE.createNestedType();
>         staticGraph.setNestedType(nested);
>         ((DataObject)nested).set("test1", "test1");
>         ((DataObject)nested).set("test2", "test2");
>         staticGraph.getChangeSummary().beginLogging();
>         ((DataObject)nested).set("test2",
> "test2_modified");
>         nested.setTest1("test1_modified");
>
>         input.setMyDataGraph(staticGraph);
>
>             saveGraph(staticGraph);
>
>             System.out.println("\n\n");
>             System.out.println("**************** dynamic
> graph **********************\n");
>
>         DataGraph dynamicGraph =
> SDOUtil.createDataGraph();
>
>         Type type =
> ((TestFactoryImpl)TestFactory.INSTANCE).getNestedType();
>         nested =
> (NestedType)dynamicGraph.createRootObject(type);
>         ((DataObject)nested).set("test1", "test1");
>         ((DataObject)nested).set("test2", "test2");
>
> dynamicGraph.getChangeSummary().beginLogging();
>         ((DataObject)nested).set("test2",
> "test2_modified");
>         nested.setTest1("test1_modified");
>
>         saveGraph(dynamicGraph);
>
>
>     }
>
>     /**
>      * @param dataobject
>      */
>     private static void saveGraph(MyDataGraph
> dataobject) {
>         ByteArrayOutputStream os = new
> ByteArrayOutputStream();
>         try {
>             XMLHelper.INSTANCE.save((DataObject)
> dataobject, null, "datagraph", os);
>             System.out.println(os.toString());
>         } catch (IOException e) {
>             e.printStackTrace();
>         }
>     }
>
>     /**
>      * @param datagraph
>      */
>     private static void saveGraph(DataGraph datagraph)
> {
>         try {
>             ByteArrayOutputStream os = new
> ByteArrayOutputStream();
>             SDOUtil.saveDataGraph(datagraph, os,
> null);
>             System.out.println(os.toString());
>         } catch (IOException e1) {
>             e1.printStackTrace();
>         }
>     }
> }
>
> Please note, it's the static graph approach which
> doesn't seem to record the summary. The dynamic
> approach using the commonj.sdo.DataGraph works fine.
>
> Thanks Erich
> --- Frank Budinsky <fr...@ca.ibm.com> wrote:
>
> > Hi Erich,
> >
> > This sounds like a little fishy to me, since it
> > looks like you are
> > serializing your specialized DataGraph inside
> > another DataGraph. The SDO
> > spec says that you can't nest change summaries,
> > which could be the
> > problem. Note that in SDO 2.1, commonj.sdo.DataGraph
> > and a DataObject-type
> > DataGraph are two alternative ways of creating a
> > graph of dataobjects.This
> > is something that we'd like to clean up in SDO3. I
> > think tere may be a
> > Tuscany sample that explains the two approaches: is
> > that right Kelvin?
> >
> >  For your specialized DataObject-type MyDataGraph
> > you should just
> > serialize it using XMLHelper.save(). You shouldn't
> > use a
> > commonj.sdo.DataGraph in this case. This may be the
> > problem, but then
> > again, there may also be a bug. You say below, that
> > you attached a test
> > case, but I don't see any attachments?
> >
> > Thanks,
> > Frank.
> >
> > Erich Rueede <er...@yahoo.com> wrote on 07/06/2007
> > 10:21:26 AM:
> >
> > > Hi all
> > >
> > > I have created an XML Schema with a toplevel
> > > dataobject and a contained datagraph as specified
> > in
> > > the webservice sample part of the SDO 2.1 spec
> > (page
> > > 132).
> > >
> > > I then generated static SDO code from the XML
> > schema
> > > which resulted in implementations for the toplevel
> > > dataobject and the contained datagraph.
> > >
> > > The generated code for the static datagraph
> > somehow
> > > differs quite a lot from the dynamic programming
> > model
> > > using the commonj.sdo.DataGraph.
> > >
> > > When I turn on logging on the generated static
> > > datagraph, I notice that no changes are getting
> > > recorded. It contains a partial change summary
> > without
> > > any changes:
> > >
> > > <?xml version="1.0" encoding="ASCII"?>
> > > <datagraph
> > >
> >
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > xmlns:tns="http://abc.com/services"
> > > xsi:type="tns:MyDataGraph">
> > >   <changeSummary logging="true" />
> > >   <NestedType>
> > >     <test1>test1_modified</test1>
> > >     <test2>test2_modified</test2>
> > >   </NestedType>
> > > </datagraph>
> > >
> > > Using the dynamic programming model, it contains a
> > > full change summary with recorded changes:
> > >
> > > <?xml version="1.0" encoding="ASCII"?>
> > > <sdo:datagraph
> > >
> >
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > xmlns:sdo="commonj.sdo"
> > >
> > >
> > xmlns:sdo_1="http://www.apache.org/tuscany/2005/SDO"
> > > xmlns:tns="http://abc.com/services">
> > >   <changeSummary xmlns=""
> > >       logging="true">
> > >     <objectChanges key="#//@eRootObject">
> > >       <value xsi:type="sdo_1:ChangeSummarySetting"
> > > featureName="test2" dataValue="test2"/>
> > >       <value xsi:type="sdo_1:ChangeSummarySetting"
> > > featureName="test1" dataValue="test1"/>
> > >     </objectChanges>
> > >   </changeSummary>
> > >   <tns:NestedType>
> > >     <test1>test1_modified</test1>
> > >     <test2>test2_modified</test2>
> > >   </tns:NestedType>
> > > </sdo:datagraph>
> > >
> > > Is the static approach of modelling a datagraph
> > within
> > > an XSD basically supported with the current
> > TUSCANY
> > > implementation?
> > >
> > > I attached a sample XSD and test implementation.
> > >
> > > Thanks
> > > Erich
> > >
> > >
> > >
> > >
> > >
> >
>
> ____________________________________________________________________________________
> > > Choose the right car based on your needs.  Check
> > out Yahoo! Autos
> > > new Car Finder tool.
> > > http://autos.yahoo.com/carfinder/
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > tuscany-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail:
> > tuscany-user-help@ws.apache.org
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail:
> > tuscany-user-help@ws.apache.org
> >
> >
>
>
>
>
>
> ____________________________________________________________________________________
> Looking for a deal? Find great prices on flights and hotels with Yahoo!
> FareChase.
> http://farechase.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>

Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by Erich Rueede <er...@yahoo.com>.
Hi Frank and Kelvin

since I don't know how to make attachments work for
the mailing list, here's a text copy of its content:

The XSD:
========
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://abc.com/services"
	xmlns:tns="http://abc.com/services"
	xmlns:sdo="commonj.sdo"
xmlns:sdoJava="commonj.sdo/java"
xmlns:sdoXml="commonj.sdo/xml"
	sdoJava:package="com.abc.services"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:import namespace="commonj.sdo"
schemaLocation="datagraph.xsd" />

	<xsd:complexType name="NestedType">
				<xsd:sequence>
						<xsd:element name="test1" type="xsd:string" />
						<xsd:element name="test2" type="xsd:string" />
				</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="MyDataGraph">
		<complexContent>
			<extension base="sdo:BaseDataGraphType">
				<xsd:sequence>
						<xsd:element name="NestedType"
type="tns:NestedType" />
				</xsd:sequence>
			</extension>
		</complexContent>
	</xsd:complexType>

	<xsd:complexType name="Input">
		<xsd:sequence>
		  <xsd:element name="MyDataGraph"
type="tns:MyDataGraph"/>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>

The Java Test:
==============

package com.abc.services;

import java.io.ByteArrayOutputStream;
import java.io.IOException;

import org.apache.tuscany.sdo.util.SDOUtil;

import com.abc.services.impl.TestFactoryImpl;
import commonj.sdo.DataGraph;
import commonj.sdo.DataObject;
import commonj.sdo.Type;
import commonj.sdo.helper.XMLHelper;
import commonj.sdo.impl.HelperProvider;


public class TestABC {

    public static void main(String[] args) {

       
TestFactory.INSTANCE.register(HelperProvider.getDefaultContext());
        NestedType nested;

        System.out.println("**************** static
graph **********************\n");

        Input input =
TestFactory.INSTANCE.createInput();

        MyDataGraph staticGraph =
TestFactory.INSTANCE.createMyDataGraph();
        nested =
TestFactory.INSTANCE.createNestedType();
        staticGraph.setNestedType(nested);
        ((DataObject)nested).set("test1", "test1");
        ((DataObject)nested).set("test2", "test2");
        staticGraph.getChangeSummary().beginLogging();
        ((DataObject)nested).set("test2",
"test2_modified");
        nested.setTest1("test1_modified");

        input.setMyDataGraph(staticGraph);
        
	    saveGraph(staticGraph);

	    System.out.println("\n\n");
	    System.out.println("**************** dynamic
graph **********************\n");

        DataGraph dynamicGraph =
SDOUtil.createDataGraph();
        
        Type type =
((TestFactoryImpl)TestFactory.INSTANCE).getNestedType();
        nested =
(NestedType)dynamicGraph.createRootObject(type);
        ((DataObject)nested).set("test1", "test1");
        ((DataObject)nested).set("test2", "test2");
       
dynamicGraph.getChangeSummary().beginLogging();
        ((DataObject)nested).set("test2",
"test2_modified");
        nested.setTest1("test1_modified");
        
        saveGraph(dynamicGraph);


    }

    /**
     * @param dataobject
     */
    private static void saveGraph(MyDataGraph
dataobject) {
        ByteArrayOutputStream os = new
ByteArrayOutputStream();
        try {
            XMLHelper.INSTANCE.save((DataObject)
dataobject, null, "datagraph", os);
            System.out.println(os.toString());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * @param datagraph
     */
    private static void saveGraph(DataGraph datagraph)
{
        try {
    	    ByteArrayOutputStream os = new
ByteArrayOutputStream();
            SDOUtil.saveDataGraph(datagraph, os,
null);
            System.out.println(os.toString());
        } catch (IOException e1) {
            e1.printStackTrace();
        }
    }
}

Please note, it's the static graph approach which
doesn't seem to record the summary. The dynamic
approach using the commonj.sdo.DataGraph works fine.

Thanks Erich
--- Frank Budinsky <fr...@ca.ibm.com> wrote:

> Hi Erich,
> 
> This sounds like a little fishy to me, since it
> looks like you are 
> serializing your specialized DataGraph inside
> another DataGraph. The SDO 
> spec says that you can't nest change summaries,
> which could be the 
> problem. Note that in SDO 2.1, commonj.sdo.DataGraph
> and a DataObject-type 
> DataGraph are two alternative ways of creating a
> graph of dataobjects.This 
> is something that we'd like to clean up in SDO3. I
> think tere may be a 
> Tuscany sample that explains the two approaches: is
> that right Kelvin?
> 
>  For your specialized DataObject-type MyDataGraph
> you should just 
> serialize it using XMLHelper.save(). You shouldn't
> use a 
> commonj.sdo.DataGraph in this case. This may be the
> problem, but then 
> again, there may also be a bug. You say below, that
> you attached a test 
> case, but I don't see any attachments?
> 
> Thanks,
> Frank.
> 
> Erich Rueede <er...@yahoo.com> wrote on 07/06/2007
> 10:21:26 AM:
> 
> > Hi all
> > 
> > I have created an XML Schema with a toplevel
> > dataobject and a contained datagraph as specified
> in
> > the webservice sample part of the SDO 2.1 spec
> (page
> > 132).
> > 
> > I then generated static SDO code from the XML
> schema
> > which resulted in implementations for the toplevel
> > dataobject and the contained datagraph.
> > 
> > The generated code for the static datagraph
> somehow
> > differs quite a lot from the dynamic programming
> model
> > using the commonj.sdo.DataGraph.
> > 
> > When I turn on logging on the generated static
> > datagraph, I notice that no changes are getting
> > recorded. It contains a partial change summary
> without
> > any changes:
> > 
> > <?xml version="1.0" encoding="ASCII"?>
> > <datagraph
> >
>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:tns="http://abc.com/services"
> > xsi:type="tns:MyDataGraph">
> >   <changeSummary logging="true" />
> >   <NestedType>
> >     <test1>test1_modified</test1>
> >     <test2>test2_modified</test2>
> >   </NestedType>
> > </datagraph>
> > 
> > Using the dynamic programming model, it contains a
> > full change summary with recorded changes:
> > 
> > <?xml version="1.0" encoding="ASCII"?>
> > <sdo:datagraph
> >
>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:sdo="commonj.sdo"
> > 
> >
> xmlns:sdo_1="http://www.apache.org/tuscany/2005/SDO"
> > xmlns:tns="http://abc.com/services">
> >   <changeSummary xmlns=""
> >       logging="true">
> >     <objectChanges key="#//@eRootObject">
> >       <value xsi:type="sdo_1:ChangeSummarySetting"
> > featureName="test2" dataValue="test2"/>
> >       <value xsi:type="sdo_1:ChangeSummarySetting"
> > featureName="test1" dataValue="test1"/>
> >     </objectChanges>
> >   </changeSummary>
> >   <tns:NestedType>
> >     <test1>test1_modified</test1>
> >     <test2>test2_modified</test2>
> >   </tns:NestedType>
> > </sdo:datagraph>
> > 
> > Is the static approach of modelling a datagraph
> within
> > an XSD basically supported with the current
> TUSCANY
> > implementation? 
> > 
> > I attached a sample XSD and test implementation.
> > 
> > Thanks
> > Erich
> > 
> > 
> > 
> > 
> > 
>
____________________________________________________________________________________
> > Choose the right car based on your needs.  Check
> out Yahoo! Autos 
> > new Car Finder tool.
> > http://autos.yahoo.com/carfinder/
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail:
> tuscany-user-help@ws.apache.org
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail:
> tuscany-user-help@ws.apache.org
> 
> 



       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/

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


Re: static DataObject with contained static DataGraph doesn't record changes in summary

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Hi Erich,

This sounds like a little fishy to me, since it looks like you are 
serializing your specialized DataGraph inside another DataGraph. The SDO 
spec says that you can't nest change summaries, which could be the 
problem. Note that in SDO 2.1, commonj.sdo.DataGraph and a DataObject-type 
DataGraph are two alternative ways of creating a graph of dataobjects.This 
is something that we'd like to clean up in SDO3. I think tere may be a 
Tuscany sample that explains the two approaches: is that right Kelvin?

 For your specialized DataObject-type MyDataGraph you should just 
serialize it using XMLHelper.save(). You shouldn't use a 
commonj.sdo.DataGraph in this case. This may be the problem, but then 
again, there may also be a bug. You say below, that you attached a test 
case, but I don't see any attachments?

Thanks,
Frank.

Erich Rueede <er...@yahoo.com> wrote on 07/06/2007 10:21:26 AM:

> Hi all
> 
> I have created an XML Schema with a toplevel
> dataobject and a contained datagraph as specified in
> the webservice sample part of the SDO 2.1 spec (page
> 132).
> 
> I then generated static SDO code from the XML schema
> which resulted in implementations for the toplevel
> dataobject and the contained datagraph.
> 
> The generated code for the static datagraph somehow
> differs quite a lot from the dynamic programming model
> using the commonj.sdo.DataGraph.
> 
> When I turn on logging on the generated static
> datagraph, I notice that no changes are getting
> recorded. It contains a partial change summary without
> any changes:
> 
> <?xml version="1.0" encoding="ASCII"?>
> <datagraph
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:tns="http://abc.com/services"
> xsi:type="tns:MyDataGraph">
>   <changeSummary logging="true" />
>   <NestedType>
>     <test1>test1_modified</test1>
>     <test2>test2_modified</test2>
>   </NestedType>
> </datagraph>
> 
> Using the dynamic programming model, it contains a
> full change summary with recorded changes:
> 
> <?xml version="1.0" encoding="ASCII"?>
> <sdo:datagraph
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:sdo="commonj.sdo"
> 
> xmlns:sdo_1="http://www.apache.org/tuscany/2005/SDO"
> xmlns:tns="http://abc.com/services">
>   <changeSummary xmlns=""
>       logging="true">
>     <objectChanges key="#//@eRootObject">
>       <value xsi:type="sdo_1:ChangeSummarySetting"
> featureName="test2" dataValue="test2"/>
>       <value xsi:type="sdo_1:ChangeSummarySetting"
> featureName="test1" dataValue="test1"/>
>     </objectChanges>
>   </changeSummary>
>   <tns:NestedType>
>     <test1>test1_modified</test1>
>     <test2>test2_modified</test2>
>   </tns:NestedType>
> </sdo:datagraph>
> 
> Is the static approach of modelling a datagraph within
> an XSD basically supported with the current TUSCANY
> implementation? 
> 
> I attached a sample XSD and test implementation.
> 
> Thanks
> Erich
> 
> 
> 
> 
> 
____________________________________________________________________________________
> Choose the right car based on your needs.  Check out Yahoo! Autos 
> new Car Finder tool.
> http://autos.yahoo.com/carfinder/
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org

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


static DataObject with contained static DataGraph doesn't record changes in summary

Posted by Erich Rueede <er...@yahoo.com>.
Hi all

I have created an XML Schema with a toplevel
dataobject and a contained datagraph as specified in
the webservice sample part of the SDO 2.1 spec (page
132).

I then generated static SDO code from the XML schema
which resulted in implementations for the toplevel
dataobject and the contained datagraph.

The generated code for the static datagraph somehow
differs quite a lot from the dynamic programming model
using the commonj.sdo.DataGraph.

When I turn on logging on the generated static
datagraph, I notice that no changes are getting
recorded. It contains a partial change summary without
any changes:

<?xml version="1.0" encoding="ASCII"?>
<datagraph
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://abc.com/services"
xsi:type="tns:MyDataGraph">
  <changeSummary logging="true" />
  <NestedType>
    <test1>test1_modified</test1>
    <test2>test2_modified</test2>
  </NestedType>
</datagraph>

Using the dynamic programming model, it contains a
full change summary with recorded changes:

<?xml version="1.0" encoding="ASCII"?>
<sdo:datagraph
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sdo="commonj.sdo"
   
xmlns:sdo_1="http://www.apache.org/tuscany/2005/SDO"
xmlns:tns="http://abc.com/services">
  <changeSummary xmlns=""
      logging="true">
    <objectChanges key="#//@eRootObject">
      <value xsi:type="sdo_1:ChangeSummarySetting"
featureName="test2" dataValue="test2"/>
      <value xsi:type="sdo_1:ChangeSummarySetting"
featureName="test1" dataValue="test1"/>
    </objectChanges>
  </changeSummary>
  <tns:NestedType>
    <test1>test1_modified</test1>
    <test2>test2_modified</test2>
  </tns:NestedType>
</sdo:datagraph>

Is the static approach of modelling a datagraph within
an XSD basically supported with the current TUSCANY
implementation? 

I attached a sample XSD and test implementation.

Thanks
Erich



       
____________________________________________________________________________________
Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.
http://autos.yahoo.com/carfinder/

Re: DataObject with contained DataGraph causes NullPointerException in ChangePackage$Literals

Posted by Erich Rueede <er...@yahoo.com>.
Hi Ron

I am running WebSphere 5.1 application server. You
were right! Setting the System Property resolved my
problems. 

I totally agree about the need of bringing in more
light into this subject. Not sure yet whether it is a
EMF or a Tuscany issue.

Thanks very much
Erich

PS: The change summary still contains NO changes,
despite I changed an attribute after turning on
logging...

--- Ron Gavlin <rg...@yahoo.com> wrote:

> Hi Erich,
> 
> What appserver are you using? If you set the
> following system property 
> on the appserver's JVM at startup 
> "org.eclipse.emf.ecore.EPackage.Registry.INSTANCE = 
> org.eclipse.emf.ecore.impl.EPackageRegistryImpl",
> does that resolve the 
> problem?
> 
> See mail thread 
>
http://mail-archives.apache.org/mod_mbox/ws-tuscany-user/200606.mbox/%3C20060601115838.54508.qmail@web31308.mail.mud.yahoo.com%3E
> 
> for additional details. Setting the appserver JVM
> property served as a 
> workaround for me, however it does completely
> disable the default 
> delegating classloader EMF registry. This delegating
> registry was 
> apparently specifically designed to work in the IBM
> WebSphere 
> application server. Without the delegating registry,
> every Tuscany app 
> running in your appserver shares the same EMF/SDO
> type registry which 
> may or may not cause you major problems.
> 
> We should probably open a JIRA with Eclipse EMF
> and/or Tuscany to 
> improve type registry handling in complex
> classloader environments.
> 
> Regards,
> 
> - Ron
> 
> Erich Rueede wrote:
> > Hi Kelvin
> >
> > Yes, this partly represents my szenario. It works
> for
> > me in a standalone JVM. It works also within a
> simple
> > servlet szenario. It doesn't work in a servlet/ejb
> > szenario when I run an initialization step when
> > starting up the ejb module such as:
> >
> > HelperContext hc =
> HelperProvider.getDefaultContext();
> > Factory.INSTANCE.register(hc);
> >
> > This initialization is required in order to have
> all
> > types registered for subsequent rmi/iiop calls.
> Btw,
> > without having a datagraph in my SDO hierarchy, it
> all
> > works fine, even in the servlet/ejb szenario.
> >
> > If I omit the initialization step in the ejb, the
> > servlet works fine but the ejb fails when
> > deserializing the serialized datagraph.
> >
> > To me this looks like something (the change
> package)
> > registered during the ejb initialization in the
> global
> > registry is not visible to the servlet afterwards.
> >
> > Thanks Erich
> > --- kelvin goodson <ke...@gmail.com>
> wrote:
> >
> >   
> >> Hi Erich,
> >>
> >> I generated code from your schema and tried the
> >> following lines of code,
> >> which executed without failure ...
> >>
> >>
> >> *public* *void* testErichsProblem() *throws*
> >> Exception {
> >>
> >>   PublicationDataGraph pdg =
> >>
> >>     
> >
>
ServicesFactory.*INSTANCE*.createPublicationDataGraph();
> >   
> >>   DataObject dob = (DataObject)pdg;
> >>   ChangeSummary cs = dob.getChangeSummary();
> >>   cs.beginLogging();
> >> }
> >>
> >> does this represent a distilled version of your
> >> scenario?
> >>
> >> Regards,Kelvin
> >> On 29/06/07, Erich Rueede <er...@yahoo.com>
> wrote:
> >>     
> >>> Hi
> >>>
> >>> I am testing with the SDO beta-1 code.
> >>>
> >>> I generated static SDO classes with an embedded
> >>> datagraph by extending the BaseDataGraphType
> >>> as described in the SDO 2.1 spec using the
> >>>       
> >> following
> >>     
> >>> XSD:
> >>>
> >>> <xsd:schema
> >>>       
> >> xmlns="http://www.w3.org/2001/XMLSchema"
> >>     
> >>>        targetNamespace="http://abc.com/services"
> >>>        xmlns:tns="http://abc.com/services"
> >>>        xmlns:sdo="commonj.sdo"
> >>> xmlns:sdoJava="commonj.sdo/java"
> >>> xmlns:sdoXml="commonj.sdo/xml"
> >>>        sdoJava:package="com.abc.services"
> >>>       
> >>>       
> >> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >>     
> >>>        <xsd:complexType
> >>>       
> >> name="PublicationDataGraph">
> >>     
> >>>                <complexContent>
> >>>                        <extension
> >>>       
> >> base="sdo:BaseDataGraphType">
> >>     
> >>>                                <xsd:sequence>
> >>>                                               
> >>>       
> >> <xsd:element name="test"
> >>     
> >>> type="xsd:string" />
> >>>                                </xsd:sequence>
> >>>                        </extension>
> >>>                </complexContent>
> >>>        </xsd:complexType>
> >>>
> >>>        <xsd:complexType
> >>>       
> >> name="ModifyPublicationInput"
> >>     
> >>>                <xsd:sequence>
> >>>                        <xsd:element
> >>>       
> >> name="PublicationDataGraph"
> >>     
> >>> type="tns:PublicationDataGraph" />
> >>>                </xsd:sequence>
> >>>        </xsd:complexType>
> >>> </xsd:schema>
> >>>
> >>>
> >>> After I instantiated the top level DataObject
> >>> (ModifyPubicationInput) containing the embedded
> >>> Datagraph,
> >>> I tried to beginLogging which causes the
> following
> >>> exception in
> >>>
> >>>       
> >
>
org.eclipse.emf.ecore.change.ChangePackage$Literals.<clinit>(
> >   
> >>> ChangePackage.java:903).
> >>>
> >>> The same exception also happens when I try to
> >>> serialize the toplevel DataObject to XML or when
> I
> >>>       
> >> try
> >>     
> >>> to
> >>> send it via RMI/IIOP to an EJB.
> >>>
> >>>
> >>> [6/29/07 11:32:31:898 CEST] 7dec7dec WebGroup   
>  
> >>>       
> >> E
> >>     
> >>> SRVE0026E: [Servlet Error]-[]:
> >>> java.lang.ExceptionInInitializerError
> >>>        at
> >>>       
> >> java.lang.Class.initialize(Class.java:345)
> >>     
> >>>        at
> >>>
> >>>       
> >
>
org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl.getObjectChanges(
> 
=== message truncated ===



       
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/

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


Re: DataObject with contained DataGraph causes NullPointerException in ChangePackage$Literals

Posted by Ron Gavlin <rg...@yahoo.com>.
Hi Erich,

What appserver are you using? If you set the following system property 
on the appserver's JVM at startup 
"org.eclipse.emf.ecore.EPackage.Registry.INSTANCE = 
org.eclipse.emf.ecore.impl.EPackageRegistryImpl", does that resolve the 
problem?

See mail thread 
http://mail-archives.apache.org/mod_mbox/ws-tuscany-user/200606.mbox/%3C20060601115838.54508.qmail@web31308.mail.mud.yahoo.com%3E 
for additional details. Setting the appserver JVM property served as a 
workaround for me, however it does completely disable the default 
delegating classloader EMF registry. This delegating registry was 
apparently specifically designed to work in the IBM WebSphere 
application server. Without the delegating registry, every Tuscany app 
running in your appserver shares the same EMF/SDO type registry which 
may or may not cause you major problems.

We should probably open a JIRA with Eclipse EMF and/or Tuscany to 
improve type registry handling in complex classloader environments.

Regards,

- Ron

Erich Rueede wrote:
> Hi Kelvin
>
> Yes, this partly represents my szenario. It works for
> me in a standalone JVM. It works also within a simple
> servlet szenario. It doesn't work in a servlet/ejb
> szenario when I run an initialization step when
> starting up the ejb module such as:
>
> HelperContext hc = HelperProvider.getDefaultContext();
> Factory.INSTANCE.register(hc);
>
> This initialization is required in order to have all
> types registered for subsequent rmi/iiop calls. Btw,
> without having a datagraph in my SDO hierarchy, it all
> works fine, even in the servlet/ejb szenario.
>
> If I omit the initialization step in the ejb, the
> servlet works fine but the ejb fails when
> deserializing the serialized datagraph.
>
> To me this looks like something (the change package)
> registered during the ejb initialization in the global
> registry is not visible to the servlet afterwards.
>
> Thanks Erich
> --- kelvin goodson <ke...@gmail.com> wrote:
>
>   
>> Hi Erich,
>>
>> I generated code from your schema and tried the
>> following lines of code,
>> which executed without failure ...
>>
>>
>> *public* *void* testErichsProblem() *throws*
>> Exception {
>>
>>   PublicationDataGraph pdg =
>>
>>     
> ServicesFactory.*INSTANCE*.createPublicationDataGraph();
>   
>>   DataObject dob = (DataObject)pdg;
>>   ChangeSummary cs = dob.getChangeSummary();
>>   cs.beginLogging();
>> }
>>
>> does this represent a distilled version of your
>> scenario?
>>
>> Regards,Kelvin
>> On 29/06/07, Erich Rueede <er...@yahoo.com> wrote:
>>     
>>> Hi
>>>
>>> I am testing with the SDO beta-1 code.
>>>
>>> I generated static SDO classes with an embedded
>>> datagraph by extending the BaseDataGraphType
>>> as described in the SDO 2.1 spec using the
>>>       
>> following
>>     
>>> XSD:
>>>
>>> <xsd:schema
>>>       
>> xmlns="http://www.w3.org/2001/XMLSchema"
>>     
>>>        targetNamespace="http://abc.com/services"
>>>        xmlns:tns="http://abc.com/services"
>>>        xmlns:sdo="commonj.sdo"
>>> xmlns:sdoJava="commonj.sdo/java"
>>> xmlns:sdoXml="commonj.sdo/xml"
>>>        sdoJava:package="com.abc.services"
>>>       
>>>       
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>>     
>>>        <xsd:complexType
>>>       
>> name="PublicationDataGraph">
>>     
>>>                <complexContent>
>>>                        <extension
>>>       
>> base="sdo:BaseDataGraphType">
>>     
>>>                                <xsd:sequence>
>>>                                               
>>>       
>> <xsd:element name="test"
>>     
>>> type="xsd:string" />
>>>                                </xsd:sequence>
>>>                        </extension>
>>>                </complexContent>
>>>        </xsd:complexType>
>>>
>>>        <xsd:complexType
>>>       
>> name="ModifyPublicationInput"
>>     
>>>                <xsd:sequence>
>>>                        <xsd:element
>>>       
>> name="PublicationDataGraph"
>>     
>>> type="tns:PublicationDataGraph" />
>>>                </xsd:sequence>
>>>        </xsd:complexType>
>>> </xsd:schema>
>>>
>>>
>>> After I instantiated the top level DataObject
>>> (ModifyPubicationInput) containing the embedded
>>> Datagraph,
>>> I tried to beginLogging which causes the following
>>> exception in
>>>
>>>       
> org.eclipse.emf.ecore.change.ChangePackage$Literals.<clinit>(
>   
>>> ChangePackage.java:903).
>>>
>>> The same exception also happens when I try to
>>> serialize the toplevel DataObject to XML or when I
>>>       
>> try
>>     
>>> to
>>> send it via RMI/IIOP to an EJB.
>>>
>>>
>>> [6/29/07 11:32:31:898 CEST] 7dec7dec WebGroup     
>>>       
>> E
>>     
>>> SRVE0026E: [Servlet Error]-[]:
>>> java.lang.ExceptionInInitializerError
>>>        at
>>>       
>> java.lang.Class.initialize(Class.java:345)
>>     
>>>        at
>>>
>>>       
> org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl.getObjectChanges(
>   
>>> ChangeDescriptionImpl.java:141)
>>>        at
>>>
>>>       
> org.apache.tuscany.sdo.impl.ChangeSummaryImpl.beginLogging(
>   
>>> ChangeSummaryImpl.java:190)
>>>        at
>>>
>>>       
> com.abc.servlet.TestServlet.doPost(TestServlet.java:156)
>   
>>>        at
>>>
>>>       
> com.abc.servlet.TestServlet.doGet(TestServlet.java:127)
>   
>>>        at
>>>
>>>       
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>   
>>>        at
>>>
>>>       
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(
>   
>>> StrictServletInstance.java:110)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(
>   
>>> StrictLifecycleServlet.java:174)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.servlet.IdleServletState.service(
>   
>>> StrictLifecycleServlet.java:313)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(
>   
>>> StrictLifecycleServlet.java:116)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.servlet.ServletInstance.service(
>   
>>> ServletInstance.java:283)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(
>   
>>> ValidServletReferenceState.java:42)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(
>   
>>> ServletInstanceReference.java:40)
>>>        at
>>>
>>>
>>>       
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch
>   
>>> (WebAppRequestDispatcher.java:1018)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(
>   
>>> WebAppRequestDispatcher.java:529)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(
>   
>>> WebAppRequestDispatcher.java:208)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java
>   
>>> :134)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(
>   
>>> WebAppInvoker.java:321)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation
>   
>>> (CachedInvocation.java:71)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(
>   
>>> ServletRequestProcessor.java:246)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(
>   
>>> OSEListener.java:334)
>>>        at
>>>
>>>       
> com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(
>   
>>> HttpConnection.java:56)
>>>        at
>>>
>>>       
> com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java
>   
>>> :652)
>>>        at
>>>
>>>       
> com.ibm.ws.http.HttpConnection.run(HttpConnection.java:448)
>   
>>>        at
>>>
>>>       
> com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:937)
>   
>>> Caused by: java.lang.NullPointerException
>>>        at
>>>
>>>       
> org.eclipse.emf.ecore.change.ChangePackage$Literals.<clinit>(
>   
>>> ChangePackage.java:903)
>>>        at java.lang.Class.initializeImpl(Native
>>>       
>> Method)
>>     
>>>        at
>>>       
>> java.lang.Class.initialize(Class.java:339)
>>     
>>>        at
>>>
>>>       
> org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl.getObjectChanges(
>   
>>> ChangeDescriptionImpl.java:141)
>>>        at
>>>       
> === message truncated ===
>
>
>
>  
> ____________________________________________________________________________________
> Bored stiff? Loosen up... 
> Download and play hundreds of games for free on Yahoo! Games.
> http://games.yahoo.com/games/front
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>  
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>   


Re: DataObject with contained DataGraph causes NullPointerException in ChangePackage$Literals

Posted by Erich Rueede <er...@yahoo.com>.
Hi Kelvin

Yes, this partly represents my szenario. It works for
me in a standalone JVM. It works also within a simple
servlet szenario. It doesn't work in a servlet/ejb
szenario when I run an initialization step when
starting up the ejb module such as:

HelperContext hc = HelperProvider.getDefaultContext();
Factory.INSTANCE.register(hc);

This initialization is required in order to have all
types registered for subsequent rmi/iiop calls. Btw,
without having a datagraph in my SDO hierarchy, it all
works fine, even in the servlet/ejb szenario.

If I omit the initialization step in the ejb, the
servlet works fine but the ejb fails when
deserializing the serialized datagraph.

To me this looks like something (the change package)
registered during the ejb initialization in the global
registry is not visible to the servlet afterwards.

Thanks Erich
--- kelvin goodson <ke...@gmail.com> wrote:

> Hi Erich,
> 
> I generated code from your schema and tried the
> following lines of code,
> which executed without failure ...
> 
> 
> *public* *void* testErichsProblem() *throws*
> Exception {
> 
>   PublicationDataGraph pdg =
>
ServicesFactory.*INSTANCE*.createPublicationDataGraph();
> 
>   DataObject dob = (DataObject)pdg;
>   ChangeSummary cs = dob.getChangeSummary();
>   cs.beginLogging();
> }
> 
> does this represent a distilled version of your
> scenario?
> 
> Regards,Kelvin
> On 29/06/07, Erich Rueede <er...@yahoo.com> wrote:
> >
> > Hi
> >
> > I am testing with the SDO beta-1 code.
> >
> > I generated static SDO classes with an embedded
> > datagraph by extending the BaseDataGraphType
> > as described in the SDO 2.1 spec using the
> following
> > XSD:
> >
> > <xsd:schema
> xmlns="http://www.w3.org/2001/XMLSchema"
> >        targetNamespace="http://abc.com/services"
> >        xmlns:tns="http://abc.com/services"
> >        xmlns:sdo="commonj.sdo"
> > xmlns:sdoJava="commonj.sdo/java"
> > xmlns:sdoXml="commonj.sdo/xml"
> >        sdoJava:package="com.abc.services"
> >       
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >
> >        <xsd:complexType
> name="PublicationDataGraph">
> >                <complexContent>
> >                        <extension
> base="sdo:BaseDataGraphType">
> >                                <xsd:sequence>
> >                                               
> <xsd:element name="test"
> > type="xsd:string" />
> >                                </xsd:sequence>
> >                        </extension>
> >                </complexContent>
> >        </xsd:complexType>
> >
> >        <xsd:complexType
> name="ModifyPublicationInput"
> >                <xsd:sequence>
> >                        <xsd:element
> name="PublicationDataGraph"
> > type="tns:PublicationDataGraph" />
> >                </xsd:sequence>
> >        </xsd:complexType>
> > </xsd:schema>
> >
> >
> > After I instantiated the top level DataObject
> > (ModifyPubicationInput) containing the embedded
> > Datagraph,
> > I tried to beginLogging which causes the following
> > exception in
> >
>
org.eclipse.emf.ecore.change.ChangePackage$Literals.<clinit>(
> > ChangePackage.java:903).
> >
> > The same exception also happens when I try to
> > serialize the toplevel DataObject to XML or when I
> try
> > to
> > send it via RMI/IIOP to an EJB.
> >
> >
> > [6/29/07 11:32:31:898 CEST] 7dec7dec WebGroup     
> E
> > SRVE0026E: [Servlet Error]-[]:
> > java.lang.ExceptionInInitializerError
> >        at
> java.lang.Class.initialize(Class.java:345)
> >        at
> >
>
org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl.getObjectChanges(
> > ChangeDescriptionImpl.java:141)
> >        at
> >
>
org.apache.tuscany.sdo.impl.ChangeSummaryImpl.beginLogging(
> > ChangeSummaryImpl.java:190)
> >        at
> >
>
com.abc.servlet.TestServlet.doPost(TestServlet.java:156)
> >        at
> >
>
com.abc.servlet.TestServlet.doGet(TestServlet.java:127)
> >        at
> >
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> >        at
> >
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >        at
> >
>
com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(
> > StrictServletInstance.java:110)
> >        at
> >
>
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(
> > StrictLifecycleServlet.java:174)
> >        at
> >
>
com.ibm.ws.webcontainer.servlet.IdleServletState.service(
> > StrictLifecycleServlet.java:313)
> >        at
> >
>
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(
> > StrictLifecycleServlet.java:116)
> >        at
> >
>
com.ibm.ws.webcontainer.servlet.ServletInstance.service(
> > ServletInstance.java:283)
> >        at
> >
>
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(
> > ValidServletReferenceState.java:42)
> >        at
> >
>
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(
> > ServletInstanceReference.java:40)
> >        at
> >
> >
>
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch
> > (WebAppRequestDispatcher.java:1018)
> >        at
> >
>
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(
> > WebAppRequestDispatcher.java:529)
> >        at
> >
>
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(
> > WebAppRequestDispatcher.java:208)
> >        at
> >
>
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java
> > :134)
> >        at
> >
>
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(
> > WebAppInvoker.java:321)
> >        at
> >
>
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation
> > (CachedInvocation.java:71)
> >        at
> >
>
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(
> > ServletRequestProcessor.java:246)
> >        at
> >
>
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(
> > OSEListener.java:334)
> >        at
> >
>
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(
> > HttpConnection.java:56)
> >        at
> >
>
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java
> > :652)
> >        at
> >
>
com.ibm.ws.http.HttpConnection.run(HttpConnection.java:448)
> >        at
> >
>
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:937)
> > Caused by: java.lang.NullPointerException
> >        at
> >
>
org.eclipse.emf.ecore.change.ChangePackage$Literals.<clinit>(
> > ChangePackage.java:903)
> >        at java.lang.Class.initializeImpl(Native
> Method)
> >        at
> java.lang.Class.initialize(Class.java:339)
> >        at
> >
>
org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl.getObjectChanges(
> > ChangeDescriptionImpl.java:141)
> >        at
> 
=== message truncated ===



 
____________________________________________________________________________________
Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front

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