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 Hale India <ha...@yahoo.com> on 2004/06/16 11:44:27 UTC

Problems getting ojb-blank

Hi

I still try to get running my project using ojb
1.0rc6.

When I run :
ant ojb-blank

I get :

[torque-sql] (transform.DTDResolver               128
) Resolver: used database.dtd from
org.apache.torque.engine.database.transform package

sql-template:

create-db-check:

create-db:

datasql:
     [echo]
+-----------------------------------------------+
     [echo] |                                         
     |
     [echo] | Generating SQL from data XML !          
     |
     [echo] | Woo hoo!                                
     |
     [echo] |                                         
     |
     [echo]
+-----------------------------------------------+
[torque-data-sql] Using contextProperties file:
/home/rcs/Master/extern/java/db-ojb/build.properties
[torque-data-sql] Using classpath
[torque-data-sql] Generating to file
/home/rcs/Master/extern/java/db-ojb/target/test/sql/ojbtest-data.sql
[torque-data-sql] Parsing file: 'ojbtest-schema.xml'
[torque-data-sql] (transform.DTDResolver              
128 ) Resolver: used database.dtd from
org.apache.torque.engine.database.transform package
[torque-data-sql] Resolver: used
/home/rcs/Master/extern/java/db-ojb/target/test/ojbtest-data.dtd

insert-sql:
[torque-sql-exec] Our new url ->
jdbc:postgresql://localhost/OJB

BUILD FAILED
/home/rcs/Master/extern/java/db-ojb/build.xml:386:
Following error occured while executing this line
/home/rcs/Master/extern/java/db-ojb/build-torque.xml:339:
org.postgresql.util.PSQLException: Backend start-up
failed: org.postgresql.util.PSQLException: FATAL:
database "OJB" does not exist


Thnk's for any help

Andre

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


Re: Problems getting ojb-blank

Posted by Hale India <ha...@yahoo.com>.
Hi Thomas

I will change to jar-debug.

I have been able to run tutorial1 example.
So it is application dependent.

To run tutorial1 I have been obliged to change dbalias
to ojb (instead of OJB) this seems to confirm the case
problem.

Thanks for your help.

Andre Legendre

--- Thomas Dudziak <to...@first.fhg.de> wrote:
> Hale India wrote:
> 
> >Hi Thomas
> >
> >Yes I updae the OJB.properties.
> >
> >I forget to give you the most important part of
> error
> >message :
> >Caused by: java.lang.NullPointerException
> >        at
>
>org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown
> >Source)
> >        at
>
>org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown
> >Source)
> >        at
>
>org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.<clinit>(Unknown
> >Source)
> >        ... 19 more
> >
> >Maybe it can hep.
> >
> >  
> >
> Could you change OJB's build.xml file so that the
> 'ojb-blank' target 
> depends on 'jar-debug' (not on 'jar'), and then
> rerun your test and post 
> the complete stacktrace ?
> 
> Tom
> 
> 
>
---------------------------------------------------------------------
> 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 Loading Configuration need java Hackers help.

Posted by A Leg <ha...@yahoo.com>.
Hi Thomas

Thank's for your ideas.
I will try them and I will keep you inform.

Best regards

Andre

Thomas Dudziak wrote:

> A Leg wrote:
>
>> Hi Thomas
>>
>> *_loggerClass = Log4jLoggerImpl.class;*
>> crash when LogingConfiguration , it could seem surprising but it is 
>> sure.
>>
>> The problem arrive
>> when PersistenceBrokerFactoryBaseImpl make LogFactory.getLogger
>> getLogger make first a "new LogingConfiguration()"
>> Which call the load() method in it's constructor.
>>
>> The crash arrive exactly *in LogingConfiguration.java, line 161*.
>>
>> This is probably linked to the fact that dbManager is a JINI service.
>>
>> I have added :
>> System.out.println("yep, so use log4j");
>> _loggerClass = Log4jLoggerImpl.class;
>> _loggerConfigFile = "log4j.properties";
>> System.out.println("After yep, so use log4j");
>>
>> and you can see below that it crash just after yep, so use log4j
>>
>> The debug build give no information here, because debug use logger 
>> which does not load.
>> I have tried first to get debug working, but *this stack come from 
>> release compile with jar-debug.*
>>
>> That is why I have been obliged to add debug messages.
>>
>> If you look at the stack below :
>>
>> Load of *ojbLoggingPropFile fail first* :
>> Load of *ojbPropFile fail also*.
>>
>> Do we need to adapt our application to support new logging elements ?
>> Any idea welcome.
>
>
> Hmm, I have zero knowledge of Jini, but there may be two things that 
> you can try:
>
> * Specify the log4j logger directly in the OJB-logging.properties 
> because the exception occurs in a fallback check that is only called 
> if there is no logger explicitly configured. So put these lines in 
> your OJB-logging.properties:
>
> LoggerClass=org.apache.ojb.broker.util.logging.Log4jLoggerImpl
> LoggerConfigFile=log4j.properties
>
> * This might be a classloader issue, so you could change the 
> classloader that OJB uses (when it is not accessing classes directly, 
> in this case it uses the thread's context classloader) via the 
> org.apache.ojb.broker.util.ClassHelper#setClassLoader method. Here you 
> would use the Jini classloader. Please note that you have to do this 
> before using *any* OJB class, and you'll need a recent OJB version 
> (rc7 or CVS).
>
> Tom
>
>
> ---------------------------------------------------------------------
> 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 Loading Configuration now repository PB

Posted by A Leg <ha...@yahoo.com>.
Hi Armin and Thomas

I finaly got a stack. It is probably not the right way to do it, but ...
It seems that it could help you to help me. 8-)

Any way.

Thank's

Andre


STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Starting TaskConsumerDB
Starting TaskConsumerDB try
[BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
illegal for key "OqlCollectionClass" (should be a class, using default 
value class org.apache.ojb.odmg.collections.DListImpl)
[org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] INFO: 
Create PersistenceBroker instance pool, pool configuration was 
{whenExhaustedAction=0, maxIdle=-1, maxActive=100, maxWait=2000, 
removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false, 
minEvictableIdleTimeMillis=1000000, testOnReturn=false, 
logAbandoned=false, removeAbandonedTimeout=300, 
timeBetweenEvictionRunsMillis=-1, testOnBorrow=false}
readDescriptorRepository filename repository.xml
readDescriptorRepository else useSerializedRepository repository.xml
readDescriptorRepository buildRepository repository.xml
[org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB 
Descriptor Repository: 
file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
[org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Building 
repository from :file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
readMetadataFromXML SAXParserFactory.newInstance().newSAXParser()
readMetadataFromXML p.getClass().getName()
readMetadataFromXML p.getXMLReader()
readMetadataFromXML reader.getClass().getName().indexOf
readMetadataFromXML reader.setFeature
readMetadataFromXML if DescriptorRepository.class.equals(target)
readMetadataFromXML DescriptorRepository.class.equals(target)
readMetadataFromXML DescriptorRepository
readMetadataFromXML RepositoryXmlHandler
RepositoryXmlHandler Constructor
readMetadataFromXML reader.setContentHandler
readMetadataFromXML reader.parse(source)
RepositoryXmlHandler startDoc
startDoc
RepositoryXmlHandler startElement uri name qName descriptor-repository
 > descriptor-repository
isolation-level: read-uncommitted
RepositoryXmlHandler getIsoLevel
proxy-prefetching-limit: 50
version: 1.0
RepositoryXmlHandler startElement uri name qName jdbc-connection-descriptor
RepositoryXmlHandler startElement uri name qName object-cache
RepositoryXmlHandler startElement uri name qName attribute
 > attribute
attribute-name: timeout
attribute-value: 900
RepositoryXmlHandler endElement uri name qName attribute
RepositoryXmlHandler startElement uri name qName attribute
 > attribute
attribute-name: autoSync
attribute-value: true
RepositoryXmlHandler endElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName object-cache
RepositoryXmlHandler startElement uri name qName connection-pool
RepositoryXmlHandler endElement uri name qName connection-pool
Ignoring unused Element connection-pool
RepositoryXmlHandler startElement uri name qName sequence-manager
RepositoryXmlHandler startElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName attribute
RepositoryXmlHandler startElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName attribute
RepositoryXmlHandler startElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName attribute
RepositoryXmlHandler startElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName sequence-manager
Ignoring unused Element sequence-manager
RepositoryXmlHandler endElement uri name qName jdbc-connection-descriptor
Ignoring unused Element jdbc-connection-descriptor
RepositoryXmlHandler startElement uri name qName jdbc-connection-descriptor
RepositoryXmlHandler startElement uri name qName connection-pool
RepositoryXmlHandler endElement uri name qName connection-pool
Ignoring unused Element connection-pool
RepositoryXmlHandler startElement uri name qName sequence-manager
RepositoryXmlHandler startElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName sequence-manager
Ignoring unused Element sequence-manager
RepositoryXmlHandler endElement uri name qName jdbc-connection-descriptor
Ignoring unused Element jdbc-connection-descriptor
RepositoryXmlHandler startElement uri name qName jdbc-connection-descriptor
RepositoryXmlHandler startElement uri name qName object-cache
RepositoryXmlHandler startElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName attribute
RepositoryXmlHandler startElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName object-cache
RepositoryXmlHandler startElement uri name qName connection-pool
RepositoryXmlHandler endElement uri name qName connection-pool
Ignoring unused Element connection-pool
RepositoryXmlHandler startElement uri name qName sequence-manager
RepositoryXmlHandler startElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName attribute
RepositoryXmlHandler startElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName attribute
RepositoryXmlHandler endElement uri name qName sequence-manager
Ignoring unused Element sequence-manager
RepositoryXmlHandler endElement uri name qName jdbc-connection-descriptor
Ignoring unused Element jdbc-connection-descriptor
RepositoryXmlHandler startElement uri name qName class-descriptor
 > class-descriptor
isolation-level: read-uncommitted
RepositoryXmlHandler getIsoLevel
class: org.apache.ojb.broker.util.sequence.HighLowSequence
proxy: null
proxy-prefetching-limit: null
table: OJB_HL_SEQ
row-reader: null
extends: null
accept-locks: true
accept-locks: true
initialization-method: null
factory-class: null
factory-method: null
refresh: false
persistent-field-class: null
RepositoryXmlHandler startElement uri name qName object-cache
 > object-cache
org.apache.ojb.broker.metadata.MetadataException: Can't read repository 
file 'repository.xml'
at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown Source)
at org.apache.ojb.broker.metadata.MetadataManager.<init>(Unknown Source)
at org.apache.ojb.broker.metadata.MetadataManager.getInstance(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.getDefaultKey(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
Source)
at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
at 
org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
at com.sun.rio.jsb.ServiceBeanAdapter.doStart(ServiceBeanAdapter.java:277)
at 
com.sun.rio.jsb.ServiceBeanAdapter.access$000(ServiceBeanAdapter.java:101)
at com.sun.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:237)
at com.sun.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:248)
at com.sun.rio.boot.ServiceBeanLoader.load(ServiceBeanLoader.java:171)
at com.sun.rio.cybernode.JSBDelegate$2.run(JSBDelegate.java:342)
Caused by: org.apache.ojb.broker.metadata.MetadataException: Exception 
when reading metadata information, please check your repository.xml file
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at 
org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(Unknown 
Source)
at 
org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unknown 
Source)
at 
org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(Unknown 
Source)
... 16 more


Armin Waibel wrote:

> Hi Andre,
>
> A Leg wrote:
>
>> Hi Thomas
>>
>> I upgrade my machine from CVS this morning.
>> The class loader problem desappear without having to use setClassLoader.
>> Thank's for the idea.
>>
>> But I sill have the following error :
>>
>> STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>> Starting TaskConsumerDB
>> Starting TaskConsumerDB try
>> [BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
>> illegal for key "OqlCollectionClass" (should be a class, using 
>> default value class org.apache.ojb.odmg.collections.DListImpl)
>
>
> hmm, I think this warning is still caused by a class loader problem, 
> because the specified class exists in source.
>
> To get more information about repository parsing you should enable 
> 'DEBUG' logging status for
> org.apache.ojb.broker.metadata.RepositoryXmlHandler
> org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler
> in the used logging framework.
>
> regards,
> Armin
>
>> [org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] 
>> INFO: Create PersistenceBroker instance pool, pool configuration was 
>> {whenExhaustedAction=0, maxIdle=-1, maxActive=100, maxWait=2000, 
>> removeAbandoned=false, numTestsPerEvictionRun=10, 
>> testWhileIdle=false, minEvictableIdleTimeMillis=1000000, 
>> testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, 
>> timeBetweenEvictionRunsMillis=-1, testOnBorrow=false}
>> readDescriptorRepository filename repository.xml
>> readDescriptorRepository else useSerializedRepository repository.xml
>> readDescriptorRepository buildRepository repository.xml
>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB 
>> Descriptor Repository: 
>> file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Building 
>> repository from :file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>> readMetadataFromXML SAXParserFactory.newInstance().newSAXParser()
>> readMetadataFromXML p.getClass().getName()
>> readMetadataFromXML p.getXMLReader()
>> readMetadataFromXML reader.getClass().getName().indexOf
>> readMetadataFromXML reader.setFeature
>> readMetadataFromXML if DescriptorRepository.class.equals(target)
>> readMetadataFromXML DescriptorRepository.class.equals(target)
>> readMetadataFromXML DescriptorRepository
>> readMetadataFromXML RepositoryXmlHandler
>> readMetadataFromXML reader.setContentHandler
>> readMetadataFromXML reader.parse(source)
>> org.apache.ojb.broker.metadata.MetadataException: Can't read 
>> repository file 'repository.xml'
>> at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown Source)
>> at org.apache.ojb.broker.metadata.MetadataManager.<init>(Unknown Source)
>> at org.apache.ojb.broker.metadata.MetadataManager.getInstance(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.getDefaultKey(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
>> Source)
>> at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
>> at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
>> Source)
>> at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
>> Source)
>> at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown 
>> Source)
>> Caused by: org.apache.ojb.broker.metadata.MetadataException: 
>> Exception when reading metadata information, please check your 
>> repository.xml file
>> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
>> at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
>> at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
>> at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(Unknown 
>> Source)
>> ... 16 more
>>
>> I have add some debug to be sure that the problem was not classLoader.
>> The problem arrive during *reader.parse(source) in readMetadataFromXML*
>>
>> I first try to get my different repository files good, no result, 
>> then I copy all repository from test.
>> {orion:rcs} cp 
>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository*.xml 
>> /home/Absynt/Compiere/mfg_scm/sbin/
>> {orion:rcs} cp 
>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository.xml 
>> /home/Absynt/Compiere/mfg_scm/sbin/
>> And the error did not desappear.
>>
>> Any idea welcome.
>>
>> Andre
>>
>> Thomas Dudziak wrote:
>>
>>> A Leg wrote:
>>>
>>>> Hi Thomas.
>>>>
>>>> In fact setClassLoader is not usable.
>>>> As ClassLoader is used inside the first call to OJB :
>>>> PersistenceBrokerFactory.defaultPersistenceBroker();
>>>> Which use it to load Configuration and Logger elements.
>>>> So when you have conflict between OJB ClassLoader and your 
>>>> application ClassLoader ....
>>>
>>>
>>>
>>>
>>> Hmm, why would that prevent you from using setClassLoader ?
>>>
>>> // this should be the very first call
>>> ClassHelper.setClassLoader(myClassLoader);
>>>
>>> // because of this call logging and OJB will get initialized (lazy 
>>> initialization)
>>> broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>>>
>>> Since ClassHelper does not use logging or OJB's properties, there 
>>> should be no interference!
>>>
>>> Tom
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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 Loading Configuration now repository PB

Posted by A Leg <ha...@yahoo.com>.
Hi Armin and Thomas

I will try to hunt them one by one, my JINI service should be as small 
as possible.
It enable, client having only some jini capabilities to access databases 
and in that case small is beautifull.

Have nice time.
Thank's again, OJB is realy a nice project.

Andre

Armin Waibel wrote:

> Hi Andre,
>
> assume the same problem as with 
> 'org.apache.ojb.odmg.collections.DListImpl_2' before.
>
> Now you have class loader problem with:
> org.apache.ojb.broker.platforms.PlatformPostgreSQLImpl
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl
>
> regards,
> Armin
>
> A Leg wrote:
>
>> Hi Armin and Thomas
>>
>> Following your advices I progress a lot.
>> Problems was comming from the fact that some class loaded at run time 
>> was not included in jar.
>> At compile I nuse a ClassDep api which detect required classes and 
>> put it in jar.
>> But they don't detect what is loaded at run time.
>>
>> As with rc7 we load at run time some odmg classes even if we don't 
>> use odmg, theses classes was not existing in my jar.
>> From the stack trace of RepositoryXmlHandler, I got the name of 
>> missing classes etc...
>>
>> Only problem I fail someWhere after now.
>> Without software problems, companies would not need software 
>> engeneers so it's may be a good news...
>>
>> The stack trace is :
>>
>> Any idea welcome; I keep looking for some missing class on my side.
>>
>> One more time thank's for your help.
>>
>> Andre
>>
>> ConnectionDescriptorXmlHandler endElement uri name qName 
>> descriptor-repository
>> **** endDoc ****
>> readMetadataFromXML result = repository
>> readMetadataFromXML rreturn result
>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Read 
>> connection repository took 1259 ms
>> [org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl] INFO: 
>> Create new PB instance for PBKey org.apache.ojb.broker.PBKey: 
>> jcdAlias=default, user=postgres, password=*****, already created 
>> persistence broker instances: 0
>> [DEFAULT] WARN: [PlatformFactory] problems with platform 
>> org.apache.ojb.broker.platforms.PlatformPostgreSQLImpl: 
>> org.apache.ojb.broker.platforms.PlatformPostgreSQLImpl
>> [DEFAULT] WARN: [PlatformFactory] OJB will use PlatformDefaultImpl 
>> instead
>> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Start creating 
>> new ObjectCache instance
>> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Default 
>> ObjectCache class was org.apache.ojb.broker.cache.ObjectCacheDefaultImpl
>> [org.apache.ojb.broker.cache.CacheDistributor] INFO: Use property 
>> 'descriptorBasedCaches' is set 'false'
>> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Instantiate 
>> new org.apache.ojb.broker.cache.CacheDistributor class object
>> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: New 
>> ObjectCache instance was created
>> [BOOT] WARN: Value "org.apache.ojb.broker.accesslayer.JdbcAccessImpl" 
>> is illegal for key "JdbcAccessClass" (should be a class, using 
>> default value null)
>> [org.apache.ojb.broker.accesslayer.JdbcAccessFactory] ERROR: 
>> ConfigurableFactory configuration key class for key'JdbcAccessClass' 
>> does not exist.
>> [org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl] ERROR: 
>> Creation of a new PB instance failed
>> null
>> java.lang.reflect.InvocationTargetException
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>> at 
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
>>
>> at 
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
>>
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>> at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
>> at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.createNewBrokerInstance(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolableObjectFactory.makeObject(Unknown 
>> Source)
>> at 
>> org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
>> Source)
>> at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
>> at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
>> Source)
>> at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
>> Source)
>> at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown 
>> Source)
>> at 
>> com.sun.rio.jsb.ServiceBeanAdapter.doStart(ServiceBeanAdapter.java:277)
>> at 
>> com.sun.rio.jsb.ServiceBeanAdapter.access$000(ServiceBeanAdapter.java:101) 
>>
>> at com.sun.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:237)
>> at com.sun.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:248)
>> at com.sun.rio.boot.ServiceBeanLoader.load(ServiceBeanLoader.java:171)
>> at com.sun.rio.cybernode.JSBDelegate$2.run(JSBDelegate.java:342)
>> Caused by: org.apache.ojb.broker.PersistenceBrokerException: 
>> ConfigurableFactory configuration key class for key'JdbcAccessClass' 
>> does not exist.
>> at 
>> org.apache.ojb.broker.util.factory.ConfigurableFactory.configure(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.configure(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.util.factory.ConfigurableFactory.<init>(Unknown 
>> Source)
>> at org.apache.ojb.broker.accesslayer.JdbcAccessFactory.<init>(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.accesslayer.JdbcAccessFactory.getInstance(Unknown 
>> Source)
>> at org.apache.ojb.broker.core.PersistenceBrokerImpl.<init>(Unknown 
>> Source)
>> ... 22 more
>> org.apache.ojb.broker.PBFactoryException: Borrow broker from pool 
>> failed, using PBKey org.apache.ojb.broker.PBKey: jcdAlias=default, 
>> user=postgres, password=*****
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
>> Source)
>> at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
>> at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
>> Source)
>> at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
>> Source)
>> at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown 
>> Source)
>> at 
>> com.sun.rio.jsb.ServiceBeanAdapter.doStart(ServiceBeanAdapter.java:277)
>> at 
>> com.sun.rio.jsb.ServiceBeanAdapter.access$000(ServiceBeanAdapter.java:101) 
>>
>> at com.sun.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:237)
>> at com.sun.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:248)
>> at com.sun.rio.boot.ServiceBeanLoader.load(ServiceBeanLoader.java:171)
>> at com.sun.rio.cybernode.JSBDelegate$2.run(JSBDelegate.java:342)
>> Caused by: org.apache.ojb.broker.PBFactoryException: Creation of a 
>> new PB instance failed
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.createNewBrokerInstance(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolableObjectFactory.makeObject(Unknown 
>> Source)
>> at 
>> org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Unknown 
>> Source)
>> ... 13 more
>> Caused by: java.lang.reflect.InvocationTargetException
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>> at 
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
>>
>> at 
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
>>
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>> at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
>> at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
>> ... 16 more
>> Caused by: org.apache.ojb.broker.PersistenceBrokerException: 
>> ConfigurableFactory configuration key class for key'JdbcAccessClass' 
>> does not exist.
>> at 
>> org.apache.ojb.broker.util.factory.ConfigurableFactory.configure(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.configure(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.util.factory.ConfigurableFactory.<init>(Unknown 
>> Source)
>> at org.apache.ojb.broker.accesslayer.JdbcAccessFactory.<init>(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.accesslayer.JdbcAccessFactory.getInstance(Unknown 
>> Source)
>> at org.apache.ojb.broker.core.PersistenceBrokerImpl.<init>(Unknown 
>> Source)
>> ... 22 more
>>
>>
>>
>> Armin Waibel wrote:
>>
>>> Hi Andre,
>>>
>>> A Leg wrote:
>>>
>>>> Hi Thomas
>>>>
>>>> I upgrade my machine from CVS this morning.
>>>> The class loader problem desappear without having to use 
>>>> setClassLoader.
>>>> Thank's for the idea.
>>>>
>>>> But I sill have the following error :
>>>>
>>>> STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>>>> Starting TaskConsumerDB
>>>> Starting TaskConsumerDB try
>>>> [BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
>>>> illegal for key "OqlCollectionClass" (should be a class, using 
>>>> default value class org.apache.ojb.odmg.collections.DListImpl)
>>>
>>>
>>>
>>>
>>> hmm, I think this warning is still caused by a class loader problem, 
>>> because the specified class exists in source.
>>>
>>> To get more information about repository parsing you should enable 
>>> 'DEBUG' logging status for
>>> org.apache.ojb.broker.metadata.RepositoryXmlHandler
>>> org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler
>>> in the used logging framework.
>>>
>>> regards,
>>> Armin
>>>
>>>> [org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] 
>>>> INFO: Create PersistenceBroker instance pool, pool configuration 
>>>> was {whenExhaustedAction=0, maxIdle=-1, maxActive=100, 
>>>> maxWait=2000, removeAbandoned=false, numTestsPerEvictionRun=10, 
>>>> testWhileIdle=false, minEvictableIdleTimeMillis=1000000, 
>>>> testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, 
>>>> timeBetweenEvictionRunsMillis=-1, testOnBorrow=false}
>>>> readDescriptorRepository filename repository.xml
>>>> readDescriptorRepository else useSerializedRepository repository.xml
>>>> readDescriptorRepository buildRepository repository.xml
>>>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB 
>>>> Descriptor Repository: 
>>>> file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>>>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Building 
>>>> repository from 
>>>> :file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>>>> readMetadataFromXML SAXParserFactory.newInstance().newSAXParser()
>>>> readMetadataFromXML p.getClass().getName()
>>>> readMetadataFromXML p.getXMLReader()
>>>> readMetadataFromXML reader.getClass().getName().indexOf
>>>> readMetadataFromXML reader.setFeature
>>>> readMetadataFromXML if DescriptorRepository.class.equals(target)
>>>> readMetadataFromXML DescriptorRepository.class.equals(target)
>>>> readMetadataFromXML DescriptorRepository
>>>> readMetadataFromXML RepositoryXmlHandler
>>>> readMetadataFromXML reader.setContentHandler
>>>> readMetadataFromXML reader.parse(source)
>>>> org.apache.ojb.broker.metadata.MetadataException: Can't read 
>>>> repository file 'repository.xml'
>>>> at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown Source)
>>>> at org.apache.ojb.broker.metadata.MetadataManager.<init>(Unknown 
>>>> Source)
>>>> at 
>>>> org.apache.ojb.broker.metadata.MetadataManager.getInstance(Unknown 
>>>> Source)
>>>> at 
>>>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.getDefaultKey(Unknown 
>>>> Source)
>>>> at 
>>>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
>>>> Source)
>>>> at 
>>>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
>>>> Source)
>>>> at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
>>>> at 
>>>> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
>>>> Source)
>>>> at 
>>>> org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
>>>> Source)
>>>> at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown 
>>>> Source)
>>>> Caused by: org.apache.ojb.broker.metadata.MetadataException: 
>>>> Exception when reading metadata information, please check your 
>>>> repository.xml file
>>>> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
>>>> at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
>>>> at 
>>>> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
>>>> at 
>>>> org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(Unknown 
>>>> Source)
>>>> at 
>>>> org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unknown 
>>>> Source)
>>>> at 
>>>> org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(Unknown 
>>>> Source)
>>>> ... 16 more
>>>>
>>>> I have add some debug to be sure that the problem was not classLoader.
>>>> The problem arrive during *reader.parse(source) in 
>>>> readMetadataFromXML*
>>>>
>>>> I first try to get my different repository files good, no result, 
>>>> then I copy all repository from test.
>>>> {orion:rcs} cp 
>>>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository*.xml 
>>>> /home/Absynt/Compiere/mfg_scm/sbin/
>>>> {orion:rcs} cp 
>>>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository.xml 
>>>> /home/Absynt/Compiere/mfg_scm/sbin/
>>>> And the error did not desappear.
>>>>
>>>> Any idea welcome.
>>>>
>>>> Andre
>>>>
>>>> Thomas Dudziak wrote:
>>>>
>>>>> A Leg wrote:
>>>>>
>>>>>> Hi Thomas.
>>>>>>
>>>>>> In fact setClassLoader is not usable.
>>>>>> As ClassLoader is used inside the first call to OJB :
>>>>>> PersistenceBrokerFactory.defaultPersistenceBroker();
>>>>>> Which use it to load Configuration and Logger elements.
>>>>>> So when you have conflict between OJB ClassLoader and your 
>>>>>> application ClassLoader ....
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Hmm, why would that prevent you from using setClassLoader ?
>>>>>
>>>>> // this should be the very first call
>>>>> ClassHelper.setClassLoader(myClassLoader);
>>>>>
>>>>> // because of this call logging and OJB will get initialized (lazy 
>>>>> initialization)
>>>>> broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>>>>>
>>>>> Since ClassHelper does not use logging or OJB's properties, there 
>>>>> should be no interference!
>>>>>
>>>>> Tom
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>
>


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


Re: Pb Loading Configuration now repository PB

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

assume the same problem as with 
'org.apache.ojb.odmg.collections.DListImpl_2' before.

Now you have class loader problem with:
org.apache.ojb.broker.platforms.PlatformPostgreSQLImpl
org.apache.ojb.broker.accesslayer.JdbcAccessImpl

regards,
Armin

A Leg wrote:

> Hi Armin and Thomas
> 
> Following your advices I progress a lot.
> Problems was comming from the fact that some class loaded at run time 
> was not included in jar.
> At compile I nuse a ClassDep api which detect required classes and put 
> it in jar.
> But they don't detect what is loaded at run time.
> 
> As with rc7 we load at run time some odmg classes even if we don't use 
> odmg, theses classes was not existing in my jar.
>  From the stack trace of RepositoryXmlHandler, I got the name of missing 
> classes etc...
> 
> Only problem I fail someWhere after now.
> Without software problems, companies would not need software engeneers 
> so it's may be a good news...
> 
> The stack trace is :
> 
> Any idea welcome; I keep looking for some missing class on my side.
> 
> One more time thank's for your help.
> 
> Andre
> 
> ConnectionDescriptorXmlHandler endElement uri name qName 
> descriptor-repository
> **** endDoc ****
> readMetadataFromXML result = repository
> readMetadataFromXML rreturn result
> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Read 
> connection repository took 1259 ms
> [org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl] INFO: 
> Create new PB instance for PBKey org.apache.ojb.broker.PBKey: 
> jcdAlias=default, user=postgres, password=*****, already created 
> persistence broker instances: 0
> [DEFAULT] WARN: [PlatformFactory] problems with platform 
> org.apache.ojb.broker.platforms.PlatformPostgreSQLImpl: 
> org.apache.ojb.broker.platforms.PlatformPostgreSQLImpl
> [DEFAULT] WARN: [PlatformFactory] OJB will use PlatformDefaultImpl instead
> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Start creating 
> new ObjectCache instance
> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Default 
> ObjectCache class was org.apache.ojb.broker.cache.ObjectCacheDefaultImpl
> [org.apache.ojb.broker.cache.CacheDistributor] INFO: Use property 
> 'descriptorBasedCaches' is set 'false'
> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Instantiate new 
> org.apache.ojb.broker.cache.CacheDistributor class object
> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: New ObjectCache 
> instance was created
> [BOOT] WARN: Value "org.apache.ojb.broker.accesslayer.JdbcAccessImpl" is 
> illegal for key "JdbcAccessClass" (should be a class, using default 
> value null)
> [org.apache.ojb.broker.accesslayer.JdbcAccessFactory] ERROR: 
> ConfigurableFactory configuration key class for key'JdbcAccessClass' 
> does not exist.
> [org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl] ERROR: 
> Creation of a new PB instance failed
> null
> java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
> 
> at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
> 
> at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
> at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
> at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
> at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.createNewBrokerInstance(Unknown 
> Source)
> at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolableObjectFactory.makeObject(Unknown 
> Source)
> at 
> org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Unknown 
> Source)
> at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Unknown 
> Source)
> at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
> Source)
> at 
> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
> Source)
> at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
> at 
> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
> Source)
> at org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
> Source)
> at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
> at com.sun.rio.jsb.ServiceBeanAdapter.doStart(ServiceBeanAdapter.java:277)
> at 
> com.sun.rio.jsb.ServiceBeanAdapter.access$000(ServiceBeanAdapter.java:101)
> at com.sun.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:237)
> at com.sun.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:248)
> at com.sun.rio.boot.ServiceBeanLoader.load(ServiceBeanLoader.java:171)
> at com.sun.rio.cybernode.JSBDelegate$2.run(JSBDelegate.java:342)
> Caused by: org.apache.ojb.broker.PersistenceBrokerException: 
> ConfigurableFactory configuration key class for key'JdbcAccessClass' 
> does not exist.
> at 
> org.apache.ojb.broker.util.factory.ConfigurableFactory.configure(Unknown 
> Source)
> at 
> org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.configure(Unknown 
> Source)
> at org.apache.ojb.broker.util.factory.ConfigurableFactory.<init>(Unknown 
> Source)
> at org.apache.ojb.broker.accesslayer.JdbcAccessFactory.<init>(Unknown 
> Source)
> at 
> org.apache.ojb.broker.accesslayer.JdbcAccessFactory.getInstance(Unknown 
> Source)
> at org.apache.ojb.broker.core.PersistenceBrokerImpl.<init>(Unknown Source)
> ... 22 more
> org.apache.ojb.broker.PBFactoryException: Borrow broker from pool 
> failed, using PBKey org.apache.ojb.broker.PBKey: jcdAlias=default, 
> user=postgres, password=*****
> at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Unknown 
> Source)
> at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
> Source)
> at 
> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
> Source)
> at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
> at 
> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
> Source)
> at org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
> Source)
> at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
> at com.sun.rio.jsb.ServiceBeanAdapter.doStart(ServiceBeanAdapter.java:277)
> at 
> com.sun.rio.jsb.ServiceBeanAdapter.access$000(ServiceBeanAdapter.java:101)
> at com.sun.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:237)
> at com.sun.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:248)
> at com.sun.rio.boot.ServiceBeanLoader.load(ServiceBeanLoader.java:171)
> at com.sun.rio.cybernode.JSBDelegate$2.run(JSBDelegate.java:342)
> Caused by: org.apache.ojb.broker.PBFactoryException: Creation of a new 
> PB instance failed
> at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.createNewBrokerInstance(Unknown 
> Source)
> at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolableObjectFactory.makeObject(Unknown 
> Source)
> at 
> org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Unknown 
> Source)
> ... 13 more
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
> 
> at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
> 
> at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
> at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
> at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
> ... 16 more
> Caused by: org.apache.ojb.broker.PersistenceBrokerException: 
> ConfigurableFactory configuration key class for key'JdbcAccessClass' 
> does not exist.
> at 
> org.apache.ojb.broker.util.factory.ConfigurableFactory.configure(Unknown 
> Source)
> at 
> org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.configure(Unknown 
> Source)
> at org.apache.ojb.broker.util.factory.ConfigurableFactory.<init>(Unknown 
> Source)
> at org.apache.ojb.broker.accesslayer.JdbcAccessFactory.<init>(Unknown 
> Source)
> at 
> org.apache.ojb.broker.accesslayer.JdbcAccessFactory.getInstance(Unknown 
> Source)
> at org.apache.ojb.broker.core.PersistenceBrokerImpl.<init>(Unknown Source)
> ... 22 more
> 
> 
> 
> Armin Waibel wrote:
> 
>> Hi Andre,
>>
>> A Leg wrote:
>>
>>> Hi Thomas
>>>
>>> I upgrade my machine from CVS this morning.
>>> The class loader problem desappear without having to use setClassLoader.
>>> Thank's for the idea.
>>>
>>> But I sill have the following error :
>>>
>>> STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>>> Starting TaskConsumerDB
>>> Starting TaskConsumerDB try
>>> [BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
>>> illegal for key "OqlCollectionClass" (should be a class, using 
>>> default value class org.apache.ojb.odmg.collections.DListImpl)
>>
>>
>>
>> hmm, I think this warning is still caused by a class loader problem, 
>> because the specified class exists in source.
>>
>> To get more information about repository parsing you should enable 
>> 'DEBUG' logging status for
>> org.apache.ojb.broker.metadata.RepositoryXmlHandler
>> org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler
>> in the used logging framework.
>>
>> regards,
>> Armin
>>
>>> [org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] 
>>> INFO: Create PersistenceBroker instance pool, pool configuration was 
>>> {whenExhaustedAction=0, maxIdle=-1, maxActive=100, maxWait=2000, 
>>> removeAbandoned=false, numTestsPerEvictionRun=10, 
>>> testWhileIdle=false, minEvictableIdleTimeMillis=1000000, 
>>> testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, 
>>> timeBetweenEvictionRunsMillis=-1, testOnBorrow=false}
>>> readDescriptorRepository filename repository.xml
>>> readDescriptorRepository else useSerializedRepository repository.xml
>>> readDescriptorRepository buildRepository repository.xml
>>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB 
>>> Descriptor Repository: 
>>> file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Building 
>>> repository from :file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>>> readMetadataFromXML SAXParserFactory.newInstance().newSAXParser()
>>> readMetadataFromXML p.getClass().getName()
>>> readMetadataFromXML p.getXMLReader()
>>> readMetadataFromXML reader.getClass().getName().indexOf
>>> readMetadataFromXML reader.setFeature
>>> readMetadataFromXML if DescriptorRepository.class.equals(target)
>>> readMetadataFromXML DescriptorRepository.class.equals(target)
>>> readMetadataFromXML DescriptorRepository
>>> readMetadataFromXML RepositoryXmlHandler
>>> readMetadataFromXML reader.setContentHandler
>>> readMetadataFromXML reader.parse(source)
>>> org.apache.ojb.broker.metadata.MetadataException: Can't read 
>>> repository file 'repository.xml'
>>> at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown Source)
>>> at org.apache.ojb.broker.metadata.MetadataManager.<init>(Unknown Source)
>>> at org.apache.ojb.broker.metadata.MetadataManager.getInstance(Unknown 
>>> Source)
>>> at 
>>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.getDefaultKey(Unknown 
>>> Source)
>>> at 
>>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
>>> Source)
>>> at 
>>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
>>> Source)
>>> at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
>>> at 
>>> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
>>> Source)
>>> at 
>>> org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
>>> Source)
>>> at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown 
>>> Source)
>>> Caused by: org.apache.ojb.broker.metadata.MetadataException: 
>>> Exception when reading metadata information, please check your 
>>> repository.xml file
>>> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
>>> at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
>>> at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
>>> at 
>>> org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(Unknown 
>>> Source)
>>> at 
>>> org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unknown 
>>> Source)
>>> at 
>>> org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(Unknown 
>>> Source)
>>> ... 16 more
>>>
>>> I have add some debug to be sure that the problem was not classLoader.
>>> The problem arrive during *reader.parse(source) in readMetadataFromXML*
>>>
>>> I first try to get my different repository files good, no result, 
>>> then I copy all repository from test.
>>> {orion:rcs} cp 
>>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository*.xml 
>>> /home/Absynt/Compiere/mfg_scm/sbin/
>>> {orion:rcs} cp 
>>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository.xml 
>>> /home/Absynt/Compiere/mfg_scm/sbin/
>>> And the error did not desappear.
>>>
>>> Any idea welcome.
>>>
>>> Andre
>>>
>>> Thomas Dudziak wrote:
>>>
>>>> A Leg wrote:
>>>>
>>>>> Hi Thomas.
>>>>>
>>>>> In fact setClassLoader is not usable.
>>>>> As ClassLoader is used inside the first call to OJB :
>>>>> PersistenceBrokerFactory.defaultPersistenceBroker();
>>>>> Which use it to load Configuration and Logger elements.
>>>>> So when you have conflict between OJB ClassLoader and your 
>>>>> application ClassLoader ....
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Hmm, why would that prevent you from using setClassLoader ?
>>>>
>>>> // this should be the very first call
>>>> ClassHelper.setClassLoader(myClassLoader);
>>>>
>>>> // because of this call logging and OJB will get initialized (lazy 
>>>> initialization)
>>>> broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>>>>
>>>> Since ClassHelper does not use logging or OJB's properties, there 
>>>> should be no interference!
>>>>
>>>> Tom
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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 Loading Configuration now repository PB

Posted by Thomas Dudziak <to...@first.fhg.de>.
A Leg wrote:

> Hi Armin and Thomas
> 
> Following your advices I progress a lot.
> Problems was comming from the fact that some class loaded at run time 
> was not included in jar.
> At compile I nuse a ClassDep api which detect required classes and put 
> it in jar.
> But they don't detect what is loaded at run time.
> 
> As with rc7 we load at run time some odmg classes even if we don't use 
> odmg, theses classes was not existing in my jar.
>  From the stack trace of RepositoryXmlHandler, I got the name of missing 
> classes etc...
> 
> Only problem I fail someWhere after now.
> Without software problems, companies would not need software engeneers 
> so it's may be a good news...
> 
> The stack trace is :
> 
> Any idea welcome; I keep looking for some missing class on my side.
> 
> One more time thank's for your help.
> 
> Andre
> 
> ConnectionDescriptorXmlHandler endElement uri name qName 
> descriptor-repository
> **** endDoc ****
> readMetadataFromXML result = repository
> readMetadataFromXML rreturn result
> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Read 
> connection repository took 1259 ms
> [org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl] INFO: 
> Create new PB instance for PBKey org.apache.ojb.broker.PBKey: 
> jcdAlias=default, user=postgres, password=*****, already created 
> persistence broker instances: 0
> [DEFAULT] WARN: [PlatformFactory] problems with platform 
> org.apache.ojb.broker.platforms.PlatformPostgreSQLImpl: 
> org.apache.ojb.broker.platforms.PlatformPostgreSQLImpl
> [DEFAULT] WARN: [PlatformFactory] OJB will use PlatformDefaultImpl instead
> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Start creating 
> new ObjectCache instance
> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Default 
> ObjectCache class was org.apache.ojb.broker.cache.ObjectCacheDefaultImpl
> [org.apache.ojb.broker.cache.CacheDistributor] INFO: Use property 
> 'descriptorBasedCaches' is set 'false'
> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Instantiate new 
> org.apache.ojb.broker.cache.CacheDistributor class object
> [org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: New ObjectCache 
> instance was created
> [BOOT] WARN: Value "org.apache.ojb.broker.accesslayer.JdbcAccessImpl" is 
> illegal for key "JdbcAccessClass" (should be a class, using default 
> value null)

This is the interesting message it seems (and the rest of the stacktrace 
  indicates as much): the class 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl seems to be missing.

You'll probably have to hunt these messages one at a time and add the 
classes that are marked as illegal in these messages.

However, in your case it might be easiest if you include all classes 
from the OJB jar and related jars (e.g. commons-*).

Tom


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


Re: Pb Loading Configuration now repository PB

Posted by A Leg <ha...@yahoo.com>.
Hi Armin and Thomas

Following your advices I progress a lot.
Problems was comming from the fact that some class loaded at run time 
was not included in jar.
At compile I nuse a ClassDep api which detect required classes and put 
it in jar.
But they don't detect what is loaded at run time.

As with rc7 we load at run time some odmg classes even if we don't use 
odmg, theses classes was not existing in my jar.
 From the stack trace of RepositoryXmlHandler, I got the name of missing 
classes etc...

Only problem I fail someWhere after now.
Without software problems, companies would not need software engeneers 
so it's may be a good news...

The stack trace is :

Any idea welcome; I keep looking for some missing class on my side.

One more time thank's for your help.

Andre

ConnectionDescriptorXmlHandler endElement uri name qName 
descriptor-repository
**** endDoc ****
readMetadataFromXML result = repository
readMetadataFromXML rreturn result
[org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Read 
connection repository took 1259 ms
[org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl] INFO: 
Create new PB instance for PBKey org.apache.ojb.broker.PBKey: 
jcdAlias=default, user=postgres, password=*****, already created 
persistence broker instances: 0
[DEFAULT] WARN: [PlatformFactory] problems with platform 
org.apache.ojb.broker.platforms.PlatformPostgreSQLImpl: 
org.apache.ojb.broker.platforms.PlatformPostgreSQLImpl
[DEFAULT] WARN: [PlatformFactory] OJB will use PlatformDefaultImpl instead
[org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Start creating 
new ObjectCache instance
[org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Default 
ObjectCache class was org.apache.ojb.broker.cache.ObjectCacheDefaultImpl
[org.apache.ojb.broker.cache.CacheDistributor] INFO: Use property 
'descriptorBasedCaches' is set 'false'
[org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: Instantiate new 
org.apache.ojb.broker.cache.CacheDistributor class object
[org.apache.ojb.broker.cache.ObjectCacheFactory] INFO: New ObjectCache 
instance was created
[BOOT] WARN: Value "org.apache.ojb.broker.accesslayer.JdbcAccessImpl" is 
illegal for key "JdbcAccessClass" (should be a class, using default 
value null)
[org.apache.ojb.broker.accesslayer.JdbcAccessFactory] ERROR: 
ConfigurableFactory configuration key class for key'JdbcAccessClass' 
does not exist.
[org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl] ERROR: 
Creation of a new PB instance failed
null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.createNewBrokerInstance(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolableObjectFactory.makeObject(Unknown 
Source)
at 
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
Source)
at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
at 
org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
at com.sun.rio.jsb.ServiceBeanAdapter.doStart(ServiceBeanAdapter.java:277)
at 
com.sun.rio.jsb.ServiceBeanAdapter.access$000(ServiceBeanAdapter.java:101)
at com.sun.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:237)
at com.sun.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:248)
at com.sun.rio.boot.ServiceBeanLoader.load(ServiceBeanLoader.java:171)
at com.sun.rio.cybernode.JSBDelegate$2.run(JSBDelegate.java:342)
Caused by: org.apache.ojb.broker.PersistenceBrokerException: 
ConfigurableFactory configuration key class for key'JdbcAccessClass' 
does not exist.
at 
org.apache.ojb.broker.util.factory.ConfigurableFactory.configure(Unknown 
Source)
at 
org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.configure(Unknown 
Source)
at org.apache.ojb.broker.util.factory.ConfigurableFactory.<init>(Unknown 
Source)
at org.apache.ojb.broker.accesslayer.JdbcAccessFactory.<init>(Unknown 
Source)
at 
org.apache.ojb.broker.accesslayer.JdbcAccessFactory.getInstance(Unknown 
Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.<init>(Unknown Source)
... 22 more
org.apache.ojb.broker.PBFactoryException: Borrow broker from pool 
failed, using PBKey org.apache.ojb.broker.PBKey: jcdAlias=default, 
user=postgres, password=*****
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
Source)
at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
at 
org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
at com.sun.rio.jsb.ServiceBeanAdapter.doStart(ServiceBeanAdapter.java:277)
at 
com.sun.rio.jsb.ServiceBeanAdapter.access$000(ServiceBeanAdapter.java:101)
at com.sun.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:237)
at com.sun.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:248)
at com.sun.rio.boot.ServiceBeanLoader.load(ServiceBeanLoader.java:171)
at com.sun.rio.cybernode.JSBDelegate$2.run(JSBDelegate.java:342)
Caused by: org.apache.ojb.broker.PBFactoryException: Creation of a new 
PB instance failed
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.createNewBrokerInstance(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolableObjectFactory.makeObject(Unknown 
Source)
at 
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Unknown 
Source)
... 13 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source)
... 16 more
Caused by: org.apache.ojb.broker.PersistenceBrokerException: 
ConfigurableFactory configuration key class for key'JdbcAccessClass' 
does not exist.
at 
org.apache.ojb.broker.util.factory.ConfigurableFactory.configure(Unknown 
Source)
at 
org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.configure(Unknown 
Source)
at org.apache.ojb.broker.util.factory.ConfigurableFactory.<init>(Unknown 
Source)
at org.apache.ojb.broker.accesslayer.JdbcAccessFactory.<init>(Unknown 
Source)
at 
org.apache.ojb.broker.accesslayer.JdbcAccessFactory.getInstance(Unknown 
Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.<init>(Unknown Source)
... 22 more



Armin Waibel wrote:

> Hi Andre,
>
> A Leg wrote:
>
>> Hi Thomas
>>
>> I upgrade my machine from CVS this morning.
>> The class loader problem desappear without having to use setClassLoader.
>> Thank's for the idea.
>>
>> But I sill have the following error :
>>
>> STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>> Starting TaskConsumerDB
>> Starting TaskConsumerDB try
>> [BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
>> illegal for key "OqlCollectionClass" (should be a class, using 
>> default value class org.apache.ojb.odmg.collections.DListImpl)
>
>
> hmm, I think this warning is still caused by a class loader problem, 
> because the specified class exists in source.
>
> To get more information about repository parsing you should enable 
> 'DEBUG' logging status for
> org.apache.ojb.broker.metadata.RepositoryXmlHandler
> org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler
> in the used logging framework.
>
> regards,
> Armin
>
>> [org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] 
>> INFO: Create PersistenceBroker instance pool, pool configuration was 
>> {whenExhaustedAction=0, maxIdle=-1, maxActive=100, maxWait=2000, 
>> removeAbandoned=false, numTestsPerEvictionRun=10, 
>> testWhileIdle=false, minEvictableIdleTimeMillis=1000000, 
>> testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, 
>> timeBetweenEvictionRunsMillis=-1, testOnBorrow=false}
>> readDescriptorRepository filename repository.xml
>> readDescriptorRepository else useSerializedRepository repository.xml
>> readDescriptorRepository buildRepository repository.xml
>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB 
>> Descriptor Repository: 
>> file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Building 
>> repository from :file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>> readMetadataFromXML SAXParserFactory.newInstance().newSAXParser()
>> readMetadataFromXML p.getClass().getName()
>> readMetadataFromXML p.getXMLReader()
>> readMetadataFromXML reader.getClass().getName().indexOf
>> readMetadataFromXML reader.setFeature
>> readMetadataFromXML if DescriptorRepository.class.equals(target)
>> readMetadataFromXML DescriptorRepository.class.equals(target)
>> readMetadataFromXML DescriptorRepository
>> readMetadataFromXML RepositoryXmlHandler
>> readMetadataFromXML reader.setContentHandler
>> readMetadataFromXML reader.parse(source)
>> org.apache.ojb.broker.metadata.MetadataException: Can't read 
>> repository file 'repository.xml'
>> at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown Source)
>> at org.apache.ojb.broker.metadata.MetadataManager.<init>(Unknown Source)
>> at org.apache.ojb.broker.metadata.MetadataManager.getInstance(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.getDefaultKey(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
>> Source)
>> at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
>> at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
>> Source)
>> at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
>> Source)
>> at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown 
>> Source)
>> Caused by: org.apache.ojb.broker.metadata.MetadataException: 
>> Exception when reading metadata information, please check your 
>> repository.xml file
>> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
>> at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
>> at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
>> at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(Unknown 
>> Source)
>> ... 16 more
>>
>> I have add some debug to be sure that the problem was not classLoader.
>> The problem arrive during *reader.parse(source) in readMetadataFromXML*
>>
>> I first try to get my different repository files good, no result, 
>> then I copy all repository from test.
>> {orion:rcs} cp 
>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository*.xml 
>> /home/Absynt/Compiere/mfg_scm/sbin/
>> {orion:rcs} cp 
>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository.xml 
>> /home/Absynt/Compiere/mfg_scm/sbin/
>> And the error did not desappear.
>>
>> Any idea welcome.
>>
>> Andre
>>
>> Thomas Dudziak wrote:
>>
>>> A Leg wrote:
>>>
>>>> Hi Thomas.
>>>>
>>>> In fact setClassLoader is not usable.
>>>> As ClassLoader is used inside the first call to OJB :
>>>> PersistenceBrokerFactory.defaultPersistenceBroker();
>>>> Which use it to load Configuration and Logger elements.
>>>> So when you have conflict between OJB ClassLoader and your 
>>>> application ClassLoader ....
>>>
>>>
>>>
>>>
>>> Hmm, why would that prevent you from using setClassLoader ?
>>>
>>> // this should be the very first call
>>> ClassHelper.setClassLoader(myClassLoader);
>>>
>>> // because of this call logging and OJB will get initialized (lazy 
>>> initialization)
>>> broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>>>
>>> Since ClassHelper does not use logging or OJB's properties, there 
>>> should be no interference!
>>>
>>> Tom
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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 Loading Configuration now repository PB

Posted by A Leg <ha...@yahoo.com>.
Thank's Armin and Thomas.

I have added :
ClassHelper.setClassLoader(myClassLoader);

And I get the same result.

Can you tell me how I can enable 'DEBUG' logging status ?

I have set jar-debug in build.xml
I don't use ant ide.

Andre

Armin Waibel wrote:

> Hi Andre,
>
> A Leg wrote:
>
>> Hi Thomas
>>
>> I upgrade my machine from CVS this morning.
>> The class loader problem desappear without having to use setClassLoader.
>> Thank's for the idea.
>>
>> But I sill have the following error :
>>
>> STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>> Starting TaskConsumerDB
>> Starting TaskConsumerDB try
>> [BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
>> illegal for key "OqlCollectionClass" (should be a class, using 
>> default value class org.apache.ojb.odmg.collections.DListImpl)
>
>
> hmm, I think this warning is still caused by a class loader problem, 
> because the specified class exists in source.
>
> To get more information about repository parsing you should enable 
> 'DEBUG' logging status for
> org.apache.ojb.broker.metadata.RepositoryXmlHandler
> org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler
> in the used logging framework.
>
> regards,
> Armin
>
>> [org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] 
>> INFO: Create PersistenceBroker instance pool, pool configuration was 
>> {whenExhaustedAction=0, maxIdle=-1, maxActive=100, maxWait=2000, 
>> removeAbandoned=false, numTestsPerEvictionRun=10, 
>> testWhileIdle=false, minEvictableIdleTimeMillis=1000000, 
>> testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, 
>> timeBetweenEvictionRunsMillis=-1, testOnBorrow=false}
>> readDescriptorRepository filename repository.xml
>> readDescriptorRepository else useSerializedRepository repository.xml
>> readDescriptorRepository buildRepository repository.xml
>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB 
>> Descriptor Repository: 
>> file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Building 
>> repository from :file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>> readMetadataFromXML SAXParserFactory.newInstance().newSAXParser()
>> readMetadataFromXML p.getClass().getName()
>> readMetadataFromXML p.getXMLReader()
>> readMetadataFromXML reader.getClass().getName().indexOf
>> readMetadataFromXML reader.setFeature
>> readMetadataFromXML if DescriptorRepository.class.equals(target)
>> readMetadataFromXML DescriptorRepository.class.equals(target)
>> readMetadataFromXML DescriptorRepository
>> readMetadataFromXML RepositoryXmlHandler
>> readMetadataFromXML reader.setContentHandler
>> readMetadataFromXML reader.parse(source)
>> org.apache.ojb.broker.metadata.MetadataException: Can't read 
>> repository file 'repository.xml'
>> at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown Source)
>> at org.apache.ojb.broker.metadata.MetadataManager.<init>(Unknown Source)
>> at org.apache.ojb.broker.metadata.MetadataManager.getInstance(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.getDefaultKey(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
>> Source)
>> at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
>> at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
>> Source)
>> at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
>> Source)
>> at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown 
>> Source)
>> Caused by: org.apache.ojb.broker.metadata.MetadataException: 
>> Exception when reading metadata information, please check your 
>> repository.xml file
>> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
>> at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
>> at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
>> at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unknown 
>> Source)
>> at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(Unknown 
>> Source)
>> ... 16 more
>>
>> I have add some debug to be sure that the problem was not classLoader.
>> The problem arrive during *reader.parse(source) in readMetadataFromXML*
>>
>> I first try to get my different repository files good, no result, 
>> then I copy all repository from test.
>> {orion:rcs} cp 
>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository*.xml 
>> /home/Absynt/Compiere/mfg_scm/sbin/
>> {orion:rcs} cp 
>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository.xml 
>> /home/Absynt/Compiere/mfg_scm/sbin/
>> And the error did not desappear.
>>
>> Any idea welcome.
>>
>> Andre
>>
>> Thomas Dudziak wrote:
>>
>>> A Leg wrote:
>>>
>>>> Hi Thomas.
>>>>
>>>> In fact setClassLoader is not usable.
>>>> As ClassLoader is used inside the first call to OJB :
>>>> PersistenceBrokerFactory.defaultPersistenceBroker();
>>>> Which use it to load Configuration and Logger elements.
>>>> So when you have conflict between OJB ClassLoader and your 
>>>> application ClassLoader ....
>>>
>>>
>>>
>>>
>>> Hmm, why would that prevent you from using setClassLoader ?
>>>
>>> // this should be the very first call
>>> ClassHelper.setClassLoader(myClassLoader);
>>>
>>> // because of this call logging and OJB will get initialized (lazy 
>>> initialization)
>>> broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>>>
>>> Since ClassHelper does not use logging or OJB's properties, there 
>>> should be no interference!
>>>
>>> Tom
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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 Loading Configuration now repository PB

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

A Leg wrote:

> Hi Thomas
> 
> I upgrade my machine from CVS this morning.
> The class loader problem desappear without having to use setClassLoader.
> Thank's for the idea.
> 
> But I sill have the following error :
> 
> STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> Starting TaskConsumerDB
> Starting TaskConsumerDB try
> [BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
> illegal for key "OqlCollectionClass" (should be a class, using default 
> value class org.apache.ojb.odmg.collections.DListImpl)

hmm, I think this warning is still caused by a class loader problem, 
because the specified class exists in source.

To get more information about repository parsing you should enable 
'DEBUG' logging status for
org.apache.ojb.broker.metadata.RepositoryXmlHandler
org.apache.ojb.broker.metadata.ConnectionDescriptorXmlHandler
in the used logging framework.

regards,
Armin

> [org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] INFO: 
> Create PersistenceBroker instance pool, pool configuration was 
> {whenExhaustedAction=0, maxIdle=-1, maxActive=100, maxWait=2000, 
> removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false, 
> minEvictableIdleTimeMillis=1000000, testOnReturn=false, 
> logAbandoned=false, removeAbandonedTimeout=300, 
> timeBetweenEvictionRunsMillis=-1, testOnBorrow=false}
> readDescriptorRepository filename repository.xml
> readDescriptorRepository else useSerializedRepository repository.xml
> readDescriptorRepository  buildRepository repository.xml
> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB 
> Descriptor Repository: 
> file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Building 
> repository from :file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
> readMetadataFromXML SAXParserFactory.newInstance().newSAXParser()
> readMetadataFromXML p.getClass().getName()
> readMetadataFromXML p.getXMLReader()
> readMetadataFromXML reader.getClass().getName().indexOf
> readMetadataFromXML reader.setFeature
> readMetadataFromXML if DescriptorRepository.class.equals(target)
> readMetadataFromXML DescriptorRepository.class.equals(target)
> readMetadataFromXML DescriptorRepository
> readMetadataFromXML RepositoryXmlHandler
> readMetadataFromXML reader.setContentHandler
> readMetadataFromXML reader.parse(source)
> org.apache.ojb.broker.metadata.MetadataException: Can't read repository 
> file 'repository.xml'
>        at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown 
> Source)
>        at org.apache.ojb.broker.metadata.MetadataManager.<init>(Unknown 
> Source)
>        at 
> org.apache.ojb.broker.metadata.MetadataManager.getInstance(Unknown Source)
>        at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.getDefaultKey(Unknown 
> Source)
>        at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
> Source)
>        at 
> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
> Source)
>        at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown 
> Source)
>        at 
> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
> Source)
>        at 
> org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
> Source)
>        at 
> org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
> Caused by: org.apache.ojb.broker.metadata.MetadataException: Exception 
> when reading metadata information, please check your repository.xml file
>        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
>        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
>        at 
> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
>        at 
> org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(Unknown 
> Source)
>        at 
> org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unknown 
> Source)
>        at 
> org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(Unknown 
> Source)
>        ... 16 more
> 
> I have add some debug to be sure that the problem was not classLoader.
> The problem arrive during *reader.parse(source) in readMetadataFromXML*
> 
> I first try to get my different repository files good, no result, then I 
> copy all repository from test.
> {orion:rcs} cp 
> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository*.xml 
> /home/Absynt/Compiere/mfg_scm/sbin/
> {orion:rcs} cp 
> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository.xml 
> /home/Absynt/Compiere/mfg_scm/sbin/
> And the error did not desappear.
> 
> Any idea welcome.
> 
> Andre
> 
> Thomas Dudziak wrote:
> 
>> A Leg wrote:
>>
>>> Hi Thomas.
>>>
>>> In fact setClassLoader is not usable.
>>> As ClassLoader is used inside the first call to OJB :
>>> PersistenceBrokerFactory.defaultPersistenceBroker();
>>> Which use it to load Configuration and Logger elements.
>>> So when you have conflict between OJB ClassLoader and your 
>>> application ClassLoader ....
>>
>>
>>
>> Hmm, why would that prevent you from using setClassLoader ?
>>
>>    // this should be the very first call
>>    ClassHelper.setClassLoader(myClassLoader);
>>
>>    // because of this call logging and OJB will get initialized (lazy 
>> initialization)
>>    broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>>
>> Since ClassHelper does not use logging or OJB's properties, there 
>> should be no interference!
>>
>> Tom
>>
>>
>> ---------------------------------------------------------------------
>> 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 Loading Configuration now repository PB

Posted by Thomas Dudziak <to...@first.fhg.de>.
A Leg wrote:

> Hi Thomas.
>
> Thank for your help.
>
> In fact ojb find repositoty. it is tested before.
> I can verify, because if I suppress some end of one tag inside for 
> example repository_database, it shut about.
> This seems to mean that parse arrive to read the repository files 
> content.
>
> I got tutorial1 running with elements of CVS and I copy all 
> repositoryxxx and OJBxxx files from tutorial1 to my appli.
>
> reader.parse(source)
> works in tutorial1
> and fail in my project even with the same source ...

Then please try to retrieve the complete stacktrace. If you use an IDE 
(e.g. eclipse or idea), you can define an exception breakpoint for the 
MetaDataException, and then the IDE allows you to copy the stacktrace.

Tom


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


Re: Pb Loading Configuration now repository PB

Posted by A Leg <ha...@yahoo.com>.
Hi Thomas.

Thank for your help.

In fact ojb find repositoty. it is tested before.
I can verify, because if I suppress some end of one tag inside for 
example repository_database, it shut about.
This seems to mean that parse arrive to read the repository files content.

I got tutorial1 running with elements of CVS and I copy all 
repositoryxxx and OJBxxx files from tutorial1 to my appli.

reader.parse(source)
works in tutorial1
and fail in my project even with the same source ...

Any idea welcome.

Andre



Thomas Dudziak wrote:

> A Leg wrote:
>
>> Hi Thomas
>>
>> I upgrade my machine from CVS this morning.
>> The class loader problem desappear without having to use setClassLoader.
>> Thank's for the idea.
>>
>> But I sill have the following error :
>>
>> STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>> Starting TaskConsumerDB
>> Starting TaskConsumerDB try
>> [BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
>> illegal for key "OqlCollectionClass" (should be a class, using 
>> default value class org.apache.ojb.odmg.collections.DListImpl)
>> [org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] 
>> INFO: Create PersistenceBroker instance pool, pool configuration was 
>> {whenExhaustedAction=0, maxIdle=-1, maxActive=100, maxWait=2000, 
>> removeAbandoned=false, numTestsPerEvictionRun=10, 
>> testWhileIdle=false, minEvictableIdleTimeMillis=1000000, 
>> testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, 
>> timeBetweenEvictionRunsMillis=-1, testOnBorrow=false}
>> readDescriptorRepository filename repository.xml
>> readDescriptorRepository else useSerializedRepository repository.xml
>> readDescriptorRepository  buildRepository repository.xml
>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB 
>> Descriptor Repository: 
>> file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Building 
>> repository from :file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
>> readMetadataFromXML SAXParserFactory.newInstance().newSAXParser()
>> readMetadataFromXML p.getClass().getName()
>> readMetadataFromXML p.getXMLReader()
>> readMetadataFromXML reader.getClass().getName().indexOf
>> readMetadataFromXML reader.setFeature
>> readMetadataFromXML if DescriptorRepository.class.equals(target)
>> readMetadataFromXML DescriptorRepository.class.equals(target)
>> readMetadataFromXML DescriptorRepository
>> readMetadataFromXML RepositoryXmlHandler
>> readMetadataFromXML reader.setContentHandler
>> readMetadataFromXML reader.parse(source)
>> org.apache.ojb.broker.metadata.MetadataException: Can't read 
>> repository file 'repository.xml'
>>        at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown 
>> Source)
>>        at 
>> org.apache.ojb.broker.metadata.MetadataManager.<init>(Unknown Source)
>>        at 
>> org.apache.ojb.broker.metadata.MetadataManager.getInstance(Unknown 
>> Source)
>>        at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.getDefaultKey(Unknown 
>> Source)
>>        at 
>> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
>> Source)
>>        at 
>> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
>> Source)
>>        at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown 
>> Source)
>>        at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
>> Source)
>>        at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
>> Source)
>>        at 
>> org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
>> Caused by: org.apache.ojb.broker.metadata.MetadataException: 
>> Exception when reading metadata information, please check your 
>> repository.xml file
>>        at 
>> org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
>>        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
>>        at 
>> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
>>        at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(Unknown 
>> Source)
>>        at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unknown 
>> Source)
>>        at 
>> org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(Unknown 
>> Source)
>>        ... 16 more
>>
>> I have add some debug to be sure that the problem was not classLoader.
>> The problem arrive during *reader.parse(source) in readMetadataFromXML*
>>
>> I first try to get my different repository files good, no result, 
>> then I copy all repository from test.
>> {orion:rcs} cp 
>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository*.xml 
>> /home/Absynt/Compiere/mfg_scm/sbin/
>> {orion:rcs} cp 
>> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository.xml 
>> /home/Absynt/Compiere/mfg_scm/sbin/
>> And the error did not desappear.
>
>
> Mhm, the most interesting part of the stacktrace is probably in the 
> "... 16 more", e.g. a FileNotFoundException.
> This error is usually issued because OJB cannot find the 
> repository.xml. Another reason could be that the repository.xml file 
> does not match the DTD (for instance due to different versions) but 
> I'm not sure whether OJB does check the XML against the DTD.
>
> Tom
>
>
> ---------------------------------------------------------------------
> 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 Loading Configuration now repository PB

Posted by Thomas Dudziak <to...@first.fhg.de>.
A Leg wrote:

> Hi Thomas
>
> I upgrade my machine from CVS this morning.
> The class loader problem desappear without having to use setClassLoader.
> Thank's for the idea.
>
> But I sill have the following error :
>
> STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> Starting TaskConsumerDB
> Starting TaskConsumerDB try
> [BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
> illegal for key "OqlCollectionClass" (should be a class, using default 
> value class org.apache.ojb.odmg.collections.DListImpl)
> [org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] INFO: 
> Create PersistenceBroker instance pool, pool configuration was 
> {whenExhaustedAction=0, maxIdle=-1, maxActive=100, maxWait=2000, 
> removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false, 
> minEvictableIdleTimeMillis=1000000, testOnReturn=false, 
> logAbandoned=false, removeAbandonedTimeout=300, 
> timeBetweenEvictionRunsMillis=-1, testOnBorrow=false}
> readDescriptorRepository filename repository.xml
> readDescriptorRepository else useSerializedRepository repository.xml
> readDescriptorRepository  buildRepository repository.xml
> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB 
> Descriptor Repository: 
> file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
> [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Building 
> repository from :file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
> readMetadataFromXML SAXParserFactory.newInstance().newSAXParser()
> readMetadataFromXML p.getClass().getName()
> readMetadataFromXML p.getXMLReader()
> readMetadataFromXML reader.getClass().getName().indexOf
> readMetadataFromXML reader.setFeature
> readMetadataFromXML if DescriptorRepository.class.equals(target)
> readMetadataFromXML DescriptorRepository.class.equals(target)
> readMetadataFromXML DescriptorRepository
> readMetadataFromXML RepositoryXmlHandler
> readMetadataFromXML reader.setContentHandler
> readMetadataFromXML reader.parse(source)
> org.apache.ojb.broker.metadata.MetadataException: Can't read 
> repository file 'repository.xml'
>        at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown 
> Source)
>        at 
> org.apache.ojb.broker.metadata.MetadataManager.<init>(Unknown Source)
>        at 
> org.apache.ojb.broker.metadata.MetadataManager.getInstance(Unknown 
> Source)
>        at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.getDefaultKey(Unknown 
> Source)
>        at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
> Source)
>        at 
> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
> Source)
>        at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown 
> Source)
>        at 
> org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
> Source)
>        at 
> org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
> Source)
>        at 
> org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
> Caused by: org.apache.ojb.broker.metadata.MetadataException: Exception 
> when reading metadata information, please check your repository.xml file
>        at 
> org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
>        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
>        at 
> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
>        at 
> org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(Unknown 
> Source)
>        at 
> org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unknown 
> Source)
>        at 
> org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(Unknown 
> Source)
>        ... 16 more
>
> I have add some debug to be sure that the problem was not classLoader.
> The problem arrive during *reader.parse(source) in readMetadataFromXML*
>
> I first try to get my different repository files good, no result, then 
> I copy all repository from test.
> {orion:rcs} cp 
> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository*.xml 
> /home/Absynt/Compiere/mfg_scm/sbin/
> {orion:rcs} cp 
> /home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository.xml 
> /home/Absynt/Compiere/mfg_scm/sbin/
> And the error did not desappear.

Mhm, the most interesting part of the stacktrace is probably in the "... 
16 more", e.g. a FileNotFoundException.
This error is usually issued because OJB cannot find the repository.xml. 
Another reason could be that the repository.xml file does not match the 
DTD (for instance due to different versions) but I'm not sure whether 
OJB does check the XML against the DTD.

Tom


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


Re: Pb Loading Configuration now repository PB

Posted by A Leg <ha...@yahoo.com>.
Hi Thomas

I upgrade my machine from CVS this morning.
The class loader problem desappear without having to use setClassLoader.
Thank's for the idea.

But I sill have the following error :

STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Starting TaskConsumerDB
Starting TaskConsumerDB try
[BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
illegal for key "OqlCollectionClass" (should be a class, using default 
value class org.apache.ojb.odmg.collections.DListImpl)
[org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] INFO: 
Create PersistenceBroker instance pool, pool configuration was 
{whenExhaustedAction=0, maxIdle=-1, maxActive=100, maxWait=2000, 
removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false, 
minEvictableIdleTimeMillis=1000000, testOnReturn=false, 
logAbandoned=false, removeAbandonedTimeout=300, 
timeBetweenEvictionRunsMillis=-1, testOnBorrow=false}
readDescriptorRepository filename repository.xml
readDescriptorRepository else useSerializedRepository repository.xml
readDescriptorRepository  buildRepository repository.xml
[org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB 
Descriptor Repository: 
file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
[org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: Building 
repository from :file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml
readMetadataFromXML SAXParserFactory.newInstance().newSAXParser()
readMetadataFromXML p.getClass().getName()
readMetadataFromXML p.getXMLReader()
readMetadataFromXML reader.getClass().getName().indexOf
readMetadataFromXML reader.setFeature
readMetadataFromXML if DescriptorRepository.class.equals(target)
readMetadataFromXML DescriptorRepository.class.equals(target)
readMetadataFromXML DescriptorRepository
readMetadataFromXML RepositoryXmlHandler
readMetadataFromXML reader.setContentHandler
readMetadataFromXML reader.parse(source)
org.apache.ojb.broker.metadata.MetadataException: Can't read repository 
file 'repository.xml'
        at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown 
Source)
        at org.apache.ojb.broker.metadata.MetadataManager.<init>(Unknown 
Source)
        at 
org.apache.ojb.broker.metadata.MetadataManager.getInstance(Unknown Source)
        at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.getDefaultKey(Unknown 
Source)
        at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker(Unknown 
Source)
        at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
Source)
        at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown 
Source)
        at 
org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
Source)
        at 
org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown Source)
        at 
org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
Caused by: org.apache.ojb.broker.metadata.MetadataException: Exception 
when reading metadata information, please check your repository.xml file
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at 
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at 
org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(Unknown 
Source)
        at 
org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unknown 
Source)
        at 
org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(Unknown 
Source)
        ... 16 more

I have add some debug to be sure that the problem was not classLoader.
The problem arrive during *reader.parse(source) in readMetadataFromXML*

I first try to get my different repository files good, no result, then I 
copy all repository from test.
{orion:rcs} cp 
/home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository*.xml 
/home/Absynt/Compiere/mfg_scm/sbin/
{orion:rcs} cp 
/home/rcs/Master/extern/java/db-ojb/target/srctest/org/apache/ojb/repository.xml 
/home/Absynt/Compiere/mfg_scm/sbin/
And the error did not desappear.

Any idea welcome.

Andre

Thomas Dudziak wrote:

> A Leg wrote:
>
>> Hi Thomas.
>>
>> In fact setClassLoader is not usable.
>> As ClassLoader is used inside the first call to OJB :
>> PersistenceBrokerFactory.defaultPersistenceBroker();
>> Which use it to load Configuration and Logger elements.
>> So when you have conflict between OJB ClassLoader and your 
>> application ClassLoader ....
>
>
> Hmm, why would that prevent you from using setClassLoader ?
>
>    // this should be the very first call
>    ClassHelper.setClassLoader(myClassLoader);
>
>    // because of this call logging and OJB will get initialized (lazy 
> initialization)
>    broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>
> Since ClassHelper does not use logging or OJB's properties, there 
> should be no interference!
>
> Tom
>
>
> ---------------------------------------------------------------------
> 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 Loading Configuration need java Hackers help.

Posted by A Leg <ha...@yahoo.com>.
Hi Thomas

You are right, it is much better.
I will try and give you result tomorrow, now it is late in Cyprus.

Thank you for your help.

Andre
Thomas Dudziak wrote:

> A Leg wrote:
>
>> Hi Thomas.
>>
>> In fact setClassLoader is not usable.
>> As ClassLoader is used inside the first call to OJB :
>> PersistenceBrokerFactory.defaultPersistenceBroker();
>> Which use it to load Configuration and Logger elements.
>> So when you have conflict between OJB ClassLoader and your 
>> application ClassLoader ....
>
>
> Hmm, why would that prevent you from using setClassLoader ?
>
>    // this should be the very first call
>    ClassHelper.setClassLoader(myClassLoader);
>
>    // because of this call logging and OJB will get initialized (lazy 
> initialization)
>    broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>
> Since ClassHelper does not use logging or OJB's properties, there 
> should be no interference!
>
> Tom
>
>
> ---------------------------------------------------------------------
> 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 Loading Configuration need java Hackers help.

Posted by Thomas Dudziak <to...@first.fhg.de>.
A Leg wrote:

> Hi Thomas.
>
> In fact setClassLoader is not usable.
> As ClassLoader is used inside the first call to OJB :
> PersistenceBrokerFactory.defaultPersistenceBroker();
> Which use it to load Configuration and Logger elements.
> So when you have conflict between OJB ClassLoader and your application 
> ClassLoader ....

Hmm, why would that prevent you from using setClassLoader ?

    // this should be the very first call
    ClassHelper.setClassLoader(myClassLoader);

    // because of this call logging and OJB will get initialized (lazy 
initialization)
    broker = PersistenceBrokerFactory.defaultPersistenceBroker();

Since ClassHelper does not use logging or OJB's properties, there should 
be no interference!

Tom


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


Re: Pb Loading Configuration need java Hackers help.

Posted by A Leg <ha...@yahoo.com>.
Hi Thomas.

In fact setClassLoader is not usable.
As ClassLoader is used inside the first call to OJB :
PersistenceBrokerFactory.defaultPersistenceBroker();
Which use it to load Configuration and Logger elements.
So when you have conflict between OJB ClassLoader and your application 
ClassLoader ....

If anybody has an idea.

Mais be it you had another defaultPersistenceBroker method with 
ClassLoader as parameter :
This would give
PersistenceBrokerFactory.defaultPersistenceBroker(myClassLoader);

I will try to implement it, or tell me if you can do it.
Any idea welcome.

Thank's for help

Andre

Thomas Dudziak wrote:

> A Leg wrote:
>
>> Hi Thomas
>>
>> *_loggerClass = Log4jLoggerImpl.class;*
>> crash when LogingConfiguration , it could seem surprising but it is 
>> sure.
>>
>> The problem arrive
>> when PersistenceBrokerFactoryBaseImpl make LogFactory.getLogger
>> getLogger make first a "new LogingConfiguration()"
>> Which call the load() method in it's constructor.
>>
>> The crash arrive exactly *in LogingConfiguration.java, line 161*.
>>
>> This is probably linked to the fact that dbManager is a JINI service.
>>
>> I have added :
>> System.out.println("yep, so use log4j");
>> _loggerClass = Log4jLoggerImpl.class;
>> _loggerConfigFile = "log4j.properties";
>> System.out.println("After yep, so use log4j");
>>
>> and you can see below that it crash just after yep, so use log4j
>>
>> The debug build give no information here, because debug use logger 
>> which does not load.
>> I have tried first to get debug working, but *this stack come from 
>> release compile with jar-debug.*
>>
>> That is why I have been obliged to add debug messages.
>>
>> If you look at the stack below :
>>
>> Load of *ojbLoggingPropFile fail first* :
>> Load of *ojbPropFile fail also*.
>>
>> Do we need to adapt our application to support new logging elements ?
>> Any idea welcome.
>
>
> Hmm, I have zero knowledge of Jini, but there may be two things that 
> you can try:
>
> * Specify the log4j logger directly in the OJB-logging.properties 
> because the exception occurs in a fallback check that is only called 
> if there is no logger explicitly configured. So put these lines in 
> your OJB-logging.properties:
>
> LoggerClass=org.apache.ojb.broker.util.logging.Log4jLoggerImpl
> LoggerConfigFile=log4j.properties
>
> * This might be a classloader issue, so you could change the 
> classloader that OJB uses (when it is not accessing classes directly, 
> in this case it uses the thread's context classloader) via the 
> org.apache.ojb.broker.util.ClassHelper#setClassLoader method. Here you 
> would use the Jini classloader. Please note that you have to do this 
> before using *any* OJB class, and you'll need a recent OJB version 
> (rc7 or CVS).
>
> Tom
>
>
> ---------------------------------------------------------------------
> 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 Loading Configuration need java Hackers help.

Posted by Thomas Dudziak <to...@first.fhg.de>.
A Leg wrote:

> Hi Thomas
>
> *_loggerClass = Log4jLoggerImpl.class;*
> crash when LogingConfiguration , it could seem surprising but it is sure.
>
> The problem arrive
> when PersistenceBrokerFactoryBaseImpl make LogFactory.getLogger
> getLogger make first a "new LogingConfiguration()"
> Which call the load() method in it's constructor.
>
> The crash arrive exactly *in LogingConfiguration.java, line 161*.
>
> This is probably linked to the fact that dbManager is a JINI service.
>
> I have added :
> System.out.println("yep, so use log4j");
> _loggerClass = Log4jLoggerImpl.class;
> _loggerConfigFile = "log4j.properties";
> System.out.println("After yep, so use log4j");
>
> and you can see below that it crash just after yep, so use log4j
>
> The debug build give no information here, because debug use logger 
> which does not load.
> I have tried first to get debug working, but *this stack come from 
> release compile with jar-debug.*
>
> That is why I have been obliged to add debug messages.
>
> If you look at the stack below :
>
> Load of *ojbLoggingPropFile fail first* :
> Load of *ojbPropFile fail also*.
>
> Do we need to adapt our application to support new logging elements ?
> Any idea welcome.

Hmm, I have zero knowledge of Jini, but there may be two things that you 
can try:

* Specify the log4j logger directly in the OJB-logging.properties 
because the exception occurs in a fallback check that is only called if 
there is no logger explicitly configured. So put these lines in your 
OJB-logging.properties:

LoggerClass=org.apache.ojb.broker.util.logging.Log4jLoggerImpl
LoggerConfigFile=log4j.properties

* This might be a classloader issue, so you could change the classloader 
that OJB uses (when it is not accessing classes directly, in this case 
it uses the thread's context classloader) via the 
org.apache.ojb.broker.util.ClassHelper#setClassLoader method. Here you 
would use the Jini classloader. Please note that you have to do this 
before using *any* OJB class, and you'll need a recent OJB version (rc7 
or CVS).

Tom


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


Pb Loading Configuration need java Hackers help.

Posted by A Leg <ha...@yahoo.com>.
Hi Thomas

*_loggerClass = Log4jLoggerImpl.class;*
crash when LogingConfiguration , it could seem surprising but it is sure.

The problem arrive
when PersistenceBrokerFactoryBaseImpl make LogFactory.getLogger
getLogger make first a "new LogingConfiguration()"
Which call the load() method in it's constructor.

The crash arrive exactly *in LogingConfiguration.java, line 161*.

This is probably linked to the fact that dbManager is a JINI service.

I have added :
System.out.println("yep, so use log4j");
_loggerClass = Log4jLoggerImpl.class;
_loggerConfigFile = "log4j.properties";
System.out.println("After yep, so use log4j");

and you can see below that it crash just after yep, so use log4j

The debug build give no information here, because debug use logger which 
does not load.
I have tried first to get debug working, but *this stack come from 
release compile with jar-debug.*

That is why I have been obliged to add debug messages.

If you look at the stack below :

Load of *ojbLoggingPropFile fail first* :
Load of *ojbPropFile fail also*.

Do we need to adapt our application to support new logging elements ?
Any idea welcome.

Thanks for your help.

Andre


I have controlled, Log4jLoggerImpl.class is present in my JINI service jar.

STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
illegal for key "OqlCollectionClass" (should be a class, using default 
value class org.apache.ojb.odmg.collections.DListImpl)
BEGIN getLogger org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl
New LoggingConfiguration
LoggingConfiguration load oggerFactory.getBootLogger
LoggingConfiguration load ClassHelper.getClassLoader
LoggingConfiguration load loggerClassName == null trying to load the 
OJB-logging.properties
LoggingConfiguration load ojbLoggingPropFile = OJB-logging.properties
LoggingConfiguration contextLoader
LoggingConfiguration 
contextLoader.getResourceAsStream(OJB-logging.properties)
Found logging properties file OJB-logging.properties
LoggingConfiguration load ojbLoggingPropFile exception 
java.lang.NullPointerException
LoggingConfiguration load loggerClassName == null deprecated: load the 
OJB.properties file
LoggingConfiguration load ojbPropFile = OJB.properties
LoggingConfiguration contextLoader.getResourceAsStream(OJB.properties)
Found OJB properties file OJB.properties
LoggingConfiguration load ojbPropFile exception 
java.lang.NullPointerException
still no logger configured - lets check whether commons-logging is 
configured
but perhaps there is a log4j.properties file ?
yep, so use log4j
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source)
at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source)
at 
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown 
Source)
at 
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unknown 
Source)
at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
at 
org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
at com.sun.rio.jsb.ServiceBeanAdapter.doStart(ServiceBeanAdapter.java:277)
at 
com.sun.rio.jsb.ServiceBeanAdapter.access$000(ServiceBeanAdapter.java:101)
at com.sun.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:237)
at com.sun.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:248)
at com.sun.rio.boot.ServiceBeanLoader.load(ServiceBeanLoader.java:171)
at com.sun.rio.cybernode.JSBDelegate$2.run(JSBDelegate.java:342)
Caused by: java.lang.NullPointerException
at 
org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown 
Source)
at org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.<clinit>(Unknown 
Source)
... 19 more
Thomas Dudziak wrote:

> A Leg wrote:
>
>> Hi Thomas
>>
>> In fact I have been obliged to add System.out element in code to be 
>> able to get a trace.
>> Now I have a full trace.
>> But I still don't know what to do to solve my problem.
>
>
> Please use a debug build of OJB, otherwise its hard to tell where the 
> NullPointerException occurs. You can simply run the OJB build.xml file 
> with the target jar-debug, then copy the created OJB jar from the dist 
> folder over the one in your project. BTW, which version of OJB do you 
> use ?
> Also, if you are able to set system properties for your project (in a 
> normal app you would use the -D commandline switch of the java 
> executable), then you can change the log level of the boot loggerto 
> INFO or DEBUG to see more log messages via the OJB.bootLogLevel system 
> property.
>
> Tom
>
>
> ---------------------------------------------------------------------
> 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: Problems getting ojb-blank Now Pb Loading Configuration

Posted by Thomas Dudziak <to...@first.fhg.de>.
A Leg wrote:

> Hi Thomas
>
> In fact I have been obliged to add System.out element in code to be 
> able to get a trace.
> Now I have a full trace.
> But I still don't know what to do to solve my problem.

Please use a debug build of OJB, otherwise its hard to tell where the 
NullPointerException occurs. You can simply run the OJB build.xml file 
with the target jar-debug, then copy the created OJB jar from the dist 
folder over the one in your project. BTW, which version of OJB do you use ?
Also, if you are able to set system properties for your project (in a 
normal app you would use the -D commandline switch of the java 
executable), then you can change the log level of the boot loggerto INFO 
or DEBUG to see more log messages via the OJB.bootLogLevel system property.

Tom


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


Re: Problems getting ojb-blank Now Pb Loading Configuration

Posted by A Leg <ha...@yahoo.com>.
Hi Thomas

In fact I have been obliged to add System.out element in code to be able 
to get a trace.
Now I have a full trace.
But I still don't know what to do to solve my problem.

For your info dbManager is a JINI service,

Thank's for your help :


Andre

STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is 
illegal for key "OqlCollectionClass" (should be a class, using default 
value class org.apache.ojb.odmg.collections.DListImpl)
BEGIN getLogger org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl
New LoggingConfiguration
LoggingConfiguration load oggerFactory.getBootLogger
LoggingConfiguration load ClassHelper.getClassLoader
LoggingConfiguration load the OJB-logging.properties
LoggingConfiguration load ojbLoggingPropFile = OJB-logging.properties
LoggingConfiguration contextLoader
LoggingConfiguration 
contextLoader.getResourceAsStream(OJB-logging.properties)
Found logging properties file OJB-logging.properties
LoggingConfiguration load ojbLoggingPropFile exception 
java.lang.NullPointerException
LoggingConfiguration load the OJB.properties file
LoggingConfiguration load ojbPropFile = OJB.properties
LoggingConfiguration contextLoader.getResourceAsStream(OJB.properties)
Found OJB properties file OJB.properties
LoggingConfiguration load ojbPropFile exception 
java.lang.NullPointerException
still no logger configured - lets check whether commons-logging is 
configured
but perhaps there is a log4j.properties file ?
yep, so use log4j
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source)
at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source)
at 
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown 
Source)
at 
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unknown 
Source)
at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
at 
org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown 
Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
Caused by: java.lang.NullPointerException
at 
org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown 
Source)
at org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.<clinit>(Unknown 
Source)
... 19 more



Thomas Dudziak wrote:

> Hale India wrote:
>
>> Hi Thomas
>>
>> I have built after changing jar to jar-debug
>> Then I have rebuilt my project using the new jars
>> but when I run my appl I don't get more info.
>
>
> You should get more info because the stacktrace now contains line 
> numbers which help locating the place in OJB where the error happens. 
> Please post this *complete* stacktrace.
>
> Tom
>
> ---------------------------------------------------------------------
> 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: Problems getting ojb-blank

Posted by A Leg <ha...@yahoo.com>.
Thomas

Something go wrong with the debug, (I get no more info) I try to find 
out and I send the stack.
I will need time.

Thank you for your help.

Andre

Thomas Dudziak wrote:

> Hale India wrote:
>
>> Hi Thomas
>>
>> I have built after changing jar to jar-debug
>> Then I have rebuilt my project using the new jars
>> but when I run my appl I don't get more info.
>
>
> You should get more info because the stacktrace now contains line 
> numbers which help locating the place in OJB where the error happens. 
> Please post this *complete* stacktrace.
>
> Tom
>
> ---------------------------------------------------------------------
> 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: Problems getting ojb-blank

Posted by Thomas Dudziak <to...@first.fhg.de>.
Hale India wrote:
> Hi Thomas
> 
> I have built after changing jar to jar-debug
> Then I have rebuilt my project using the new jars
> but when I run my appl I don't get more info.

You should get more info because the stacktrace now contains line 
numbers which help locating the place in OJB where the error happens. 
Please post this *complete* stacktrace.

Tom

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


Re: Problems getting ojb-blank

Posted by Hale India <ha...@yahoo.com>.
Hi Thomas

I have built after changing jar to jar-debug
Then I have rebuilt my project using the new jars
but when I run my appl I don't get more info.

Can you help me?

Andre


--- Thomas Dudziak <to...@first.fhg.de> wrote:
> Hale India wrote:
> 
> >Hi Thomas
> >
> >Yes I updae the OJB.properties.
> >
> >I forget to give you the most important part of
> error
> >message :
> >Caused by: java.lang.NullPointerException
> >        at
>
>org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown
> >Source)
> >        at
>
>org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown
> >Source)
> >        at
>
>org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.<clinit>(Unknown
> >Source)
> >        ... 19 more
> >
> >Maybe it can hep.
> >
> >  
> >
> Could you change OJB's build.xml file so that the
> 'ojb-blank' target 
> depends on 'jar-debug' (not on 'jar'), and then
> rerun your test and post 
> the complete stacktrace ?
> 
> Tom
> 
> 
>
---------------------------------------------------------------------
> 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: Problems getting ojb-blank

Posted by Thomas Dudziak <to...@first.fhg.de>.
Hale India wrote:

>Hi Thomas
>
>Yes I updae the OJB.properties.
>
>I forget to give you the most important part of error
>message :
>Caused by: java.lang.NullPointerException
>        at
>org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown
>Source)
>        at
>org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown
>Source)
>        at
>org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.<clinit>(Unknown
>Source)
>        ... 19 more
>
>Maybe it can hep.
>
>  
>
Could you change OJB's build.xml file so that the 'ojb-blank' target 
depends on 'jar-debug' (not on 'jar'), and then rerun your test and post 
the complete stacktrace ?

Tom


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


Re: Problems getting ojb-blank

Posted by Hale India <ha...@yahoo.com>.
Hi Thomas

Yes I updae the OJB.properties.

I forget to give you the most important part of error
message :
Caused by: java.lang.NullPointerException
        at
org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown
Source)
        at
org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.<clinit>(Unknown
Source)
        ... 19 more

Maybe it can hep.

Thank's for your help

Andre
--- Thomas Dudziak <to...@first.fhg.de> wrote:
> A Leg wrote:
> 
> > Hi Thomas
> > Finally I follow your second option, I enter
> database elements by 
> > hand, and I got the ojb-blank.jar
> >
> > I recompiled my project, and adapt all
> configuration files.
> >
> > When I run m project I get the following error :
> >
> > WARN: Value
> "org.apache.ojb.odmg.collections.DListImpl_2" is
> illegal 
> > for key "OqlCollectionClass" (should be a class,
> using default value 
> > class org.apache.ojb.odmg.collections.DListImpl)
> > java.lang.ExceptionInInitializerError
> > at java.lang.Class.forName0(Native Method)
> > at java.lang.Class.forName(Class.java:219)
> > at
>
org.apache.ojb.broker.util.ClassHelper.getClass(Unknown
> Source)
> > at
>
org.apache.ojb.broker.util.ClassHelper.getClass(Unknown
> Source)
> > at 
> >
>
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown
> 
> > Source)
> > at 
> >
>
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown
> 
> > Source)
> > at 
> >
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
> 
> > Source)
> > at 
> >
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unknown
> 
> > Source)
> > at 
> >
>
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown
> 
> > Source)
> >
> > My project was good working with rc4.
> > May be I should first run some tests on ojb, to
> validate my install.
> 
> Did you update your OJB.properties file, or is the
> one from rc4 ? Also, 
> you can specify the mentioned default value for the
> 'OqlCollectionClass' 
> in the OJB.properties file to remove this warning.
> 
> Tom
> 
> 
>
---------------------------------------------------------------------
> 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: Problems getting ojb-blank

Posted by Thomas Dudziak <to...@first.fhg.de>.
A Leg wrote:

> Hi Thomas
> Finally I follow your second option, I enter database elements by 
> hand, and I got the ojb-blank.jar
>
> I recompiled my project, and adapt all configuration files.
>
> When I run m project I get the following error :
>
> WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is illegal 
> for key "OqlCollectionClass" (should be a class, using default value 
> class org.apache.ojb.odmg.collections.DListImpl)
> java.lang.ExceptionInInitializerError
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:219)
> at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source)
> at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source)
> at 
> org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown 
> Source)
> at 
> org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown 
> Source)
> at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown 
> Source)
> at 
> org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unknown 
> Source)
> at 
> org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
> Source)
>
> My project was good working with rc4.
> May be I should first run some tests on ojb, to validate my install.

Did you update your OJB.properties file, or is the one from rc4 ? Also, 
you can specify the mentioned default value for the 'OqlCollectionClass' 
in the OJB.properties file to remove this warning.

Tom


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


Re: Problems getting ojb-blank

Posted by A Leg <ha...@yahoo.com>.
Hi Thomas
Finally I follow your second option, I enter database elements by hand, 
and I got the ojb-blank.jar

I recompiled my project, and adapt all configuration files.

When I run m project I get the following error :

WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is illegal for 
key "OqlCollectionClass" (should be a class, using default value class 
org.apache.ojb.odmg.collections.DListImpl)
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source)
at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source)
at 
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown 
Source)
at 
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unknown 
Source)
at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown 
Source)

My project was good working with rc4.
May be I should first run some tests on ojb, to validate my install.

Any advice will help me.

Andre


Thomas Dudziak wrote:

> Hale India wrote:
>
>> Hi
>>
>> I still try to get running my project using ojb
>> 1.0rc6.
>>
>> When I run :
>> ant ojb-blank
>>
>> I get :
>>
>> [torque-sql] (transform.DTDResolver 128
>> ) Resolver: used database.dtd from
>> org.apache.torque.engine.database.transform package
>>
>> sql-template:
>>
>> create-db-check:
>>
>> create-db:
>>
>> datasql:
>> [echo]
>> +-----------------------------------------------+
>> [echo] | |
>> [echo] | Generating SQL from data XML ! |
>> [echo] | Woo hoo! |
>> [echo] | |
>> [echo]
>> +-----------------------------------------------+
>> [torque-data-sql] Using contextProperties file:
>> /home/rcs/Master/extern/java/db-ojb/build.properties
>> [torque-data-sql] Using classpath
>> [torque-data-sql] Generating to file
>> /home/rcs/Master/extern/java/db-ojb/target/test/sql/ojbtest-data.sql
>> [torque-data-sql] Parsing file: 'ojbtest-schema.xml'
>> [torque-data-sql] (transform.DTDResolver 128 ) Resolver: used 
>> database.dtd from
>> org.apache.torque.engine.database.transform package
>> [torque-data-sql] Resolver: used
>> /home/rcs/Master/extern/java/db-ojb/target/test/ojbtest-data.dtd
>>
>> insert-sql:
>> [torque-sql-exec] Our new url ->
>> jdbc:postgresql://localhost/OJB
>>
>> BUILD FAILED
>> /home/rcs/Master/extern/java/db-ojb/build.xml:386:
>> Following error occured while executing this line
>> /home/rcs/Master/extern/java/db-ojb/build-torque.xml:339:
>> org.postgresql.util.PSQLException: Backend start-up
>> failed: org.postgresql.util.PSQLException: FATAL:
>> database "OJB" does not exist
>>
>>
> Well, you have two options:
>
> * If you want to roll database creation (e.g. CREATE DATABASE) and 
> initialization (CREATE TABLE) on your own, you can simply remove the 
> dependency of the 'ojb-blank' target on the 'prepare-testdb' target in 
> the build.xml buildfile.
>
> * If you want to use Torque for database creation and initialization 
> (which makes things easier if you plan to use your project with 
> different databases), then you'll have to resolve the above error. I'm 
> no PostgreSQL expert, but it seems that Torque is not able to create 
> the database, but you can do this manually in PostgreSQL (the database 
> name is OJB).
>
> Tom
>
>
> ---------------------------------------------------------------------
> 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: Manual Link and Unlink question

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

Bradford Pielech wrote:

> Hello:
> 
>     This is a follow on to my question from last week where I have a 
> graph structure where each graph node has a list of parents and 
> children.  I was trying to use the auto-update=object and 
> auto-delete=object features, but it was not working well in my 
> particular scenario (meaning there were not any bugs in OJB) so I am 
> investigating switching to auto-update and auto-delete = none and 
> linking / unlinking on my own.
> 
>     So here is my question: if I have object A and object B already 
> stored in the database, how can I create or delete an M to N link 
> between them in their indirection table? I know that the BrokerHelper 
> link and unlink methods are the way to go, but I cannot see how to use 
> it because, to me, it looks like you can only specify 1 side of the link.

If you specify one side of the link this should be enough, because in 
indirection table the FK of both objects are inserted - or I'm missing 
something?
For example:
A, B already existing.
// declare relation
A.addBs(B)
broker.beginTx
broker.serviceBrokerHelper().link(A);
broker.commitTx

After this in indirection table the m:n relation between A and B should 
be stored.

If you now call
broker.retrieveAllReferences(B)
Collection result = B.getAs()
B now should contain A

There is a test case in test suite ([db-ojb/src/test]) called 
org.apache.ojb.broker.M2NTest handle with m:n relation (automatic store 
and custom store with linking)

regards,
Armin

> 
>     Here is some rough sample code of what I want to do:
> -----------
>     PersistenceBroker pbroker = 
> PersistenceBrokerFactory.defaultPersistenceBroker();
>     pbroker.beginTransaction();
>     pbroker.store(a);
>     pbroker.commitTransaction();
> 
>     //then some time later
>     pbroker.beginTransaction();
>     pbroker.store(a);
>     pbroker.commitTransaction();
> 
>     //and finally even later
>     pbroker.serviceBrokerHelper().link(a,b); //I know this method 
> doesn't exist, but this is what I want to do.
>     //  or
>     pbroker.serviceBrokerHelper().unlink(a,b);
> -------------
> 
> Here is what the repository file for the DAGNode looks like:
> 
> <collection-descriptor
>         name="children"
>         element-class-ref="DAGNode"
>         indirection-table="parent_children_table"
>         auto-retrieve="true"
>         auto-update="none"
>         auto-delete="none"
>     >
>         <fk-pointing-to-this-class column="parent_id"/>
>         <fk-pointing-to-element-class column="child_id"/>
>     </collection-descriptor>
>     <collection-descriptor
>         name="parents"
>         element-class-ref="DAGNode"
>         indirection-table="parent_children_table"
>         auto-retrieve="true"
>         auto-update="none"
>         auto-delete="none"
>     >
>         <fk-pointing-to-this-class column="child_id"/>
>         <fk-pointing-to-element-class column="parent_id"/>
> 
> 
> thank you!
> Brad
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Manual Link and Unlink question

Posted by Bradford Pielech <br...@alphatech.com>.
Hello:

	This is a follow on to my question from last week where I have a graph 
structure where each graph node has a list of parents and children.  I was 
trying to use the auto-update=object and auto-delete=object features, but 
it was not working well in my particular scenario (meaning there were not 
any bugs in OJB) so I am investigating switching to auto-update and 
auto-delete = none and linking / unlinking on my own.

	So here is my question: if I have object A and object B already stored in 
the database, how can I create or delete an M to N link between them in 
their indirection table? I know that the BrokerHelper link and unlink 
methods are the way to go, but I cannot see how to use it because, to me, 
it looks like you can only specify 1 side of the link.

	Here is some rough sample code of what I want to do:
-----------
	PersistenceBroker pbroker = 
PersistenceBrokerFactory.defaultPersistenceBroker();
	pbroker.beginTransaction();
	pbroker.store(a);
	pbroker.commitTransaction();

	//then some time later
	pbroker.beginTransaction();
	pbroker.store(a);
	pbroker.commitTransaction();

	//and finally even later
	pbroker.serviceBrokerHelper().link(a,b); //I know this method doesn't 
exist, but this is what I want to do.
	//  or
	pbroker.serviceBrokerHelper().unlink(a,b);
-------------

Here is what the repository file for the DAGNode looks like:

<collection-descriptor
         name="children"
         element-class-ref="DAGNode"
         indirection-table="parent_children_table"
         auto-retrieve="true"
         auto-update="none"
         auto-delete="none"
     >
         <fk-pointing-to-this-class column="parent_id"/>
         <fk-pointing-to-element-class column="child_id"/>
     </collection-descriptor>
     <collection-descriptor
         name="parents"
         element-class-ref="DAGNode"
         indirection-table="parent_children_table"
         auto-retrieve="true"
         auto-update="none"
         auto-delete="none"
     >
         <fk-pointing-to-this-class column="child_id"/>
         <fk-pointing-to-element-class column="parent_id"/>


thank you!
Brad






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


Re: Problems getting ojb-blank

Posted by Thomas Dudziak <to...@first.fhg.de>.
A Leg wrote:

> Hi Thomas,
>
> I am not sure but it seems that somewhere, it ahs been some problems 
> because the database name is upper case.
> It seems to give some problem somewhere.

This is likely with PostgreSQL since you're probably using Linux or Unix.
In the ojb-blank project, you specify the database url in the 
build.properties file (using urlDbalias, in your case it would be 
'//localhost/OJB').
Then, the build process will create a corresponding jdbc connection 
descriptor (repository_database.xml).
So, if you create the database manually, all you'd have to do is to 
specify the database name in the urlDbalias in the build.properties file 
that you used with psql (in the same case).

> I am trying to create everything by hand.
> Is it another place than build files to know what t I have to create ?

You might need OJB's internal tables, they are required by several 
components of OJB (ODMG, some sequence managers etc.). You should try 
first without them, but if that does not work, you'll have to add them. 
I'm no PostgreSQL user, but there is surely someone on the list that can 
send you the PostgreSQL table definitions for them.

Tom


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


Re: Problems getting ojb-blank

Posted by A Leg <ha...@yahoo.com>.
Hi Thomas,

I am not sure but it seems that somewhere, it ahs been some problems 
because the database name is upper case.
It seems to give some problem somewhere.

I am trying to create everything by hand.
Is it another place than build files to know what t I have to create ?

Best regards

Andre Legendre
Thomas Dudziak wrote:

> Hale India wrote:
>
>> Hi
>>
>> I still try to get running my project using ojb
>> 1.0rc6.
>>
>> When I run :
>> ant ojb-blank
>>
>> I get :
>>
>> [torque-sql] (transform.DTDResolver 128
>> ) Resolver: used database.dtd from
>> org.apache.torque.engine.database.transform package
>>
>> sql-template:
>>
>> create-db-check:
>>
>> create-db:
>>
>> datasql:
>> [echo]
>> +-----------------------------------------------+
>> [echo] | |
>> [echo] | Generating SQL from data XML ! |
>> [echo] | Woo hoo! |
>> [echo] | |
>> [echo]
>> +-----------------------------------------------+
>> [torque-data-sql] Using contextProperties file:
>> /home/rcs/Master/extern/java/db-ojb/build.properties
>> [torque-data-sql] Using classpath
>> [torque-data-sql] Generating to file
>> /home/rcs/Master/extern/java/db-ojb/target/test/sql/ojbtest-data.sql
>> [torque-data-sql] Parsing file: 'ojbtest-schema.xml'
>> [torque-data-sql] (transform.DTDResolver 128 ) Resolver: used 
>> database.dtd from
>> org.apache.torque.engine.database.transform package
>> [torque-data-sql] Resolver: used
>> /home/rcs/Master/extern/java/db-ojb/target/test/ojbtest-data.dtd
>>
>> insert-sql:
>> [torque-sql-exec] Our new url ->
>> jdbc:postgresql://localhost/OJB
>>
>> BUILD FAILED
>> /home/rcs/Master/extern/java/db-ojb/build.xml:386:
>> Following error occured while executing this line
>> /home/rcs/Master/extern/java/db-ojb/build-torque.xml:339:
>> org.postgresql.util.PSQLException: Backend start-up
>> failed: org.postgresql.util.PSQLException: FATAL:
>> database "OJB" does not exist
>>
>>
> Well, you have two options:
>
> * If you want to roll database creation (e.g. CREATE DATABASE) and 
> initialization (CREATE TABLE) on your own, you can simply remove the 
> dependency of the 'ojb-blank' target on the 'prepare-testdb' target in 
> the build.xml buildfile.
>
> * If you want to use Torque for database creation and initialization 
> (which makes things easier if you plan to use your project with 
> different databases), then you'll have to resolve the above error. I'm 
> no PostgreSQL expert, but it seems that Torque is not able to create 
> the database, but you can do this manually in PostgreSQL (the database 
> name is OJB).
>
> Tom
>
>
> ---------------------------------------------------------------------
> 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: Problems getting ojb-blank

Posted by Thomas Dudziak <to...@first.fhg.de>.
Hale India wrote:

>Hi
>
>I still try to get running my project using ojb
>1.0rc6.
>
>When I run :
>ant ojb-blank
>
>I get :
>
>[torque-sql] (transform.DTDResolver               128
>) Resolver: used database.dtd from
>org.apache.torque.engine.database.transform package
>
>sql-template:
>
>create-db-check:
>
>create-db:
>
>datasql:
>     [echo]
>+-----------------------------------------------+
>     [echo] |                                         
>     |
>     [echo] | Generating SQL from data XML !          
>     |
>     [echo] | Woo hoo!                                
>     |
>     [echo] |                                         
>     |
>     [echo]
>+-----------------------------------------------+
>[torque-data-sql] Using contextProperties file:
>/home/rcs/Master/extern/java/db-ojb/build.properties
>[torque-data-sql] Using classpath
>[torque-data-sql] Generating to file
>/home/rcs/Master/extern/java/db-ojb/target/test/sql/ojbtest-data.sql
>[torque-data-sql] Parsing file: 'ojbtest-schema.xml'
>[torque-data-sql] (transform.DTDResolver              
>128 ) Resolver: used database.dtd from
>org.apache.torque.engine.database.transform package
>[torque-data-sql] Resolver: used
>/home/rcs/Master/extern/java/db-ojb/target/test/ojbtest-data.dtd
>
>insert-sql:
>[torque-sql-exec] Our new url ->
>jdbc:postgresql://localhost/OJB
>
>BUILD FAILED
>/home/rcs/Master/extern/java/db-ojb/build.xml:386:
>Following error occured while executing this line
>/home/rcs/Master/extern/java/db-ojb/build-torque.xml:339:
>org.postgresql.util.PSQLException: Backend start-up
>failed: org.postgresql.util.PSQLException: FATAL:
>database "OJB" does not exist
>  
>
Well, you have two options:

* If you want to roll database creation (e.g. CREATE DATABASE) and 
initialization (CREATE TABLE) on your own, you can simply remove the 
dependency of the 'ojb-blank' target on the 'prepare-testdb' target in 
the build.xml buildfile.

* If you want to use Torque for database creation and initialization 
(which makes things easier if you plan to use your project with 
different databases), then you'll have to resolve the above error. I'm 
no PostgreSQL expert, but it seems that Torque is not able to create the 
database, but you can do this manually in PostgreSQL (the database name 
is OJB).

Tom


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