first, the following lines can be completely nonsense (never used Netbean, don't have a clue in ClassLoader problematic ;-))
But this sounds like a typical ClassLoader problem. On OJB startup the classes specified in OJB.properties file are loaded. Maybe the OJB config files or/and OJB jars use "wrong"/different ClassLoader.
Maybe you need to notify netbean to include OJB jars(+ used jars) in Internal Execution mode ClassLoader, or you need to move this jars in a directory included by the netbeans "Internal ClassLoader". Or does netbeans read the jars two times by different ClassLoader.
regards, Armin
Muhammad Aamir wrote:
Well, I develop and setup my small test application from scratch. There is one persistent class, a Test class which has main method, OJB.properties, repository.xml and repository.dtd.
It all goes well but when I change Executor to Internal Execution it generates some warnings and exceptions as follows:
[BOOT] WARN: Value "org.apache.ojb.broker.cache.ObjectCacheDefaultImpl" is illegal for key "ObjectCacheClass" (should be a class, using default value class org.apache.ojb.broker.cache.ObjectCacheDefaultImpl) [BOOT] WARN: Value "org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl" is illegal for key "ConnectionFactoryClass" (should be a class, using default value class org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl) [BOOT] WARN: Value "org.apache.ojb.odmg.locking.LockManagerDefaultImpl" is illegal for key "LockManagerClass" (should be a class, using default value class org.apache.ojb.odmg.locking.LockManagerDefaultImpl) [BOOT] WARN: Value "org.apache.ojb.odmg.locking.InMemoryLockMapImpl" is illegal for key "LockMapClass" (should be a class, using default value class org.apache.ojb.odmg.locking.PersistentLockMapImpl) [BOOT] WARN: Value "org.apache.ojb.broker.util.logging.PoorMansLoggerImpl" is illegal for key "LoggerClass" (should be a class, using default value class org.apache.ojb.broker.util.logging.PoorMansLoggerImpl) [BOOT] WARN: Value "org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessI mpl" is illegal for key "PersistentFieldClass" (should be a class, using default value class org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessIm pl) [BOOT] WARN: Value "org.apache.ojb.broker.core.PersistenceBrokerImpl" is illegal for key "PersistenceBrokerClass" (should be a class, using default value class org.apache.ojb.broker.core.PersistenceBrokerImpl) [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) [BOOT] WARN: Value "org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl" is illegal for key "PersistenceBrokerFactoryClass" (should be a class, using default value null) [BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed, can't get PBF class object java.lang.ExceptionInInitializerError at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker( Unknown Source) at kict.Test.main(Test.java:11) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.openide.execution.ThreadExecutor.executeClass(ThreadExecutor.java:11 6) at org.openide.execution.ThreadExecutor$TERunnable.run(ThreadExecutor.java: 183) at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:118) Caused by: org.apache.ojb.broker.OJBRuntimeException: Property for key 'PersistenceBrokerFactoryClass' can not be found in properties file at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unkn own Source) ... 9 more
Following is the first line of my main method:
System.setProperty("OJB.properties", "c:/work/test/OJB.properties");
Following is the line from OJB.properties:
repositoryFile=c:/work/test/repository.xml
Following segment has been taken from repository.xml:
<!DOCTYPE descriptor-repository PUBLIC "-//Apache Software Foundation//DTD OJB Repository//EN" "file:///c:/work/test/repository.dtd"
One thing is to remember that it goes well when Executor is External.
I am will be thankful if someone gives me a solution. I have also used
Oracle TopLink and was really happy with that. I am really disappointing
to think that I've wasted 1 week just to setup that small application.
Regards Aamir
-----Original Message-----
From: Edson Carlos Ericksson Richter
[mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 6:47 PM
To: OJB Users List
Subject: Re: FW: NetBeans and OJB
Hi!
I could answer you question. In NetBeans, go to
Tools -> Options -> Debbuging and Executing -> Execution Types -> External Execution -> Expert -> Working Directory.
Unfortunately, there is no equivalent option for Internal Execution (but the default execution for NetBeans apps is External Execution). In Internal Execution mode, the Working Directory is the NetBeans bin directory. So, if you need to use Internal Execution, you should set complete path for repository/ojb.properties.
I sugest you to use External Execution, and set Working Directory (to avoid annoiances).
I've collected these info in more than a year working with OJB inside NetBeans.
Best regards,
Edson Richter
----- Original Message ----- From: Muhammad Aamir To: OJB Users List Sent: Friday, January 09, 2004 9:38 AM
Subject: RE: FW: NetBeans and OJB
NetBeans IDE is a wonderful modular application and you can develop your own application on top of NetBeans platform. I want to use NetBeans platform and my developed modules to build my application.
The answer of your question that why I am using internal execution, is that I want to do some experiments with Open IDE API (an API to communicate with NetBeans IDE components). And internal execution uses the same virtual machine in which NetBeans IDE is running.
Aamir
-----Original Message-----
From: Thomas Dudziak [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 5:20 PM
To: OJB Users List
Subject: RE: FW: NetBeans and OJB
Well, I'm no expert when it comes to NetBeans (I prefer Eclipse). What is the benefit of internal execution vs. external execution ?
Tom
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.558 / Virus Database: 350 - Release Date: 2/1/2004
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
