[ 
https://issues.apache.org/jira/browse/TUSCANY-1479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516038
 ] 

Frank Budinsky commented on TUSCANY-1479:
-----------------------------------------

The SDO generator in RAD is the Eclipse EMF generator supporting SDO 1.0. The 
EMF codegenerator supports a "large model" pattern, whereby if a model is very 
large, instead of generating code to initialize the metadata, it generates a 
call to load the metadata from a file. The Tuscany SDO generator does not 
currently have a similar feature, although it would be good to add one. Perhaps 
you'd like to open a JIRA feature request for that.

In the meantime, the workaround is to manually break up the createXSDMetaData() 
method into several smaller methods.

> The code of method createXSDMetaData(ModelFactoryImpl) is exceeding the 65535 
> bytes limit
> -----------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1479
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1479
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Tools
>    Affects Versions: Java-SDO-beta1
>         Environment: Rational 7.0.0.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 
> j9vmxi3223ifx-20070323 (JIT enabled)
>            Reporter: Eric Coolman
>
> I am attempting to have a number of root objects creatable from a single 
> factory, ie. my main xsd contains a number of imports:
> <xsd:include schemaLocation="SyncItemClass.xsd"/>
> <xsd:include schemaLocation="SyncCatalog.xsd"/>
> <xsd:include schemaLocation="AddRFQ.xsd"/>
> <xsd:include schemaLocation="CancelRFQ.xsd"/>
> <xsd:include schemaLocation="ProcessPO.xsd"/>
> ... etc.
> This works well for me with the SDO Generator in RAD, but tuscany is 
> generating a very large createXSDMetaData() method that will not compile:
> java.lang.Error: Unresolved compilation problem: 
>       The code of method createXSDMetaData(ModelFactoryImpl) is exceeding the 
> 65535 bytes limit
>       at 
> com.ibm.ocs.sdo.impl.SdoFactoryImpl.createXSDMetaData(SdoFactoryImpl.java:10695)
>       at 
> com.ibm.ocs.sdo.impl.SdoFactoryImpl.initializeMetaData(SdoFactoryImpl.java:10692)
>       at com.ibm.ocs.sdo.impl.SdoFactoryImpl.init(SdoFactoryImpl.java:3455)
>       at com.ibm.ocs.sdo.SdoFactory.<clinit>(SdoFactory.java:28)
>       at java.lang.J9VMInternals.initializeImpl(Native Method)
>       at java.lang.J9VMInternals.initialize(J9VMInternals.java:187)
>       at 
> com.ibm.ocs.sdo.test.ProcessPOTestCase.testSerializePO(ProcessPOTestCase.java:42)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:615)
>       at junit.framework.TestCase.runTest(TestCase.java:154)
>       at junit.framework.TestCase.runBare(TestCase.java:127)
>       at junit.framework.TestResult$1.protect(TestResult.java:106)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at junit.framework.TestResult.run(TestResult.java:109)
>       at junit.framework.TestCase.run(TestCase.java:118)
>       at junit.framework.TestSuite.runTest(TestSuite.java:208)
>       at junit.framework.TestSuite.run(TestSuite.java:203)
>       at 
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
>       at 
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> The createXSDMetaData method looks like this fragment:
>   protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
>   {
>     super.initXSD();
>     
>     Property property = null;
>     
>     addXSDMapping
>       (acknowledgeCompanyType,
>        new String[] 
>        {
>        "name", "AcknowledgeCompany",
>        "kind", "elementOnly"
>        });
>     addXSDMapping
>       (getProperty(acknowledgeCompanyType, 
> AcknowledgeCompanyImpl.INTERNAL_HEADER),
>        new String[]
>        {
>        "kind", "element",
>        "name", "header"
>        });
>     addXSDMapping
>       (controlVerbType,
>        new String[] 
>        {
>        "name", "ControlVerb",
>        "baseType", "commonj.sdo#String",
>        "enumeration", "GET GETLIST SHOW LIST VALIDATE ACKNOWLEDGE ADD CHANGE 
> CANCEL PROCESS REGISTER RESPOND SYNC"
>        });
>     addXSDMapping
>       (countryCodeType,
>        new String[] 
>        {
>        "name", "countryCode",
>        "baseType", "commonj.sdo#String",
>        "enumeration", "AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA 
> BB BD BE BF BG BH BI BJ BM BN BO BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK 
> CL CM CN CO CR CS CU CV CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ 
> FK FM FO FR GA GB GD GE GF GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR 
> HT HU ID IE IL IN IO IQ IR IS IT JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA 
> LB LC LI LK LR LS LT LU LV LY MA MC MD MG MH MK ML MM MN MO MP MQ MR MS MT MU 
> MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM 
> PN PR PS PT PW PY QA RE RO RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR 
> ST SV SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ 
> VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW"
>        });
>     addXSDMapping
>       (currencyCodeType,
>        new String[] 
>        {
>        "name", "currencyCode",
>        "baseType", "commonj.sdo#String",
>        "enumeration", "AED AFA ALL AMD ANG AOA ARS AUD AWG AZM BAM BBD BDT 
> BGN BHD BIF BMD BND BOB BRL BSD BTN BWP BYR BZD CAD CDF CHF CLP CNY CRC CSD 
> CUP CVE CYP CZK DJF DKK DOP DZD EEK EGP ERN ETB EUR FJD FKP GBP GEL GGP GHC 
> GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS IMP INR IQD IRR ISK JEP JMD 
> JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LTL LVL LYD 
> MAD MDL MGA MKD MMK MNT MOP MRO MTL MUR MVR MWK MXN MYR MZM NAD NGN NIO NOK 
> NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RUB RWF SAR SBD SCR SDD SEK 
> SGD SHP SIT SKK SLL SOS SPL SRD STD SVC SYP SZL THB TJS TMM TND TOP TRL TRY 
> TTD TVD TWD TZS UAH UGX USD UYU UZS VEB VND VUV WST XAF XAG XAU XCD XDR XOF 
> XPD XPF XPT YER ZAR ZMK ZWD"
>        });
>     addXSDMapping
>       (idType,
>        new String[] 
>        {
>        "name", "id_._type",
>        "baseType", "commonj.sdo#String",
>        "enumeration", "FREIGHT FREIGHTTAX OTHERCHARGES TAX GST HST PST QST"
>        });
> ... etc.   addXSDMapping fragment is repeated for every object. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to