You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Mojmir.Hanes" <Mo...@seznam.cz> on 2006/06/13 21:47:31 UTC

Maven torque plugin incorrectly generates BaseXXXPeer.java files in torque:om goal if property torque.subpackage.object is specified

Hi folks, it seems maven-torque plugin incorrectly generates BaseXXXPeer 
      java sources if property torque.subpackage.object is specified.

Error can be reproduced this way

1. set property torque.subpackage.object (for example 
torque.subpackage.object = object)
2. execute maven torque:om goal
3. examine generated BaseXXXPeer.java files. Look for lines

     /** A class that can be returned by this peer. */
     protected static final String CLASSNAME_DEFAULT =
         "${package}.${table}";

(instead of velocity variables package and table  you'll see substituted 
values, of course)

Correct lines should looks like

     /** A class that can be returned by this peer. */
     protected static final String CLASSNAME_DEFAULT =
         "${packageObject}.${table}";


Bug is in Torque templates module, in file 
templates/src/templates/om/Peer.vm

I'm sending you patch which corrects this minor bug.

Anyway, your Torque 'suite' is great, I love examining it.

Best regards

Mojmir Hanes aka miuek (Mojmir.Hanes@seznam.cz)

P.S. I'd commit patch to SVN, if I had/know username/password for write 
access - could you send me it or send me link with information how to 
obtain it ? Or it is impossible to write changes to svn for non-project 
developers ?

P.S 2 Here is stack trace before applying patch

13.06.2006 21:00:55 ERROR [org.apache.torque.util.BasePeer] A FATAL 
ERROR has occurred which should not have happened under any 
circumstance.  Please notify the Torque developers 
<to...@db.apache.org> and give as many details as possible 
(including the error stack trace).
java.lang.ClassNotFoundException: sk.miuek.littlegolem.om.Player
	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:164)
	at 
sk.miuek.littlegolem.om.BasePlayerPeer.initClass(BasePlayerPeer.java:112)
	at sk.miuek.littlegolem.om.BasePlayerPeer.<clinit>(BasePlayerPeer.java:99)
	at sk.miuek.littlegolem.om.BasePlayer.<clinit>(BasePlayer.java:41)
	at sk.miuek.littlegolem.Main.main(Main.java:146)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at com.werken.forehead.Forehead.run(Forehead.java:551)
	at com.werken.forehead.Forehead.main(Forehead.java:581)
13.06.2006 21:00:56 DEBUG [org.apache.torque.util.Transaction] called 
safeRollback with null argument
13.06.2006 21:00:56 ERROR [sk.miuek.littlegolem.Main] Exception has been 
thrown, e