db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry V. Streepy, Jr." <stre...@healthlanguage.com>
Subject Re: servlet OJB
Date Wed, 14 Jan 2004 22:35:27 GMT
I'm pretty uncertain about this one since I'm new to OJB as well.  But 
my guess is that you may not have a "default" jdbc-connection-descriptor 
in your repository.xml.  Are you running the tutorials using the scripts 
provided with OJB?  If so, this should not be possible since they 
repository_database.xml is included from repository.xml.

So, this one may also be a classpath problem.  All the repository*.xml 
files must be available on the classpath.

I would suggest enabling DEBUG output in the OJB.properties file so you 
can see what's going on.

Sorry I wasn't abel to help more.

Murugan Ramu wrote:

>Larry:
>
>I started to work on the tutorial1 and I am getting another error when I
>run the tutorial1. 
>
>
>org.apache.ojb.broker.PBFactoryException: There was no default-PBKey
>specified
>        at
>org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPersi
>stenceBroker(PersistenceBrokerFactoryBaseImpl.java:196)
>        at
>org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(
>PersistenceBrokerFactory.java:104)
>        at
>org.apache.ojb.tutorial1.Application.<init>(Application.java:25)
>        at
>org.apache.ojb.tutorial1.Application.main(Application.java:56)
>     _  _
> __ (_)| |_
>
>
>What is PBKey? I would greatly appreciate it if you could Please let me
>know 
>
>Thanks
>
>Murugan Ramu
>
>-----Original Message-----
>From: Larry V. Streepy, Jr. [mailto:streepy@healthlanguage.com] 
>Sent: Tuesday, January 13, 2004 6:57 PM
>To: OJB Developers List
>Subject: Re: servlet OJB
>
>Murugan, one thing is that you have specific files (OJB.properties, 
>repository.xml) in your classpath and I'm pretty sure that won't work.  
>You need to include the directory in which those files live on the 
>classpath.  Thus include C:/db-ojb-1.0.rc5/doc in the path.  Also, OJB 
>requires a number of libraries at runtime (as documented on the OJB 
>website) and they don't appear to be in your classpath.  I would clean 
>these things up first and see if you get any better results.
>
>Murugan Ramu wrote:
>
>  
>
>>I am relatively new to OJB. I have the common-pool-1.1.jar in the
>>classpath.  I am giving you as much as information as possible so that
>>    
>>
>I
>  
>
>>could just get past this error. 
>>
>>This is my classpath
>>C:\db-ojb-1.0.rc5\lib\commons-pool-1.1.jar;C:\db-ojb-1.0.rc5\lib\db-ojb
>>    
>>
>-
>  
>
>>1.0.rc5.jar;C:\db-ojb-1.0.rc5\lib\commons-lang-2.0.jar;C:\db-ojb-1.0.rc
>>    
>>
>5
>  
>
>>\test\mappingclass.jar;C:\db-ojb-1.0.rc5\doc\OJB.properties;C:\db-ojb-1
>>    
>>
>.
>  
>
>>0.rc5\doc\repository.xml;
>>
>>The jsp code snippet is 
>>
>>
>>
>><%@ page import="com.trulogica.truaccess.util.*, 
>>org.apache.ojb.broker.*, import org.apache.ojb.broker.query.*,
>>java.util.*,
>>org.apache.commons.lang.exception.NestableRuntimeException,
>>ClassToBeMapped" %>
>><%
>>String classpath =  System.getProperty("java.class.path");
>><!-- JUST FOR CHECKING THE CLASSPATH -->
>>%>
>><%= classpath %>
>><%	
>>
>>PersistenceBroker _broker;
>>_broker = PersistenceBrokerFactory.defaultPersistenceBroker();
>>Class clazz =  ClassToBeMapped.class; 
>>String critStr = null;
>>      Criteria crit = null;
>>      if( critStr != null ) {
>>        crit = new Criteria();
>>        crit.addSql(critStr);
>>      }
>>      Query query = new QueryByCriteria( clazz, crit);
>>
>>%>
>>
>>
>>	The first time when I run the servlet I get this error (stack
>>trace) 
>>
>>java.lang.NoClassDefFoundError:
>>org/apache/commons/pool/PoolableObjectFactory
>>       at java.lang.Class.forName0(Native Method)
>>       at java.lang.Class.forName(Class.java:115)
>>       at
>>org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.class$(U
>>    
>>
>n
>  
>
>>known Source)
>>       at
>>org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.load(Unk
>>    
>>
>n
>  
>
>>own Source)
>>       at
>>org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl
>>    
>>
>.
>  
>
>><init>(Unknown Source)
>>       at
>>org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.<init>(U
>>    
>>
>n
>  
>
>>known Source)
>>       at
>>org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.<init>(Un
>>    
>>
>k
>  
>
>>nown Source)
>>       at
>>org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.<clinit>(
>>    
>>
>U
>  
>
>>nknown Source)
>>       at
>>org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
>>Source)
>>       at
>>org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unk
>>    
>>
>n
>  
>
>>own Source)
>>       at
>>org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker
>>    
>>
>(
>  
>
>>Unknown Source)
>>       at
>>    
>>
>jsp_servlet.__setproperty._jspService(__setproperty.java:119)
>  
>
>>       at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
>>       at
>>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl
>>    
>>
>.
>  
>
>>java:262)
>>       at
>>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl
>>    
>>
>.
>  
>
>>java:198)
>>       at
>>weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServ
>>    
>>
>l
>  
>
>>etContext.java:2678)
>>       at
>>weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl
>>    
>>
>.
>  
>
>>java:2412)
>>       at
>>    
>>
>weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:140)
>  
>
>>       at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:121)
>>
>>
>>
>>
>>then the next time I try to run the servlet I get the following error.
>>
>>
>>
>>
>>java.lang.NoClassDefFoundError
>>       at
>>org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker
>>    
>>
>(
>  
>
>>Unknown Source)
>>       at
>>    
>>
>jsp_servlet.__setproperty._jspService(__setproperty.java:119)
>  
>
>>       at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
>>       at
>>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl
>>    
>>
>.
>  
>
>>java:262)
>>       at
>>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl
>>    
>>
>.
>  
>
>>java:198)
>>       at
>>weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServ
>>    
>>
>l
>  
>
>>etContext.java:2678)
>>       at
>>weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl
>>    
>>
>.
>  
>
>>java:2412)
>>       at
>>    
>>
>weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:140)
>  
>
>>       at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:121)
>>
>>
>>
>>
>>ANY HELP IS GREATLY APPRECIATED!
>>
>>Thanks
>>
>>MR
>>-----Original Message-----
>>From: Larry V. Streepy, Jr. [mailto:streepy@healthlanguage.com] 
>>Sent: Tuesday, January 13, 2004 6:00 PM
>>To: OJB Developers List
>>Subject: Re: servlet OJB
>>
>>I would assume that you don't have commons-pool.jar in your classpath.
>>
>>Murugan Ramu wrote:
>>
>> 
>>
>>    
>>
>>>Hello:
>>>
>>>
>>>
>>>I keep getting this error when I invoke the servlet that contains the
>>>OJB access code. Anyone had such a problem and rectified it? 
>>>
>>>
>>>
>>>
>>>
>>>java.lang.NoClassDefFoundError:
>>>org/apache/commons/pool/PoolableObjectFactory
>>>
>>>      at java.lang.Class.forName0(Native Method)
>>>
>>>
>>>
>>>MR
>>>
>>>
>>>
>>>
>>>   
>>>
>>>      
>>>
>> 
>>
>>    
>>
>
>  
>

-- 
Larry V. Streepy, Jr.
Senior Vice President and CTO
Health Language, Inc.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message