Hi Marc,

does this mean that the xml-references (ENTITY elements) in repository.xml will not work with resin?

For example your repository.xml file looks like

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE descriptor-repository PUBLIC
       "-//Apache Software Foundation//DTD OJB Repository//EN"
       "repository.dtd"
[
<!ENTITY database SYSTEM "repository_database.xml">
<!ENTITY user SYSTEM "repository_user.xml">
]>

<descriptor-repository version="1.0" isolation-level="read-uncommitted"
        proxy-prefetching-limit="50">
    &database;
    &user;
</descriptor-repository>

and you put repository_database.xml and repository_user.xml in the same directory (and in OJB.properties 'repositoryFile' points to repository.xml), than resin will not proper read xml metadata?

regards,
Armin


marc salvetti wrote:


ZZZ Liu <z2liu_work <at> yahoo.com> writes:


I am using OJB rc5. Everything is fine when I use it
for stand alone program. But when I try to use it in a
web application (applciation server is resin 2.1.10),
I got following error. From the log, we can see that
there is a NullPointerException at org.apache.ojb.broker.metadata.RepositoryXmlHandler.getIsoLevel(Unknown
Source) and from the debug message we can see that
isolation-level: null.


If I manually add isolation-level attribute to each
class descriptor element in repository_internal.xml
and all included repository_user.xml's, then it works.

I don't think there is any document saying that we
need to change repository_internal.xml. I am wondering
whether anybody has ever had the same problem and
what's the real cause and the soultion for it.

Thanks in advance.

Zhe

=======================================================
84938 DEBUG [tcpConnection-9003-0] util.RequestUtils -
Get module name for path
/core/domain/party/partySearchReport.jsp
84938 DEBUG [tcpConnection-9003-0] util.RequestUtils -
Module name found: default
84953 DEBUG [tcpConnection-9003-0] tiles.InsertTag -
insert page='/core/fwk/mainLayout.jsp'.
88953 INFO  [tcpConnection-9003-0]
util.PropertyMessageResources - Initializing,
config='org.apache.struts.taglib.html.LocalStrings',
returnNull=true
[org.apache.ojb.broker.metadata.RepositoryPersistor]
INFO: OJB Descriptor Repository:
file:/D:/gsnx/builds/hourly/dist/gsnx/conf/repository.xml
[org.apache.ojb.broker.metadata.RepositoryXmlHandler]
DEBUG: startDoc
[org.apache.ojb.broker.metadata.RepositoryXmlHandler]
DEBUG:      proxy-prefetching-limit: null
[org.apache.ojb.broker.metadata.RepositoryXmlHandler]
DEBUG:  > descriptor-repository
[org.apache.ojb.broker.metadata.RepositoryXmlHandler]
DEBUG:     < documentation
[org.apache.ojb.broker.metadata.RepositoryXmlHandler]
DEBUG:   > class-descriptor
[org.apache.ojb.broker.metadata.RepositoryXmlHandler]
DEBUG:      isolation-level: null
89719 DEBUG [tcpConnection-9003-0] tiles.InsertTag -
[ServletException in:/core/fwk/mainLayout.jsp] null'
java.lang.ExceptionInInitializerError
        at
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.

getDefaultKey(Unknown


Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.

defaultPersistenceBroker(Unknown


Source)
        at
org.apache.ojb.broker.PersistenceBrokerFactory.

defaultPersistenceBroker(Unknown


Source)
        at
com.gsnx.core.server.persistence.ojb.OjbPersistenceManager.

<init>(OjbPersistenceManager.java)


        at
com.gsnx.core.server.persistence.PersistenceManagerFactory.

getPersistenceManager(PersistenceManagerFactory.java)


        at
com.gsnx.core.server.util.lang.TranslationUtil.

cacheTranslation(TranslationUtil.java)


        at
com.gsnx.core.server.util.lang.TranslationUtil.getTranslation(TranslationUtil.

java)


        at
com.gsnx.core.server.util.lang.TranslationUtil.message(TranslationUtil.java)
        at
com.gsnx.core.server.util.lang.TranslationUtil.message(TranslationUtil.java)
        at
com.gsnx.core.webui.fwk.util.HtmlUtil.resolveLabel(HtmlUtil.java)
        at
_core._fwk._mainlayout__jsp._jspService(_mainlayout__jsp.java:73)
        at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
        at com.caucho.jsp.Page.subservice(Page.java:506)
        at
com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
        at
com.caucho.server.http.Invocation.service(Invocation.java:315)
        at
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
        at
com.caucho.server.http.QRequestDispatcher.include(QRequestDispatcher.java:362)
        at
com.caucho.server.http.QRequestDispatcher.include(QRequestDispatcher.java:274)
        at
com.caucho.jsp.QPageContext.include(QPageContext.java:547)
        at
org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
        at
org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
        at
org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
        at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.

java:881)


        at
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
        at
_core._domain._party._partysearchreport__jsp.

_jspService(_partysearchreport__jsp.java:82)


        at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
        at com.caucho.jsp.Page.subservice(Page.java:506)
        at
com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
        at
com.caucho.server.http.Invocation.service(Invocation.java:315)
        at
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
        at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:246)
        at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:164)
        at
com.caucho.server.TcpConnection.run(TcpConnection.java:139)
        at java.lang.Thread.run(Thread.java:534)
Caused by:
org.apache.ojb.broker.metadata.MetadataException: Can
not read repository class descriptor data, using
repository: repository.xml
        at
org.apache.ojb.broker.metadata.MetadataManager.init(Unknown
Source)
        at
org.apache.ojb.broker.metadata.MetadataManager.<init>(Unknown
Source)
        at
org.apache.ojb.broker.metadata.MetadataManager.<clinit>(Unknown
Source)
        ... 34 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
com.caucho.xml.XmlParser.addElement(XmlParser.java:2257)
        at
com.caucho.xml.XmlParser.parseElement(XmlParser.java:615)
        at
com.caucho.xml.XmlParser.parseNode(XmlParser.java:364)
        at
com.caucho.xml.XmlParser.parseNode(XmlParser.java:292)
        at
com.caucho.xml.XmlParser.parseNode(XmlParser.java:292)
        at
com.caucho.xml.XmlParser.parseInt(XmlParser.java:246)
        at
com.caucho.xml.AbstractParser.parse(AbstractParser.java:614)
        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


Source)
        ... 37 more
Caused by: java.lang.NullPointerException
        at
org.apache.ojb.broker.metadata.RepositoryXmlHandler.getIsoLevel(Unknown
Source)
        ... 48 more


__________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus




hello, i'm trying to move from tomcat to Resin-3.0.6



I encountered exactly the same problem,
it seems that a solution is to put the xerces.jar in resin classpath... if you have access to it :/



besides, i'm encountering problems with the loading of nested objects and collections


it seems that ojb don't load the referenced objects, neither the collections referenced with inverse-foreignkey

if i try on my local computer with tomcat it works well
but if i try on my webhost's server with resin it fails

here is the repository_user.xml

<!-- Mapping of User defined classes starts here -->
    <jdbc-connection-descriptor
        jcd-alias="tribu"
        default-connection="true"
                platform="MySQL"
                driver="com.mysql.jdbc.Driver"
                protocol="jdbc"
                subprotocol="mysql"
                jdbc-level="2.0"
                dbalias="//localhost:3306/marc_tribu"
                username="toto"
                password="toto"
                eager-release="false"
        batch-mode="false"
        useAutoCommit="2"
        ignoreAutoCommitExceptions="false"
   >
        <sequence-manager className="org.apache.ojb.broker.util.sequence.
SequenceManagerNextValImpl">
            <attribute attribute-name="autoNaming" attribute-value="true"/>
        </sequence-manager>

</jdbc-connection-descriptor>

<!-- Definitions for bo.ForumMessage -->
<class-descriptor isolation-level="read-uncommitted" class="bo.ForumMessage"
table="message">
<field-descriptor
name="OID"
column="cle"
jdbc-type="INTEGER"
primarykey="true"
/>
<field-descriptor
name="subject"
column="objet"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="body"
column="texte"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="date"
column="date"
jdbc-type="TIMESTAMP"
conversion="org.apache.ojb.broker.accesslayer.conversions.
JavaDate2SqlDateFieldConversion"
/>
<field-descriptor
name="authorID"
column="cle_user"
jdbc-type="INTEGER"
/>
<field-descriptor
name="rootMessageID"
column="cle_sujet"
jdbc-type="INTEGER"
/>
<field-descriptor
name="parentMessageID"
column="cle_pere"
jdbc-type="INTEGER"
/>
<reference-descriptor name="author" class-ref="bo.User" >
<foreignkey field-ref="authorID"/>
</reference-descriptor>
<reference-descriptor name="rootMessage" class-ref="bo.ForumMessage" >
<foreignkey field-ref="rootMessageID"/>
</reference-descriptor>
<reference-descriptor name="parentMessage" class-ref="bo.ForumMessage" >
<foreignkey field-ref="parentMessageID"/>
</reference-descriptor>
<collection-descriptor name="answers" element-class-ref="bo.
ForumMessage" orderby="date" sort="DESC" >
<inverse-foreignkey field-ref="parentMessageID"/>
</collection-descriptor>
</class-descriptor>


<!-- Definitions for bo.User -->
<class-descriptor isolation-level="read-uncommitted"
class="bo.User"
table="user"
>
<field-descriptor
name="OID"
column="cle"
jdbc-type="INTEGER"
primarykey="true"
/>
<field-descriptor
name="firstName"
column="nom"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="name"
column="prenom"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="surname"
column="surnom"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="email"
column="mail"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="adress"
column="adresse"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="phone"
column="tel"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="birthDate"
column="date_anniv"
jdbc-type="DATE"
conversion="org.apache.ojb.broker.accesslayer.conversions.
JavaDate2SqlDateFieldConversion"
/>
<field-descriptor
name="theme"
column="theme"
jdbc-type="INTEGER"
/>
<field-descriptor
name="color"
column="couleur"
jdbc-type="INTEGER"
/>
<field-descriptor
name="styleComments"
column="aff_comments"
jdbc-type="INTEGER"
/>
<field-descriptor
name="avatar"
column="avatar"
jdbc-type="VARCHAR"
/>
<field-descriptor
name="connected"
column="connecte"
jdbc-type="INTEGER"
conversion="org.apache.ojb.broker.accesslayer.conversions.
Boolean2IntFieldConversion"
/>
<collection-descriptor name="messages" element-class-ref="bo.
ForumMessage" orderby="date" >
<inverse-foreignkey field-ref="authorID"/>
</collection-descriptor>
</class-descriptor>



<!-- Mapping of User defined classes ends here -->



thanks in advance for any help




---------------------------------------------------------------------
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]



Reply via email to