JDO O/R-Mapping
Hi all,
i am starting programming with JDO.
First i start with the example Getting Started with JDO. After some trouble, it is running now.
I want to expand the example, so i have three Objects/Tables.
Employee, Manager, Department with the following relationships. Primary Key (Manager, Department) Forign-Key (Employee).
Manager 1:N Employee N:1 Department
For every Object/Table i have a jdo and map-File.
JDO
Department
If i check and enhance the classes i got the following errros:
com.sap.jdo.enhancer.util.InternalError: assertion failed: JDO metadata: managed fields exceed annotated fields
Where is my fault ?
Thanks for help.
Regards Jürgen
Further Question:
Are there any tools from SAP or others to help O/R-Mapping?
Regards
Jürgen
Similar Messages
-
JDO : how to map a byte array field correctly
Could someone please provide an example on how to correctly map a byte array field in a PCClass.
The field should be mapped to a BLOB field in my Dictionary project.
The checker keeps throwing errors during the enhancement process. Tried all sorts of combinations of xml in my jdo and map file (using the dtd) but I still haven't found the solution. The compilation works fine though, it is only the checker that complains.You're already in a PDF open in Acrobat (not the free Adobe Reader) and you've made a new PDF? Which you want to save to disk and reopen?
-
Mapping feature for queries that cannot be expressed using JDO QL
In the "Java Data Objects vs. Entity Beans" thread at theserverside.com,
there was a question concerning the ways to use a query that cannot be
expressed using JDO QL (for example SQL requests having no equivalent) .
Among the possibilities mentionned in his answers, Craig Russel said
that a JDO implementation could map an SQL query to a Java class
directly :
"This might be done by a JDO vendor who mapped a user-specified SQL
query to a JDO PC class. For example, if you have a DEPARTMENT table
that you want to write an aggregate query for "SELECT D.DEPTID,
MAX(E.SALARY) FROM DEPARTMENT D, EMPLOYEE E WHERE D.DEPTID = E.DEPTID".
You would map this query to a JDO PC class DepartmentMaxSalary which has
a key field deptid and a non-key field maxSalary. The key class
DepartmentMaxSalaryKey has a key field deptid.
Now, construct an instance of the key class:
DepartmentMaxSalaryKey dk = new DepartmentMaxSalaryKey(100);
DepartmentMaxSalary d = pm.getObjectById(dk);
System.out.println ("Department " + d.getDeptid()
+ " has max salary of " + d.getMaxSalary());
When the getObjectById is executed a hollow instance of
DepartmentMaxSalary is constructed by the PersistenceManager. When the
d.getMaxSalary() is executed, the implementation of the method accesses
the maxSalary field which causes the PersistenceManager to executes the
query and return the result into the field.
No implementation to my knowledge currently offers this kind of mapping,
but certainly some will in future."
Do you consider in providing this kind of mapping feature in Kodo ?
Thanks in advance.patrice thiebaud <[email protected]> writes:
In the "Java Data Objects vs. Entity Beans" thread at theserverside.com,
there was a question concerning the ways to use a query that cannot be
expressed using JDO QL (for example SQL requests having no equivalent) .
Among the possibilities mentionned in his answers, Craig Russel said
that a JDO implementation could map an SQL query to a Java class
directly :
"This might be done by a JDO vendor who mapped a user-specified SQL
query to a JDO PC class. For example, if you have a DEPARTMENT table
that you want to write an aggregate query for "SELECT D.DEPTID,
MAX(E.SALARY) FROM DEPARTMENT D, EMPLOYEE E WHERE D.DEPTID = E.DEPTID".
You would map this query to a JDO PC class DepartmentMaxSalary which has
a key field deptid and a non-key field maxSalary. The key class
DepartmentMaxSalaryKey has a key field deptid.
Now, construct an instance of the key class:
DepartmentMaxSalaryKey dk = new DepartmentMaxSalaryKey(100);
DepartmentMaxSalary d = pm.getObjectById(dk);
System.out.println ("Department " + d.getDeptid()
+ " has max salary of " + d.getMaxSalary());
When the getObjectById is executed a hollow instance of
DepartmentMaxSalary is constructed by the PersistenceManager. When the
d.getMaxSalary() is executed, the implementation of the method accesses
the maxSalary field which causes the PersistenceManager to executes the
query and return the result into the field.
No implementation to my knowledge currently offers this kind of mapping,
but certainly some will in future."
Do you consider in providing this kind of mapping feature in Kodo ?Patrice,
Sorry for the delay responding to this question. The thread dropped out
of my awareness until Rakesh's followup question today.
We do not currently plan on providing a mechanism for configuring JDO
objects to load themselves from arbitrary SQL queries at this point. The
example above seems a little contrived, for a few reasons:
- Presumably, this aggregate salary object would be read-only.
Read-only JDO fields/objects are a whole separate topic that we
have chosen not to address just yet.
- Where would the complex SQL statement go? Putting it in the
metadata seems less than ideal, as this would make for a hideous
metadata file, and even more complexity and more debugging
problems than using direct JDBC SQL calls. Putting the SQL
statement into the class also seems awkward.
- Kodo provides a mechanism for obtaining a connection to the data
store. When aggregate info are needed or complex,
non-object-oriented queries must be executed, standard JDBC calls
to the data store are probably the most appropriate approach, as
they give you complete access to your data store.
If we see a significant interest in these capabilities, then we may
consider them for a future release.
Thanks in advance.Again, I apologize for the time delay in my response. I hope that this
answers your questions.
-Patrick
Patrick Linskey [email protected]
SolarMetric Inc. http://www.solarmetric.com -
How to use a MAP whithout join table
Hello
I am still evaluating KODO ;-)
I am using kodo 3.1.2 with an evaluation version
linux (kernel 2.6)
SUN JDK 1.4.2_04
MYSQL MAX 4.0.18 -Max
IDEA 4.0.3 and ANT 1.5.4 (to be exhaustive)
I am wondering how to configure the following mapping involving a Map. :
public class Translation {
private String locale;
private String txt;
public class TranslatableDescription {
/**Map of Key=locale as String; Value = {@link Translation}*/
==> private Map translations = new HashMap(); <==
public void addATranslation(Translation t){
translations.put(t.getLocale(), t);
file package.jdo :
<?xml version="1.0"?>
<jdo>
<package name="data">
<class name="Translation"/>
<class name="TranslatableDescription">
<field name="translations">
<map key-type="java.lang.String"
value-type="tutorial.data.Translation"/>
<extension vendor-name="kodo" key="jdbc-key-size" value="10"/>
</field>
</class>
</package>
</jdo>
The default Mapping generate a join table : TRANS_TRANSLATION which works
fine, but I would like to remove this table by adding a
colonne in the "TRANSLATION" table containing the JDOID of the
TRANSLATIONDESCRIPTION owner of this TRANSLATION.
I have made some try like this one in the mapping file
<class name="TranslatableDescription">
<field name="translations">
<jdbc-field-map type="n-many-map" key-column="LOCALE"
ref-column.JDOID="OWNERJDOID" table="TRANSLATION0"
value-column.JDOID="JDOID"/>
</field>
The schema generated in my DB is correct but when I try to persist some
objects I have the following Exception :
727 INFO [main] kodo.jdbc.JDBC - Using dictionary class
"kodo.jdbc.sql.MySQLDictionary" (MySQL 4.0.18'-Max' ,MySQL-AB JDBC Driver
mysql-connector-java-3.0.10-stable ( $Date: 2004/01/13 21:56:18 $,
$Revision: 1.27.2.33 $ )).
Exception in thread "main" kodo.util.FatalDataStoreException: Invalid
argument value, message from server: "Duplicate entry '2' for key 1"
{prepstmnt 8549963 INSERT INTO TRANSLATION0 (JDOID, LOCALESTR, OWNERJDOID)
VALUES (?, ?, ?) [reused=0]} [code=1062, state=S1009]
NestedThrowables:
com.solarmetric.jdbc.ReportingSQLException: Invalid argument value,
message from server: "Duplicate entry '2' for key 1" {prepstmnt 8549963
INSERT INTO TRANSLATION0 (JDOID, LOCALESTR, OWNERJDOID) VALUES (?, ?, ?)
[reused=0]} [code=1062, state=S1009]
java.sql.BatchUpdateException: Invalid argument value, message from
server: "Duplicate entry '2' for key 1"
at kodo.jdbc.sql.SQLExceptions.getFatalDataStore(SQLExceptions.java:42)
at kodo.jdbc.sql.SQLExceptions.getFatalDataStore(SQLExceptions.java:24)
at kodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:594)
at
kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:152)
at
kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.java:964)
at
kodo.runtime.PersistenceManagerImpl.beforeCompletion(PersistenceManagerImpl.java:813)
at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:69)
at
kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
at
tutorial.CreateTranslatableDescription.main(CreateTranslatableDescription.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
I have the feeling that KODO does try to make diffent row in the table
"TRANSLATION0" for the TRANSLATION and the MAP.
So, is this kind of mapping supported by KODO and if yes, how can I
configure it.
Thank you for your help
NicolasSo, is this kind of mapping supported by KODO and if yes, how can I
configure it.It is not directly supported. You can fake it using a one-many mapping
(see thread: Externalizing Map to Collection of PC), but unless you must
map to an existing schema, it's probably not worth the effort. (Note:
also there is a bug that actually prevents this from working with 3.1.2;
the bug is fixed for 3.1.3, but it hasn't been released yet). -
Query: Missing tablename in generated SQL for vertical mapped classes
Hi,
I am playing with Kodo 3.1.4 / Postgres 7.4 and could not find any
solution for this problem:
I have one class calles "Clipfragment" which represents video clips and
has a long - field named "lengthInMinutes". It extends a baseclass
called "Categorizablefragment", which has a field "id" and some others.
I use vertical mapping, thus having one table per class. The identity
type is 'application'. The table for the class "Categorizablefragment"
contains fields for jdoclass and jdoversion and IMHO correct entries.
Everything works really fine except for Querys against subclass fields
with aggregate functions. E.g. counting all clips works:
KodoQuery q = (KodoQuery) getJdoPm().newQuery(ClipFragment.class);
q.setResult ("count(id)");
Number count = (Number) q.execute ();
But: Querying for the sum of the field 'lengthInMinutes' fails:
KodoQuery q = (KodoQuery) getJdoPm().newQuery(ClipFragment.class);
q.setResult ("sum(lengthInMinutes)");
Number count = (Number) q.execute ();
The exception is:
kodo.util.UserException: com.solarmetric.jdbc.ReportingSQLException:
ERROR: syntax error at or near "WHERE"
{prepstmnt 16398807 SELECT AVG(t0.lengthinminutes) FROM WHERE
t1.jdoclass = ? [reused=0]} [code=0, state=42601]
NestedThrowables:
com.solarmetric.jdbc.ReportingSQLException: ERROR: syntax error at or
near "WHERE"
{prepstmnt 16398807 SELECT AVG(t0.lengthinminutes) FROM WHERE
t1.jdoclass = ? [reused=0]} [code=0, state=42601]
at kodo.query.AbstractQuery.executeWithMap(AbstractQuery.java:865)
at kodo.query.AbstractQuery.execute(AbstractQuery.java:728)
atde.jk.buvas.model.impl.DefaultClipManager.getTotalTime(DefaultClipManager.java:43)
And the SQL - Trace:
5766 TRACE [main] kodo.jdbc.SQL - <t 17089909, conn 31908613 (1
errors)> [0 ms] executing prepstmnt 17226426 SELECT
SUM(t0.lengthinminutes) FROM WHERE t1.jdoclass = ? [params=(String)
de.jk.buvas.model.fragments.ClipFragment] [reused=0]
I tried both 'base-tables' and 'per-subclass' for the property
kodo.jdbc.VerticalQueryMode, without any results.
Any ideas?
Thanks,
JochenHi Stephen,
here are the excerpts from the .jdo and the .mapping files. The .jdo
file was generated by XDoclet.
..jdo
<class name="ClipFragment"
identity-type="application"
objectid-class="CategorizableFragment$Id"
persistence-capable-superclass="CategorizableFragment"
> <!-- end class tag -->
<extension vendor-name="kodo"
key="jdbc-class-map-name"
value="vertical">
<extension vendor-name="kodo" key="table" value="Clip"/>
</extension>
<field name="title"
> <!-- end field tag -->
<extension vendor-name="kodo"
key="jdbc-size"
value="100">
</extension>
</field>
<field name="lengthInMinutes"
> <!-- end field tag -->
</field>
<field name="description"
> <!-- end field tag -->
<extension vendor-name="kodo"
key="jdbc-size"
value="3000">
</extension>
</field>
<field name="recordingDate"
> <!-- end field tag -->
</field>
<field name="actors"
> <!-- end field tag -->
<collection
element-type="de.jk.buvas.model.fragments.ActorFragment"
> <!-- end collection tag -->
</collection>
<extension vendor-name="kodo"
key="jdbc-element-delete-action"
value="exception-deferred">
</extension>
<extension vendor-name="kodo"
key="inverse-owner"
value="clips">
</extension>
</field>
<field name="media"
> <!-- end field tag -->
<collection
element-type="de.jk.buvas.model.fragments.MediumFragment"
> <!-- end collection tag -->
</collection>
<extension vendor-name="kodo"
key="jdbc-element-delete-action"
value="exception-deferred">
</extension>
</field>
</class>
<class name="CategorizableFragment"
identity-type="application"
objectid-class="CategorizableFragment$Id"
> <!-- end class tag -->
<extension vendor-name="kodo"
key="jdbc-class-map-name"
value="base">
<extension vendor-name="kodo" key="table" value="Categorizable"/>
</extension>
<field name="id"
primary-key="true"
> <!-- end field tag -->
</field>
<field name="category"
> <!-- end field tag -->
<extension vendor-name="kodo"
key="jdbc-delete-action"
value="exception-deferred">
</extension>
</field>
</class>
..mapping
<class name="ClipFragment">
<jdbc-class-map type="vertical" ref-column.ID="ID" table="CLIPFRAGMENT"/>
<field name="actors">
<jdbc-field-map type="many-many" element-column.ID="ID"
ref-column.ID="CLIPS_ID" table="ACTOR_CLIPS"/>
</field>
<field name="description">
<jdbc-field-map type="value" column="DESCRIPTION"/>
</field>
<field name="lengthInMinutes">
<jdbc-field-map type="value" column="LENGTHINMINUTES"/>
</field>
<field name="media">
<jdbc-field-map type="many-many" element-column.ID="MEDIA_ID"
order-column="MEDIA_ORDER" ref-column.ID="ID" table="CLIPF_MEDIA"/>
</field>
<field name="recordingDate">
<jdbc-field-map type="value" column="RECORDINGDATE"/>
</field>
<field name="title">
<jdbc-field-map type="value" column="TITLE"/>
</field>
</class>
<class name="CategorizableFragment">
<jdbc-class-map type="base" table="CATEGORIZABLEFRAGMENT"/>
<jdbc-version-ind type="version-number" column="JDOVERSION"/>
<jdbc-class-ind type="in-class-name" column="JDOCLASS"/>
<field name="category">
<jdbc-field-map type="one-one" column.ID="CATEGORY_ID"/>
</field>
<field name="id">
<jdbc-field-map type="value" column="ID"/>
</field>
</class>
Thanks,
Jochen
Stephen Kim wrote:
Can you post the mapping/metadata files for the two classes?
Jochen Kressin wrote:
Hi,
I am playing with Kodo 3.1.4 / Postgres 7.4 and could not find any
solution for this problem:
I have one class calles "Clipfragment" which represents video clips
and has a long - field named "lengthInMinutes". It extends a baseclass
called "Categorizablefragment", which has a field "id" and some
others. I use vertical mapping, thus having one table per class. The
identity type is 'application'. The table for the class
"Categorizablefragment" contains fields for jdoclass and jdoversion
and IMHO correct entries.
Everything works really fine except for Querys against subclass fields
with aggregate functions. E.g. counting all clips works:
KodoQuery q = (KodoQuery) getJdoPm().newQuery(ClipFragment.class);
q.setResult ("count(id)");
Number count = (Number) q.execute ();
But: Querying for the sum of the field 'lengthInMinutes' fails:
KodoQuery q = (KodoQuery) getJdoPm().newQuery(ClipFragment.class);
q.setResult ("sum(lengthInMinutes)");
Number count = (Number) q.execute ();
The exception is:
kodo.util.UserException: com.solarmetric.jdbc.ReportingSQLException:
ERROR: syntax error at or near "WHERE"
{prepstmnt 16398807 SELECT AVG(t0.lengthinminutes) FROM WHERE
t1.jdoclass = ? [reused=0]} [code=0, state=42601]
NestedThrowables:
com.solarmetric.jdbc.ReportingSQLException: ERROR: syntax error at or
near "WHERE"
{prepstmnt 16398807 SELECT AVG(t0.lengthinminutes) FROM WHERE
t1.jdoclass = ? [reused=0]} [code=0, state=42601]
at kodo.query.AbstractQuery.executeWithMap(AbstractQuery.java:865)
at kodo.query.AbstractQuery.execute(AbstractQuery.java:728)
atde.jk.buvas.model.impl.DefaultClipManager.getTotalTime(DefaultClipManager.java:43)
And the SQL - Trace:
5766 TRACE [main] kodo.jdbc.SQL - <t 17089909, conn 31908613 (1
errors)> [0 ms] executing prepstmnt 17226426 SELECT
SUM(t0.lengthinminutes) FROM WHERE t1.jdoclass = ? [params=(String)
de.jk.buvas.model.fragments.ClipFragment] [reused=0]
I tried both 'base-tables' and 'per-subclass' for the property
kodo.jdbc.VerticalQueryMode, without any results.
Any ideas?
Thanks,
Jochen -
Hi
I am evaluating Kodo in the prospect to migrate an existing application
which uses a different JDO implementation and I am currently wondering
what is the best way to define the mapping.
So far, we have only used __.jdo__ metadata file with default values and
some jdo extension. Then we delegate to the JDO implementation the task to
define the schema and create it in the relationnal database.
I am trying to reproduce the same process with KODO. But :
- I am encountering some problem with the kodo extension.(but they are
certainly some mistake from my part, I will introduce some at the end of
this email)
- I understand that kodo can use a mapping file.
Here are my very first questions
- Which method should I use. Only JDO extension, or mapping file.
- if I use the mapping file, is it possible to only specify info for
fields which are different than default behavior of kodo
- If I use the jdo extension only how can I :
specify the name of a table for a particular class?
specify the name of a join table?
Specify the name of a column for a particular java field?
Is there a way to configure the mapping tool to use a custom naming
convention for the whole project (for a particular package)?
I already made a small evaluation of kodo 7 month ago with version 3.1.0,
but with this version, there was a bug discussed in this forum which
forced me to use the mapping file. But I had to define the complete
mapping, which was a huge task especially when you have to repeat field
mapping for sub classes. My first tests with kodo 3.2.2 works with jdo
extension, but I still have some issues as you can see from my questions.
Thank you for your answer.
Nicolas GANDRIAU
Environment description
Kodo 3.2.2 evaluation
MySQL 4.1.4-gamma'-Max'
MySQL Connector/J 3.0.15-ga
JDK 1.4.2_05 de Sun
Linux Kernel 2.6.8 (Mandrake 10.1)
IDEA 4.5.2Nicolas,
You need to define which mapping file using the kodo.jdbc.MappingFactory
extension. Note that with either format that the mapping information
must be complete (or you can have Kodo create them for you):
http://solarmetric.com/Software/Documentation/3.2.2/docs/ref_guide_conf_kodo.html#kodo.jdbc.MappingFactory
The metadata mapping factory is more verbose though all of your
information is in a single file. .mapping files are more consise but
need to be deployed in addition to your .jdo metadata.
Nicolas GANDRIAU wrote:
Hi
I am evaluating Kodo in the prospect to migrate an existing application
which uses a different JDO implementation and I am currently wondering
what is the best way to define the mapping.
So far, we have only used __.jdo__ metadata file with default values and
some jdo extension. Then we delegate to the JDO implementation the task to
define the schema and create it in the relationnal database.
I am trying to reproduce the same process with KODO. But :
- I am encountering some problem with the kodo extension.(but they are
certainly some mistake from my part, I will introduce some at the end of
this email)
- I understand that kodo can use a mapping file.
Here are my very first questions
- Which method should I use. Only JDO extension, or mapping file.
- if I use the mapping file, is it possible to only specify info for
fields which are different than default behavior of kodo
- If I use the jdo extension only how can I :
specify the name of a table for a particular class?
specify the name of a join table?
Specify the name of a column for a particular java field?
Is there a way to configure the mapping tool to use a custom naming
convention for the whole project (for a particular package)?
I already made a small evaluation of kodo 7 month ago with version 3.1.0,
but with this version, there was a bug discussed in this forum which
forced me to use the mapping file. But I had to define the complete
mapping, which was a huge task especially when you have to repeat field
mapping for sub classes. My first tests with kodo 3.2.2 works with jdo
extension, but I still have some issues as you can see from my questions.
Thank you for your answer.
Nicolas GANDRIAU
Environment description
Kodo 3.2.2 evaluation
MySQL 4.1.4-gamma'-Max'
MySQL Connector/J 3.0.15-ga
JDK 1.4.2_05 de Sun
Linux Kernel 2.6.8 (Mandrake 10.1)
IDEA 4.5.2
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com -
Problem with mapping the Entity beans onto database tables
Hi,
I got a problem with mapping the Entity beans onto database tables. Here are what I did:
First Step:
asant capture-schema
Second Step:
capture-schema -driver com.pointbase.jdbc.jdbcUniversalDriver -dburl jdbc:pointbase:server://localhost/sun-appserv-samples -username pbPublic -password pbpublic -table APPLICANT -table APPLICANTSKILL -table CUSTOMER -table LOCATION -table job -table JOBSKILL -table SKILL -out build/agency.dbschema
The first step was fine. But, in the second step, I got the error message as follow:
using dburl:jdbc:pointbase:server://localhost/sun-appserv-samples
using username:pbPublic
using password:pbpublic
using driver:com.pointbase.jdbc.jdbcUniversalDriver
using schemaname:null
using output file:build/agency.dbschema
JDO71100: Failed to find a class. Verify that the class is available on your CLASSPATH
java.lang.ClassNotFoundException: com.pointbase.jdbc.jdbcUniversalDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at com.sun.forte4j.modules.dbmodel.jdbcimpl.ConnectionProvider.<init>(Co
nnectionProvider.java:38)
at com.sun.jdo.api.persistence.mapping.ejb.CaptureSchema.main(CaptureSch
ema.java:130)
at com.sun.jdo.spi.persistence.support.ejb.util.CaptureSchemaWrapper.mai
n(CaptureSchemaWrapper.java:29)
Thanks for your help!You need to add the pbclient.jar or some similar name like that, in the CalssPath.
-
<field name="employee">
<extension vendor-name="kodo" key="jdbc-field-map"
value="one-one">
<extension vendor-name="kodo" key="column.ID" value="EMPLOYEE_ID"/>
</extension>
</field>
Hello all,
If I have the above field defined for one my classes in package.jdo,
should the mapping tools create the foreign keys automatically?
Thanks.Hi Marc,
Thanks for the reply.
I tried using null and cascade for the value of the jdbc-delete-action. I
also added the property kodo.jdbc.ForeignKeyConstraints: true to
kodo.properties. In all cases the foreign key is showing up in the
schema, but not getting inserted into the database, MySQL with jdbc
driver version 3.0.15ga.
A more worrying issue to me is that fact that the joins are not showing up
in the schema. From what I understood from section 7.5.1 of the
documentation the one-one jdbc-field-map extension should add the joins.
My code still works I am just a little miffed as to why the joins are not
showing up. They do not show up for other types of jdbc-field-map, for
collections, as I would expect.
I'm pasting below the meta-data for the class in question plus the portion
of the schema.xml for that class. (If you need the full schema.xml and
meta-data please supply an email address I can send it to, as I do not
want to post this information on an open forum).
I'm also posting below the output of the mapping tool. Please tell me if
there is anything else you need.
Cheers.
<class name="TripImpJdo"
persistence-capable-superclass="trekwatch.core.security.AbstractPolicedObject"
objectid-class="TripImpJdoId">
<extension vendor-name="kodo" key="data-cache-timeout"
value="-1"/>
<extension vendor-name="kodo" key="jdbc-class-ind"
value="in-class-name">
<extension vendor-name="kodo" key="column"
value="JDOCLASS"/>
</extension>
<extension vendor-name="kodo" key="jdbc-class-map"
value="base">
<extension vendor-name="kodo" key="table"
value="tripimpjdo"/>
</extension>
<extension vendor-name="kodo" key="jdbc-field-mappings">
<extension vendor-name="kodo"
key="trekwatch.core.TWObject.authorId">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="AUTHORID"/>
</extension>
</extension>
<extension vendor-name="kodo"
key="trekwatch.core.TWObject.id">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="ID"/>
</extension>
</extension>
<extension vendor-name="kodo"
key="trekwatch.core.TWObject.timeStamp">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="TIMESTAMP0"/>
</extension>
</extension>
<extension vendor-name="kodo"
key="trekwatch.core.security.AbstractPolicedObject.copyPolicy">
<extension vendor-name="kodo" key="jdbc-field-map"
value="pc">
<extension vendor-name="kodo" key="column"
value="COPYPOLICY"/>
</extension>
</extension>
<extension vendor-name="kodo"
key="trekwatch.core.security.AbstractSecureTWObject.acl">
<extension vendor-name="kodo" key="jdbc-field-map"
value="pc">
<extension vendor-name="kodo" key="column"
value="ACL"/>
</extension>
</extension>
</extension>
<extension vendor-name="kodo" key="jdbc-version-ind"
value="version-number">
<extension vendor-name="kodo" key="column"
value="JDOVERSION"/>
</extension>
<field name="activities">
<collection
element-type="trekwatch.core.activity.ActivityImpJdo"/>
<extension vendor-name="kodo" key="jdbc-field-map"
value="many-many">
<extension vendor-name="kodo" key="element-column.ID"
value="ACTIVITIES_ID"/>
<extension vendor-name="kodo" key="order-column"
value="ACTIVITIES_ORDER"/>
<extension vendor-name="kodo" key="ref-column.ID"
value="ID"/>
<extension vendor-name="kodo" key="table"
value="tripi_activities"/>
</extension>
</field>
<field name="atomSignature" persistence-modifier="persistent">
<extension vendor-name="kodo" key="jdbc-field-map"
value="pc">
<extension vendor-name="kodo" key="column"
value="ATOMSIGNATURE"/>
</extension>
</field>
<field name="budget">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="BUDGET"/>
</extension>
</field>
<field name="budgetType">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="BUDGETTYPE"/>
</extension>
</field>
<field name="description">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="DESCRIPTION"/>
</extension>
</field>
<field name="endDate">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="ENDDATE"/>
</extension>
</field>
<field name="gearList">
<extension vendor-name="kodo" key="jdbc-delete-action"
value="null"/>
<extension vendor-name="kodo" key="jdbc-field-map"
value="one-one">
<extension vendor-name="kodo" key="column.ID"
value="GEARLIST_ID"/>
</extension>
</field>
<field name="name">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="NAME0"/>
</extension>
</field>
<field name="numDays">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="NUMDAYS"/>
</extension>
</field>
<field name="startDate">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="STARTDATE"/>
</extension>
</field>
<field name="timeAvailable">
<extension vendor-name="kodo" key="jdbc-field-map"
value="value">
<extension vendor-name="kodo" key="column"
value="TIMEAVAILABLE"/>
</extension>
</field>
<field name="todoList">
<extension vendor-name="kodo" key="jdbc-field-map"
value="one-one">
<extension vendor-name="kodo" key="column.ID"
value="TODOLIST_ID"/>
</extension>
</field>
<field name="tripElements">
<collection element-type="TripElement"/>
<extension vendor-name="kodo" key="jdbc-field-map"
value="pc-collection">
<extension vendor-name="kodo" key="element-column"
value="ELEMENT"/>
<extension vendor-name="kodo" key="order-column"
value="TRIPELEMENTS_ORDER"/>
<extension vendor-name="kodo" key="ref-column.ID"
value="ID"/>
<extension vendor-name="kodo" key="table"
value="tripi_tripelements"/>
</extension>
</field>
</class>
<table name="tripimpjdo">
<pk column="ID"/>
<column name="ACL" type="varchar" size="255"/>
<column name="ATOMSIGNATURE" type="varchar" size="255"/>
<column name="AUTHORID" type="varchar" size="255"/>
<column name="BUDGET" type="integer"/>
<column name="BUDGETTYPE" type="integer"/>
<column name="COPYPOLICY" type="varchar" size="255"/>
<column name="DESCRIPTION" type="varchar" size="255"/>
<column name="ENDDATE" type="timestamp"/>
<column name="GEARLIST_ID" type="bigint"/>
<column name="ID" type="bigint" not-null="true"/>
<column name="JDOCLASS" type="varchar" size="255"/>
<column name="JDOVERSION" type="integer"/>
<column name="NAME0" type="varchar" size="255"/>
<column name="NUMDAYS" type="integer"/>
<column name="STARTDATE" type="timestamp"/>
<column name="TIMEAVAILABLE" type="integer"/>
<column name="TIMESTAMP0" type="timestamp"/>
<column name="TODOLIST_ID" type="bigint"/>
<fk delete-action="cascade" to-table="gearitemlist"
column="GEARLIST_ID"/>
<fk to-table="todolist" column="TODOLIST_ID"/>
<index name="I_TRPMPJD_GEARLIST_ID" column="GEARLIST_ID"/>
<index name="I_TRPMPJD_JDOCLASS" column="JDOCLASS"/>
<index name="I_TRPMPJD_JDOVERSION" column="JDOVERSION"/>
<index name="I_TRPMPJD_TODOLIST_ID" column="TODOLIST_ID"/>
</table>
create-schema:
[echo]
================================================================
[echo] Refreshing the schema in the data store
[echo]
================================================================
[mappingtool] 625 INFO [main] kodo.Tool - Mapping tool running on type
"class ***" with action "refresh".
[mappingtool] 1891 INFO [main] kodo.Tool - Mapping tool running on type
"class ***" with action "refresh".
[mappingtool] 1906 INFO [main] kodo.Tool - Mapping tool running on type
"class ***" with action "refresh".
(many more of the same as above for each persistent class.
[mappingtool] 2250 INFO [main] kodo.Tool - Recording mapping and schema
changes.
[mappingtool] 5063 WARN [main] kodo.jdbc.Schema - The foreign key
"F_TRPMPJD_GEARLIST" was not added to table "TRIPIMPJDO".
build:
BUILD SUCCESSFUL
Total time: 20 seconds
Marc Prud'hommeaux wrote:
Goerge-
As well as adding the jdbc-delete-action, you also want to set the
following in your kodo.properties:
kodo.jdbc.ForeignKeyConstraints: true
Also, I notice you are using MySQL: MySQL doesn't support some foreign
keys (such as deferred constraints). Is your foreign key deferred? Can
you post the schema.xml file, as well as the complete output from the
mappingtool so we can take a look at it?
In article <[email protected]>, Goerge wrote:
UPDATE again:
This dialog with myself is actually not bad.
Anyway, I've made some head way:
After reading through 16 pages of posts here, I found one with the same
problem I had, where it stated that foreign key constraints are not added
to the database unless a jdbc-delete-action extension is used.
After adding the following extension to the field in question, I still do
not get the foreign key in the database, but at least I get the following
message when running the mapping tool:
[mappingtool] 6157 WARN [main] kodo.jdbc.Schema - The foreign key
"F_TRPMPJD_GEARLIST" was not added to table "TRIPIMPJDO".
I am using MySQL with innodb tables, so foreign keys should be supported.
Is there another reason they are not being added?
Thanks again.
Marc Prud'hommeaux
SolarMetric Inc. -
RC1 and MetaDataMappingFactory
I'm trying to migrate from 2.5.3 to 3.0RC1.
To use only the old 2.5.3 package.jdo file including mapping information
instead of additionally my newly generated .mapping file, I've set
'metadata' as MappingFactory.
Compiling my queries, I get
kodo.jdbc.meta.MappingInfoNotFoundException: No mapping information was
found for "class thisIsMyClass".
at
kodo.jdbc.meta.RuntimeMappingProvider.getMapping(RuntimeMappingProvider.java:43)
at
kodo.jdbc.meta.MappingRepository.getMappingInternal(MappingRepository.java:342)
at kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:297)
at
kodo.jdbc.meta.MappingRepository.getMappings(MappingRepository.java:272)
at
kodo.jdbc.meta.MappingRepository.getMetaDatas(MappingRepository.java:256)
at kodo.query.QueryImpl.internalCompile(QueryImpl.java:559)
at kodo.query.QueryImpl.compile(QueryImpl.java:523)
If I add a .mapping file with the default FileMappingFactory everything
works fine. The new mapping file was generated with kodo2migrator.
Did I misunderstand the documentation or is this an RC1-error?Did you use the mappingtool to import the .mapping file created with
kodo2migrator into .jdo metadata extensions?I've mapped the mapping information back to the .jdo-files, removed the
mapping files and tried to start again with "kodo.jdbc.MappingFactory:
metadata". Unfortunately it did not work.
I'm using Oracle 9.2.0.1.0.
The only properties set next to metadata are:
javax.jdo.option.NontransactionalRead=true
javax.jdo.option.RetainValues=true
javax.jdo.option.Optimistic=true
javax.jdo.PersistenceManagerFactoryClass=kodo.jdbc.runtime.JDBCPersistenceManagerFactory
If I add the property
kodo.jdbc.SchemaFactory=dynamic
to prevent schema synchronization everything next to a bug I'll report
later works fine. I can read + (partially) write to the database.
Here's the stack trace, the .jdo-files come below:
kodo.MetaData :INFO: Parsing metadata resource
"jar:file:/myjar.jar!/firstpackage/package.jdo".
kodo.MetaData :INFO: Parsing metadata resource
"jar:file:/myjar.jar!/secondpackage/package.jdo".
kodo.jdbc.Schema :INFO: Generating tables for schema name "null", table
name "APPLICATION".
kodo.jdbc.Schema :INFO: Generating column information for table
"GAMBLE.APPLICATION".
kodo.jdbc.Schema :INFO: Generating tables for schema name "null", table
name "ZSYS_INTERCEPTOR".
kodo.jdbc.Schema :INFO: Generating column information for table
"GAMBLE.ZSYS_INTERCEPTOR".
kodo.jdbc.meta.MappingInfoNotFoundException: The mapping for field
"secondpackage.InterceptorDefImpl.application" is missing information on
how to link the field to the related class table, or the given information
is invalid.
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:89)
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:75)
at
kodo.jdbc.meta.OneToOneFieldMapping.fromMappingInfo(OneToOneFieldMapping.java:98)
at
kodo.jdbc.meta.RuntimeMappingProvider.getFieldMapping(RuntimeMappingProvider.java:156)
at
kodo.jdbc.meta.MappingRepository.getFieldMapping(MappingRepository.java:410)
at kodo.jdbc.meta.ClassMapping.getFieldMapping(ClassMapping.java:1048)
at kodo.jdbc.meta.ClassMapping.getMappings(ClassMapping.java:1018)
at
kodo.jdbc.meta.ClassMapping.getDeclaredFieldMappings(ClassMapping.java:781)
at kodo.jdbc.meta.ClassMapping.resolve(ClassMapping.java:936)
at kodo.jdbc.meta.BaseClassMapping.resolve(BaseClassMapping.java:302)
at kodo.jdbc.meta.MappingRepository.resolve(MappingRepository.java:381)
at kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:298)
at
kodo.jdbc.meta.MappingRepository.getMappings(MappingRepository.java:272)
at
kodo.jdbc.meta.MappingRepository.getMetaDatas(MappingRepository.java:256)
at kodo.query.QueryImpl.internalCompile(QueryImpl.java:559)
at kodo.query.QueryImpl.compile(QueryImpl.java:523)
---------------- First mapping file
<jdo>
<package name="firstpackage">
<class name="ApplicationDefImpl">
<extension vendor-name="kodo" key="class-column" value="none"/>
<extension vendor-name="kodo" key="jdbc-class-map"
value="base">
<extension vendor-name="kodo" key="pk-column" value="ID"/>
<extension vendor-name="kodo" key="table"
value="APPLICATION"/>
</extension>
<extension vendor-name="kodo" key="jdbc-version-ind"
value="version-number">
<extension vendor-name="kodo" key="column"
value="VERSION"/>
</extension>
<extension vendor-name="kodo" key="lock-column"
value="VERSION"/>
<extension vendor-name="kodo" key="pk-column" value="ID"/>
<extension vendor-name="kodo" key="table" value="APPLICATION"/>
<field name="interceptors">
<collection
element-type="secondpackage.InterceptorDefImpl"/>
<extension vendor-name="kodo" key="inverse"
value="application"/>
<extension vendor-name="kodo" key="jdbc-field-map"
value="one-many">
<extension vendor-name="kodo" key="ref-column.ID"
value="APPLICATION_ID"/>
<extension vendor-name="kodo" key="table"
value="ZSYS_INTERCEPTOR"/>
</extension>
</field>
</class>
</package>
</jdo>
---------------- Second mapping file
<jdo>
<package name="secondpackage">
<class name="InterceptorDefImpl">
<extension vendor-name="kodo" key="class-column" value="none"/>
<extension vendor-name="kodo" key="jdbc-class-map"
value="base">
<extension vendor-name="kodo" key="pk-column" value="ID"/>
<extension vendor-name="kodo" key="table"
value="ZSYS_INTERCEPTOR"/>
</extension>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="pk-column" value="ID"/>
<extension vendor-name="kodo" key="table"
value="ZSYS_INTERCEPTOR"/>
<field name="interceptor" persistence-modifier="none"/>
<field name="application">
<extension vendor-name="kodo" key="data-column"
value="APPLICATION_ID"/>
<extension vendor-name="kodo" key="jdbc-field-map"
value="one-one">
<extension vendor-name="kodo" key="column.JDOIDX"
value="APPLICATION_ID"/>
</extension>
</field>
</class>
</package>
</jdo> -
I am trying to add jdbc to my project and find that jdbc components seem to be missing
compiles and runs fine in IDE
but when I try to run outside IDE I get this error
Exception in thread "main" java.lang.NoClassDefFoundError: org/netbeans/lib/sql/
DataNavigatorhere is my log file
Log Session: Sunday, May 22, 2005 10:17:39 PM EDT
System Info: Product Version = Sun(tm) Java(tm) Studio Enterprise 7 2004Q4 (Build 041123)
IDE Versioning = IDE/1 spec=4.26.1 impl=041123
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.4.2_05; Java HotSpot(TM) Client VM 1.4.2_05-b04; Sun Microsystems Inc.
Java Home = C:\j2sdk1.4.2_05\jre
System Locale; Encod. = en_US (f4j_ee); Cp1252
Home Dir; Current Dir = C:\Documents and Settings\dale; C:\Sun\jstudio_04Q4\Ent_04Q4\bin
IDE Install; User Dir = C:\Sun\jstudio_04Q4\Ent_04Q4; C:\Documents and Settings\dale\.jstudio\Ent04Q4
CLASSPATH = C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\boot.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\Describe.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\DescribeIDE.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\jaxen.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\logger.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\msv.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\parser.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\saxpath.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\Tidy.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsgdtj55.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsgetj55.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsglt55.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsgltc55.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsgltjava55.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\ext\tsgmtj55.jar;C:\j2sdk1.4.2_05\lib\dt.jar;C:\j2sdk1.4.2_05\lib\tools.jar;C:\Sun\jstudio_04Q4\AppServer7\pointbase\client_tools\lib\pbclient42RE.jar
Boot & ext classpath = C:\j2sdk1.4.2_05\jre\lib\rt.jar;C:\j2sdk1.4.2_05\jre\lib\i18n.jar;C:\j2sdk1.4.2_05\jre\lib\sunrsasign.jar;C:\j2sdk1.4.2_05\jre\lib\jsse.jar;C:\j2sdk1.4.2_05\jre\lib\jce.jar;C:\j2sdk1.4.2_05\jre\lib\charsets.jar;C:\j2sdk1.4.2_05\jre\classes;C:\j2sdk1.4.2_05\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.2_05\jre\lib\ext\jai_codec.jar;C:\j2sdk1.4.2_05\jre\lib\ext\jai_core.jar;C:\j2sdk1.4.2_05\jre\lib\ext\ldapsec.jar;C:\j2sdk1.4.2_05\jre\lib\ext\localedata.jar;C:\j2sdk1.4.2_05\jre\lib\ext\mlibwrapper_jai.jar;C:\j2sdk1.4.2_05\jre\lib\ext\sunjce_provider.jar
Dynamic classpath = C:\Sun\jstudio_04Q4\Ent_04Q4\lib\patches\TopLogging.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\core.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\openfile-cli.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\openide-loaders.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\openide.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\locale\core_f4j.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\locale\core_f4j_ee.jar;C:\Sun\jstudio_04Q4\Ent_04Q4\lib\locale\openide_f4j.jar
Patched TopLogging from crash-reporter.nbm
[org.netbeans.core.modules #4] Warning - had to upgrade dependencies for module com.sun.xml.registry1_0_01: added = [module org.netbeans.libs.xerces/1 > 1.2] removed = [package org.apache.xerces.parsers[SAXParser], package org.apache.xml.serialize[XMLSerializer]]; details: [Xerces is now available only as an autoload module, not in classpath: http://libs.netbeans.org/#xerces]
[org.netbeans.core.modules #4] Warning: the extension C:\Sun\jstudio_04Q4\Ent_04Q4\modules\autoload\ext\namespace1_3.jar may be multiply loaded by modules: [C:\Sun\jstudio_04Q4\Ent_04Q4\modules\autoload\jaxr-module-1-3.jar, C:\Sun\jstudio_04Q4\Ent_04Q4\modules\autoload\jax-qname-module.jar]; see: http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/classpath.html#class-path
Module patch or custom extension: C:\Sun\jstudio_04Q4\Ent_04Q4\modules\patches\org-netbeans-modules-editor\codetemplatesPatches.jar
[org.netbeans.core.modules #4] Warning - had to upgrade dependencies for module org.netbeans.modules.jarpackager: added = [module org.netbeans.libs.regexp > 1.2] removed = [package org.apache.regexp > 1.2]; details: [Regexp is now available only as an autoload module, not on classpath: http://libs.netbeans.org/#regexp]
[org.netbeans.core.modules #4] Warning - had to upgrade dependencies for module org.netbeans.modules.refactoring: added = [module org.openide.debugger > 1.0, token org.openide.compiler.CompilationEngine, module org.openide.compiler > 1.0, token org.openide.TopManager, module org.openide.execution > 1.0, token org.openide.windows.IOProvider, module org.openide.deprecated > 1.0, token org.openide.execution.ExecutionEngine] removed = []; details: [API separation phase I (#19443): http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-I, API separation phase II (#19443): http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-II, Debugger API separation (#29914): http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-III]
[org.netbeans.core.modules #4] Warning - had to upgrade dependencies for module org.netbeans.modules.web.tomcat.tomcat40: added = [module org.netbeans.libs.xerces/1 > 1.2] removed = [package [org.apache.xml.serialize.EncodingInfo]]; details: [Xerces is now available only as an autoload module, not in classpath: http://libs.netbeans.org/#xerces]
[org.netbeans.core.modules #4] Warning - had to add recursive class loader dependencies for module org.netbeans.modules.refactoring on [org.netbeans.modules.classfile]; see http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-indirect-dep-cp
[org.netbeans.core.modules #4] Warning - had to add recursive class loader dependencies for module com.sun.forte4j.j2ee.debugger on [org.openidex.util, org.netbeans.modules.web.core, org.netbeans.modules.schema2beans, org.netbeans.api.xml, org.netbeans.modules.jarpackager, javax.activation, org.netbeans.modules.vcscore, org.netbeans.libs.jaxp, org.netbeans.libs.xerces, org.netbeans.modules.projects, org.netbeans.modules.logger, org.netbeans.modules.html, com.sun.forte4j.j2ee.lib, org.netbeans.modules.clazz, javax.mail, org.netbeans.modules.image, com.sun.forte4j.modules.depclass, org.netbeans.libs.regexp]; see http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-indirect-dep-cp
[org.netbeans.core.modules #6] Warning: the module org.netbeans.modules.jarpackager uses org.netbeans.libs.regexp which is deprecated: JDK 1.4 includes regular expression support which should be used instead: http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.6-jre-regexp
[org.netbeans.core.modules #6] Warning: the module org.netbeans.modules.projects uses org.openide.deprecated which is deprecated: Clients of obsoleted Open APIs are encouraged to remove this dependency. See http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-I
[org.netbeans.core.modules #6] Warning: the module org.netbeans.modules.refactoring uses org.openide.deprecated which is deprecated: Clients of obsoleted Open APIs are encouraged to remove this dependency. See http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-I
[org.netbeans.core.modules #6] Warning: the module com.embarcadero.netbeans uses org.openide.deprecated which is deprecated: Clients of obsoleted Open APIs are encouraged to remove this dependency. See http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-I
[org.netbeans.core.modules #6] Warning: the module com.sun.forte4j.j2ee.debugger uses org.openide.deprecated which is deprecated: Clients of obsoleted Open APIs are encouraged to remove this dependency. See http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-I
Type Groups Level Module Name
err * 255 * (Default)
Type Groups Level Module Name
err * 255 * (Default)
cfg 9 255 com.sun.forte4j.webdesigner
Last execution suffered an abnormal exit at Sunday, May 22, 2005 10:15:18 PM EDT
Log file not specified
Turning on modules:
org.openide/1 [4.26.1 041123]
org.openide.loaders [4.11.1 041123]
org.netbeans.core/1 [1.21.1 041123]
org.openide.io [1.1.1 041123]
org.netbeans.lib.terminalemulator [1.1.1 041123]
org.netbeans.core.output/1 [1.1.1 041123]
com.sun.tools.ide.collab/1 [7.0.0 041123]
com.sun.im [7.0.0 041123]
org.openide.src [1.1.1 041123]
org.openide.execution [1.1.1 041123]
org.openide.compiler [1.2.1 041123]
org.netbeans.core.compiler/1 [1.4.1 041123]
org.openide.debugger [1.1.1 041123]
org.netbeans.modules.editor/1 [1.14.1 041123]
org.netbeans.libs.xalan/1 [1.4.1 2.5.2]
org.netbeans.libs.jaxp/1 [1.2.1 1.1.2]
org.netbeans.api.xml/1 [1.3.1.3.6.0 3.6.0 041123]
org.netbeans.modules.xml.core/2 [1.1.1.3.6.0 3.6.0 041123]
org.netbeans.modules.xml.text/2 [1.1.1.3.6.0 3.6.0 041123]
org.netbeans.modules.classfile/1 [1.8 041123]
org.netbeans.core.execution/1 [1.3.1 041123]
org.netbeans.modules.clazz/1 [1.13.1 041123]
org.netbeans.modules.javahelp/1 [2.1.1 041123]
org.netbeans.modules.db/1 [1.8.2 041123]
com.sun.forte4j.modules.dbmodel.jdbcimpl/1 [7.0.0 041123]
org.openide.deprecated [1.3.1 041123]
org.netbeans.core.deprecated [1.3.1 041123]
org.netbeans.modules.debugger.core/3 [2.10.1 041123]
org.netbeans.modules.debugger.jpda/1 [1.17.1 041123]
org.netbeans.modules.j2eeserver/2 [1.7.3 041123]
org.apache.xalan [2.2.2 Xalan 2.2.0 release]
org.netbeans.modules.image/1 [1.11.1 041123]
javax.activation/1 [1.0.2 1.0.2]
javax.mail/1 [1.1.4 1.1.4]
org.netbeans.modules.logger/1 [1.5 041123]
com.sun.forte4j.modules.depclass/1 [2.4 041123]
org.openidex.util/2 [2.7.1 041123]
org.netbeans.modules.vcscore/1 [1.9.1 041123]
org.netbeans.libs.regexp [1.2.1 1.2]
org.netbeans.modules.jarpackager/2 [1.13.3 041123]
org.netbeans.modules.schema2beans/1 [1.4.3 041123]
org.netbeans.api.java/1 [1.3.1 041123]
org.netbeans.libs.xerces/1 [1.4.1 2.6.0]
org.netbeans.modules.java/1 [1.16.1 041123]
com.sun.ffj.modules.licensemgr/1 [7.0.0 041123]
com.sun.forte4j.j2ee.lib/1 [7.0.0 041123]
com.sun.forte4j.j2ee.ejb/1 [7.0.0 041123]
com.sun.forte4j.j2ee.ejbmodule/1 [7.0.0 041123]
org.netbeans.modules.projects/1 [1.14.1 041123]
org.netbeans.modules.html/1 [1.12.1 041123]
org.netbeans.modules.web.core/1 [1.16.3 041123]
com.sun.forte4j.j2ee.appasm/1 [7.0.0 041123]
com.sun.forte4j.j2ee.appclient/1 [7.0.0 041123]
com.sun.forte4j.j2ee.j2eeconn/1 [7.0.0 041123]
com.sun.forte4j.j2ee.importear/1 [7.0.0 041123]
org.netbeans.modules.diff/1 [1.7.1 041123]
org.netbeans.modules.vcs.advanced/1 [1.9.1 041123]
org.netbeans.modules.vcs.profiles.clearcase/1 [1.2 041123]
org.netbeans.modules.xml.catalog/2 [1.1.1.3.6.0 3.6.0 041123]
org.netbeans.modules.properties/1 [1.11.1 041123]
org.netbeans.modules.i18n/1 [1.14.1 041123]
org.netbeans.modules.javadoc/1 [1.11.1 041123]
javax.xml.namespace/1 [1.0 1.0]
com.sun.xml.messaging1_3/1 [1.0 1.0]
com.sun.xml.registry1_3/1 [1.0 1.0]
com.sun.tools.jaxrpc_cmn/1 [1.1 1.1]
com.sun.xml.rpc1_3/1 [1.0 1.0]
com.sun.forte4j.j2ee.wsdl/1 [7.0.0 041123]
org.netbeans.modules.servletapi23/1 [1.3.2 041123]
org.netbeans.modules.web.jspparser/1 [1.5.2 041123]
org.netbeans.modules.web.tomcat.tomcat40/1 [1.8.3 041123]
com.sun.forte4j.genericgenerator4/1 [1.1.1 020327]
org.netbeans.modules.web.ie/1 [1.15.3 041123]
com.sun.forte4j.webdesigner.xmlservice/1 [7.0.0 041123]
com.sun.tools.ide.j2eeant/1 [7.0.0 041123]
org.netbeans.modules.xml.schema/1 [1.1.1.3.6.0 3.6.0 041123]
org.netbeans.modules.filecopy/1 [1.11 041123]
org.netbeans.modules.group/1 [1.0.1 041123]
org.netbeans.modules.settings/1 [1.4.1 041123]
org.netbeans.tasklistapi/1 [1.7.1.2 2 041123]
org.netbeans.modules.tasklist.core/2 [1.22.1.26 6 041123]
org.netbeans.modules.suggestions_framework/2 [1.2.1.265 5 041123]
org.netbeans.modules.tasklist.docscan/2 [1.13.1.2653 3 041123]
com.sun.forte4j.codetemplates/1 [7.0.0 @BUILD_NUMBER_SUBST@]
com.sun.tools.vcsscc/1 [7.0.0 041123]
com.sun.tools.vcsscc.profiles.vss/1 [7.0.0 041123]
com.sun.forte4j.modules.pointbase/1 [7.0.0 041123]
org.netbeans.core.windows/2 [2.0.1 041123]
org.netbeans.core.ui/1 [1.3.1 041123]
org.netbeans.modules.utilities/1 [1.15.1 041123]
org.netbeans.modules.autoupdate/1 [2.8.1 041123]
org.netbeans.modules.welcome/1 [1.5.1 041123]
org.apache.soap [2.2.1 SOAP 2.2 release]
org.netbeans.lib.cvsclient/1 [1.8.1 041123]
org.netbeans.modules.vcs.profiles.cvsprofiles/1 [1.3.1 041123]
org.netbeans.modules.applet/1 [1.14.1 041123]
org.netbeans.modules.web.debug/1 [1.8.2 041123]
org.netbeans.modules.web.core.syntax/1 [1.12.3 041123]
com.sun.jato.tools.sunone.ee/1 [2.1.4 20041123.213634]
org.netbeans.modules.usersguide/1 [1.13.1 041123]
com.sun.forte4j.ee_examples/1 [7.0.0 041123]
org.netbeans.modules.css/2 [1.1.1.3.6.0 3.6.0 041123]
com.sun.tools.j2mews/1 [7.0.0 041123]
org.ksoap/1 [1.0.1 kSOAP release 1.0]
org.netbeans.modules.vcs.cmdline.compat/1 [1.3.1 041123]
org.netbeans.modules.form/2 [1.13.1 041123]
com.sun.tools.ide.collab.channel.mdc/1 [7.0.0 041123]
org.netbeans.modules.servletapi/1 [1.3.1 041123]
org.netbeans.modules.web.taglibed/1 [1.11.3 041123]
com.sun.tools.dbdrivers/1 [7.0.0 041123]
org.netbeans.modules.refactoring/1 [7.0.0 041123]
org.netbeans.modules.web.assemblee/1 [1.2.1 041123]
com.sun.tools.ide.portal.portlet/1 [1.0 041123]
com.sun.tools.crashreporter [7.0.0 041123]
org.netbeans.modules.text/1 [1.12.1 041123]
com.embarcadero.netbeans/2 [1.0 041123]
com.sun.tools.modules.cvsdisabler/1 [7.0.0 041123]
com.sun.tools.vcsscc.profiles.pvcs/1 [7.0.0 041123]
com.sun.tools.ide.collab.channel.chat/1 [7.0.0 041123]
org.netbeans.modules.i18n.form/2 [1.12 041123]
org.netbeans.modules.properties.syntax/1 [1.11 041123]
org.netbeans.modules.cvsclient/1 [2.0.1 041123]
com.sun.tools.ide.collab.channel.filesharing/1 [7.0.0 041123]
com.sun.forte4j.j2ee.ejbtest/1 [7.0.0 041123]
org.netbeans.modules.httpserver/1 [1.13.1 041123]
org.netbeans.modules.jdbc/1 [7.0.0 041123]
com.sun.jdo.modules.persistence.mapping.core/1 [7.0.0 041123]
com.sun.jdo.modules.persistence.mapping.ejb/1 [7.0.0 041123]
org.netbeans.modules.web.tomcat.tomcat40.autocompile/1 [7.0.0 041123]
org.netbeans.modules.junit/2 [2.11.1 041123]
com.sun.ffj.modules.registration/1 [7.0.0 041123]
org.netbeans.modules.xsl/1 [1.1.1.3.6.0 3.6.0 041123]
com.sun.forte4j.webdesigner.jwsdp/1 [7.0.0 041123]
org.netbeans.modules.extbrowser/1 [1.3.1 041123]
com.sun.forte4j.j2ee.debugger/1 [7.0.0 041123]
com.sun.xml.messaging1_0_01/1 [1.0 1.0]
com.sun.xml.rpc1_0_01/1 [1.0 1.0]
org.netbeans.modules.web.monitor/1 [1.8.3 041123]
org.netbeans.core.ide/1 [1.3.1 041123]
org.apache.tools.ant.module/3 [3.6.1 041123]
javax.portlet/1 [1.0 041123]
org.netbeans.modules.autoupdateffj/1 [7.0.0 041123 ]
com.sun.tools.profiler.monitor [7.2.4 041123]
org.netbeans.modules.beans/1 [1.11.1 041123]
com.sun.enterprise.webserver.tools/1 [7.0.0 PLUGINVERSION]
com.sun.portal.devtool/1 [1.0 041123]
com.sun.tools.ide.collab.ui/1 [7.0.0 041123]
org.netbeans.modules.xml.tax/2 [1.1.1.3.6.0 3.6.0 041123]
org.netbeans.modules.xml.tools/2 [1.1.1.3.6.0 3.6.0 041123]
com.sun.appserv.tools.forte/1 [7.0.0 041123]
org.netbeans.modules.web.dd.editors/1 [1.1.2 041123]
QuantumAutoupdateModule 1116814706515 starting check
Warning - org.netbeans.modules.projects.SetMainClassCookieAction should override CallableSystemAction.asynchronous() to return false
Warning - org.netbeans.modules.debugger.delegator.DefaultDebuggerType should have overridden startDebugger(DataObject,boolean); falling back on deprecated ExecInfo usage; see: http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.5i-sep-II-ExecInfo -
CaptureSchema from PointBase Problem
I am having trouble getting my dbcapture schema for inclusion in the
ear file.
According to the J2EE 1.4 application Server, Developer's Guide,
November 2003 (p82) , I need to run a command like:
capture-schema -dburl jdbc:pointbase:server://localhost:9092/sample
-username public -password public -drive com.pointbase.jdbc.jdbcUniversalDriver
-table C -out C.dbschemaThen, I include C in the <schema>C</schema> entry in the sun-cmp-mappings.xml
file.
When I do that command, I get the following error message
using dburl: jdbc:pointbase:server://localhost:9092/sample
using username: public
using password: public
using driver:
using schemaname: null
using output file: C.dbschema
JDO71100: Failed to find a class. Verify that the class is available on your
CLASSPATH
java.lang.ClassNotFoundException:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.sun.forte4j.modules.dbmodel.jdbcimpl.ConnectionProvider.<init>
(ConnectionProvider.java:45)
at com.sun.jdo.api.persistence.mapping.ejb.CaptureSchema.main
(CaptureSchema.java:131)
Exception in thread "main" java.lang.NullPointerException
at com.sun.jdo.api.persistence.mapping.ejb.CaptureSchema.main
(CaptureSchema.java:183)Here is my class path:
.:/opt/j2ee/lib/j2ee.jar:/opt/j2ee/lib/j2ee-svc.jar:/opt/j2ee/lib/jsf-api.jar:/opt/j2ee/lib/jsf-impl.jar:/opt/j2ee/lib/appserv-rt.jar:/opt/j2ee/pointbase/lib/pbtools.jar:/opt/j2ee/pointbase/lib/pbclient.jar:/opt/j2ee/pointbase/lib/pbembedded.jarAny hint what I overlooked would be greatly appreciated.
Dr. Laurence Leff, Associate Professor of Computer Science
Western Illinois University, 1 University Circle, Macomb IL 61455
Pager 309 367 0787 Fax 309 298 2302I've never used an embedded db. My connection settings are:
<jdbc-connection-pool connection-validation-method="auto-commit" datasource-classname="com.pointbase.jdbc.jdbcDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" max-pool-size="32" max-wait-time-in-millis="60000" name="jdbc-pointbase-pool" pool-resize-quantity="2" steady-pool-size="8">
<property name="DatabaseName" value="jdbc:pointbase:server://localhost:9092/sample"/>
<property name="Password" value="pbpublic"/>
<property name="User" value="pbpublic"/>
</jdbc-connection-pool>
-- markus. -
Capture-schema issues!!!
I am trying to capture the schema details from pointbase db that come bundled with J2ee 1.4
I am running into :-
D:\>D:\appserver\Sun\bin\capture-schema -dburl jdbc:pointbase:server://localhost
:9092/vinman -schemaname vinman -username apps -password apps -driver com.pointb
ase.jdbc.jdbcUniversalDriver -table CustomerBean -out CustomerBean.dbschema
using dburl: jdbc:pointbase:server://localhost:9092/vinman
using username: apps
using password: apps
using driver: com.pointbase.jdbc.jdbcUniversalDriver
using schemaname: vinman
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at com.sun.forte4j.modules.dbmodel.jdbcimpl.ConnectionProvider.<init>(Co
nnectionProvider.java:46)
at com.sun.jdo.api.persistence.mapping.ejb.CaptureSchema.main(CaptureSch
ema.java:120)
Exception in thread "main" java.lang.NullPointerException
at com.sun.jdo.api.persistence.mapping.ejb.CaptureSchema.main(CaptureSch
ema.java:177)
Can someone please tell what I am doing wrong?
Thanks
VineethLooks like a database/SQL driver issue
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532) -
Hi, Dear All:
I caught this error while I was deploying a EJB to a Sun one 8 application server.
[|[#|2004-06-24T12:52:18.927+1000|SEVERE|sun-appserver-pe8.0|javax.enterprise.system.tools.deployment|_ThreadID=14;|Caught java.lang.RuntimeException while processing CMP beans for application [wsc]; module [uidgen-ejb.jar]: JDO71002: The schema file wsc_uidgen-ejb, does not contain a table named Counter. See log for details.
java.lang.RuntimeException: JDO71002: The schema file wsc_uidgen-ejb, does not contain a table named Counter
at com.sun.jdo.api.persistence.mapping.ejb.MappingFile.intoMappingClasses(MappingFile.java:160)
at com.sun.jdo.spi.persistence.support.ejb.ejbc.MappingGenerator.loadMappingClasses(MappingGenerator.java:429)
at com.sun.jdo.spi.persistence.support.ejb.ejbc.MappingGenerator.generateMapping(MappingGenerator.java:267)
at com.sun.jdo.spi.persistence.support.ejb.ejbc.JDOCodeGenerator.loadOrCreateMappingClasses(JDOCodeGenerator.java:500)
at com.sun.jdo.spi.persistence.support.ejb.ejbc.JDOCodeGenerator.init(JDOCodeGenerator.java:145)
at com.sun.jdo.spi.persistence.support.ejb.ejbc.JDOCodeGenerator.init(JDOCodeGenerator.java:118)
at com.sun.ejb.codegen.CmpCompiler.compile(CmpCompiler.java:143)
at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:617)
at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:565)
at com.sun.enterprise.deployment.backend.EJBCompiler.preDeployApp(EJBCompiler.java:360)
at com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.java:208)
at com.sun.enterprise.deployment.backend.AppDeployer.runEJBC(AppDeployer.java:292)
at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:173)
at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:105)
at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:124)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:74)
at com.sun.enterprise.deployment.phasing.DeploymentService.executePhases(DeploymentService.java:233)
at com.sun.enterprise.deployment.phasing.DeploymentService.deploy(DeploymentService.java:150)
at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(ApplicationsConfigMBean.java:275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:287)
at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:280)
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:221)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:228)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:823)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)
at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:54)
at $Proxy1.invoke(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:282)
at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:38)
at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:92)
at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:69)
at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:768)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:102)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:192)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:261)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:215)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:583)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:200)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:180)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:582)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:161)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:156)
at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:154)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:569)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:979)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:692)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:647)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:691)
at java.lang.Thread.run(Thread.java:534)
|#]
Please Note that I wrote the Sun one cmp mappings by myself, and the mapping files is like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 EJB 2.1//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-cmp-mappings_1_1.dtd">
<sun-cmp-mappings>
<sun-cmp-mapping>
<schema/>
<entity-mapping>
<ejb-name>CounterEJB</ejb-name>
<table-name>Counter</table-name>
<cmp-field-mapping>
<field-name>name</field-name>
<column-name>Counter.Name</column-name>
</cmp-field-mapping>
<cmp-field-mapping>
<field-name>counter</field-name>
<column-name>Counter.CounterValue</column-name>
</cmp-field-mapping>
</entity-mapping>
</sun-cmp-mapping>
</sun-cmp-mappings>
Could Anybody help?
ThanksLooking a the sun-cmp-mapping.xml file that you show, the <schema> element is empty thus leaving the creation of the dbschema file to be generated during deployment. Does your XP box point to the same DB? Are the DB tables created prior to deployment of the app?
-
Hi,
I'm experiencing FK constraint violations in spite of having set
kodo.jdbc.ForeignKeyConstraints:true.
I've got a table that stores queued elements like this:
TABLE QUEUED_ELEMENTS (
ID NUMBER,
NAME VARCHAR2,
NEXT_ELEMENT_ID NUMBER
There is a FK defined:
FOREIGN KEY (NEXT_ELEMENT_ID) REFERENCES QUEUED_ELEMENTS(ID).
The reflexive relation of the JDO class is mapped as one-one relation.
Deleting queued elements leads quite consistently to a FK constraint
violation.
I investigated kodo bug reports and came across bug #900. Does bug #900 also
explain FK constraint violations in this context? When will this bug be
fixed? If this scenario is supposed to work, do you need a test case?
Thanks,
FlorianDeleting queued elements leads quite consistently to a FK constraint
violation.
I investigated kodo bug reports and came across bug #900. Does bug #900 also
explain FK constraint violations in this context?
Bug 900 would not apply in this case. Everything should work fine with
a reflexive relation. One thing to watch out for is to make sure you do
not null the relation when deleting instances. If you null the
relation, Kodo can't "see" the dependency on commit, and so won't order
the SQL appropriately. If you are not nulling the relation, then yes,
we'd need a test case. Please send it to [email protected] -
I am building a two-tiered enterprise app with Swing client and RDBMS backend. Over the last two weeks I've tried applying the DAO pattern to my design, manullay creating numerous DTO and DAO classes. I'm now starting to wonder if it's really worth the effort.
My system is not complicated enough to justify the use of automated OR mapping tools or CMP. Also, the development staff on my team, including myself, have had no expereience in OR mapping and EJB; all we've done in the past involve simple application that accesses the database directly using SQL. We also feel that using SQL directly is adequate in implementing all the functionalities of our system.
Our initial motivation for implementing DAO was to maximize reuse of persistence code, make code more readable and insulate UI/logic code from change in database schema. But it seems we're now spending too much time thinking about how to map database entities to DTOs, what DAOs to have, what DAO methods to define, etc., whereas in the past to get something from the database we could just write an SQL statement.
TIA.I wouldn't do any application without using DAOs and
DTOs.
Perhaps you are focusing to much on the examples
rather than on the pattern itself. Just because the
examples do it does not mean that you have to do it.
You can do with with just one infrustructure class (to
do the connections, statement, etc) and then the
following....
class MyDTO
public String field1;
public String field2;
class MyDAO
static void create(MyDTO p) {...}
static void update(MyDTO p) {...}
static void delete(MyDTO p) {...}
static MyDTO getById(String id) {...}
static ArrayList getBySomethingElse(String
somethingElse) {...}
}And of course if you don't need one of the above
methods then do not implement it.i have been doing almost everything in dao but i m not so sure why dtos are so essential, if you write your pojo well, dtos seem to be totally not needed; unless of course you are passing them across networks in ejb systems, and even that, theses days xmls are recommended instead. am i right?
and lately i havee started using hibernate which i think is great even for small not complecated projects: it does not complicate things, and further, you can still do things in dao with hibernate, i dont see any conficts there: hibernate, jdo are mostly mapping mechnism, and dao is a design pattern.
Maybe you are looking for
-
Hi I updated my iPhone 4 and my Mum's iPhone 4 to software version 5.0. They both use the same apple id and they are both backed up to iCloud. Once I updated my mum's phone i noticed that her contacts are now on my phone i deleted some of them but th
-
Yesterday, while playing Mafia Wars, I kept getting a bar notification that "The game can not load completely because you are missing a plugin? When I clicked on the box I got an 1/2" popup, which probably contains the information I need but it is to
-
How do I get to a diffrent web site from firefox
there is no navigation place to type in a web address How do I get to it if it is not in my bookmarks
-
Brief History: 1. First sync with iBook went fine, everything synced. 2. Edited AddressBook information. 3. Synced again, says it synced contacts, no information on Touch wasn't updated. 4. Noticed that iTunes wasn't pulling updated groups for the iP
-
About Error 1311, help to fix it
I am new here and I havent a glue and couldnt find a glue on how to post a problem I have with the adobe reader, I am at my wits end with it and have tryed everything you all have written about this error 1311. When I go to try to delete it out of my