RE: Weird BOOT issue
Hi Armin, I've actually been able to get OJB completely up and running in the portal. I had to hack the OJB source though to do so. In org/apache/ojb/broker/metadata/RepositoryPersistor.java, I hardcoded the SAXParserFactory to be an instance of com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl(); Any thoughts on making this configurable through OJB.properties? -Original Message- From: Bob Damato Sent: Friday, September 16, 2005 11:36 AM To: 'OJB Users List' Subject: RE: Weird BOOT issue Hi Armin, I've come a little farther on this issue. I've promoted the jars to the system level instead of running them as a portalapp and that allowed me a little progress. But, it turns out that SAP has a bit of an odd classloading scheme and worse, they have a weird SAXParserFactory implementation that doesn't play well with others. I've managed my way through some of the classloading issues, but I'm struggling now with dealing with this SAX issue (happens when the repository.xml is read): Caused by: java.lang.ClassCastException: com.inqmy.lib.jaxp.SAXParserFactoryImpl at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source) 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 Sour Unfortunately, I can't set the system property "javax.xml.parsers.SAXParserFactory" to something like xerces because it will cause problems for the rest of the portal. Here's a thread on the same problem with a different library: https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=http%3A//forums.sdn.sap.com/thread.jspa%3FthreadID%3D24988 The developer said he was able to make his own classloader to work around it, but what I'm wondering is if there is a simpler solution. Would it be possible (appropriate?) to add an optional property to the OJB.properties file to specify the SAXParserFactory implementation to use in OJB? Any other thoughts on how to approach this? Thanks!! -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 13, 2005 6:09 PM To: OJB Users List Subject: Re: Weird BOOT issue Bob Damato wrote: > I don't think so. There's only one copy of the jar on the system. The app is > a portal app, and I've tried the following scenarios: > > 1. db-ojb.jar in /PORTAL-INF/lib >OJB.properties and repository.xml in /PORTAL-INF/classes > > 2. db-ojb.jar in /PORTAL-INF/lib >OJB.properties and repository.xml in a jar in /PORTAL-INF/lib > > 3. db-ojb.jar unjarred under /PORTAL-INF/classes >OJB.properties and repository.xml in /PORTAL-INF/classes > I agree. The first one seems to be the correct way to specify an api and resources for use between portals. http://help.sap.com/saphelp_erp2004/helpdata/en/f9/561140d72dc442e1000a1550b0/content.htm Think the class calling OJB use a ClassLoader which doesn't have access to the OJB classes. The OJB warn message isn't helpfully (will fix this for next version), because it catch the ClassNotFoundException without printing the stack trace and only return the warn messages you get (see org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl line 337). I don't know the ClassLoader hierarchy used in the sap portal, maybe it's an issue with the Application-Config element properties (That's anyone's guess ;-)). Additionally in class ...broker.util.ClassHelper you can specify the ClassLoader used by OJB. regards, Armin > > > -Original Message- > From: Armin Waibel [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 13, 2005 3:02 PM > To: OJB Users List > Subject: Re: Weird BOOT issue > > > Hi Bob, > > Bob Damato wrote: > >>We're using OJB 1.0.1 successfully in many different scenarios (different >>jvm's, ide's and app servers). We are experimenting with integrating it with >>SAP's Application Server for a portal and I'm getting the error below. I'm >>using the same configuration files that I'm successfully using elsewhere, so >>I'm at a loss for what could be causing the issue. >> >>Any ideas? >> > > > seems to be a ClassLoader issue. Does the appServer load the ojb.jar (or > some OJB classes) twice? E.g. one jar is in appServer > system/common/shared lib, the other one is in the webApp > (/WEB-INF/classes directory). > > regards > Armin > > > >> >> >>[BOOT] WARN: Value "org.apache.ojb.broker.cache.
RE: Weird BOOT issue
Hi Armin, I've come a little farther on this issue. I've promoted the jars to the system level instead of running them as a portalapp and that allowed me a little progress. But, it turns out that SAP has a bit of an odd classloading scheme and worse, they have a weird SAXParserFactory implementation that doesn't play well with others. I've managed my way through some of the classloading issues, but I'm struggling now with dealing with this SAX issue (happens when the repository.xml is read): Caused by: java.lang.ClassCastException: com.inqmy.lib.jaxp.SAXParserFactoryImpl at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source) 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 Sour Unfortunately, I can't set the system property "javax.xml.parsers.SAXParserFactory" to something like xerces because it will cause problems for the rest of the portal. Here's a thread on the same problem with a different library: https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=http%3A//forums.sdn.sap.com/thread.jspa%3FthreadID%3D24988 The developer said he was able to make his own classloader to work around it, but what I'm wondering is if there is a simpler solution. Would it be possible (appropriate?) to add an optional property to the OJB.properties file to specify the SAXParserFactory implementation to use in OJB? Any other thoughts on how to approach this? Thanks!! -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 13, 2005 6:09 PM To: OJB Users List Subject: Re: Weird BOOT issue Bob Damato wrote: > I don't think so. There's only one copy of the jar on the system. The app is > a portal app, and I've tried the following scenarios: > > 1. db-ojb.jar in /PORTAL-INF/lib >OJB.properties and repository.xml in /PORTAL-INF/classes > > 2. db-ojb.jar in /PORTAL-INF/lib >OJB.properties and repository.xml in a jar in /PORTAL-INF/lib > > 3. db-ojb.jar unjarred under /PORTAL-INF/classes >OJB.properties and repository.xml in /PORTAL-INF/classes > I agree. The first one seems to be the correct way to specify an api and resources for use between portals. http://help.sap.com/saphelp_erp2004/helpdata/en/f9/561140d72dc442e1000a1550b0/content.htm Think the class calling OJB use a ClassLoader which doesn't have access to the OJB classes. The OJB warn message isn't helpfully (will fix this for next version), because it catch the ClassNotFoundException without printing the stack trace and only return the warn messages you get (see org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl line 337). I don't know the ClassLoader hierarchy used in the sap portal, maybe it's an issue with the Application-Config element properties (That's anyone's guess ;-)). Additionally in class ...broker.util.ClassHelper you can specify the ClassLoader used by OJB. regards, Armin > > > -Original Message- > From: Armin Waibel [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 13, 2005 3:02 PM > To: OJB Users List > Subject: Re: Weird BOOT issue > > > Hi Bob, > > Bob Damato wrote: > >>We're using OJB 1.0.1 successfully in many different scenarios (different >>jvm's, ide's and app servers). We are experimenting with integrating it with >>SAP's Application Server for a portal and I'm getting the error below. I'm >>using the same configuration files that I'm successfully using elsewhere, so >>I'm at a loss for what could be causing the issue. >> >>Any ideas? >> > > > seems to be a ClassLoader issue. Does the appServer load the ojb.jar (or > some OJB classes) twice? E.g. one jar is in appServer > system/common/shared lib, the other one is in the webApp > (/WEB-INF/classes directory). > > regards > Armin > > > >> >> >>[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.oj
RE: Weird BOOT issue
I don't think so. There's only one copy of the jar on the system. The app is a portal app, and I've tried the following scenarios: 1. db-ojb.jar in /PORTAL-INF/lib OJB.properties and repository.xml in /PORTAL-INF/classes 2. db-ojb.jar in /PORTAL-INF/lib OJB.properties and repository.xml in a jar in /PORTAL-INF/lib 3. db-ojb.jar unjarred under /PORTAL-INF/classes OJB.properties and repository.xml in /PORTAL-INF/classes -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 13, 2005 3:02 PM To: OJB Users List Subject: Re: Weird BOOT issue Hi Bob, Bob Damato wrote: > We're using OJB 1.0.1 successfully in many different scenarios (different > jvm's, ide's and app servers). We are experimenting with integrating it with > SAP's Application Server for a portal and I'm getting the error below. I'm > using the same configuration files that I'm successfully using elsewhere, so > I'm at a loss for what could be causing the issue. > > Any ideas? > seems to be a ClassLoader issue. Does the appServer load the ojb.jar (or some OJB classes) twice? E.g. one jar is in appServer system/common/shared lib, the other one is in the webApp (/WEB-INF/classes directory). regards Armin > > > [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.InMemoryLockMapImpl) > [BOOT] WARN: Value > "org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImplNew" > is illegal > for key "PersistentFieldClass" (should be a class, using default value class > org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImpl) > [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.broker.core.proxy.ListProxyDefaultImpl" is > illegal for key "ListProxyClass" (should be a class, using default value > class org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl) > [BOOT] WARN: Value "org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl" is > illegal for key "SetProxyClass" (should be a class, using default value class > org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl) > [BOOT] WARN: Value > "org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl" is illegal for > key "CollectionProxyClass" (should be a class, using default value class > org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl) > [BOOT] WARN: Value > "org.apache.ojb.broker.core.proxy.IndirectionHandlerDefaultImpl" is illegal > for key "IndirectionHandlerClass" (should be a class, using default value > class org.apache.ojb.broker.core.proxy.IndirectionHandlerDefaultImpl) > [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 > > _ > Bob Damato > Cox Target Media > Internet Technology Manager > Largo, Florida > > The thought manifests as the word. The word manif
Weird BOOT issue
We're using OJB 1.0.1 successfully in many different scenarios (different jvm's, ide's and app servers). We are experimenting with integrating it with SAP's Application Server for a portal and I'm getting the error below. I'm using the same configuration files that I'm successfully using elsewhere, so I'm at a loss for what could be causing the issue. Any ideas? [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.InMemoryLockMapImpl) [BOOT] WARN: Value "org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImplNew" is illegal for key "PersistentFieldClass" (should be a class, using default value class org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImpl) [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.broker.core.proxy.ListProxyDefaultImpl" is illegal for key "ListProxyClass" (should be a class, using default value class org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl) [BOOT] WARN: Value "org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl" is illegal for key "SetProxyClass" (should be a class, using default value class org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl) [BOOT] WARN: Value "org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl" is illegal for key "CollectionProxyClass" (should be a class, using default value class org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl) [BOOT] WARN: Value "org.apache.ojb.broker.core.proxy.IndirectionHandlerDefaultImpl" is illegal for key "IndirectionHandlerClass" (should be a class, using default value class org.apache.ojb.broker.core.proxy.IndirectionHandlerDefaultImpl) [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 _ Bob Damato Cox Target Media Internet Technology Manager Largo, Florida The thought manifests as the word. The word manifests as the deed. The deed develops into habit. And the habit hardens into character. So watch the thought and its ways with care. And let it spring from love, born out of concern for all beings.-- Buddha
RE: Pool Info?
Ok, I think I understand now. Here's what I've found. When I run the following code ... -- PersistenceBroker pb = ... <--- get a broker but don't close Properties p = ((PersistenceBrokerFactoryDefaultImpl)PersistenceBrokerFactoryFactory.instance()).getPoolConfiguration(); Iterator i = p.keySet().iterator(); while (i.hasNext()) { String key = i.next().toString(); System.out.println(key + ": " + p.getProperty(key)); } System.out.println("Active connections: " + PersistenceBrokerFactoryFactory.instance().activePersistenceBroker()); Thread.sleep(6); System.out.println("Active connections: " + PersistenceBrokerFactoryFactory.instance().activePersistenceBroker()); -- ...I see some configuration options that I don't know how to set (marked with a -). These aren't in my OJB.properties file and adding them didn't seem to work. + whenExhaustedAction: 1 + maxIdle: -1 + maxActive: 100 + maxWait: 2 - removeAbandoned: false - numTestsPerEvictionRun: 10 - testWhileIdle: false + minEvictableIdleTimeMillis: 1 - testOnReturn: false - logAbandoned: false - removeAbandonedTimeout: 300 + timeBetweenEvictionRunsMillis: 5000 - testOnBorrow: false Active connections: 1 Active connections: 1 Also, based on the configuration, I would expect the connection to be shutdown after my 60 second Thread.sleep, but as you can see, the connection is still listed as active. Am I looking in the right place? -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Thursday, February 10, 2005 1:45 PM To: OJB Users List Subject: Re: Pool Info? Hi Bob, Bob Damato wrote: > Hello Armin, Thank you for the information. I extended the > ConnectionFactoryPooledImpl and I was able to gain access to the connection > pool information. > > Another question: Is there a way that I can set up the pool to notify me > (log entry, email, electric shock etc) if a broker is evicted from the pool? > you have to differ between the connection-pool and the PB pool. The PB-pool was setup in PersistenceBrokerFactoryDefaultImpl. Think commons-pool does not provide any Listener to get notification of pooling actions. I think you can ask for the number of active PB directly in OJB doing int active = PersistenceBrokerFactoryFactory.instance().activePersistenceBroker() If you need more detailed control have a look in PersistenceBrokerFactoryDefaultImpl and extend it if possible. I will try to implement some basic monitor methods for connection/PB pool in OJB 1.1 - suggestions are welcome. regards, Armin > > -Original Message- > From: Armin Waibel [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 09, 2005 4:07 PM > To: OJB Users List > Subject: Re: Pool Info? > > > Hi Bob, > > currently there are no methods to access the used commons-pool instances > in ConnectionFactoryPooledImpl. I recommend to extend > ConnectionFactoryPooledImpl and override method #createConnectionPool. > > public ObjectPool createConnectionPool(JdbcConnectionDescriptor jcd) > { >ObjectPool pool = super.createConnectionPool... >// add 'pool' instance to list or map, ObjectPool has methods to >// lookup active connections, idle connections ... >return pool; > } > > regards, > Armin > > Bob Damato wrote: > >>I'm using ConnectionFactoryPooledImpl and I'm trying to find run time >>information about the pool such as the current number of connections "checked >>out", and the number of connections that were timed out etc. Is there any way >>to get this data? >> >> >> > > > - > 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Pool Info?
Hello Armin, Thank you for the information. I extended the ConnectionFactoryPooledImpl and I was able to gain access to the connection pool information. Another question: Is there a way that I can set up the pool to notify me (log entry, email, electric shock etc) if a broker is evicted from the pool? -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 09, 2005 4:07 PM To: OJB Users List Subject: Re: Pool Info? Hi Bob, currently there are no methods to access the used commons-pool instances in ConnectionFactoryPooledImpl. I recommend to extend ConnectionFactoryPooledImpl and override method #createConnectionPool. public ObjectPool createConnectionPool(JdbcConnectionDescriptor jcd) { ObjectPool pool = super.createConnectionPool... // add 'pool' instance to list or map, ObjectPool has methods to // lookup active connections, idle connections ... return pool; } regards, Armin Bob Damato wrote: > I'm using ConnectionFactoryPooledImpl and I'm trying to find run time > information about the pool such as the current number of connections "checked > out", and the number of connections that were timed out etc. Is there any way > to get this data? > > > - 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]
Pool Info?
I'm using ConnectionFactoryPooledImpl and I'm trying to find run time information about the pool such as the current number of connections "checked out", and the number of connections that were timed out etc. Is there any way to get this data?