You should initialize turbine before you using any turbine service.
Peer use turbine's TurbineDB service internally.
TurbineConfig tc = new TurbineConfig(base_path,
"path/of/TurbineResources.properties");
tc.init();
If you want to disable some services, just edit
TurbineResources.properties and delete those lines. But
ResourceService, PoolBrokerService and MapBrokerService should not be
deleted.
----- Original Message -----
From: Roland_R=F6der <[EMAIL PROTECTED]>
Date: Sunday, May 27, 2001 11:15 pm
Subject: Using the Peer classes
> I want to use the generated peer classes as a standalone database
> layerwithout the whole html stuff. Generation and compiling for
> table Histrate
> works well, but if I run my main method, I get an excpetion:
>
> C:\Windows\Profiles\roland\Eigene Dateien\torque\src\build.xml:59:
> java.lang.ExceptionInInitializerError
> java.lang.ExceptionInInitializerError:
> org.apache.turbine.services.Instantiation
> Exception: ServiceBroker: unknown service LoggingService requested
> at
> org.apache.turbine.services.BaseServiceBroker.getServiceInstance
(BaseService
> Broker.java:313)
> at
> org.apache.turbine.services.BaseServiceBroker.getService
(BaseServiceBroker.j
> ava:258)
> at org.apache.turbine.util.Log.error(Log.java:450)
> at
> org.apache.turbine.om.peer.BasePeer.getMapBuilder(BasePeer.java:1854)
> at
> swissrisk.database.BaseHistratePeer.<clinit>(BaseHistratePeer.java:33)
> at swissrisk.database.TestDatabase.main(TestDatabase.java:15)
> at java.lang.reflect.Method.invoke(Native Method)
> at
> org.apache.tools.ant.taskdefs.ExecuteJava.execute
(ExecuteJava.java:107)
> at org.apache.tools.ant.taskdefs.Java.run(Java.java:245)
> at
> org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:122)
> at org.apache.tools.ant.taskdefs.Java.execute(Java.java:86)
> at org.apache.tools.ant.Target.execute(Target.java:142)
> at org.apache.tools.ant.Project.runTarget(Project.java:818)
> at
> org.apache.tools.ant.Project.executeTarget(Project.java:532)
> at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:213)
> at
> org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:103)
> at org.apache.tools.ant.Target.execute(Target.java:142)
> at org.apache.tools.ant.Project.runTarget(Project.java:818)
> at
> org.apache.tools.ant.Project.executeTarget(Project.java:532)
> at org.apache.tools.ant.Project.executeTargets(Project.java:506)
> at org.apache.tools.ant.Main.runBuild(Main.java:420)
> at org.apache.tools.ant.Main.main(Main.java:149)
>
> It seems, that the initialization of the Logging service fails. Is it
> possible to use the database layer standalone? What have I to do
> for the
> correct initialization? Where have I to put the database
> information (user,
> password, driver, ...), if I want to use the internal database
> connections?
> The class causing the Exception:
>
> package swissrisk.database;
>
> public class TestDatabase
> {
> public static void main( String[] args )
> throws Exception
> {
> System.out.println("Testprogramm f�r
> Torque");
> Criteria crit = new Criteria();
> Vector v = HistratePeer.doSelect( crit );
> System.out.println("Records read: " + v.size() );
> } // void main( String[] );
>
> } // class TestDatabase
>
> Thanks for help
>
> Roland R�der tel: +41 1 455 70 00
> Swissrisk AG fax: +41 1 455 70 01
> R�ffelstrasse 32 mobile: +49 174 3279432
> 8045 Z�rich mail: [EMAIL PROTECTED]
> Switzerland home: www.swissrisk.com
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]