hi,

i'm new in ojb, and i'm trying to get the a first example working. but until
now i failed.
first i've tried the tutorials with mysql, the qork well, in the same
database where the problematic table is located.

i've created a table which contains all user related data. im trying to
access this data using OJB in a webapplication.
when i query the table i get a empty result set although i shoulkd retrieve
some data (i've tried it in both manners: whith the proprietary OJB data
access API and using OQL).
reading the logs helped not:

[org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] INFO: Already
created persistence br
oker instances: 0
settign eager: false
[org.apache.ojb.broker.util.sequence.SequenceManagerFactory] INFO: Use
sequence manager class: clas
s org.apache.ojb.broker.util.sequence.SequenceManagerHiLoImpl
[org.apache.ojb.broker.accesslayer.AbstractPoolableConnectionFactory] INFO:
# Create connection poo
l for JdbcDescriptorKey 904324514 #
[org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] INFO: Already
created persistence br
oker instances: 1
[org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] INFO: Already
created persistence br
oker instances: 2
[org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] INFO: Already
created persistence br
oker instances: 3
[org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl] INFO: Already
created persistence br
oker instances: 4

i've seen that you provide a ant tasks, which validates the o/r mapping.
when i validate it i get the following mapping error report:

[verifymappings] Done Initializing ClassLoader.
[verifymappings]  --> Mapping Error: Can't load class-descriptor class
'com.gerryxx.tapestrytest.om
.User'.
[verifymappings] Loading properties file:
tmp//tapestrytest/WEB-INF/classes/OJB.properties
[verifymappings] PersistentFieldClass: class
org.apache.ojb.broker.metadata.PersistentFieldProperty
Impl
[verifymappings]  --> DB Mapping Warning: The column 'OJB_LOCKENTRY.TIMESTAM
P_' is of type 'DECIMAL
' and cannot be mapped to the jdbc type 'BIGINT'.
[verifymappings] Done Parsing.
[verifymappings] loading XML took 11063 msecs
[verifymappings]
---------------------------------------------------
       Found 1 error(s) in the repository.
       Found 1 warning(s) in the repository.
---------------------------------------------------

here are the configuration files:

repository files

<?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_tapestry.xml">
<!ENTITY internal SYSTEM "repository_internal.xml">
]>


<descriptor-repository version="0.9.6" isolation-level="read-uncommitted">
<!-- The Default JDBC Connection. If a class-descriptor does not specify its
own JDBC Connection,
     the Connection specified here will be used. -->

   <jdbc-connection-descriptor
     platform="MySql"
     jdbc-level="2.0"
     driver="com.mysql.jdbc.Driver"
     protocol="jdbc"
     subprotocol="mysql"
     dbalias="//localhost:3306/ojb"
     username="anonymous"
     password=""
   />

    <!-- include mappings for application here -->
    &database;

    <!-- include ojb internal mappings here -->
    &internal;

</descriptor-repository>

-----------------------------------------------------------------

<class-descriptor
      class="com.gerryxx.tapestrytest.om.User"
      table="user"
   >
      <field-descriptor id="1"
         name="id"
         column="userid"
         jdbc-type="INTEGER"
         primarykey="true"
  autoincrement="true"
      />
      <field-descriptor id="2"
         name="username"
         column="username"
         jdbc-type="VARCHAR"
      />
      <field-descriptor id="3"
         name="realname"
         column="realname"
         jdbc-type="VARCHAR"
      />
      <field-descriptor id="4"
         name="isAdmin"
         column="isadmin"
         jdbc-type="INTEGER"
      />
      <field-descriptor id="5"
         name="password"
         column="password"
         jdbc-type="VARCHAR"
      />
   </class-descriptor>

--------------------------------------------------------------

here is the ant target which invokes the validator:

<path id="runtime-classpath">
   <fileset dir="${build.webapp.dir}/WEB-INF/">
    <include name="classes/**/*.class"/>
    <include name="lib/*"/>
   </fileset>
  </path>

  <!-- Access the classpath as a property -->
  <property name="runtime.classpath" refid="runtime-classpath" />

  <taskdef name="verifymappings"
classname="org.apache.ojb.broker.ant.VerifyMappingsTask" >
   <classpath refid="runtime-classpath" />
  </taskdef>

  <verifymappings
       propertiesFile="${build.webapp.dir}/WEB-INF/classes/OJB.properties"

repositoryFile="${build.webapp.dir}/WEB-INF/classes/repository.xml"
          jdbcDriver="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:3306/ojb"
          logon="anonymous"
          password="alpecino"
          ignoreFieldNameCase="true"
          useStrictTypeChecking="false"
          verifyclasspath="${runtime.classpath}"
          useXMLValidation="true"
          failonerror="true"
  />

i suppose it's a stupid config error, but i don't find it.
please help!

thankx in advance


gerryxx


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to