Re: 3.3 to 4.0 migration

Thomas Fox <[email protected]> Wed, 24 Sep 2014 10:22:08 +0200 (CEST)
Newsgroups gmane.comp.jakarta.turbine.torque.user
Message-ID <[email protected]>
Hi Youngho

can you please replace the schema location=20

http://db.apache.org/torque/4.0/templates/database.xsd

by

http://db.apache.org/torque/torque-4.0/documentation/orm-reference/database=
-4-0.xsd

This has changed in trunk.

   Thanks,

       Thomas

Youngho Co wrote:

Hello Thomas,

I checkout fresh torque and turbine/fulcrum trunk
and build torque4 trunk successfully.

But  when I build fulcrum security module (using torque-4.1-SNAPSHOT module=
s)
I got following error.

I am not sure it is torque-4.1 environent or not.


Thanks,

Youngho

[INFO] --------------------------------------------------------------------=
----
[INFO] Building Fulcrum Security Torque Impl 1.1.0-SNAPSHOT
[INFO] --------------------------------------------------------------------=
----
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @
fulcrum-security-torque ---
[INFO]
[INFO] --- torque-maven-plugin:4.1-SNAPSHOT:generate (torque-om) @
fulcrum-security-torque ---
INFO  org.apache.torque.generator.control.Controller -
readConfiguration() : Starting to read configuration files
INFO  org.apache.torque.generator.configuration.controller.Log4jLoggingAdap=
ter
- apply() : Setting loglevel to ERROR
[ERROR]
org.apache.torque.generator.source.SourceException: Error parsing XML
source file: schema_reference.4: Failed to read schema document
'http://db.apache.org/torque/4.0/templates/database.xsd', because 1)
could not find the document; 2) the document could not be read; 3) the
root element of the document is not <xsd:schema>.
    at org.apache.torque.generator.source.stream.XmlSourceFormat.parse(XmlS=
ourceFormat.java:143)
    at org.apache.torque.generator.source.stream.FileSource.createRootEleme=
nt(FileSource.java:147)
    at org.apache.torque.generator.source.SourceImpl.getRootElement(SourceI=
mpl.java:48)
    at org.apache.torque.generator.control.Controller.processSourceInOutput=
(Controller.java:326)
    at org.apache.torque.generator.control.Controller.processOutput(Control=
ler.java:297)
    at org.apache.torque.generator.control.Controller.processGenerationUnit=
(Controller.java:232)
    at org.apache.torque.generator.control.Controller.run(Controller.java:1=
43)
    at org.apache.torque.generator.maven.TorqueGeneratorMojo.execute(Torque=
GeneratorMojo.java:693)

2014-09-24 16:20 GMT+09:00 Thomas Fox <[email protected]>:
> Hi Youngho,
>
> that feature is already implemented in trunk.
> If you wish you can checkout the trunk and then this error should disappe=
ar.
>
>    Thomas
>
> ----- Urspr=C3=BCngliche Mail -----
> Youngho Cho wrote:
>
> Hello Thomas,
>
> In order to learn how torque-4.0 generator works
>
> I tried to build
>
> Turbine/Fulcrum/Torque Security module in trunk.
>
> But I got following build error.
>
> [INFO] ------------------------------------------------------------------=
------
> [INFO] Building Fulcrum Security Torque Impl 1.1.0-SNAPSHOT
> [INFO] ------------------------------------------------------------------=
------
> [INFO]
> [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @
> fulcrum-security-torque ---
> [INFO]
> [INFO] --- torque-maven-plugin:4.0:generate (torque-om) @
> fulcrum-security-torque ---
> INFO  org.apache.torque.generator.control.Controller -
> readConfiguration() : Starting to read configuration files
> INFO  org.apache.torque.generator.configuration.controller.Log4jLoggingAd=
apter
> - apply() : Setting loglevel to ERROR
> [ERROR]
> org.apache.torque.generator.source.SourceException: Error parsing XML
> source file: cvc-complex-type.3.2.2: Attribute 'peerInterface' is not
> allowed to appear in element 'table'.
>     at org.apache.torque.generator.source.stream.XmlSourceFormat.parse(Xm=
lSourceFormat.java:143)
>     at org.apache.torque.generator.source.stream.FileSource.createRootEle=
ment(FileSource.java:134)
>     at org.apache.torque.generator.source.SourceImpl.getRootElement(Sourc=
eImpl.java:48)
>     at org.apache.torque.generator.control.Controller.processSourceInOutp=
ut(Controller.java:256)
>     at org.apache.torque.generator.control.Controller.processOutput(Contr=
oller.java:228)
>     at org.apache.torque.generator.control.Controller.processGenerationUn=
it(Controller.java:181)
>     at org.apache.torque.generator.control.Controller.run(Controller.java=
:111)
>     at org.apache.torque.generator.maven.TorqueGeneratorMojo.execute(Torq=
ueGeneratorMojo.java:678)
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Defa=
ultBuildPluginManager.java:101)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecu=
tor.java:209)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecu=
tor.java:153)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecu=
tor.java:145)
>     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildPr=
oject(LifecycleModuleBuilder.java:84)
>     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildPr=
oject(LifecycleModuleBuilder.java:59)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreade=
dBuild(LifecycleStarter.java:183)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifec=
ycleStarter.java:161)
>     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
>     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
>     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
>     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
>     at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorIm=
pl.java:57)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc=
cessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(L=
auncher.java:290)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.=
java:230)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode=
(Launcher.java:409)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.ja=
va:352)
> Caused by: org.xml.sax.SAXParseException; lineNumber: 37;
> columnNumber: 94; cvc-complex-type.3.2.2: Attribute 'peerInterface' is
> not allowed to appear in element 'table'.
>     at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException=
(Unknown
> Source)
>     at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
>     at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source=
)
>     at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source=
)
>     at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source=
)
>     at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.repo=
rtError(Unknown
> Source)
>     at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unk=
nown
> Source)
>     at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unk=
nown
> Source)
>     at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Un=
known
> Source)
>     at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown =
Source)
>     at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(U=
nknown
> Source)
>     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentCont=
entDispatcher.dispatch(Unknown
> Source)
>     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument=
(Unknown
> Source)
>     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>     at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown S=
ource)
>     at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
>     at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
>     at org.apache.torque.generator.source.stream.XmlSourceFormat.parse(Xm=
lSourceFormat.java:132)
>     ... 28 more
> [INFO] ------------------------------------------------------------------=
------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Fulcrum Security Master Build ..................... SUCCESS [2.042=
s]
> [INFO] Fulcrum Security API .............................. SUCCESS [6.811=
s]
> [INFO] Fulcrum Security Hibernate Impl ................... SUCCESS [28.78=
7s]
> [INFO] Fulcrum Security Memory Impl ...................... SUCCESS [10.05=
3s]
> [INFO] Fulcrum Security Torque Impl ...................... FAILURE [0.935=
s]
> [INFO] ------------------------------------------------------------------=
------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------=
------
> [INFO] Total time: 48.893s
> [INFO] Finished at: Wed Sep 24 13:49:11 KST 2014
> [INFO] Final Memory: 20M/49M
> [INFO] ------------------------------------------------------------------=
------
> [ERROR] Failed to execute goal
> org.apache.torque:torque-maven-plugin:4.0:generate (torque-om) on
> project fulcrum-security-torque: Error parsing XML source file:
> cvc-complex-type.3.2.2: Attribute 'peerInterface' is not allowed to
> appear in element 'table'. -> [Help 1]
> [ERROR]
>
>
> How can I fix it ?
>
> Thanks,
>
> Youngho
>
> 2014-09-17 4:56 GMT+09:00 Thomas Fox <[email protected]>:
>> Youngho Cho wrote:
>> ....
>>>
>>> For the 4.0 generator usage,
>>>
>>> In my 3.3 schema xml
>>>
>>> I use database/baseClass like
>>>
>>> <database name=3D"@DATABASE_PROP_NAME@"
>>>   baseClass=3D"com.nannet.jettiger.om.AbstractCache"
>>>  defaultJavaType=3D"object">
>>>
>>> and in the AbstractCache class, I put common function for all generated=
 class.
>>>
>>> In order to migrate to torque4, how to be a change ?
>>>
>> Hi Youngho,
>>
>> As far as I found you have different options
>> - set the torque.om.dbObjectDefaultBaseClass generator option
>> - set the baseClass attribute on the database element in the schema
>> - set the baseClass attribute on the table element in the schema
>>
>> So your old method should still work.
>>
>>    Hope that helps,
>>
>>           Thomas
>>
>> 2014-09-12 17:21 GMT+09:00 Thomas Fox <[email protected]>:
>>> Hello Youngho
>>>
>>>> ...
>>>> The Generator looks like different
>>>
>>> Yes it is new-written and now better extensible. But if you have not ch=
anged the templates this should not bother you. If you have changed the tem=
plates, you can now specifically overwrite specific templates, no need to c=
opy the whole tree.
>>>
>>>> ...
>>>> Is there any plan to migrate JCS from 1.3.x to 2.x for torque4 ?
>>>
>>> Currently there is no plan I am aware of.  But I am working on 4.1 curr=
ently, if you feel this would be an improvement please add a feature reques=
t to the torque issue tracker.
>>>
>>>   Thanks,
>>>
>>>           Thomas
>>>
>>> ----- Urspr=C3=BCngliche Mail -----
>>> Von: "Youngho Cho" <[email protected]>
>>> An: "Thomas Fox" <[email protected]>
>>> CC: "Apache Torque Users List" <[email protected]>
>>> Gesendet: Freitag, 12. September 2014 10:11:15
>>> Betreff: Re: 3.3 to 4.0 migration
>>>
>>> Hello Tomas,
>>>
>>> Quicky read the torque4 document,
>>> I think I need some learing period for migration from 3.3.x to 4.x,
>>>>
>>> The BaseObject removed,
>>> The Generator looks like different
>>> and many chaned
>>> I need a better understanding about torque4 before my application's
>>> migration start.
>>>
>>> At this moment, I have a question.
>>>
>>> Is there any plan to migrate JCS from 1.3.x to 2.x for torque4 ?
>>>
>>> Thanks,
>>>
>>> Youngho
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> 2014-09-09 9:23 GMT+09:00 Youngho Cho <[email protected]>:
>>>> Hello Thomas,
>>>>
>>>> I am gathering an information for the migration at this moment.
>>>>
>>>> When I start the migration and have some specific question I will ask.
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Youngho
>>>>
>>>> 2014-09-08 16:21 GMT+09:00 Thomas Fox <[email protected]>:
>>>>> This is the only document i know in the official documentation.
>>>>> Do you have any specific questions?
>>>>>
>>>>>    Thomas
>>>>>
>>>>>
>>>>> ----- Urspr=C3=BCngliche Mail -----
>>>>> Von: "Scott Eade" <[email protected]>
>>>>> An: "Youngho Cho" <[email protected]>
>>>>> CC: [email protected]
>>>>> Gesendet: Sonntag, 7. September 2014 06:26:59
>>>>> Betreff: Re: 3.3 to 4.0 migration
>>>>>
>>>>>
>>>>>
>>>>>> On 7 Sep 2014, at 12:22 pm, Youngho Cho <[email protected]> wrot=
e:
>>>>>>
>>>>>> Hello
>>>>>>
>>>>>> I am preparing torque 3.3 to 4.0 migration.
>>>>>>
>>>>>> I read torque-4.0/documentation/orm-reference/migration-from-torque-=
3.html.
>>>>>> But I hope to know more detail information.
>>>>>>
>>>>>> Is there any more detail document / information for migration proces=
s ?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Youngho
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [email protected]
>>>>> For additional commands, e-mail: [email protected]
>>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>