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 A Leg <ha...@yahoo.com> on 2004/06/17 10:04:20 UTC

Re: Problems getting ojb-blank Now Pb Loading Configuration

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: 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