You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Lasse Pommerenke <lp...@j2l.de> on 2002/08/14 15:36:32 UTC

My Pull-Tool is not working

1) My Java-Source for the pull tool looks like this:

===cut===
package de.byteaction.buddy;

import java.util.Vector;
import org.apache.turbine.services.pull.ApplicationTool;
import org.apache.turbine.util.RunData;
import org.apache.turbine.util.db.Criteria;
import de.byteaction.buddy.om.Projekt;
import de.byteaction.buddy.om.AzubiPeer;
import de.byteaction.buddy.om.ProjektPeer;
import de.byteaction.buddy.om.KommentarPeer;
import de.byteaction.buddy.om.ProjektabschnittPeer;
import de.byteaction.buddy.om.AzubiProjektabschnittPeer;
import de.byteaction.buddy.modules.actions.ProjektAbschnitt;

/** @version $Id$ */

/* $Log$ */

public class BuddyTool implements ApplicationTool {

    /** The object containing request specific data */
    private RunData data;

    /** initialisieren... */
    public void init( Object data ) {
        this.data = ( RunData )data;
    }

    /** nulls out the issue and user objects */
    public void refresh() {
        // do not need since it is a request tool
    }

    /** liefert ALLE Azubis in der Datenbank */
    public Vector getAzubis() {
        Vector v = null;
        try {
            v = AzubiPeer.doSelect( new Criteria() );
            System.out.println( "Azubis: " + v.toString() );
        }
        catch ( Exception e ) {}
        return v;

    }
}
===cut===

When I run 'ant compile', I end up with a BuddyTool.class in
/WEB-INF/classes/de/byteaction/buddy, which seems all right to me.

2) Next I edit my TurbineResources.properties:

===cut===
.
.
.
tool.request.buddy=de.byteaction.buddy.BuddyTool;
.
.
.
===cut===

3) I start tomcart and find the following line (among many others) in
/logs/turbine.log:

===cut===
[Wed Aug 14 15:06:17 CEST 2002] -- ERROR -- Cannot find tool class
de.byteaction.buddy.BuddyTool;, please check the name of the class.
===cut===

4) Not knowing that there has been an error already, I log into the
applacation which I find under
http://localhost:8080/project-bud/servlet/project-bud/

5) I use (or intend to use) that pull tool in this template
(showAzubis.vm):
===cut===
<table>
#foreach ($azubi in $buddy.azubis )
	<tr>
		<td>Nachname: $azubi.nname()</td>
		<td>Vorname: $azubi.vname()</td>
	</tr>
#end
</table>
===cut===
When I "execute" that template I don't see the exspected output, not
even an error Message. 

6) I know that the template is accessed (velocity.log):
===cut===
Wed Aug 14 15:29:59 CEST 2002   [info] ResourceManager : found
screens/showAzubis.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Wed Aug 14 15:29:59 CEST 2002   [info] ResourceManager : found
layouts/Default.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Wed Aug 14 15:29:59 CEST 2002   [info] ResourceManager : found
navigations/DefaultTop.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Wed Aug 14 15:29:59 CEST 2002   [info] ResourceManager : found
navigations/Menu.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Wed Aug 14 15:30:00 CEST 2002   [info] ResourceManager : found
navigations/DefaultBottom.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
===cut===

Q1: Do you have any hints what I might have forgotten?
Q2: What else should I check?
Thanks in advance
---Lasse
PS: an "Azubi" ist an trainee :-)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: My Pull-Tool is not working

Posted by Sven Homburg <Sv...@hsofttec.com>.
try this

public class BuddyTool implements Recyclable,ApplicationTool

LP> 1) My Java-Source for the pull tool looks like this:

LP> ===cut===
LP> package de.byteaction.buddy;

LP> import java.util.Vector;
LP> import org.apache.turbine.services.pull.ApplicationTool;
LP> import org.apache.turbine.util.RunData;
LP> import org.apache.turbine.util.db.Criteria;
LP> import de.byteaction.buddy.om.Projekt;
LP> import de.byteaction.buddy.om.AzubiPeer;
LP> import de.byteaction.buddy.om.ProjektPeer;
LP> import de.byteaction.buddy.om.KommentarPeer;
LP> import de.byteaction.buddy.om.ProjektabschnittPeer;
LP> import de.byteaction.buddy.om.AzubiProjektabschnittPeer;
LP> import de.byteaction.buddy.modules.actions.ProjektAbschnitt;

LP> /** @version $Id$ */

LP> /* $Log$ */

LP> public class BuddyTool implements ApplicationTool {

LP>     /** The object containing request specific data */
LP>     private RunData data;

LP>     /** initialisieren... */
LP>     public void init( Object data ) {
LP>         this.data = ( RunData )data;
LP>     }

LP>     /** nulls out the issue and user objects */
LP>     public void refresh() {
LP>         // do not need since it is a request tool
LP>     }

LP>     /** liefert ALLE Azubis in der Datenbank */
LP>     public Vector getAzubis() {
LP>         Vector v = null;
LP>         try {
LP>             v = AzubiPeer.doSelect( new Criteria() );
LP>             System.out.println( "Azubis: " + v.toString() );
LP>         }
LP>         catch ( Exception e ) {}
LP>         return v;

LP>     }
LP> }
LP> ===cut===

LP> When I run 'ant compile', I end up with a BuddyTool.class in
LP> /WEB-INF/classes/de/byteaction/buddy, which seems all right to me.

LP> 2) Next I edit my TurbineResources.properties:

LP> ===cut===
LP> .
LP> .
LP> .
LP> tool.request.buddy=de.byteaction.buddy.BuddyTool;
LP> .
LP> .
LP> .
LP> ===cut===

LP> 3) I start tomcart and find the following line (among many others) in
LP> /logs/turbine.log:

LP> ===cut===
LP> [Wed Aug 14 15:06:17 CEST 2002] -- ERROR -- Cannot find tool class
LP> de.byteaction.buddy.BuddyTool;, please check the name of the class.
LP> ===cut===

LP> 4) Not knowing that there has been an error already, I log into the
LP> applacation which I find under
LP> http://localhost:8080/project-bud/servlet/project-bud/

LP> 5) I use (or intend to use) that pull tool in this template
LP> (showAzubis.vm):
LP> ===cut===
LP> <table>
LP> #foreach ($azubi in $buddy.azubis )
LP>         <tr>
LP>                 <td>Nachname: $azubi.nname()</td>
LP>                 <td>Vorname: $azubi.vname()</td>
LP>         </tr>
LP> #end
LP> </table>
LP> ===cut===
LP> When I "execute" that template I don't see the exspected output, not
LP> even an error Message. 

LP> 6) I know that the template is accessed (velocity.log):
LP> ===cut===
LP> Wed Aug 14 15:29:59 CEST 2002   [info] ResourceManager : found
LP> screens/showAzubis.vm with loader
LP> org.apache.velocity.runtime.resource.loader.FileResourceLoader
LP> Wed Aug 14 15:29:59 CEST 2002   [info] ResourceManager : found
LP> layouts/Default.vm with loader
LP> org.apache.velocity.runtime.resource.loader.FileResourceLoader
LP> Wed Aug 14 15:29:59 CEST 2002   [info] ResourceManager : found
LP> navigations/DefaultTop.vm with loader
LP> org.apache.velocity.runtime.resource.loader.FileResourceLoader
LP> Wed Aug 14 15:29:59 CEST 2002   [info] ResourceManager : found
LP> navigations/Menu.vm with loader
LP> org.apache.velocity.runtime.resource.loader.FileResourceLoader
LP> Wed Aug 14 15:30:00 CEST 2002   [info] ResourceManager : found
LP> navigations/DefaultBottom.vm with loader
LP> org.apache.velocity.runtime.resource.loader.FileResourceLoader
LP> ===cut===

LP> Q1: Do you have any hints what I might have forgotten?
LP> Q2: What else should I check?
LP> Thanks in advance
LP> ---Lasse
LP> PS: an "Azubi" ist an trainee :-)


LP> --
LP> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
LP> For additional commands, e-mail: <ma...@jakarta.apache.org>



Best regards
homburg Softwaretechnik
Sven Homburg
D-21220 Seevetal

http://www.hsofttec.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: My Pull-Tool is not working (F'UP)

Posted by Lasse Pommerenke <lp...@j2l.de>.
I forgot some details:

OS: Windows 2000
ant -version : Ant version 1.3 compiled on March 2 2001
TDK 2.1

---Lasse


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>