Re: ojb first use

Dolphin06 <[email protected]>
Newsgroups gmane.comp.jakarta.ojb.user
Message-ID <[email protected]>
Hello, i created a new project in Netbeans then import ojb-blank.jar, then i
copy the OJB.properties, repository.xml, repository.dtd in WEB-INF.  It
wasnt working.  
So as you said to me in your reply i put the file in WEB-INF/classes, it
still wasnt working like this.  It finally worked by putting the files in
both and WEB-INF and WEB-INF/classes.  Now it works fine.  Thx for help, but
why its not sufficient to put the file in only one place ?

arminw wrote:
> 
> Hi,
> 
> 
>  > In my project web-inf folder i got the following file, OJB.properties 
>  > (left ...
> 
> Did you setup your IDE or do you pack an .war-file?
> For the last please try to put all OJB files into WEB-INF/classes
> directory.
> 
> regards
> Armin
> 
> Dolphin06 wrote:
>> Hello i m trying to use ojb, but i m having problem getting a default
>> persistence broker.
>> I got an exception when executing this statement :
>> broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>> 
>> the exception i got is the following : 
>> java.lang.ExceptionInInitializerError
>>         at
>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(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)
>> 
>> In my project web-inf folder i got the following file, OJB.properties
>> (left
>> unchange), repository.dtd and repository.xml that i modified the
>> following
>> way :
>> <!ENTITY database SYSTEM "repository_database.xml">
>> <!ENTITY internal SYSTEM "repository_internal.xml">
>> <!ENTITY user SYSTEM "repository_user.xml">
>> ]>
>>  
>>  
>> <descriptor-repository version="1.0"
>>                        isolation-level="read-uncommitted"
>>                        proxy-prefetching-limit="50">
>>     
>>     <!-- include all used database connections -->
>>     <jdbc-connection-descriptor jcd-alias="default"
>>                                 default-connection="true"
>>                                 platform="MySQL"
>>                                 jdbc-level="2.0"
>>                                 driver="org.gjt.mm.mysql.Driver"
>>                                 protocol="jdbc"
>>                                 subprotocol="@OJB_DB_URL@"
>>                                 dbalias="weblog"
>>                                 username="root"
>>                                 password="supports"/>
>>     
>>     <!-- include ojb internal mappings here; comment this if you don't
>> need
>> them -->
>>     &internal;
>>     
>>     <!-- include user defined mappings here -->
>>     <class-descriptor class="member.Member" table="member">
>>         <field-descriptor name="id" column="member_id" jdbc-type="BIGINT"
>> primarykey="true" autoincrement="true"/>
>>         <field-descriptor name="name" column="member_name"
>> jdbc-type="VARCHAR"/>
>>     </class-descriptor>
>> </descriptor-repository>
>> The jar containing all the ojb class is in my lib folder.
>> I am using jdk 1.6, struts 1.2.9, ojb 1.0.4,netbeans ide.
>> Thanks for helping setting up ojb.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ojb-first-use-tf3432210.html#a9578549
Sent from the Apache DB - ObjectRelationalBridge Users mailing list archive at Nabble.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.