Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

OJB Configuration with Sun One 7

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,
I am trying to configure OJB with Sun One App Server 7. My code is working fine in java class but when i try to execute this code from JSP I get this error, seems some class initialization/lookup problem

java.lang.ExceptionInInitializerError
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at java.lang.Class.forName0(Native Method)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at java.lang.Class.forName(Class.java:219)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.ojb.broker.util.ClassHelper.getClass(ClassHelper.java:101)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.ojb.broker.util.ClassHelper.getClass(ClassHelper.java:254)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(ConfigurationAbstractImpl.java:325)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(ConfigurationAbstractImpl.java:401)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(PersistenceBrokerFactoryFactory.java:54)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(PersistenceBrokerFactoryFactory.java:36)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(PersistenceBrokerFactory.java:65)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at _jasper._testOJB_jsp._jspService(_testOJB_jsp.java:75)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at java.security.AccessController.doPrivileged(Native Method)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: Caused by: java.lang.NullPointerException
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(LoggerFactoryImpl.java:163)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(LoggerFactory.java:64)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: at org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.<clinit>(PersistenceBrokerFactoryBaseImpl.java:45)
[12/Dec/2004:09:10:53] WARNING ( 3504): CORE3283: stderr: ... 28 more

* This is my JSP Code:

<%@ page language="java"
import="java.util.*,org.apache.ojb.broker.*,org.apache.ojb.broker.query.*
,ae.gov.dm.bpcs.vo.*" %>

<%
try{
out.println("testOJB Starts........<BR>");

ContractorWorkType cwt[] = null;
Criteria crit1 = new Criteria();

QueryByCriteria query = new QueryByCriteria(ContractorWorkType.class, null,true);
query.addOrderByAscending("id");

PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
Collection collection = broker.getCollectionByQuery(query);

Vector vec = new Vector(collection);
if(vec.size()>0)
{
cwt = new ContractorWorkType[vec.size()];
cwt = (ContractorWorkType[])vec.toArray(cwt);
}

if(cwt!=null)
for(int i=0;i<cwt.length;i++){
out.println("<BR>ID = "+ cwt[i].getId() );
}else
out.println("<BR>No Record Found");

out.println("<BR>testOJB ends..");
}
catch(Throwable e){
out.println("<BR>Exception test3.jsp.." + e.getMessage());
e.printStackTrace();
}
%>

I have placed required OJB files as under, same stuff is working with Java Class.

* WEB-INF\classes
OJB.properties
repository.xml
repository_database.xml
repository_internal.xml
repository_user.xml
repository.dtd

* WEB-INF\lib

commons-collections-2.1.1.jar
commons-dbcp-1.1.jar
commons-lang-2.0.jar
commons-pool-1.1.jar
db-ojb-1.0.1.jar
log4j-1.2.8.jar


Thanks in advance

 
Liar, liar, pants on fire! refreshing plug:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic