Hello all,
I'm trying to deploy OJB 1.0 RC3 in a web application. I've been struggling for the
last few hours trying to figure out why this MetadataException occurs. I'm a newbie
with OJB so I have a hard time understanding some of these OJB errors. I would really
appreciate it if you could help me understand why I get this error that I'm copying
below. It occurs when OJB is reading repository.xml. From the exception stack trace it
looks like there is a NullPointerException coming from
RepositoryXmlHandler.getIsoLevel() but I don't why that would happen since I have the
isolationLevel="read-uncommitted" in repository.xml. I am sending my repository.xml
and repository_user.xml files as attachment as well.
Thank you so much,
Mete
Here is the error at startup:
java.lang.ExceptionInInitializerError
at
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefaultKey(Unknown
Source)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(Unknown Source)
at org.apache.ojb.broker.PersistenceBrokerFactory.getConfigurator(Unknown Source)
at org.apache.ojb.odmg.OJB.getInstance(Unknown Source)
at
com.oreilly.struts.storefront.service.StorefrontServiceImpl.init(StorefrontServiceImpl.java:206)
at
com.oreilly.struts.storefront.service.StorefrontServiceImpl.(StorefrontServiceImpl.java:35)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at
com.oreilly.struts.storefront.service.StorefrontServiceFactory.createService(StorefrontServiceFactory.java:26)
at
com.oreilly.struts.storefront.framework.StorefrontBaseAction.getStorefrontService(StorefrontBaseAction.java:28)
at
com.oreilly.struts.storefront.catalog.FeaturedPageAction.execute(FeaturedPageAction.java:20)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:506)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not read repository
class descriptor data, using repository: repository.xml: Exception when reading
metadata information, please check your repository.xml file
at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown Source)
at org.apache.ojb.broker.metadata.MetadataManager.(Unknown Source)
at org.apache.ojb.broker.metadata.MetadataManager.(Unknown Source)
... 60 more
Caused by: org.apache.ojb.broker.metadata.MetadataException: Exception when reading
metadata information, please check your repository.xml file
at org.apache.ojb.broker.metadata.RepositoryXmlHandler.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unknown Source)
at org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorRepository(Unknown
Source)
... 63 more
Caused by: java.lang.NullPointerException
at org.apache.ojb.broker.metadata.RepositoryXmlHandler.getIsoLevel(Unknown Source)
... 75 more
<!-- Mapping of User defined classes starts here -->
<!-- CUSTOMER MAPPING -->
<class-descriptor
class="com.oreilly.struts.storefront.businessobjects.CustomerBO"
table="CUSTOMER">
<field-descriptor
name="id"
column="id"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"/>
<field-descriptor
name="firstName"
column="firstname"
jdbc-type="VARCHAR"/>
<field-descriptor
name="lastName"
column="lastname"
jdbc-type="VARCHAR"/>
<field-descriptor
name="email"
column="email"
jdbc-type="VARCHAR"/>
<field-descriptor
name="password"
column="password"
jdbc-type="VARCHAR"/>
<field-descriptor
name="accountStatus"
column="accountstatus"
jdbc-type="CHAR"/>
<field-descriptor
name="creditStatus"
column="credutstatus"
jdbc-type="CHAR"/>
<collection-descriptor
name="submittedOrders"
element-class-ref="com.oreilly.struts.storefront.businessobjects.OrderBO">
<inverse-foreignkey field-ref="customerId"/>
</collection-descriptor>
</class-descriptor>
<!-- ITEM MAPPING -->
<class-descriptor
class="com.oreilly.struts.storefront.businessobjects.ItemBO"
table="ITEM">
<field-descriptor
name="id"
column="id"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"/>
<field-descriptor
name="displayLabel"
column="displaylabel"
jdbc-type="VARCHAR"/>
<field-descriptor
name="description"
column="description"
jdbc-type="VARCHAR"/>
<field-descriptor
name="manufacturer"
column="manufacturer"
jdbc-type="VARCHAR"/>
<field-descriptor
name="sku"
column="sku"
jdbc-type="VARCHAR"/>
<field-descriptor
name="minumumSellingUnits"
column="minsellingunits"
jdbc-type="INTEGER"/>
<field-descriptor
name="upc"
column="upc"
jdbc-type="VARCHAR"/>
<field-descriptor
name="modelNumber"
column="itemnumber"
jdbc-type="VARCHAR"/>
<field-descriptor
name="basePrice"
column="baseprice"
jdbc-type="DOUBLE"/>
<field-descriptor
name="sellingUOM"
column="sellinguom"
jdbc-type="VARCHAR"/>
<field-descriptor
name="onHandQuantity"
column="onhandquantity"
jdbc-type="INTEGER"/>
<field-descriptor
name="feature1"
column="featuredesc1"
jdbc-type="VARCHAR"/>
<field-descriptor
name="feature2"
column="featuredesc2"
jdbc-type="VARCHAR"/>
<field-descriptor
name="feature3"
column="featuredesc3"
jdbc-type="VARCHAR"/>
<field-descriptor
name="smallImageURL"
column="smallimageurl"
jdbc-type="VARCHAR"/>
<field-descriptor
name="largeImageURL"
column="largeimageurl"
jdbc-type="VARCHAR"/>
</class-descriptor>
<!-- CATALOG MAPPING -->
<class-descriptor
class="com.oreilly.struts.storefront.businessobjects.CatalogBO"
table="CATALOG">
<field-descriptor
name="id"
column="id"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"/>
<field-descriptor
name="displayLabel"
column="displaylabel"
jdbc-type="VARCHAR"/>
<field-descriptor
name="isFeatured"
column="featuredcatalog"
jdbc-type="CHAR"/>
<field-descriptor
name="description"
column="description"
jdbc-type="VARCHAR"/>
<collection-descriptor
name="assignedItems"
element-class-ref="com.oreilly.struts.storefront.businessobjects.ItemBO"
auto-retrieve="true"
auto-update="true"
indirection-table="CATALOGITEM_LNK">
<fk-pointing-to-this-class column="CATALOGID"/>
<fk-pointing-to-element-class column="ITEMID"/>
</collection-descriptor>
</class-descriptor>
<!-- LINEITEM MAPPING -->
<class-descriptor
class="com.oreilly.struts.storefront.businessobjects.LineItemBO"
table="LINEITEM">
<field-descriptor
name="id"
column="id"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"/>
<field-descriptor
name="orderId"
column="orderid"
jdbc-type="INTEGER"/>
<field-descriptor
name="itemId"
column="itemid"
jdbc-type="INTEGER"/>
<field-descriptor
name="quantity"
column="quantity"
jdbc-type="INTEGER"/>
<field-descriptor
name="extendedPrice"
column="extendedprice"
jdbc-type="DOUBLE"/>
<field-descriptor
name="basePrice"
column="baseprice"
jdbc-type="DOUBLE"/>
<field-descriptor
name="lineItemNumber"
column="lineitemnumber"
jdbc-type="INTEGER"/>
<reference-descriptor
name="order"
class-ref="com.oreilly.struts.storefront.businessobjects.OrderBO">
<foreignkey field-ref="orderId"/>
</reference-descriptor>
<reference-descriptor
name="item"
class-ref="com.oreilly.struts.storefront.businessobjects.ItemBO">
<foreignkey field-ref="itemId"/>
</reference-descriptor>
</class-descriptor>
<!-- ORDER MAPPING -->
<class-descriptor
class="com.oreilly.struts.storefront.businessobjects.OrderBO"
table="PURCHASEORDER">
<field-descriptor
name="id"
column="id"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"/>
<field-descriptor
name="customerId"
column="customerid"
jdbc-type="INTEGER"/>
<field-descriptor
name="orderStatus"
column="status"
jdbc-type="VARCHAR"/>
<field-descriptor
name="submittedDate"
column="submitedatetime"
jdbc-type="TIMESTAMP"/>
<field-descriptor
name="totalPrice"
column="totalprice"
jdbc-type="DOUBLE"/>
<reference-descriptor
name="customer"
class-ref="com.oreilly.struts.storefront.businessobjects.CustomerBO">
<foreignkey field-ref="customerId"/>
</reference-descriptor>
<collection-descriptor
name="lineItems"
element-class-ref="com.oreilly.struts.storefront.businessobjects.LineItemBO">
<inverse-foreignkey field-ref="orderId"/>
</collection-descriptor>
</class-descriptor>
<!-- Mapping of User defined classes ends here -->
<?xml version="1.0" encoding="UTF-8"?>
<!-- This is a sample metadata repository for the ObJectBridge System.
Use this file as a template for building your own mappings-->
<!-- defining entities for include-files -->
<!DOCTYPE descriptor-repository SYSTEM "repository.dtd" [
<!ENTITY database SYSTEM "repository_database.xml">
<!ENTITY internal SYSTEM "repository_internal.xml">
<!ENTITY user SYSTEM "repository_user.xml">
]>
<descriptor-repository version="1.0" isolation-level="rtrrtread-uncommitted">
<!-- include all used database connections -->
&database;
<!-- include ojb internal mappings here -->
&internal;
<!-- include user defined mappings here -->
&user;
</descriptor-repository>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]