You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Sven Alisch <sv...@gmx.de> on 2004/02/14 14:15:04 UTC

[BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed, can't get PBF class object

Hello ML,

I'm a newbie, sorry for my posting, i know this was discussed in past, but i 
don't get rid of that error message in this subject.

I create my application from template ojb-blank.

I created my repository_user.xml in directory ./src/ressources/ and it looks 
like (it is only an extract - after snip and it ends before snap) :

<snip>

<class-descriptor class="jegmont.Users" table="USERS">
                <field-descriptor name="userID" primarykey="true" 
default-fetch="true" column="USERID" jdbc-type="INTEGER"/>
                <field-descriptor name="name" nullable="false" 
default-fetch="true" column="NAME" jdbc-type="VARCHAR"/>
                <field-descriptor name="surname" nullable="false" 
default-fetch="true" column="SURNAME" jdbc-type="VARCHAR"/>
                <field-descriptor name="login" nullable="false" 
default-fetch="true" column="LOGIN" jdbc-type="VARCHAR"/>
                <field-descriptor name="password" nullable="false" 
default-fetch="true" column="PASSWORD" jdbc-type="VARCHAR"/>
        </class-descriptor>

</snap>

My Class for that exsample is:

public class Users
{

   public Users()
   {
   }

   /** auto_increment */
   private Integer userID;
   private String name;
   private String surname;
   private String login;
   private String password;

  // Getters & Setters ...

}

Now I do following in my Main for testing:

import java.util.*;

import org.apache.ojb.broker.*;
import org.apache.ojb.broker.query.*;

import jegmont.*;

public class JEgmont {

        public static void main(String args[]) {
                System.out.println("Hello OJB!");

                PersistenceBroker broker = null;
                try {
                        broker = 	
PersistenceBrokerFactory.defaultPersistenceBroker();
                        Users Template = new 
Users();Template.setName("Alisch");
                        QueryByCriteria query = new QueryByCriteria(Template);
                        Users alisch = (Users) broker.getObjectByQuery(query);
                        System.out.println(alisch.getName());
                }
                finally {
                        if (broker != null) broker.close();
                }
        }

}

I compiled everything with ant. If I start my app with java -DOJB.properties 
JEgmont - the following error occured:

Hello OJB!
[BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed, 
can't get PBF class object
Exception in thread "main" java.lang.ExceptionInInitializerError
        at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
Source)
        at JEgmont.main(Unknown Source)
Caused by: org.apache.ojb.broker.OJBRuntimeException: Property for key 
'PersistenceBrokerFactoryClass' can not be found in properties file
        at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown 
Source)
        at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unknown 
Source)
        ... 2 more

Please help me, i have absolutly no idea for a solution.

Greetings,
Sven	


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: [BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed, can't get PBF class object

Posted by Armin Waibel <ar...@apache.org>.
hmm strange, your posted error message says that property 
'PersistenceBrokerFactoryClass' could not be found, so maybe your 
OJB.properties file is corrupt or OJB read the "wrong" file.
Try something like
-DOJB.properties=../ressourcec/OJB.properties

regards,
Armin

Sven Alisch wrote:

> The difference is: if i start my prog with direct instructions like
> 
> java -DOJB.properties=../ressourcec JEgmont
> 
> than the line 
> 
> [BOOT] ERROR: Cannot get OJB properties file, try to use default settings!
> 
> is missing.
> 
> If I start it without the parameter D than the line is shown by OJB.
> 
> Am Samstag, 14. Februar 2004 15:29 schrieb Sven Alisch:
> 
>>Thanks Armin,
>>for the fast answer! First I edited the build.xml file for setting
>>references to that file, later i copied it into the lid dir and now I
>>copied that file in my classpath /usr/lib/java2/jre/ext ..., but the result
>>is always the same. I get this error message.
>>
>>greetings,
>>sven
>>
>>Am Samstag, 14. Februar 2004 17:20 schrieb Armin Waibel:
>>
>>>Hi Sven,
>>>
>>> >         at JEgmont.main(Unknown Source)
>>> > Caused by: org.apache.ojb.broker.OJBRuntimeException: Property for key
>>> > 'PersistenceBrokerFactoryClass' can not be found in properties file
>>>
>>>Seems that OJB.properties file is not in classpath.
>>>
>>>regards,
>>>Armin
>>>
>>>Sven Alisch wrote:
>>>
>>>>Hello ML,
>>>>
>>>>I'm a newbie, sorry for my posting, i know this was discussed in past,
>>>>but i don't get rid of that error message in this subject.
>>>>
>>>>I create my application from template ojb-blank.
>>>>
>>>>I created my repository_user.xml in directory ./src/ressources/ and it
>>>>looks like (it is only an extract - after snip and it ends before snap)
>>>>:
>>>>
>>>><snip>
>>>>
>>>><class-descriptor class="jegmont.Users" table="USERS">
>>>>                <field-descriptor name="userID" primarykey="true"
>>>>default-fetch="true" column="USERID" jdbc-type="INTEGER"/>
>>>>                <field-descriptor name="name" nullable="false"
>>>>default-fetch="true" column="NAME" jdbc-type="VARCHAR"/>
>>>>                <field-descriptor name="surname" nullable="false"
>>>>default-fetch="true" column="SURNAME" jdbc-type="VARCHAR"/>
>>>>                <field-descriptor name="login" nullable="false"
>>>>default-fetch="true" column="LOGIN" jdbc-type="VARCHAR"/>
>>>>                <field-descriptor name="password" nullable="false"
>>>>default-fetch="true" column="PASSWORD" jdbc-type="VARCHAR"/>
>>>>        </class-descriptor>
>>>>
>>>></snap>
>>>>
>>>>My Class for that exsample is:
>>>>
>>>>public class Users
>>>>{
>>>>
>>>>   public Users()
>>>>   {
>>>>   }
>>>>
>>>>   /** auto_increment */
>>>>   private Integer userID;
>>>>   private String name;
>>>>   private String surname;
>>>>   private String login;
>>>>   private String password;
>>>>
>>>>  // Getters & Setters ...
>>>>
>>>>}
>>>>
>>>>Now I do following in my Main for testing:
>>>>
>>>>import java.util.*;
>>>>
>>>>import org.apache.ojb.broker.*;
>>>>import org.apache.ojb.broker.query.*;
>>>>
>>>>import jegmont.*;
>>>>
>>>>public class JEgmont {
>>>>
>>>>        public static void main(String args[]) {
>>>>                System.out.println("Hello OJB!");
>>>>
>>>>                PersistenceBroker broker = null;
>>>>                try {
>>>>                        broker =
>>>>PersistenceBrokerFactory.defaultPersistenceBroker();
>>>>                        Users Template = new
>>>>Users();Template.setName("Alisch");
>>>>                        QueryByCriteria query = new
>>>>QueryByCriteria(Template); Users alisch = (Users)
>>>>broker.getObjectByQuery(query); System.out.println(alisch.getName());
>>>>                }
>>>>                finally {
>>>>                        if (broker != null) broker.close();
>>>>                }
>>>>        }
>>>>
>>>>}
>>>>
>>>>I compiled everything with ant. If I start my app with java
>>>>-DOJB.properties JEgmont - the following error occured:
>>>>
>>>>Hello OJB!
>>>>[BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance
>>>>failed, can't get PBF class object
>>>>Exception in thread "main" java.lang.ExceptionInInitializerError
>>>>        at
>>>>org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker
>>>>(U nknown Source)
>>>>        at JEgmont.main(Unknown Source)
>>>>Caused by: org.apache.ojb.broker.OJBRuntimeException: Property for key
>>>>'PersistenceBrokerFactoryClass' can not be found in properties file
>>>>        at
>>>>org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
>>>>Source)
>>>>        at
>>>>org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unk
>>>>no wn Source)
>>>>        ... 2 more
>>>>
>>>>Please help me, i have absolutly no idea for a solution.
>>>>
>>>>Greetings,
>>>>Sven
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: [BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed, can't get PBF class object

Posted by Sven Alisch <sv...@gmx.de>.
The difference is: if i start my prog with direct instructions like

java -DOJB.properties=../ressourcec JEgmont

than the line 

[BOOT] ERROR: Cannot get OJB properties file, try to use default settings!

is missing.

If I start it without the parameter D than the line is shown by OJB.

Am Samstag, 14. Februar 2004 15:29 schrieb Sven Alisch:
> Thanks Armin,
> for the fast answer! First I edited the build.xml file for setting
> references to that file, later i copied it into the lid dir and now I
> copied that file in my classpath /usr/lib/java2/jre/ext ..., but the result
> is always the same. I get this error message.
>
> greetings,
> sven
>
> Am Samstag, 14. Februar 2004 17:20 schrieb Armin Waibel:
> > Hi Sven,
> >
> >  >         at JEgmont.main(Unknown Source)
> >  > Caused by: org.apache.ojb.broker.OJBRuntimeException: Property for key
> >  > 'PersistenceBrokerFactoryClass' can not be found in properties file
> >
> > Seems that OJB.properties file is not in classpath.
> >
> > regards,
> > Armin
> >
> > Sven Alisch wrote:
> > > Hello ML,
> > >
> > > I'm a newbie, sorry for my posting, i know this was discussed in past,
> > > but i don't get rid of that error message in this subject.
> > >
> > > I create my application from template ojb-blank.
> > >
> > > I created my repository_user.xml in directory ./src/ressources/ and it
> > > looks like (it is only an extract - after snip and it ends before snap)
> > > :
> > >
> > > <snip>
> > >
> > > <class-descriptor class="jegmont.Users" table="USERS">
> > >                 <field-descriptor name="userID" primarykey="true"
> > > default-fetch="true" column="USERID" jdbc-type="INTEGER"/>
> > >                 <field-descriptor name="name" nullable="false"
> > > default-fetch="true" column="NAME" jdbc-type="VARCHAR"/>
> > >                 <field-descriptor name="surname" nullable="false"
> > > default-fetch="true" column="SURNAME" jdbc-type="VARCHAR"/>
> > >                 <field-descriptor name="login" nullable="false"
> > > default-fetch="true" column="LOGIN" jdbc-type="VARCHAR"/>
> > >                 <field-descriptor name="password" nullable="false"
> > > default-fetch="true" column="PASSWORD" jdbc-type="VARCHAR"/>
> > >         </class-descriptor>
> > >
> > > </snap>
> > >
> > > My Class for that exsample is:
> > >
> > > public class Users
> > > {
> > >
> > >    public Users()
> > >    {
> > >    }
> > >
> > >    /** auto_increment */
> > >    private Integer userID;
> > >    private String name;
> > >    private String surname;
> > >    private String login;
> > >    private String password;
> > >
> > >   // Getters & Setters ...
> > >
> > > }
> > >
> > > Now I do following in my Main for testing:
> > >
> > > import java.util.*;
> > >
> > > import org.apache.ojb.broker.*;
> > > import org.apache.ojb.broker.query.*;
> > >
> > > import jegmont.*;
> > >
> > > public class JEgmont {
> > >
> > >         public static void main(String args[]) {
> > >                 System.out.println("Hello OJB!");
> > >
> > >                 PersistenceBroker broker = null;
> > >                 try {
> > >                         broker =
> > > PersistenceBrokerFactory.defaultPersistenceBroker();
> > >                         Users Template = new
> > > Users();Template.setName("Alisch");
> > >                         QueryByCriteria query = new
> > > QueryByCriteria(Template); Users alisch = (Users)
> > > broker.getObjectByQuery(query); System.out.println(alisch.getName());
> > >                 }
> > >                 finally {
> > >                         if (broker != null) broker.close();
> > >                 }
> > >         }
> > >
> > > }
> > >
> > > I compiled everything with ant. If I start my app with java
> > > -DOJB.properties JEgmont - the following error occured:
> > >
> > > Hello OJB!
> > > [BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance
> > > failed, can't get PBF class object
> > > Exception in thread "main" java.lang.ExceptionInInitializerError
> > >         at
> > > org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker
> > >(U nknown Source)
> > >         at JEgmont.main(Unknown Source)
> > > Caused by: org.apache.ojb.broker.OJBRuntimeException: Property for key
> > > 'PersistenceBrokerFactoryClass' can not be found in properties file
> > >         at
> > > org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
> > > Source)
> > >         at
> > > org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unk
> > >no wn Source)
> > >         ... 2 more
> > >
> > > Please help me, i have absolutly no idea for a solution.
> > >
> > > Greetings,
> > > Sven
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: [BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed, can't get PBF class object

Posted by Sven Alisch <sv...@gmx.de>.
Thanks Armin, 
for the fast answer! First I edited the build.xml file for setting references 
to that file, later i copied it into the lid dir and now I copied that file 
in my classpath /usr/lib/java2/jre/ext ..., but the result is always the 
same. I get this error message. 

greetings,
sven

Am Samstag, 14. Februar 2004 17:20 schrieb Armin Waibel:
> Hi Sven,
>
>  >         at JEgmont.main(Unknown Source)
>  > Caused by: org.apache.ojb.broker.OJBRuntimeException: Property for key
>  > 'PersistenceBrokerFactoryClass' can not be found in properties file
>
> Seems that OJB.properties file is not in classpath.
>
> regards,
> Armin
>
> Sven Alisch wrote:
> > Hello ML,
> >
> > I'm a newbie, sorry for my posting, i know this was discussed in past,
> > but i don't get rid of that error message in this subject.
> >
> > I create my application from template ojb-blank.
> >
> > I created my repository_user.xml in directory ./src/ressources/ and it
> > looks like (it is only an extract - after snip and it ends before snap) :
> >
> > <snip>
> >
> > <class-descriptor class="jegmont.Users" table="USERS">
> >                 <field-descriptor name="userID" primarykey="true"
> > default-fetch="true" column="USERID" jdbc-type="INTEGER"/>
> >                 <field-descriptor name="name" nullable="false"
> > default-fetch="true" column="NAME" jdbc-type="VARCHAR"/>
> >                 <field-descriptor name="surname" nullable="false"
> > default-fetch="true" column="SURNAME" jdbc-type="VARCHAR"/>
> >                 <field-descriptor name="login" nullable="false"
> > default-fetch="true" column="LOGIN" jdbc-type="VARCHAR"/>
> >                 <field-descriptor name="password" nullable="false"
> > default-fetch="true" column="PASSWORD" jdbc-type="VARCHAR"/>
> >         </class-descriptor>
> >
> > </snap>
> >
> > My Class for that exsample is:
> >
> > public class Users
> > {
> >
> >    public Users()
> >    {
> >    }
> >
> >    /** auto_increment */
> >    private Integer userID;
> >    private String name;
> >    private String surname;
> >    private String login;
> >    private String password;
> >
> >   // Getters & Setters ...
> >
> > }
> >
> > Now I do following in my Main for testing:
> >
> > import java.util.*;
> >
> > import org.apache.ojb.broker.*;
> > import org.apache.ojb.broker.query.*;
> >
> > import jegmont.*;
> >
> > public class JEgmont {
> >
> >         public static void main(String args[]) {
> >                 System.out.println("Hello OJB!");
> >
> >                 PersistenceBroker broker = null;
> >                 try {
> >                         broker =
> > PersistenceBrokerFactory.defaultPersistenceBroker();
> >                         Users Template = new
> > Users();Template.setName("Alisch");
> >                         QueryByCriteria query = new
> > QueryByCriteria(Template); Users alisch = (Users)
> > broker.getObjectByQuery(query); System.out.println(alisch.getName());
> >                 }
> >                 finally {
> >                         if (broker != null) broker.close();
> >                 }
> >         }
> >
> > }
> >
> > I compiled everything with ant. If I start my app with java
> > -DOJB.properties JEgmont - the following error occured:
> >
> > Hello OJB!
> > [BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed,
> > can't get PBF class object
> > Exception in thread "main" java.lang.ExceptionInInitializerError
> >         at
> > org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(U
> >nknown Source)
> >         at JEgmont.main(Unknown Source)
> > Caused by: org.apache.ojb.broker.OJBRuntimeException: Property for key
> > 'PersistenceBrokerFactoryClass' can not be found in properties file
> >         at
> > org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
> > Source)
> >         at
> > org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unkno
> >wn Source)
> >         ... 2 more
> >
> > Please help me, i have absolutly no idea for a solution.
> >
> > Greetings,
> > Sven
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: [BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed, can't get PBF class object

Posted by Armin Waibel <ar...@apache.org>.
Hi Sven,

 >         at JEgmont.main(Unknown Source)
 > Caused by: org.apache.ojb.broker.OJBRuntimeException: Property for key
 > 'PersistenceBrokerFactoryClass' can not be found in properties file

Seems that OJB.properties file is not in classpath.

regards,
Armin

Sven Alisch wrote:
> Hello ML,
> 
> I'm a newbie, sorry for my posting, i know this was discussed in past, but i 
> don't get rid of that error message in this subject.
> 
> I create my application from template ojb-blank.
> 
> I created my repository_user.xml in directory ./src/ressources/ and it looks 
> like (it is only an extract - after snip and it ends before snap) :
> 
> <snip>
> 
> <class-descriptor class="jegmont.Users" table="USERS">
>                 <field-descriptor name="userID" primarykey="true" 
> default-fetch="true" column="USERID" jdbc-type="INTEGER"/>
>                 <field-descriptor name="name" nullable="false" 
> default-fetch="true" column="NAME" jdbc-type="VARCHAR"/>
>                 <field-descriptor name="surname" nullable="false" 
> default-fetch="true" column="SURNAME" jdbc-type="VARCHAR"/>
>                 <field-descriptor name="login" nullable="false" 
> default-fetch="true" column="LOGIN" jdbc-type="VARCHAR"/>
>                 <field-descriptor name="password" nullable="false" 
> default-fetch="true" column="PASSWORD" jdbc-type="VARCHAR"/>
>         </class-descriptor>
> 
> </snap>
> 
> My Class for that exsample is:
> 
> public class Users
> {
> 
>    public Users()
>    {
>    }
> 
>    /** auto_increment */
>    private Integer userID;
>    private String name;
>    private String surname;
>    private String login;
>    private String password;
> 
>   // Getters & Setters ...
> 
> }
> 
> Now I do following in my Main for testing:
> 
> import java.util.*;
> 
> import org.apache.ojb.broker.*;
> import org.apache.ojb.broker.query.*;
> 
> import jegmont.*;
> 
> public class JEgmont {
> 
>         public static void main(String args[]) {
>                 System.out.println("Hello OJB!");
> 
>                 PersistenceBroker broker = null;
>                 try {
>                         broker = 	
> PersistenceBrokerFactory.defaultPersistenceBroker();
>                         Users Template = new 
> Users();Template.setName("Alisch");
>                         QueryByCriteria query = new QueryByCriteria(Template);
>                         Users alisch = (Users) broker.getObjectByQuery(query);
>                         System.out.println(alisch.getName());
>                 }
>                 finally {
>                         if (broker != null) broker.close();
>                 }
>         }
> 
> }
> 
> I compiled everything with ant. If I start my app with java -DOJB.properties 
> JEgmont - the following error occured:
> 
> Hello OJB!
> [BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed, 
> can't get PBF class object
> Exception in thread "main" java.lang.ExceptionInInitializerError
>         at 
> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
> Source)
>         at JEgmont.main(Unknown Source)
> Caused by: org.apache.ojb.broker.OJBRuntimeException: Property for key 
> 'PersistenceBrokerFactoryClass' can not be found in properties file
>         at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown 
> Source)
>         at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unknown 
> Source)
>         ... 2 more
> 
> Please help me, i have absolutly no idea for a solution.
> 
> Greetings,
> Sven	
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org