"Brad Matlack" <[EMAIL PROTECTED]> writes:

> Ok,
> I've taken your advice and used the non-turbine version of torque.  By
> setting the full path, TurbineConfig finds TurbineResources.properties fine.
> 
> //here's a sample that compiles and throws a new runtime exception
> public static void main(String args[])
>  {
>   try{
>     TurbineConfig tc = new
> TurbineConfig("c:/torque","TurbineResources.properties");
>     tc.init();
>     Criteria crit = new Criteria();
>     Vector v = SimplePeer.doSelect(crit);
>     }catch(Exception e){
>       System.out.println(e.getMessage());
>     }
>   } // end main
> 
> The error indicates an invalid logfile setting:
> java.lang.Error: VelocityService runtime logfile is misconfigured: 'null' is
> not a valid logfile ...
> at
> org.apache.turbine.services.velocity.TurbineVelocityService.initVelocity(Tur
> bineVelocityService.java:427)
> 
> A closer look at the code reveals a static variable being used:
> Velocity.RUNTIME_LOG:
> 
> // heres the TurbineVelocityService.java code
> private void initVelocity() throws InitializationException
> {
>  // Now we have to perform a couple of path translations
>  // for our log file and template paths.
>  String path = getRealPath(
> getConfiguration().getString(Velocity.RUNTIME_LOG, null));
> ...
> 
> The current version of  org.apache.velocity.app.Velocity does not use any
> static variables.

But it *does* implement RuntimeConstants, which defines the log file
property:

    /** 
     * Location of the velocity log file.
     */
    public static final String RUNTIME_LOG = 
        "runtime.log";

> Therefore, is this a BUG???

If your Velocity log file exists, before you start up Turbine, I bet
everything will work fine.  getRealPath() is probably being called
somewhere, and TurbineConfig's implementation of that returns null
when the specified file does not exist (as per the contract of older
versions of the ServletContext interface).

Let me know if creating the log file before hand works for you.

> And why isn't there a simple "Hello Peers" application out there that works?

I think I hear a volunteer!  Whew, finally...

Daniel

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

Reply via email to