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 Laurent Sacaut <ls...@8d.com> on 2006/02/23 22:37:58 UTC

pb broker initialization error

Hello all,

I am trying to get started with ojb 1.0.4 in a project that uses MySQL
5.0. I already have a test project that seems to be working and I am
trying to replicate the same working conditions in a new test project so
I can move on to the real thing.
The problem I am having I think is at the configuration level. I can get
a broker off the PersistenceBrokerFactory class for some reason and I
can't pinpont why.

The error I am getting for now is:

/java.lang.ExceptionInInitializerError
    at
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown
Source)
    at org.apache.ojb.tutorial1.Application.<init>(Unknown Source)
    at org.apache.ojb.tutorial1.Application.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)
    ... 3 more


/In the OJB.property file I have in the  'PersistenceBrokerFactory /
PersistenceBroker section':/
PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl

/So I am not sure what the message means exactly./


/The code I am using for this is:
/
private PersistenceBroker broker;

public Application()
    {
        broker = null;
        try
        {
            broker = PersistenceBrokerFactory.defaultPersistenceBroker();
        }
        catch (Throwable t)
        {
            t.printStackTrace();
        }
//...

/It breaks in the try block with the error shown above.

Can anyone tell me why I would get such an error, files I need to have,
where.... I am using Eclipse as the developing environment. Not sure
where to look from there as I have been pounding on this for a few days
already.

thanks,
Laurent

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


Re: pb broker initialization error

Posted by Laurent Sacaut <ls...@8d.com>.
Yes, the whole src/resources folder is on the build path. I added it in
the source tab.
This folder contains OJB*.properties and all the repository*.xml files.

Laurent

Armin Waibel wrote:

> Hi Laurent,
>
> Laurent Sacaut wrote:
>
>> Hello Armin,
>>
>> Yes OJB.properties is placed under src/resources which is on the
>> build path.
>> OJB.properties is with default settings.
>>
>> Here is what I have on my build path for all projects using ojb 1.0.4 I
>> am trying to build and run using Eclipse:
>>
>
> Did you add the class folder where to find all OJB configuration files
> in Eclipse (java build path)?
>
> regards,
> Armin
>
>> Source:
>> src/java
>> src/resources
>>
>> Project: none
>>
>> Libraries:
>> antlr-2.7.5.jar
>> commons-beanutils-1.7.0.jar
>> commons-collections-3.1.jar
>> commons-dbcp-1.2.1.jar
>> commons-lang-2.1.jar
>> commons-logging-1.0.4.jar
>> commons-pool-1.2.jar
>> db-ojb-1.0.4.jar
>> hsqldb.jar
>> mysql-connector-java-3.1.12-bin.jar
>> DdlUtils-1.0-dev-b2.jar
>> JRE System Library [j2sdk1.5] commons-betwixt-0.8-dev.jar
>> commons-digester-1.7.jar
>>
>>
>> DdlUtils-1.0-dev-b2.jar is a file that I compiled using the build
>> facility in that project to integrate the DdlUtils functionality into my
>> own project.
>>
>> All jar files are located under the lib directory and are in the order
>> shown above in the class path.
>>
>>
>> Other files under lib but not in classpath are:
>> commons-transaction-1.1.jar
>> log4j-1.2.8.jar
>> torque-gen-3.1.1.jar
>> velocity-1.3.1.jar
>> xdoclet-1.2.3.jar
>> xdoclet-ojb-module-1.2.3.jar
>> xerces.jar
>> xjavadoc-1.1.jar
>>
>> All jar files come from the ojb1.0.4 distribution except for :
>> xerces.jar
>> mysql-connector-java-3.1.12-bin.jar
>>
>> I am stumped, not sure what else to try.
>>
>> Laurent
>>
>>
>>
>> Armin Waibel wrote:
>>
>>> Hi Laurent,
>>>
>>> sounds like a classpath issue.
>>> Is the OJB.properties really in the classpath of your new project?
>>>
>>> regards,
>>> Armin
>>>
>>> Laurent Sacaut wrote:
>>>
>>>> Hello all,
>>>>
>>>> I am trying to get started with ojb 1.0.4 in a project that uses MySQL
>>>> 5.0. I already have a test project that seems to be working and I am
>>>> trying to replicate the same working conditions in a new test
>>>> project so
>>>> I can move on to the real thing.
>>>> The problem I am having I think is at the configuration level. I
>>>> can get
>>>> a broker off the PersistenceBrokerFactory class for some reason and I
>>>> can't pinpont why.
>>>>
>>>> The error I am getting for now is:
>>>>
>>>> /java.lang.ExceptionInInitializerError
>>>>     at
>>>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown
>>>>
>>>>
>>>> Source)
>>>>     at org.apache.ojb.tutorial1.Application.<init>(Unknown Source)
>>>>     at org.apache.ojb.tutorial1.Application.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)
>>>>     ... 3 more
>>>>
>>>>
>>>> /In the OJB.property file I have in the  'PersistenceBrokerFactory /
>>>> PersistenceBroker section':/
>>>> PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
>>>>
>>>>
>>>> PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl
>>>>
>>>>
>>>> /So I am not sure what the message means exactly./
>>>>
>>>>
>>>> /The code I am using for this is:
>>>> /
>>>> private PersistenceBroker broker;
>>>>
>>>> public Application()
>>>>     {
>>>>         broker = null;
>>>>         try
>>>>         {
>>>>             broker =
>>>> PersistenceBrokerFactory.defaultPersistenceBroker();
>>>>         }
>>>>         catch (Throwable t)
>>>>         {
>>>>             t.printStackTrace();
>>>>         }
>>>> //...
>>>>
>>>> /It breaks in the try block with the error shown above.
>>>>
>>>> Can anyone tell me why I would get such an error, files I need to
>>>> have,
>>>> where.... I am using Eclipse as the developing environment. Not sure
>>>> where to look from there as I have been pounding on this for a few
>>>> days
>>>> already.
>>>>
>>>> thanks,
>>>> Laurent
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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: pb broker initialization error

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

Laurent Sacaut wrote:
> Hello Armin,
> 
> Yes OJB.properties is placed under src/resources which is on the build path.
> OJB.properties is with default settings.
> 
> Here is what I have on my build path for all projects using ojb 1.0.4 I
> am trying to build and run using Eclipse:
> 

Did you add the class folder where to find all OJB configuration files 
in Eclipse (java build path)?

regards,
Armin

> Source:
> src/java
> src/resources
> 
> Project: none
> 
> Libraries:
> antlr-2.7.5.jar
> commons-beanutils-1.7.0.jar
> commons-collections-3.1.jar
> commons-dbcp-1.2.1.jar
> commons-lang-2.1.jar
> commons-logging-1.0.4.jar
> commons-pool-1.2.jar
> db-ojb-1.0.4.jar
> hsqldb.jar
> mysql-connector-java-3.1.12-bin.jar
> DdlUtils-1.0-dev-b2.jar
> JRE System Library [j2sdk1.5] 
> commons-betwixt-0.8-dev.jar
> commons-digester-1.7.jar
> 
> 
> DdlUtils-1.0-dev-b2.jar is a file that I compiled using the build
> facility in that project to integrate the DdlUtils functionality into my
> own project.
> 
> All jar files are located under the lib directory and are in the order
> shown above in the class path.
> 
> 
> Other files under lib but not in classpath are:
> commons-transaction-1.1.jar
> log4j-1.2.8.jar
> torque-gen-3.1.1.jar
> velocity-1.3.1.jar
> xdoclet-1.2.3.jar
> xdoclet-ojb-module-1.2.3.jar
> xerces.jar
> xjavadoc-1.1.jar
> 
> All jar files come from the ojb1.0.4 distribution except for :
> xerces.jar
> mysql-connector-java-3.1.12-bin.jar
> 
> I am stumped, not sure what else to try.
> 
> Laurent
> 
> 
> 
> Armin Waibel wrote:
> 
>> Hi Laurent,
>>
>> sounds like a classpath issue.
>> Is the OJB.properties really in the classpath of your new project?
>>
>> regards,
>> Armin
>>
>> Laurent Sacaut wrote:
>>
>>> Hello all,
>>>
>>> I am trying to get started with ojb 1.0.4 in a project that uses MySQL
>>> 5.0. I already have a test project that seems to be working and I am
>>> trying to replicate the same working conditions in a new test project so
>>> I can move on to the real thing.
>>> The problem I am having I think is at the configuration level. I can get
>>> a broker off the PersistenceBrokerFactory class for some reason and I
>>> can't pinpont why.
>>>
>>> The error I am getting for now is:
>>>
>>> /java.lang.ExceptionInInitializerError
>>>     at
>>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown
>>>
>>> Source)
>>>     at org.apache.ojb.tutorial1.Application.<init>(Unknown Source)
>>>     at org.apache.ojb.tutorial1.Application.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)
>>>     ... 3 more
>>>
>>>
>>> /In the OJB.property file I have in the  'PersistenceBrokerFactory /
>>> PersistenceBroker section':/
>>> PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
>>>
>>> PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl
>>>
>>> /So I am not sure what the message means exactly./
>>>
>>>
>>> /The code I am using for this is:
>>> /
>>> private PersistenceBroker broker;
>>>
>>> public Application()
>>>     {
>>>         broker = null;
>>>         try
>>>         {
>>>             broker =
>>> PersistenceBrokerFactory.defaultPersistenceBroker();
>>>         }
>>>         catch (Throwable t)
>>>         {
>>>             t.printStackTrace();
>>>         }
>>> //...
>>>
>>> /It breaks in the try block with the error shown above.
>>>
>>> Can anyone tell me why I would get such an error, files I need to have,
>>> where.... I am using Eclipse as the developing environment. Not sure
>>> where to look from there as I have been pounding on this for a few days
>>> already.
>>>
>>> thanks,
>>> Laurent
>>>
>>> ---------------------------------------------------------------------
>>> 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: pb broker initialization error

Posted by Laurent Sacaut <ls...@8d.com>.
Hello Armin,

Yes OJB.properties is placed under src/resources which is on the build path.
OJB.properties is with default settings.

Here is what I have on my build path for all projects using ojb 1.0.4 I
am trying to build and run using Eclipse:

Source:
src/java
src/resources

Project: none

Libraries:
antlr-2.7.5.jar
commons-beanutils-1.7.0.jar
commons-collections-3.1.jar
commons-dbcp-1.2.1.jar
commons-lang-2.1.jar
commons-logging-1.0.4.jar
commons-pool-1.2.jar
db-ojb-1.0.4.jar
hsqldb.jar
mysql-connector-java-3.1.12-bin.jar
DdlUtils-1.0-dev-b2.jar
JRE System Library [j2sdk1.5] 
commons-betwixt-0.8-dev.jar
commons-digester-1.7.jar


DdlUtils-1.0-dev-b2.jar is a file that I compiled using the build
facility in that project to integrate the DdlUtils functionality into my
own project.

All jar files are located under the lib directory and are in the order
shown above in the class path.


Other files under lib but not in classpath are:
commons-transaction-1.1.jar
log4j-1.2.8.jar
torque-gen-3.1.1.jar
velocity-1.3.1.jar
xdoclet-1.2.3.jar
xdoclet-ojb-module-1.2.3.jar
xerces.jar
xjavadoc-1.1.jar

All jar files come from the ojb1.0.4 distribution except for :
xerces.jar
mysql-connector-java-3.1.12-bin.jar

I am stumped, not sure what else to try.

Laurent



Armin Waibel wrote:

> Hi Laurent,
>
> sounds like a classpath issue.
> Is the OJB.properties really in the classpath of your new project?
>
> regards,
> Armin
>
> Laurent Sacaut wrote:
>
>> Hello all,
>>
>> I am trying to get started with ojb 1.0.4 in a project that uses MySQL
>> 5.0. I already have a test project that seems to be working and I am
>> trying to replicate the same working conditions in a new test project so
>> I can move on to the real thing.
>> The problem I am having I think is at the configuration level. I can get
>> a broker off the PersistenceBrokerFactory class for some reason and I
>> can't pinpont why.
>>
>> The error I am getting for now is:
>>
>> /java.lang.ExceptionInInitializerError
>>     at
>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown
>>
>> Source)
>>     at org.apache.ojb.tutorial1.Application.<init>(Unknown Source)
>>     at org.apache.ojb.tutorial1.Application.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)
>>     ... 3 more
>>
>>
>> /In the OJB.property file I have in the  'PersistenceBrokerFactory /
>> PersistenceBroker section':/
>> PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
>>
>> PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl
>>
>> /So I am not sure what the message means exactly./
>>
>>
>> /The code I am using for this is:
>> /
>> private PersistenceBroker broker;
>>
>> public Application()
>>     {
>>         broker = null;
>>         try
>>         {
>>             broker =
>> PersistenceBrokerFactory.defaultPersistenceBroker();
>>         }
>>         catch (Throwable t)
>>         {
>>             t.printStackTrace();
>>         }
>> //...
>>
>> /It breaks in the try block with the error shown above.
>>
>> Can anyone tell me why I would get such an error, files I need to have,
>> where.... I am using Eclipse as the developing environment. Not sure
>> where to look from there as I have been pounding on this for a few days
>> already.
>>
>> thanks,
>> Laurent
>>
>> ---------------------------------------------------------------------
>> 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: pb broker initialization error

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

sounds like a classpath issue.
Is the OJB.properties really in the classpath of your new project?

regards,
Armin

Laurent Sacaut wrote:
> Hello all,
> 
> I am trying to get started with ojb 1.0.4 in a project that uses MySQL
> 5.0. I already have a test project that seems to be working and I am
> trying to replicate the same working conditions in a new test project so
> I can move on to the real thing.
> The problem I am having I think is at the configuration level. I can get
> a broker off the PersistenceBrokerFactory class for some reason and I
> can't pinpont why.
> 
> The error I am getting for now is:
> 
> /java.lang.ExceptionInInitializerError
>     at
> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown
> Source)
>     at org.apache.ojb.tutorial1.Application.<init>(Unknown Source)
>     at org.apache.ojb.tutorial1.Application.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)
>     ... 3 more
> 
> 
> /In the OJB.property file I have in the  'PersistenceBrokerFactory /
> PersistenceBroker section':/
> PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
> PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl
> 
> /So I am not sure what the message means exactly./
> 
> 
> /The code I am using for this is:
> /
> private PersistenceBroker broker;
> 
> public Application()
>     {
>         broker = null;
>         try
>         {
>             broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>         }
>         catch (Throwable t)
>         {
>             t.printStackTrace();
>         }
> //...
> 
> /It breaks in the try block with the error shown above.
> 
> Can anyone tell me why I would get such an error, files I need to have,
> where.... I am using Eclipse as the developing environment. Not sure
> where to look from there as I have been pounding on this for a few days
> already.
> 
> thanks,
> Laurent
> 
> ---------------------------------------------------------------------
> 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