Re: storing objects

Hans Novak <[email protected]> Fri, 14 Sep 2007 08:30:39 +0200
Newsgroups gmane.comp.jakarta.ojb.user
Message-ID <[email protected]>
Yes, thats it !
Without the repository and the 2 properties files it works !!!
I dont have the time this morning to test everything, but both apps are 
runnunig (my app and the test app for mandragora) without errors.
I will test it later for more information. first of all thank you. I 
would let you all informations about at little later :-)

Hans

Alessandro Colantoni schrieb:
> Ok!
> I will start using it with ojb-blank and if I fail I will ask you for your
> app.
>
>
> Anyway I think that the problem is not the ojb-blank structure, as I use the
> very similar maven structure in my projects and it works fine. I think just
> that I always use it in a web app, and maybe your structure can conflict
> with the same properties files that are inside the jar.
>
> I explain better, and hope this could solve it:
>
> Open the mandragora-0.1-SNAPSHOT.jar you are using for example with winrar
> or winzip.
> Inside it you will see the files log4j.properties, OJB.properties,
> Mandragora.properties, Ojb-logging.properties, repository.dtd and
> repository_internal.xml.
> Delete all of them and try again.
>
> In a tipical web-app structure this files don't go in the conflict, (anyway
> are totally useless, they are there for a mistake of the jar packaging
> process). In the Ojb.properties there it sets
>
> *repositoryFile=repository.xml*
>
> So it could be that Ojb read this file  it expects in the same directory the
> repository.xml.
>
> Deleting mandragora.jar it reads the proper file and works.
>
> So please try * *to delete all of them from the inside the jar
>
> Regards
>
> Alessandro
>
>
>
>
>
>
>
>
>
>
>
> On 9/13/07, Hans Novak <[email protected]> wrote:
>   
>> Hi,
>>
>>
>> When i add the mandragora jar to my project and start my standard main
>> class, i get this error when calling:
>>
>> broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>>
>> org.apache.ojb.broker.PBFactoryException: There was no
>> 'default-connection' attribute enabled in the jdbc connection descriptor
>>    at
>>
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker
>> (Unknown
>> Source)
>>    at
>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker
>> (Unknown
>> Source)
>>    at
>> de.repcom.osfaktura.core.db.PartnerFactoryCore.<init>(
>> PartnerFactoryCore.java:30)
>>    at de.repcom.osfaktura.gui.partner.PartnerFrm.<init>(PartnerFrm.java
>> :52)
>>    at de.repcom.osfaktura.aStartups.PartnerCore.<init>(PartnerCore.java
>> :42)
>>    at de.repcom.osfaktura.aStartups.PartnerCore.main(PartnerCore.java:28)
>>
>> when i remove the madragora jar from my project, it works fine.
>> Every other files, prperties, etc are untouched.
>> It seems like, that mandragora search the repositories on the wrong dir
>> and change my system settings also.
>>
>>     
>>> Can you tell me how  do you lookup the persistence broker in your app?
>>> Mandragora just do:
>>> broker=PersistenceBrokerFactory.defaultPersistenceBroker();
>>> To use the three file for the repository is not a problem. I use too
>>>       
>> except
>>     
>>> the repository- user
>>> I keep waiting  your news
>>>
>>>       
>> i think it very important, that the ojb-blank project have a - i will it
>> call - "unusual" directory structure and according to this my project
>> too (i wrote it in the last mail)
>> It is very important for me, that i can use the hole ojb-blank project
>> with the buld file, to generate all neede files etc., because in
>> development phase we change often times the database structure or
>> similar and dont want to change all related prperties.
>>
>> I had not the time, to make a new Project, to test it and i dont have a
>> web-development enviroment here.
>> so i can sadly only help and test on standard java apps ... ;-)
>>
>> if you find the time, get the ojb_blank projekt and try to merge it with
>> mandragora.
>>
>> if you like, i can send you my hole app without jars etc as zip to your
>> email - the finel app would be opensource, so no problem :-)
>>
>> Hans
>>
>>