Hi! Just more 2c:
When running app in NetBeans using Internal Execution Mode, it always set working
directory
to %NETBEANS_HOME%\bin (hipotetical path - adapt to your OS of preference). I don't
know if
there is a way to change this programmatically, and you can have trouble with this
kind of
setting due to security of Java when deploying your app.
The only way (using default NetBeans options, withou hacking anything) to specify a
user
working directory (where your .properties, .xml and so on are) is using the External
Execution Mode.
About the JARs (as Armin mentioned), I assume that you have mounted all OJB .jar files
in
your NetBeans file systems, right? That's all. It work like a charm...
AFAIK, there is no separated classloader (just for laughs: some time ago, I have
created an
Swing component that when diabled, if take the container it was inside, and disable
too,
then, the container of the container and disable too, and so on. The first time I used
the
component in a form using the Visual From Editor, and set Enabled=false, I've disabled
all
NetBeans interface!!! Yes, the Visual Form Editor was running my component inside the
NetBeans environment! :D).
Of course, if you use External Execution, there is a separate VM and so a separated
ClassLoader, but in this case, you have the option to configure the working directory.
But the settings for OJB.properties system variable should work too...
Ah, a lamp has turn on in my mind: may be NetBeans is putting their own classpath in
from of
your filesystem jars... In this case, you can have trouble with conflicts or buggy XML
parsers, ant, servlet, and so on (the ones used by default in NetBeans sometime are
little
old - as example, the latest NetBeans still came with Tomcat 4.0.6).
Best regards,
Edson Richter
> Hi Aamir,
>
> 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]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]