System.jdo
When I load my application within the servlet environment, koko is
unable to find my system.jdo file. It is located here:
catalina\webapps\at\WEB-INF\classes\system.jdo
The funny thing is that if I create a package.jdo and put it in the
right place, it finds it fine, such as:
catalina\webapps\at\WEB-INF\classes\
com\almostthere\business\data\package.jdo
Also, when I run kodo from the command-line, and have my CLASSPATH set,
it will find the system.jdo file just fine.
Can you explain why it might be able to find the package.jdo file and
not the system.jdo file within the servlet engine? This one has me
stumped! It was also had to zero in on because the message is a bit
round-about (I'm pasting it in below...). Maybe it could just say it
couldn't find any jdo files... ;-)
Thanks,
Dan
2002-03-11 10:42:56,062 [main] INFO frontend.Initialize - Initialize:
init() failed: javax.jdo.JDOFatalUserException: The system could not
initialize; the following registered persistent types are missing
metadata or have not been enhanced: [class
com.almostthere.business.data.DiscountCode, class
com.almostthere.business.data.DebitProduct, class
com.almostthere.business.data.ServiceIntervalPrice, class
com.almostthere.business.data.CreditSession, class
=========== etc, etc, for each class ================
com.almostthere.business.data.DebitSession, class
com.almostthere.business.data.Category].
at
com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory.loadPersistentTypes(JDBCPersistenceManagerFactory.java:306)
at
com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory.setup(JDBCPersistenceManagerFactory.java:269)
at
com.solarmetric.kodo.runtime.PersistenceManagerFactoryImpl.privateSetup(PersistenceManagerFactoryImpl.java:778)
at
com.solarmetric.kodo.runtime.PersistenceManagerFactoryImpl.getConnectionFactory(PersistenceManagerFactoryImpl.java:214)
at
com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory.setLogWriter(JDBCPersistenceManagerFactory.java:188)
Yes, this is a rather strange problem. It has been resolved in an
internal build, and will be available in our next patch release. As you
noticed, the problem only occurs when loading the system.jdo fine --
other .jdo files load just fine.
-Patrick
Patrick Linskey [email protected]
SolarMetric Inc. http://www.solarmetric.com
Similar Messages
-
Placement of .JDO files
Hi,
(my question
Can .JDO files be placed in src folder or some other folder or does it
have to be in the folder containing the class files. )
We have a web application under Tomcat with the structure as
web-inf
-classes
... package structure
- src
... package structure.
Currently we have our .JDO files under the classes folder in the right
package structure. we have individual .JDO file for each object rather
than a package.jdo or a system.jdo (we specify each db column and property
in each file per table)
Can these be placed in src folder or some other folder or does it have to
be in that folder.
when i tried to move the .jdo to the src folder and i tried to enhance an
object, the enhancer said
[java] Enhancing "class Adib.Motiwala.Person"...
[java] Type "Adib.Motiwala.Person" has no metadata; enhancing as
persistence-aware
Please let us know abt this.
Thanks
adib motiwalaThe metadata files must be loadable as a resource from the Classes they pertain to. This is part of the JDO specification. For more information on Java resources, consult the Javadoc for java.lang.Class.getResource() and java.lang.ClassLoader.getResource().
It boils down to this: the metadata files have to be in certain special locations, and those locations have to be in the CLASSPATH. If you put your src/ directory in your CLASSPATH things should work just fine. -
Jdoc: kodo-jdoee.jar vs. kodo-jdo.jar
When I recompile my classes and run jdoc from kodo-jdoee.jar, I get:
C:\aml\src\WEB-INF\classes>jdoc system.jdo
Exception in thread "main" java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:61)
at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
at
com.solarmetric.kodo.meta.JDOMetaDataParser.getDocType(Unknown Source
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at
com.solarmetric.kodo.meta.JDOMetaDataParser.parseMetaData(Unknown Sou
rce)
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at com.solarmetric.kodo.meta.ClassMetaData.newInstance(Unknown
Source)
at com.solarmetric.kodo.meta.ClassMetaData.getInstance(Unknown
Source)
at
com.solarmetric.kodo.impl.jdbc.ormapping.MetaDataVerifier.main(Unknow
n Source)
Exception in thread "main" java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:61)
at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
at
com.solarmetric.kodo.meta.JDOMetaDataParser.getDocType(Unknown Source
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at
com.solarmetric.kodo.meta.JDOMetaDataParser.parseMetaData(Unknown Sou
rce)
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at com.solarmetric.kodo.meta.ClassMetaData.newInstance(Unknown
Source)
at com.solarmetric.kodo.meta.ClassMetaData.getInstance(Unknown
Source)
at com.solarmetric.kodo.enhance.JDOEnhancer.<init>(Unknown Source)
at com.solarmetric.kodo.enhance.JDOEnhancer.enhance(Unknown Source)
at com.solarmetric.kodo.enhance.JDOEnhancer.main(Unknown Source)
However, when I run jdoc from kodo-jdo.jar (everything else unchanged),
it is successful:
C:\aml\src\WEB-INF\classes>set
CLASSPATH=c:\kodo-jdo-2.3.0\lib\kodo-jdo.jar;%CLA
SSPATH%
C:\aml\src\WEB-INF\classes>jdoc system.jdo
Enhancing type "class com.factor3.aml.domain.Entity"...
Enhancing type "class com.factor3.aml.domain.Person"...
Enhancing type "class com.factor3.aml.domain.Account"...
Enhancing type "class com.factor3.aml.domain.Organization"...
Enhancing type "class com.factor3.aml.domain.Vessel"...
Enhancing type "class com.factor3.aml.domain.Association"...
Enhancing type "class com.factor3.aml.domain.Position"...
Enhancing type "class com.factor3.aml.domain.EntityAddress"...
Enhancing type "class com.factor3.aml.domain.Address"...
Enhancing type "class com.factor3.aml.domain.EntityTelephone"...
Enhancing type "class com.factor3.aml.domain.Telephone"...
Enhancing type "class com.factor3.aml.domain.Activity"...
Enhancing type "class com.factor3.aml.domain.Transfer"...
Enhancing type "class com.factor3.aml.domain.Trade"...
Enhancing type "class com.factor3.aml.domain.Credential"...
Enhancing type "class com.factor3.aml.domain.Report"...
Enhancing type "class com.factor3.aml.domain.Country"...
Enhancing type "class com.factor3.aml.domain.Province"...
Enhancing type "class com.factor3.aml.domain.Instrument"...
C:\aml\src\WEB-INF\classes>javap com.factor3.aml.domain.Entity
Compiled from Entity.java
public abstract class com.factor3.aml.domain.Entity extends
java.lang.Object imp
lements java.io.Serializable, javax.jdo.spi.PersistenceCapable {
protected static java.text.SimpleDateFormat df1;When I recompile my classes and run jdoc from kodo-jdoee.jar, I get:
C:\aml\src\WEB-INF\classes>jdoc system.jdo
Exception in thread "main" java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:61)
at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
at
com.solarmetric.kodo.meta.JDOMetaDataParser.getDocType(Unknown Source
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at
com.solarmetric.kodo.meta.JDOMetaDataParser.parseMetaData(Unknown Sou
rce)
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at com.solarmetric.kodo.meta.ClassMetaData.newInstance(Unknown
Source)
at com.solarmetric.kodo.meta.ClassMetaData.getInstance(Unknown
Source)
at
com.solarmetric.kodo.impl.jdbc.ormapping.MetaDataVerifier.main(Unknow
n Source)
Exception in thread "main" java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:61)
at java.io.InputStreamReader.<init>(InputStreamReader.java:55)
at
com.solarmetric.kodo.meta.JDOMetaDataParser.getDocType(Unknown Source
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at
com.solarmetric.kodo.meta.JDOMetaDataParser.parseMetaData(Unknown Sou
rce)
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at
com.solarmetric.modules.tools.compiler.MetaDataParser.parseMetaData(U
nknown Source)
at com.solarmetric.kodo.meta.ClassMetaData.newInstance(Unknown
Source)
at com.solarmetric.kodo.meta.ClassMetaData.getInstance(Unknown
Source)
at com.solarmetric.kodo.enhance.JDOEnhancer.<init>(Unknown Source)
at com.solarmetric.kodo.enhance.JDOEnhancer.enhance(Unknown Source)
at com.solarmetric.kodo.enhance.JDOEnhancer.main(Unknown Source)
However, when I run jdoc from kodo-jdo.jar (everything else unchanged),
it is successful:
C:\aml\src\WEB-INF\classes>set
CLASSPATH=c:\kodo-jdo-2.3.0\lib\kodo-jdo.jar;%CLA
SSPATH%
C:\aml\src\WEB-INF\classes>jdoc system.jdo
Enhancing type "class com.factor3.aml.domain.Entity"...
Enhancing type "class com.factor3.aml.domain.Person"...
Enhancing type "class com.factor3.aml.domain.Account"...
Enhancing type "class com.factor3.aml.domain.Organization"...
Enhancing type "class com.factor3.aml.domain.Vessel"...
Enhancing type "class com.factor3.aml.domain.Association"...
Enhancing type "class com.factor3.aml.domain.Position"...
Enhancing type "class com.factor3.aml.domain.EntityAddress"...
Enhancing type "class com.factor3.aml.domain.Address"...
Enhancing type "class com.factor3.aml.domain.EntityTelephone"...
Enhancing type "class com.factor3.aml.domain.Telephone"...
Enhancing type "class com.factor3.aml.domain.Activity"...
Enhancing type "class com.factor3.aml.domain.Transfer"...
Enhancing type "class com.factor3.aml.domain.Trade"...
Enhancing type "class com.factor3.aml.domain.Credential"...
Enhancing type "class com.factor3.aml.domain.Report"...
Enhancing type "class com.factor3.aml.domain.Country"...
Enhancing type "class com.factor3.aml.domain.Province"...
Enhancing type "class com.factor3.aml.domain.Instrument"...
C:\aml\src\WEB-INF\classes>javap com.factor3.aml.domain.Entity
Compiled from Entity.java
public abstract class com.factor3.aml.domain.Entity extends
java.lang.Object imp
lements java.io.Serializable, javax.jdo.spi.PersistenceCapable {
protected static java.text.SimpleDateFormat df1; -
Query Issue with adding a static value
I have written a query in SAP that works the way I need it to. I am going to schedule it so that SAP does a file transfer of the output to another area where the data will be accumulated.
My problem is that I want the name of the system to appear at the end of each line but it is not in any table I can find to match up with the userid.
EX:
UserID Group System
JDOE HR Query Group P201
The field for system is not in any tables but I want to add it and give it a constant/static value all the time in the output.
Any ideas?
Thanks!
Justin Dauby -- SAP Security Analyst
Kimball International Inc.,The name of the system is not in a table, but rather a structure called SYST. You can evaluate it using the system field sy-sysid.
Another option is to call function module RFC_SYSTEM_INFO. The export parameter RFCSI_EXPORT will deliver the system id from component RFCSYSID of the structure RFCSI.
Cheers,
Julius -
Error in running refresh (META DATA)
I am evaluating the product and I am trying to map my objects to an
existing schema. However, I getting an exception i can't seem to figure
out....
Is this a bug or is it my own doing?
Here is the table:
TUSER
USER_ID | LASTNM | USERNM | FIRSTNM | .........
| | | | .........
USER_ID is PK!!!
Here is the system.jdo file:
<?xml version="1.0"?>
<jdo>
<package name="com.gulfnet.groupcast.data">
<class name="User" identity-type="datastore">
<extension vendor-name="kodo" key="table" value="TUSER"/>
<extension vendor-name="kodo" key="pk-column" value="USER_ID"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="class-column" value="none"/>
<field name="_username" persistence-modifier="none"
primary-key="true" null-value="none">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="USER_ID"/>
</field>
<field name="_firstName">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="USERNM"/>
</field>
<field name="_lastName">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="LASTNM"/>
</field>
<field name="_contactInfo">
<map key-type="PhoneNumber"/>
<extension vendor-name="kodo" key="inverse"
value="_username"/>
<extension vendor-name="kodo" key="data-column" value="TEL"/>
</field>
<field name="_birthDate">
<extension vendor-name="kodo" key="data-column"
value="REG_DATE"/>
</field>
</class>
<class name="EmailAccount">
<extension vendor-name="kodo" key="table" value="TUSER"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="class-column" value="none"/>
<field name="_username">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="MailUserID"/>
</field>
<field name="_password">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="EPASSWD"/>
</field>
<field name="_emailAddress">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="RETEMAIL"/>
</field>
<field name="_serverName">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="MSG_SERVER"/>
</field>
</class>
<class name="PhoneNumber">
<extension vendor-name="kodo" key="table" value="TUSER"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="class-column" value="none"/>
<field name="_countryCode">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="TEL"/>
</field>
<field name="_areaCode">
<extension vendor-name="kodo" key="column-length"
value="50"/>
<extension vendor-name="kodo" key="data-column"
value="FAX"/>
</field>
</class>
<class name="Address">
<extension vendor-name="kodo" key="table" value="TUSER"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="class-column" value="none"/>
<field name="_streetAddress">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="ADDRESS1"/>
</field>
<field name="_city">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="ADDRESS2"/>
</field>
</class>
<class name="Attachment"/>
<class name="InstantMessengerAddress"/>
<class name="UserStatus"/>
<class name="MessagePriority"/>
<class name="MessageStatus"/>
<class name="Organisation">
<field name="_subsidiaries">
<collection element-type="Organisation"/>
</field>
<field name="_employees">
<collection element-type="User"/>
</field>
<field name="_orgUnits">
<collection element-type="OrgUnit"/>
</field>
</class>
<class name="OrgUnit">
<field name="_employees">
<collection element-type="User"/>
</field>
<field name="_subUnits">
<collection element-type="OrgUnit"/>
</field>
</class>
<class name="Route">
<field name="_recipients">
<collection element-type="EmailAccount"/>
</field>
</class>
<class name="GcMessage">
<field name="_route">
<collection element-type="Route"/>
</field>
<field name="_attachments">
<collection element-type="Attachment"/>
</field>
</class>
</package>
</jdo>
After running my enhancer and then running the refresh. I get an unusual
exception.
Here is my enhance:
[copy] Copying 1 file to C:\GC50\GroupCast\dev\build\WEB-INF\classes
[copy] Copying 1 file to C:\GC50\GroupCast\dev\build
[copy] Copying 1 file to C:\GC50\GroupCast\dev\build\WEB-INF\classes
[java] Enhancing "class com.gulfnet.groupcast.data.User"...
[java] Enhancing "class com.gulfnet.groupcast.data.EmailAccount"...
[java] Enhancing "class com.gulfnet.groupcast.data.PhoneNumber"...
[java] Enhancing "class com.gulfnet.groupcast.data.Address"...
[java] Enhancing "class com.gulfnet.groupcast.data.Attachment"...
[java] Enhancing "class
com.gulfnet.groupcast.data.InstantMessengerAddress"...
[java] Enhancing "class com.gulfnet.groupcast.data.UserStatus"...
[java] Enhancing "class com.gulfnet.groupcast.data.MessagePriority"...
[java] Enhancing "class com.gulfnet.groupcast.data.MessageStatus"...
[java] Enhancing "class com.gulfnet.groupcast.data.Organisation"...
[java] Enhancing "class com.gulfnet.groupcast.data.OrgUnit"...
[java] Enhancing "class com.gulfnet.groupcast.data.Route"...
[java] Enhancing "class com.gulfnet.groupcast.data.GcMessage"...
refreshDataStore:
[echo] refreshing data stores
[java] javax.jdo.JDOFatalDataStoreException: An error occurred while
connecting to the data store.
[java] NestedThrowables:
[java] java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC][SQLServer]There is already an object named 'JDO_SCHEMA_METADATAX' in
the datab
ase.
[java] at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.<init>(SchemaTool.java:99)
[java] at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1114)
[java] at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1083)
[java] at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1073)
[java] at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1064)
[java] Exception in thread "main"
BUILD FAILED
C:\GC50\GroupCast\dev\andrew.xml:151: Java returned: 1
I have deleted this table and it seems to be throwing this error while it
creates the table. That is the only table JDO ends up creating before the
refresh crashes.
Andrew.Andrew,
It sounds like the username that you are using to connect to the data store
might not have access to read the JDO_SCHEMA_METADATAX table from the JDBC
database metadata. Since you are mapping to an existing schema, you should
not have to run schematool at all -- try just listing all your persistent
types in preferences/properties as described in our documentation instead of
registering the persistent types in the JDO_SCHEMA_METADATAX table.
Additionally, there are a couple of problems with your XML metadata. When
using datastore identity, you cannot use the 'primary-key=true' setting for
a field -- Kodo is responsible for managing the primary key, and you do not
have direct access to it.
If you need direct access to the id fields, then you should use application
identity. Alternately, you can extract the long value from our underlying
datastore identity type, but that requires using Kodo-specific code.
-Patrick
On 6/26/02 7:13 AM, "Andrew" <[email protected]> wrote:
I am evaluating the product and I am trying to map my objects to an
existing schema. However, I getting an exception i can't seem to figure
out....
Is this a bug or is it my own doing?
Here is the table:
TUSER
USER_ID | LASTNM | USERNM | FIRSTNM | .........
| | | | .........
USER_ID is PK!!!
Here is the system.jdo file:
<?xml version="1.0"?>
<jdo>
<package name="com.gulfnet.groupcast.data">
<class name="User" identity-type="datastore">
<extension vendor-name="kodo" key="table" value="TUSER"/>
<extension vendor-name="kodo" key="pk-column" value="USER_ID"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="class-column" value="none"/>
<field name="_username" persistence-modifier="none"
primary-key="true" null-value="none">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="USER_ID"/>
</field>
<field name="_firstName">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="USERNM"/>
</field>
<field name="_lastName">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="LASTNM"/>
</field>
<field name="_contactInfo">
<map key-type="PhoneNumber"/>
<extension vendor-name="kodo" key="inverse"
value="_username"/>
<extension vendor-name="kodo" key="data-column" value="TEL"/>
</field>
<field name="_birthDate">
<extension vendor-name="kodo" key="data-column"
value="REG_DATE"/>
</field>
</class>
<class name="EmailAccount">
<extension vendor-name="kodo" key="table" value="TUSER"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="class-column" value="none"/>
<field name="_username">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="MailUserID"/>
</field>
<field name="_password">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="EPASSWD"/>
</field>
<field name="_emailAddress">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="RETEMAIL"/>
</field>
<field name="_serverName">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="MSG_SERVER"/>
</field>
</class>
<class name="PhoneNumber">
<extension vendor-name="kodo" key="table" value="TUSER"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="class-column" value="none"/>
<field name="_countryCode">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="TEL"/>
</field>
<field name="_areaCode">
<extension vendor-name="kodo" key="column-length"
value="50"/>
<extension vendor-name="kodo" key="data-column"
value="FAX"/>
</field>
</class>
<class name="Address">
<extension vendor-name="kodo" key="table" value="TUSER"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="class-column" value="none"/>
<field name="_streetAddress">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="ADDRESS1"/>
</field>
<field name="_city">
<extension vendor-name="kodo" key="column-length"
value="255"/>
<extension vendor-name="kodo" key="data-column"
value="ADDRESS2"/>
</field>
</class>
<class name="Attachment"/>
<class name="InstantMessengerAddress"/>
<class name="UserStatus"/>
<class name="MessagePriority"/>
<class name="MessageStatus"/>
<class name="Organisation">
<field name="_subsidiaries">
<collection element-type="Organisation"/>
</field>
<field name="_employees">
<collection element-type="User"/>
</field>
<field name="_orgUnits">
<collection element-type="OrgUnit"/>
</field>
</class>
<class name="OrgUnit">
<field name="_employees">
<collection element-type="User"/>
</field>
<field name="_subUnits">
<collection element-type="OrgUnit"/>
</field>
</class>
<class name="Route">
<field name="_recipients">
<collection element-type="EmailAccount"/>
</field>
</class>
<class name="GcMessage">
<field name="_route">
<collection element-type="Route"/>
</field>
<field name="_attachments">
<collection element-type="Attachment"/>
</field>
</class>
</package>
</jdo>
After running my enhancer and then running the refresh. I get an unusual
exception.
Here is my enhance:
[copy] Copying 1 file to C:\GC50\GroupCast\dev\build\WEB-INF\classes
[copy] Copying 1 file to C:\GC50\GroupCast\dev\build
[copy] Copying 1 file to C:\GC50\GroupCast\dev\build\WEB-INF\classes
[java] Enhancing "class com.gulfnet.groupcast.data.User"...
[java] Enhancing "class com.gulfnet.groupcast.data.EmailAccount"...
[java] Enhancing "class com.gulfnet.groupcast.data.PhoneNumber"...
[java] Enhancing "class com.gulfnet.groupcast.data.Address"...
[java] Enhancing "class com.gulfnet.groupcast.data.Attachment"...
[java] Enhancing "class
com.gulfnet.groupcast.data.InstantMessengerAddress"...
[java] Enhancing "class com.gulfnet.groupcast.data.UserStatus"...
[java] Enhancing "class com.gulfnet.groupcast.data.MessagePriority"...
[java] Enhancing "class com.gulfnet.groupcast.data.MessageStatus"...
[java] Enhancing "class com.gulfnet.groupcast.data.Organisation"...
[java] Enhancing "class com.gulfnet.groupcast.data.OrgUnit"...
[java] Enhancing "class com.gulfnet.groupcast.data.Route"...
[java] Enhancing "class com.gulfnet.groupcast.data.GcMessage"...
refreshDataStore:
[echo] refreshing data stores
[java] javax.jdo.JDOFatalDataStoreException: An error occurred while
connecting to the data store.
[java] NestedThrowables:
[java] java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC][SQLServer]There is already an object named 'JDO_SCHEMA_METADATAX' in
the datab
ase.
[java] at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.<init>(SchemaTool.java:99)
[java] at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1114)
[java] at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1083)
[java] at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1073)
[java] at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(SchemaTool.java:1064)
[java] Exception in thread "main"
BUILD FAILED
C:\GC50\GroupCast\dev\andrew.xml:151: Java returned: 1
I have deleted this table and it seems to be throwing this error while it
creates the table. That is the only table JDO ends up creating before the
refresh crashes.
Andrew.
Patrick Linskey [email protected]
SolarMetric Inc. http://www.solarmetric.com -
Solved strange problem. Reason: a strange bug?
Hi,
recently I had a really strange problem, where I could not work with the enhanced classes from within a web application (but from the dos-prompt, see my prosting "Kodo says classes are not enhanced ..."). Everybody suggested it was a classpath problem, what I also
thought was the most sensible reason, but all I tried with the classpath didn't seem to work. What I really didn't understand was that it worked before once. I couldn't think of anything that I changed, but now I tried something unreasonable, and it seems to be the reason for
the problem. What I did was, that in the early stages of my application (when everything was still alright) I used a file package.jdo (in the classes-subdirectory) to enhance the classes. Later I changed to system.jdo in the root-dir of the package hierarchie. Now I went back
to package.jdo, and it worked. But I can't imagine how this might change the behaviour of Kodo? The content of package.jdo / system.jdo is this:
<?xml version="1.0"?>
<jdo>
<package name="de.mediateam.quizmaster.data">
<class name="User" />
<class name="Category">
<field name="children">
<collection element-type="Category" />
</field>
<field name="questions">
<collection element-type="Question" />
</field>
</class>
<class name="Topic" persistence-capable-superclass="Category" />
<class name="Test" persistence-capable-superclass="Category">
<field name="participants">
<collection element-type="User" />
</field>
</class>
<class name="Question">
<field name="prerequisites">
<collection element-type="Question" />
</field>
</class>
<class name="Answer" />
</package>
</jdo>
There is no difference if you remove all classes but the User-class. The problem stays when it is system.jdo.
So is this a bug with Kodo, or did I miss something in the documentation about differences between package.jdo and system.jdo?
Cheers
MartinI had system.jdo in the class-hierarchies root directory, but for web-apps this dir (web-context/WEB-INF/classes) doesn't need to be in the classpath. I just tried to copy system.jdo to the same dir as system.prefs and this works.
It might however be helpful in such situations to get a bit more precise error message (not: "The system could not initialize; the following registered persistent types have not been enhanced: [...]").
But thanks for your help. Mysterie solved now.
Martin
On Mon, 10 Sep 2001 17:19:50 -0500, "Abe White" <[email protected]> wrote:
Perhaps system.jdo is not being found by Kodo? system.jdo should be located
in the same place as system.prefs -- at the top level of the CLASSPATH.
package.jdo files, on the other hand, should be placed in the same package
as the classes they contain metadata for. That is the only difference
between the two.
-- Abe White
Kodo Product Team -
Persistence By reachability issue Application Identity
When I Persist the base object it tries to create the related objects
ParamRuleCondition has Collection of ParamRuleConditionExp and
ParamRuleConditionExp has Collection of ParametricExpValue
ParamRuleConditionExp has composite Primary Key with two keys
(ParamRuleCondition , ParametricFeature)
ParametricExpValue has composite Primary Key with three keys one of them
(ExpValue) is a String (ParamRuleCondition , ParametricFeature , ExpValue)
On saving ParamRuleCondition,
it create ParamRuleCondition and ParamRuelConditionExp properly
but tries to insert null in ParametricExpValue
The error is listed at the end
To define composite primary key for ParamRuleConditionExp
I have two extra attribute 'Id' and 'paramFeatureId'
Is this the right way of doing it?
The Pk were generated using the
com.solarmetric.kodo.enhance.ApplicationIdTool class
Thanks for your Help
-Paresh
I have the following object hirearchy
Class RuleCondition {
private Long Id
Class ParamRuleCondition extends RuleCondition {
private Collection paramRuleConditionExps;
class ParamRuleConditionExp {
private ParamRuleCondition paramRuleCondition;
private Long id;
private ParametricFeature parametricFeature;
private Long paramFeatureId;
private Collection expressionValues;
Class ParametricFeature {
private Long paramFeatureId;
private String parametricFeatureCode;
Class ParametricExpValue {
private String expValue;
private ParamRuleConditionExp paramRuleCondExp;
private Long id;
private Long paramFeatureId;
The system.jdo is as follows
<jdo>
<package name="com.paresh">
<class
objectid-class="com.international.core.pk.RuleConditionPK"
identity-type="application" name="RuleCondition">
<field name="id" primary-key="true">
<extension key="data-column" value="RULE_COND_ID"
vendor-name="kodo"/>
</field>
<extension key="class-column" value="TYPE" vendor-name="kodo"/>
<extension key="subclass-provider"
value="com.solarmetric.kodo.impl.jdbc.ormapping.IntegerSubclassProvider"
vendor-name="kodo"/>
<extension key="subclass-indicator-value" value="0"
vendor-name="kodo"/>
<extension key="table" value="RULE_CONDITION"
vendor-name="kodo"/>
<extension key="lock-column" value="none" vendor-name="kodo"/>
</class>
<class identity-type="application" name="ParamRuleCondition"
persistence-capable-superclass="RuleCondition">
<field name="paramRuleConditionExp">
<collection element-type="ParamRuleConditionExp"/>
<extension key="inverse" value="paramRuleCondition"
vendor-name="kodo"/>
</field>
<extension key="subclass-indicator-value" value="3"
vendor-name="kodo"/>
<extension key="table" value="RULE_CONDITION"
vendor-name="kodo"/>
<extension key="lock-column" value="none" vendor-name="kodo"/>
</class>
<class
objectid-class="com.international.core.pk.ParamRuleConditionExpPK"
identity-type="application" name="ParamRuleConditionExp">
<field name="id" primary-key="true">
<extension key="data-column" value="RULE_COND_ID"
vendor-name="kodo"/>
</field>
<field name="paramRuleCondition">
<extension key="id-data-column" value="RULE_COND_ID"
vendor-name="kodo"/>
</field>
<field name="paramFeatureId" primary-key="true">
<extension key="data-column" value="PARAM_FETR_ID"
vendor-name="kodo"/>
</field>
<field name="parametricFeature">
<extension key="paramFeatureId-data-column"
value="PARAM_FETR_ID" vendor-name="kodo"/>
</field>
<field name="expressionValues">
<collection element-type="ParametricExpValue"/>
<extension key="inverse" value="paramRuleCondExp"
vendor-name="kodo"/>
</field>
<extension key="class-column" value="none" vendor-name="kodo"/>
<extension key="table" value="PARAM_RULE_CONDITION_EXP"
vendor-name="kodo"/>
<extension key="lock-column" value="none" vendor-name="kodo"/>
</class>
<class
objectid-class="com.international.core.pk.ParametricFeaturePK"
identity-type="application" name="ParametricFeature">
<field name="paramFeatureId" primary-key="true">
<extension key="data-column" value="PARAM_FETR_ID"
vendor-name="kodo"/>
</field>
<field name="parametricFeatureCode">
<extension key="data-column" value="PARAM_FETR_CD"
vendor-name="kodo"/>
</field>
<extension key="class-column" value="none" vendor-name="kodo"/>
<extension key="table" value="PARAMETRIC_FEATURE"
vendor-name="kodo"/>
<extension key="lock-column" value="none" vendor-name="kodo"/>
</class>
<class
objectid-class="com.international.core.pk.ParametricExpValuePK"
identity-type="application" name="ParametricExpValue">
<field name="expValue" primary-key="true">
<extension key="data-column" value="EXP_VAL"
vendor-name="kodo"/>
</field>
<field name="id" primary-key="true">
<extension key="data-column" value="RULE_COND_ID"
vendor-name="kodo"/>
</field>
<field name="paramFeatureId" primary-key="true">
<extension key="data-column" value="PARAM_FETR_ID"
vendor-name="kodo"/>
</field>
<field name="paramRuleCondExp">
<extension key="id-data-column" value="RULE_COND_ID"
vendor-name="kodo"/>
<extension key="paramFeatureId-data-column"
value="PARAM_FETR_ID" vendor-name="kodo"/>
</field>
<extension key="class-column" value="none" vendor-name="kodo"/>
<extension key="table" value="PARAMETRIC_EXP_VALUE"
vendor-name="kodo"/>
<extension key="lock-column" value="none" vendor-name="kodo"/>
</class>
</jdo>
</package>
THe error is something like
[9/25/03 10:42:12:797 GMT+05:30] 44501d6f ExceptionUtil E CNTR0020E:
Non-application exception occurred while processing method
"createParamRuleCondition" on bean
"BeanId(CdmsDeploy#cdms-ejb.jar#Validation, null)". Exception data:
com.solarmetric.kodo.runtime.FatalDataStoreException:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=INSERT INTO PARAMETRIC_EXP_VALUE(EXP_VAL, PARAM_FETR_ID,
RULE_COND_ID) VALUES ('100', null, null)]
[PRE=INSERT INTO PARAMETRIC_EXP_VALUE(EXP_VAL, PARAM_FETR_ID,
RULE_COND_ID) VALUES (?, ?, ?)]
ORA-01400: cannot insert NULL into
("PARESH"."PARAMETRIC_EXP_VALUE"."RULE_COND_ID")
[code=1400;state=23000]It sounds like your "PARAMETRIC_EXP_VALUE" table's "RULE_COND_ID" field
does not allow nulls. Did you create this table? If so, did you
explicitely disallow nulls from being inserted into the table?Yes nulls are disallowed for column "RULE_COND_ID" as it is part of the
composite primary key for PARAMETRIC_EXP_VALUE table.
I don't understand what you mean here. Do you mean that you are trying
to set the ID "just before it is persisted"? How are you doing this
(e.g., in the jdoPreStore method)?It is not done in jdoPreStore method.
I call paramRuleCondition.setId(new Long(<value>))
just before calling pm.makePersistent(paramRuleCondition)
Thanks
-Paresh
Marc Prud'hommeaux wrote:
Paresh-
It sounds like your "PARAMETRIC_EXP_VALUE" table's "RULE_COND_ID" field
does not allow nulls. Did you create this table? If so, did you
explicitely disallow nulls from being inserted into the table?
One thing I would like to add is that ParamRuleCondition's id has a 'null'
value until just before it is persisted.
I don't understand what you mean here. Do you mean that you are trying
to set the ID "just before it is persisted"? How are you doing this
(e.g., in the jdoPreStore method)?
In article <[email protected]>, Paresh wrote:
Thanks for your help Stephen
I changed the business object method to set the id
But now I am getting a different error
The new error is listed below
One thing I would like to add is that ParamRuleCondition's id has a 'null'
value until just before it is persisted.
But even then the Id is propogated to ParamRuleConditionExp, from where I
would expect it to go to the ParametricExpValue. But it doesn't happen.
Is my expectation right or is there a gap in my understanding of the way
KODO works?
Thanks for your help
-Paresh
Exception data: com.solarmetric.kodo.runtime.FatalDataStoreException:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=INSERT INTO PARAMETRIC_EXP_VALUE(EXP_VAL, PARAM_FETR_ID,
RULE_COND_ID) VALUES ('100', 3, null)]
[PRE=INSERT INTO PARAMETRIC_EXP_VALUE(EXP_VAL, PARAM_FETR_ID,
RULE_COND_ID) VALUES (?, ?, ?)]
ORA-01400: cannot insert NULL into
("CDMS2"."PARAMETRIC_EXP_VALUE"."RULE_COND_ID")
Stephen Kim wrote:
When attempting to do what you want to do (a persistent class column as
part of the pk), you have to set both the pk field and the relation.
i.e. yourClass.setFeatureId (feature.getId ());
yourClass.setFeature (feature);
Of course that logic can be encapsulated in your business objects.
Paresh wrote:
When I Persist the base object it tries to create the related objects
ParamRuleCondition has Collection of ParamRuleConditionExp and
ParamRuleConditionExp has Collection of ParametricExpValue
ParamRuleConditionExp has composite Primary Key with two keys
(ParamRuleCondition , ParametricFeature)
ParametricExpValue has composite Primary Key with three keys one of them
(ExpValue) is a String (ParamRuleCondition , ParametricFeature ,
ExpValue)
>>>>
On saving ParamRuleCondition,
it create ParamRuleCondition and ParamRuelConditionExp properly
but tries to insert null in ParametricExpValue
The error is listed at the end
To define composite primary key for ParamRuleConditionExp
I have two extra attribute 'Id' and 'paramFeatureId'
Is this the right way of doing it?
The Pk were generated using the
com.solarmetric.kodo.enhance.ApplicationIdTool class
Thanks for your Help
-Paresh
I have the following object hirearchy
Class RuleCondition {
private Long Id
Class ParamRuleCondition extends RuleCondition {
private Collection paramRuleConditionExps;
class ParamRuleConditionExp {
private ParamRuleCondition paramRuleCondition;
private Long id;
private ParametricFeature parametricFeature;
private Long paramFeatureId;
private Collection expressionValues;
Class ParametricFeature {
private Long paramFeatureId;
private String parametricFeatureCode;
Class ParametricExpValue {
private String expValue;
private ParamRuleConditionExp paramRuleCondExp;
private Long id;
private Long paramFeatureId;
The system.jdo is as follows
<jdo>
<package name="com.paresh">
<class
objectid-class="com.international.core.pk.RuleConditionPK"
identity-type="application" name="RuleCondition">
<field name="id" primary-key="true">
<extension key="data-column" value="RULE_COND_ID"
vendor-name="kodo"/>
</field>
<extension key="class-column" value="TYPE"vendor-name="kodo"/>
<extension key="subclass-provider"
value="com.solarmetric.kodo.impl.jdbc.ormapping.IntegerSubclassProvider"
vendor-name="kodo"/>
<extension key="subclass-indicator-value" value="0"
vendor-name="kodo"/>
<extension key="table" value="RULE_CONDITION"
vendor-name="kodo"/>
<extension key="lock-column" value="none"vendor-name="kodo"/>
</class>
<class identity-type="application" name="ParamRuleCondition"
persistence-capable-superclass="RuleCondition">
<field name="paramRuleConditionExp">
<collection element-type="ParamRuleConditionExp"/>
<extension key="inverse" value="paramRuleCondition"
vendor-name="kodo"/>
</field>
<extension key="subclass-indicator-value" value="3"
vendor-name="kodo"/>
<extension key="table" value="RULE_CONDITION"
vendor-name="kodo"/>
<extension key="lock-column" value="none"vendor-name="kodo"/>
</class>
<class
objectid-class="com.international.core.pk.ParamRuleConditionExpPK"
identity-type="application" name="ParamRuleConditionExp">
<field name="id" primary-key="true">
<extension key="data-column" value="RULE_COND_ID"
vendor-name="kodo"/>
</field>
<field name="paramRuleCondition">
<extension key="id-data-column" value="RULE_COND_ID"
vendor-name="kodo"/>
</field>
<field name="paramFeatureId" primary-key="true">
<extension key="data-column" value="PARAM_FETR_ID"
vendor-name="kodo"/>
</field>
<field name="parametricFeature">
<extension key="paramFeatureId-data-column"
value="PARAM_FETR_ID" vendor-name="kodo"/>
</field>
<field name="expressionValues">
<collection element-type="ParametricExpValue"/>
<extension key="inverse" value="paramRuleCondExp"
vendor-name="kodo"/>
</field>
<extension key="class-column" value="none"vendor-name="kodo"/>
<extension key="table" value="PARAM_RULE_CONDITION_EXP"
vendor-name="kodo"/>
<extension key="lock-column" value="none"vendor-name="kodo"/>
</class>
<class
objectid-class="com.international.core.pk.ParametricFeaturePK"
identity-type="application" name="ParametricFeature">
<field name="paramFeatureId" primary-key="true">
<extension key="data-column" value="PARAM_FETR_ID"
vendor-name="kodo"/>
</field>
<field name="parametricFeatureCode">
<extension key="data-column" value="PARAM_FETR_CD"
vendor-name="kodo"/>
</field>
<extension key="class-column" value="none"vendor-name="kodo"/>
<extension key="table" value="PARAMETRIC_FEATURE"
vendor-name="kodo"/>
<extension key="lock-column" value="none"vendor-name="kodo"/>
</class>
<class
objectid-class="com.international.core.pk.ParametricExpValuePK"
identity-type="application" name="ParametricExpValue">
<field name="expValue" primary-key="true">
<extension key="data-column" value="EXP_VAL"
vendor-name="kodo"/>
</field>
<field name="id" primary-key="true">
<extension key="data-column" value="RULE_COND_ID"
vendor-name="kodo"/>
</field>
<field name="paramFeatureId" primary-key="true">
<extension key="data-column" value="PARAM_FETR_ID"
vendor-name="kodo"/>
</field>
<field name="paramRuleCondExp">
<extension key="id-data-column" value="RULE_COND_ID"
vendor-name="kodo"/>
<extension key="paramFeatureId-data-column"
value="PARAM_FETR_ID" vendor-name="kodo"/>
</field>
<extension key="class-column" value="none"vendor-name="kodo"/>
<extension key="table" value="PARAMETRIC_EXP_VALUE"
vendor-name="kodo"/>
<extension key="lock-column" value="none"vendor-name="kodo"/>
</class>
</jdo>
</package>
THe error is something like
[9/25/03 10:42:12:797 GMT+05:30] 44501d6f ExceptionUtil E CNTR0020E:
Non-application exception occurred while processing method
"createParamRuleCondition" on bean
"BeanId(CdmsDeploy#cdms-ejb.jar#Validation, null)". Exception data:
com.solarmetric.kodo.runtime.FatalDataStoreException:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=INSERT INTO PARAMETRIC_EXP_VALUE(EXP_VAL, PARAM_FETR_ID,
RULE_COND_ID) VALUES ('100', null, null)]
[PRE=INSERT INTO PARAMETRIC_EXP_VALUE(EXP_VAL, PARAM_FETR_ID,
RULE_COND_ID) VALUES (?, ?, ?)]
ORA-01400: cannot insert NULL into
("PARESH"."PARAMETRIC_EXP_VALUE"."RULE_COND_ID")
[code=1400;state=23000]
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com -
Kodo newbie seeks explanation of exception occurring during
enhancement. My 'package.jdo' contains mappings for a dozen or so
classes to an existing schema. Most of the classes contain no JDO code
and get enhanced with no problem. Two of the classes are intended for
readonly use; they're sort-of-singletons that initialize all allowable
instances of themselves from storage at class load time. The only
thing that differentiates these classes from the others is their
initialization code. When I run the enhancer over these classes, I get
the following exception:
Exception in thread "main" java.lang.IllegalArgumentException: The
specified class "com.commercehub.
carrier.ServiceLevel" could not be loaded. null
at
com.techtrader.modules.tools.compiler.ClassArgParser.parseClasses(ClassArgParser.java:65)
at
com.techtrader.modules.jdo.enhance.JDOEnhancer.main(JDOEnhancer.java:80)
Here's the method that contains JDO code: (The JDOFactory mentioned in
the code is the same one distributed with the Kodo tutorials.)
private static void allInstances() {
PersistenceManager pm = JDOFactory.getPersistenceManager();
Extent cln = pm.getExtent( ServiceLevel.class, false );
Query qry = pm.newQuery( ServiceLevel.class, cln );
Collection results = (Collection) qry.execute();
Iterator it = results.iterator();
while (it.hasNext()) {
ServiceLevel nextType = (ServiceLevel) it.next();
String key = nextType.getCarrierString() +
nextType.getCode();
cache.put( key, nextType );
Could I impose on someone with source code to look at the line in
question and suggest what might be failing?
Thanks,
jp
Jerry Pulley
Sr. Developer
Commerce Technologies, Inc.Jerry Pulley <[email protected]> writes:
Exception in thread "main" java.lang.IllegalArgumentException: The
specified class "com.commercehub.
carrier.ServiceLevel" could not be loaded. nullIs the newline between 'com.commercehub.' and 'carrier.ServiceLevel'
an artifact of your post, or did the error message have that newline
in it? If the latter, what was the command that you executed in order
to run the enhancer, and can you post the contents of your
package.jdo, system.jdo, or ServiceLevel.jdo file?
Thanks,
Patrick Linskey -
DB name shortening algorithm probably needs more sophistication
Hi,
I think it might be wise to come up with a more sophisticated way to
shorten the names when the class names and field names are too long. I
ran into the following situation with a class called
"AttributeCollection" with a HashSet field called "attributes". The
elements of attributes are instances of "Attribute" a simple persistent
class with a "name" and "value" string. Changing the field name to
"set" fixed it. The only reason that I found the problem relatively
easily is that I remembered observing the shortening algorithm (snip) in
another harmless case.
David Ezzio
Yankee Software
E:\MyCode>kodoschematool -action refresh
Refreshing schema for type "class
com.ysoft.jdo.attributes.AttributeCollection" and known subclasses...
CREATE TABLE ATTRIBUTECOLLECTION_ATTRIBUTEX (ATTRIBUTESX NUMBER, JDOIDX
NUMBER)
CREATE INDEX ATTRIBUTECOLLECTION_ATTRIBUTEX ON
ATTRIBUTECOLLECTION_ATTRIBUTEX (ATTRIBUTESX)
CREATE INDEX ATTRIBUTECOLLECTION_ATTRIBUTEX ON
ATTRIBUTECOLLECTION_ATTRIBUTEX (JDOIDX)
java.sql.SQLException: ORA-00955: name is already used by an existing
object
E:\MyCode>kodoschematool -action refresh
Refreshing schema for type "class
com.ysoft.jdo.attributes.AttributeCollection" and known subclasses...
CREATE TABLE ATTRIBUTECOLLECTION_SETX (SETX NUMBER, JDOIDX NUMBER)
CREATE INDEX ATTRIBUTECOLLECTION_SETXSETX ON ATTRIBUTECOLLECTION_SETX
(SETX)
CREATE INDEX ATTRIBUTECOLLECTION_SETXJDOIDX ON ATTRIBUTECOLLECTION_SETX
(JDOIDX)
CREATE TABLE ATTRIBUTECOLLECTIONX (JDOIDX NUMBER NOT NULL, JDOLOCKX
NUMBER, JDOCLASSX VARCHAR2(255), PRIMARY KEY (JDOIDX))
Refreshing schema for type "class com.ysoft.jdo.attributes.Attribute"
and known subclasses...
CREATE TABLE ATTRIBUTEX (JDOIDX NUMBER NOT NULL, JDOLOCKX NUMBER,
JDOCLASSX VARCHAR2(255), NAMEX VARCHAR2(255), VALUEX VARCHAR2(255),
PRIMARY KEY (JDOIDX))Hi,
I had the same problem about a month ago. Patrick Linskey suggested in his post from 12.09.01 "Re: Schematool problem" to "use the 'table' class-level extension in
your system.jdo file". But this didn't seem to work, so I shortened the name of the class to fix it.
Here is Patricks original post:
Martin,
As Joe Mannerling pointed out earlier, the problem that you are seeing
is related to a bug in Kodo's table name generation algorithm. In
order to keep table and column names below database limits (Oracle,
for example, has a 30 character limit), Kodo truncates names to this
length. Unfortunately, it performs this truncation after assembling
the name, so if a class name is over a certain length, then name
conflicts such as those that you are seeing will arise.
We are working on a better name generation algorithm to resolve this
problem. In the mean time, use the 'table' class-level extension in
your system.jdo file:
<?xml version="1.0"?>
<jdo>
<package name="de.mediateam.quizmaster.data">
<... snip ...>
<class name="Question">
<field name="prerequisites">
<collection element-type="Question" />
</field>
</class>
<class name="TextQuestion" persistence-capable-superclass="Question" />
<!-- change this section -->
<class name="MultipleChoiceQuestion"
persistence-capable-superclass="Question" >
<extension key="table" value="MCQuestionX"/>
</class>
<!-- end changes -->
<class name="BooleanQuestion" persistence-capable-superclass="Question" />
<... snip ...>
</package>
</jdo>
Thanks, and good luck.
Cheers
Martin
On Thu, 18 Oct 2001 08:44:11 -0400, David Ezzio <[email protected]> wrote:
Hi,
I think it might be wise to come up with a more sophisticated way to
shorten the names when the class names and field names are too long. I
ran into the following situation with a class called
"AttributeCollection" with a HashSet field called "attributes". The
elements of attributes are instances of "Attribute" a simple persistent
class with a "name" and "value" string. Changing the field name to
"set" fixed it. The only reason that I found the problem relatively
easily is that I remembered observing the shortening algorithm (snip) in
another harmless case.
David Ezzio
Yankee Software
E:\MyCode>kodoschematool -action refresh
Refreshing schema for type "class
com.ysoft.jdo.attributes.AttributeCollection" and known subclasses...
CREATE TABLE ATTRIBUTECOLLECTION_ATTRIBUTEX (ATTRIBUTESX NUMBER, JDOIDX
NUMBER)
CREATE INDEX ATTRIBUTECOLLECTION_ATTRIBUTEX ON
ATTRIBUTECOLLECTION_ATTRIBUTEX (ATTRIBUTESX)
CREATE INDEX ATTRIBUTECOLLECTION_ATTRIBUTEX ON
ATTRIBUTECOLLECTION_ATTRIBUTEX (JDOIDX)
java.sql.SQLException: ORA-00955: name is already used by an existing
object
E:\MyCode>kodoschematool -action refresh
Refreshing schema for type "class
com.ysoft.jdo.attributes.AttributeCollection" and known subclasses...
CREATE TABLE ATTRIBUTECOLLECTION_SETX (SETX NUMBER, JDOIDX NUMBER)
CREATE INDEX ATTRIBUTECOLLECTION_SETXSETX ON ATTRIBUTECOLLECTION_SETX
(SETX)
CREATE INDEX ATTRIBUTECOLLECTION_SETXJDOIDX ON ATTRIBUTECOLLECTION_SETX
(JDOIDX)
CREATE TABLE ATTRIBUTECOLLECTIONX (JDOIDX NUMBER NOT NULL, JDOLOCKX
NUMBER, JDOCLASSX VARCHAR2(255), PRIMARY KEY (JDOIDX))
Refreshing schema for type "class com.ysoft.jdo.attributes.Attribute"
and known subclasses...
CREATE TABLE ATTRIBUTEX (JDOIDX NUMBER NOT NULL, JDOLOCKX NUMBER,
JDOCLASSX VARCHAR2(255), NAMEX VARCHAR2(255), VALUEX VARCHAR2(255),
PRIMARY KEY (JDOIDX)) -
Contains Queries on Empty Collections
I'm running into the following problem when attempting a JDO query which
uses the .contains() operator on multiple collections, where one of the
collections is empty.
My class contains two vectors, both of which contain strings. I want to run
a query that returns all instances of TestClass that contain a certain
string in one of the two lists. I have done roughly what is outlined below.
1) The class looks like:
public class TestClass
private Vector _collection1;
private Vector _collection2;
2) The metadata in system.jdo looks like:
<class name="TestClass">
<field name="_collection1">
<collection element-type="java.lang.String"/>
</field>
<field name="_collection2">
<collection element-type="java.lang.String"/>
</field>
</class>
3) I construct the query as follows:
// pm is the existing persistence manager
Query query = pm.newQuery();
query.setClass( TestClass.class );
query.setCandidates( pm.getExtent( TestClass.class, true ) );
query.setFilter( "_collection1.contains( string ) ||
_collection2.contains( string )" );
query.declareParameters( "String string" );
Collection results = (Collection) query.executeWithArray( new Object[]
{ "searchString" } );
4) The resulting SQL query (for SQL/Server) looks like:
SELECT DISTINCT
t0.JDOIDX,
t0.JDOCLASSX,
t0.JDOLOCKX
FROM
TESTCLASS__COLLECTION2X t2,
TESTCLASSX t0,
TESTCLASS__COLLECTION1X t1
WHERE
t1.COLLECTION1X = 'searchString'
OR (t2.COLLECTION2X = 'searchString')
AND t0.JDOIDX = t1.JDOIDX
AND t0.JDOIDX = t2.JDOIDX
Suppose that the target string is located in the first collection of some
instance of TestClass. Also suppose that there are no strings in the second
collection. Under these circumstances, the query will not return this
instance.
Is there a way to work around this other than running two separate queries?
Is this a bug or is this the expected behaviour?
Any help on this is much appreciated.
Regards,
Sasha Haghani.Hi David,
I've tried this approach as well and am now getting a different error.
Using:
1) query filter: "( _collection1.contains( var ) && var == param ) || (
_collection2.contains( var ) && var == param )"
2) parameter string: "String param"
3) variable string: "String var"
4) parameters: new Object[] { "value" }
The following exception raised is:
com.techtrader.modules.jdo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=SELECT
t0.JDOIDX, t0.JDOCLASSX, t0.JDOLOCKX FROM TESTCLASSX t0 WHERE variable =
'value' OR (*variable* = 'value')] Line 1: Incorrect syntax near '*'.
Severity 15, State 1 <rest of exception message omitted>
at
com.techtrader.modules.jdo.impl.jdbc.runtime.JDBCFieldData.load(JDBCFieldDat
a.java:127)
at
com.techtrader.modules.jdo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuer
y.java:33)
at
com.techtrader.modules.jdo.query.QueryImpl.executeWithMap(QueryImpl.java:330
at
com.techtrader.modules.jdo.query.QueryImpl.executeWithArray(QueryImpl.java:3
93)
As you can see from above, the generated SQL statement looks like:
SELECT
t0.JDOIDX,
t0.JDOCLASSX,
t0.JDOLOCKX
FROM
TESTCLASSX t0
WHERE
variable = 'value'
OR (*variable* = 'value')
Additionally, if I change the filter to "( (_collection1.contains( var )) &&
(var == param) )", I get the following exception:
com.techtrader.modules.jdo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=SELECT
t0.JDOIDX, t0.JDOCLASSX, t0.JDOLOCKX FROM TESTCLASSX t0 WHERE variable =
'value'] Line 1: Incorrect syntax near '*'. Severity 15, State 1, <rest of
exception message omitted>
at
com.techtrader.modules.jdo.impl.jdbc.runtime.JDBCFieldData.load(JDBCFieldDat
a.java:127)
at
com.techtrader.modules.jdo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuer
y.java:33)
at
com.techtrader.modules.jdo.query.QueryImpl.executeWithMap(QueryImpl.java:330
at
com.techtrader.modules.jdo.query.QueryImpl.executeWithArray(QueryImpl.java:3
93)
Again, the generated SQL looks like:
SELECT
t0.JDOIDX,
t0.JDOCLASSX,
t0.JDOLOCKX
FROM
TESTCLASSX t0
WHERE
variable = 'value'
We are using multiple queries for now and aggregating the results by hand,
so this issue isn't blocking us.
Regards,
Sasha Haghani.
"David Ezzio" <[email protected]> wrote in message
news:[email protected]...
Hi Sasha,
One thing that appears "unusual", if you will, about your queries
is that you are using a parameter in the contains() method rather
than a variable. The spec mentions a different usage pattern along
the following lines: "collection.contains(string) && string ==
strParam" where "strParam" is declared as the parameter, and
"string" is declared as a variable. You may have already tried this
as a variation. Your usage appears permitted as far as the spec
goes, but may not have been tested for Kodo.
David Ezzio
Sasha Haghani wrote:
Hi Patrick,
I tried your workaround and the following exception was thrown:
javax.jdo.JDOUserException: The given filter/ordering String "( (
(_collection1.isEmpty() == false) && (_collection1.contains( string )) )
||
( (_collection2.isEmpty() == false) && (_collection2.contains(
string )) ) )" is not valid. Make sure all parentheses are properlymatched
and that the filter uses proper Java syntax.
at
com.techtrader.modules.jdo.query.QueryImpl.getExpression(QueryImpl.java:371)
at
com.techtrader.modules.jdo.impl.jdbc.runtime.JDBCQuery.getExpression(JDBCQue
ry.java:49)
at
com.techtrader.modules.jdo.query.QueryImpl.executeWithMap(QueryImpl.java:312
at
com.techtrader.modules.jdo.query.QueryImpl.executeWithArray(QueryImpl.java:3
93)
I tried three variations on the parentheses used in the filterexpression.
All yielded the same exception. I couldn't find any glaring errors or
omissions in the query. The string parameter is also properly declared.Is
this possibly another bug?
I'm executing multiple individual queries to acheive my goal for thetime
being. Let me know if I'm doing anything wrong or if these are bugs,let me
know when they are fixed. Thanks much.
Regards,
Sasha Haghani.
"Patrick Linskey" <[email protected]> wrote in message
news:[email protected]...
Sasha,
This sounds like a bug. I will enter it into our database and get back
to you later.
Meanwhile, you may be able to work around it using something like
query.setFilter (
"(_collection1.isEmpty () == false && _collection1.contains(string))"
+ " || (_collection2.isEmpty () == false &&
_collection2.contains
(string))" );
-Patrick Linskey -
I have an enhanced class FileAudit which has a reference to 2 other
enhanced class NetworkOperator and another instance of FileAudit
protected NetworkOperator networkOperator = null;
protected FileAudit rapFile = null;
I persist an instance of FileAudit and then commit. The SQL generated is
INSERT INTO FILE_AUDIT(FILE_SEQ_NO, LOADED, DIRECTION, FATAL_ERRORS, NAME,
AVAILABILITY, PROCESSED, REJECTED, FILE_TYPE, SEVERE_ERRORS, FILE_ID,
RAPFILEX, KEYSTRING_NETWORKOPERATORX, ARRIVAL_DATE, PROCESS_DATE,
VALIDATED) VALUES (236, 0, 1, 1,
'c:\\roambroker\\data\\ebs\\in\\archive\\LTUOM\\CDGRCSHLTUOM00236.dat1',
2, 0, 0, 1, 1, 0, NULL, NULL, {ts '2002-07-11 16:56:13.093'}, {ts
'2002-07-30 17:03:04.5'},
Neither RAPFILEX nor KEYSTRING_NETWORKOPERATORX are in my table. There is
nothing in my xml to persist rapFile and the persistence description for
networkOperator is shown below. Where is this coming from???
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jdo SYSTEM "jdo.dtd">
<jdo>
<package name="com.capetechnologies.roambroker.model">
<class identity-type="datastore" name="FileAudit">
<extension vendor-name="kodo" key="table" value="FILE_AUDIT"/>
<extension vendor-name="kodo" key="pk-column" value="FILE_ID"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="class-column" value="none"/>
<field name="fileTypeValue">
<extension vendor-name="kodo" key="data-column"
value="FILE_TYPE"/></field>
<field name="networkOperator">
<extension vendor-name="kodo" key="data-column"
value="NETWORK_OPERATOR_UID"/></field>
</class>
</package>
</jdo>Abe White wrote:
nothing in my xml to persist rapFile
But the field \'rapFile\' is of type \'FileAudit\', which is apersistence-capable
class. The JDO specification states that all fields of a persistence-capable
type are persistent unless you explicitly mark them otherwise (or unless
they\'re static, final, or transient). So in your metadata for FileAudit you
should include the line:
<field name=\"rapFile\" persistence-modifier=\"none\"/>Thanks, that explains the rapFile field but for the other persistent
capable class field:
protected NetworkOperator networkOperator = null;
I have this in my jdo xml file
<field name=\"networkOperator\">
<extension vendor-name=\"kodo\" key=\"data-column\"
value=\"NETWORK_OPERATOR_UID\"/></field>
NETWORK_OPERATOR_UID is a foreign key in my FILE_AUDIT table that refers to
the primary key in my NETWORK_OPERATOR table which is represented by the
NetworkOperator persistent capable class. -
Bad SQL in 2.3.1 with n*m collection
Hi guys,
This bug comes from an example in my book. The Library example is one of the JDO Learning Tools
that I am providing that allows the user to enter queries interactively. The bug arises in an
example of its use presented in the book. Abe will receive the code with Chapter 8, coming soon.
Basically, Volunteer has a 1 to 1 relation with Borrower. A Borrower has a 1 to M relation with
Book. Book has a N to M relation with Category. Or in object terms, a Volunteer is always a
Borrower, but a Borrower is not always a Volunteer. A Book can be borrowed by one Borrower. A
Borrower can borrow from 0 to M books. A Book can be in the books collection of any number of
Category objects, and a Category can be in the categories collection of any number of Book objects.
Here is the JDO metadata:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jdo SYSTEM "jdo.dtd">
<jdo>
<package name="com.ysoft.jdo.book.library">
<class name="Borrower" identity-type="datastore" >
<field name="oidString" persistence-modifier="none" />
<field name="books" >
<collection element-type="com.ysoft.jdo.book.library.Book" />
<extension vendor-name="kodo" key="inverse" value="borrower"/>
</field>
</class>
<class name="Book" identity-type="datastore" >
<field name="oidString" persistence-modifier="none" />
<field name="borrower" />
<field name="categories" >
<collection element-type="com.ysoft.jdo.book.library.Category" />
<extension vendor-name="kodo" key="inverse" value="books"/>
</field>
</class>
<class name="Category" identity-type="datastore" >
<field name="oidString" persistence-modifier="none" />
<field name="books" >
<collection element-type="com.ysoft.jdo.book.library.Book" />
<extension vendor-name="kodo" key="inverse" value="categories"/>
</field>
</class>
<class name="Volunteer" identity-type="datastore" >
<field name="oidString" persistence-modifier="none" />
</class>
</package>
</jdo>
Here is the example as presented in the book, this is quoting output from the JDORI.
-- begin quote --
To find all the books that are in categories that interest Harry, use the Book extent, and define
the query variables:
Book b; Category c;
Then use the query string:
categories.contains(c) && (c.books.contains(b) && b.borrower.name == "Harry")
Your answer for the default object population should be:
Found 1 objects in the results
book [OID: 102-16] "Gone to Work" checked out: Mon Aug 26 08:23:10 EDT 2002
-- end quote --
Here is the SQL that KODO produces. It finds many (or all?) books instead of 1.
SELECT DISTINCT
t0.JDOIDX,
t0.JDOCLASSX,
t0.JDOLOCKX,
t0.BORROWERX,
t0.CHECKOUTX,
t0.TITLEX
FROM BOOKX t0, BOOKX t5, BOOKX t6,
BOOK_CATEGORIESX t1, BOOK_CATEGORIESX t4,
BORROWERX t7, CATEGORYX t2, CATEGORYX t3
WHERE (t7.NAMEX = 'Harry'
AND t0.JDOIDX = t1.JDOIDX
AND t1.CATEGORIESX = t2.JDOIDX
AND t3.JDOIDX = t4.CATEGORIESX
AND t4.JDOIDX = t5.JDOIDX
AND t6.BORROWERX = t7.JDOIDX)
Here is the modified version that gets the job done:
SELECT
t0.JDOIDX,
t0.JDOCLASSX,
t0.JDOLOCKX,
t0.BORROWERX,
t0.CHECKOUTX,
t0.TITLEX
FROM BOOKX t0,
BOOK_CATEGORIESX t1,
CATEGORYX t2,
BORROWERX t3
WHERE (t3.NAMEX = 'Harry'
AND t0.JDOIDX = t1.JDOIDX
AND t1.CATEGORIESX = t2.JDOIDX
AND t0.BORROWERX = t3.JDOIDX)
David EzzioDavid,
This has been fixed internally, and will be available in 2.3.3 (hopefully
along with a fix to your other issue).
-Patrick
In article <[email protected]>, David Ezzio wrote:
Hi guys,
This bug continues to exist in 2.3.2
David Ezzio
David Ezzio wrote:
Hi guys,
This bug comes from an example in my book. The Library example is one of the JDO Learning Tools
that I am providing that allows the user to enter queries interactively. The bug arises in an
example of its use presented in the book. Abe will receive the code with Chapter 8, coming soon.
Basically, Volunteer has a 1 to 1 relation with Borrower. A Borrower has a 1 to M relation with
Book. Book has a N to M relation with Category. Or in object terms, a Volunteer is always a
Borrower, but a Borrower is not always a Volunteer. A Book can be borrowed by one Borrower. A
Borrower can borrow from 0 to M books. A Book can be in the books collection of any number of
Category objects, and a Category can be in the categories collection of any number of Book objects.
Here is the JDO metadata:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jdo SYSTEM "jdo.dtd">
<jdo>
<package name="com.ysoft.jdo.book.library">
<class name="Borrower" identity-type="datastore" >
<field name="oidString" persistence-modifier="none" />
<field name="books" >
<collection element-type="com.ysoft.jdo.book.library.Book" />
<extension vendor-name="kodo" key="inverse" value="borrower"/>
</field>
</class>
<class name="Book" identity-type="datastore" >
<field name="oidString" persistence-modifier="none" />
<field name="borrower" />
<field name="categories" >
<collection element-type="com.ysoft.jdo.book.library.Category" />
<extension vendor-name="kodo" key="inverse" value="books"/>
</field>
</class>
<class name="Category" identity-type="datastore" >
<field name="oidString" persistence-modifier="none" />
<field name="books" >
<collection element-type="com.ysoft.jdo.book.library.Book" />
<extension vendor-name="kodo" key="inverse" value="categories"/>
</field>
</class>
<class name="Volunteer" identity-type="datastore" >
<field name="oidString" persistence-modifier="none" />
</class>
</package>
</jdo>
Here is the example as presented in the book, this is quoting output from the JDORI.
-- begin quote --
To find all the books that are in categories that interest Harry, use the Book extent, and define
the query variables:
Book b; Category c;
Then use the query string:
categories.contains(c) && (c.books.contains(b) && b.borrower.name == "Harry")
Your answer for the default object population should be:
Found 1 objects in the results
book [OID: 102-16] "Gone to Work" checked out: Mon Aug 26 08:23:10 EDT 2002
-- end quote --
Here is the SQL that KODO produces. It finds many (or all?) books instead of 1.
SELECT DISTINCT
t0.JDOIDX,
t0.JDOCLASSX,
t0.JDOLOCKX,
t0.BORROWERX,
t0.CHECKOUTX,
t0.TITLEX
FROM BOOKX t0, BOOKX t5, BOOKX t6,
BOOK_CATEGORIESX t1, BOOK_CATEGORIESX t4,
BORROWERX t7, CATEGORYX t2, CATEGORYX t3
WHERE (t7.NAMEX = 'Harry'
AND t0.JDOIDX = t1.JDOIDX
AND t1.CATEGORIESX = t2.JDOIDX
AND t3.JDOIDX = t4.CATEGORIESX
AND t4.JDOIDX = t5.JDOIDX
AND t6.BORROWERX = t7.JDOIDX)
Here is the modified version that gets the job done:
SELECT
t0.JDOIDX,
t0.JDOCLASSX,
t0.JDOLOCKX,
t0.BORROWERX,
t0.CHECKOUTX,
t0.TITLEX
FROM BOOKX t0,
BOOK_CATEGORIESX t1,
CATEGORYX t2,
BORROWERX t3
WHERE (t3.NAMEX = 'Harry'
AND t0.JDOIDX = t1.JDOIDX
AND t1.CATEGORIESX = t2.JDOIDX
AND t0.BORROWERX = t3.JDOIDX)
David Ezzio
Patrick Linskey [email protected]
SolarMetric Inc. http://www.solarmetric.com -
Maven kodo plugin for 3.1.2
Hi, I'm trying to use Kodo 3.1.2 with Maven.
I'm new to maven plugins, and i got some difficulties with a classloader
problem .
I want to enhance some classes which are using commons logging
facilities, but i got a error :
Class org.apache.commons.logging.impl.SimpleLog does not implement Log
But the enhancer seems to do his job (see the log below).
Can someone help me ?
Stephane.
Maven log :
[INFO] Tool - -JDO enhancer running on type "class
fr.emn.bn.collections.metier.CollectionBN".
[INFO] MetaData - -Parsing metadata resource
"file:/C:/eclipse/workspace/BN/target/classes/system.jdo".
[INFO] Enhance - -Enhancing type "class
fr.emn.bn.collections.metier.CollectionBN".
[WARN] Enhance - -The type "class
fr.emn.bn.collections.metier.CollectionBN" must have a no-args
constructor. Adding a protected no-args constructor.
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at fr.emn.bn.collections.metier.CollectionBN.class$(CollectionBN.java:55)
at fr.emn.bn.collections.metier.CollectionBN.<clinit>(CollectionBN.java:55)
at java.io.ObjectStreamClass.hasStaticInitializer(Native Method)
at
java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1557)
at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:47)
at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:173)
at java.security.AccessController.doPrivileged(Native Method)
at
java.io.ObjectStreamClass.getSerialVersionUID(ObjectStreamClass.java:170)
at kodo.enhance.JDOEnhancer.addSerializationCode(JDOEnhancer.java:1841)
at kodo.enhance.JDOEnhancer.enhance(JDOEnhancer.java:262)
at kodo.enhance.JDOEnhancer.run(JDOEnhancer.java:2186)
at kodo.enhance.JDOEnhancer.run(JDOEnhancer.java:2122)
at kodo.enhance.JDOEnhancer.main(JDOEnhancer.java:2094)
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Class
org.apache.commons.logging.impl.SimpleLog does not implement Logmy kodo.properties looks like that :
javax.jdo.PersistenceManagerFactoryClass:
kodo.jdbc.runtime.JDBCPersistenceManagerFactory
javax.jdo.option.ConnectionUserName: sa
javax.jdo.option.ConnectionPassword:
javax.jdo.option.ConnectionURL: jdbc\:hsqldb\:/Temp/test_database
javax.jdo.option.ConnectionDriverName: org.hsqldb.jdbcDriver
javax.jdo.option.Multithreaded: false
javax.jdo.option.NontransactionalWrite: false
kodo.jdbc.ForeignKeyConstraints: false
kodo.jdbc.Schemas:
kodo.jdbc.AutoIncrementConstraints: false
kodo.jdbc.SynchronizeMappings: refresh
kodo.WriteLockLevel: write
kodo.FetchGroups:
kodo.PersistentClasses:
kodo.CopyObjectIds: false
kodo.RestoreMutableValues: false
kodo.Log: commons
Stephane
Patrick Linskey a __crit :
How are you configuring Kodo's logging (the kodo.Log property)?
-Patrick
Stephane Bouchet wrote:
Hi, I'm trying to use Kodo 3.1.2 with Maven.
I'm new to maven plugins, and i got some difficulties with a
classloader problem .
I want to enhance some classes which are using commons logging
facilities, but i got a error :
Class org.apache.commons.logging.impl.SimpleLog does not implement Log
But the enhancer seems to do his job (see the log below).
Can someone help me ?
Stephane.
Maven log :
[INFO] Tool - -JDO enhancer running on type "class
fr.emn.bn.collections.metier.CollectionBN".
[INFO] MetaData - -Parsing metadata resource
"file:/C:/eclipse/workspace/BN/target/classes/system.jdo".
[INFO] Enhance - -Enhancing type "class
fr.emn.bn.collections.metier.CollectionBN".
[WARN] Enhance - -The type "class
fr.emn.bn.collections.metier.CollectionBN" must have a no-args
constructor. Adding a protected no-args constructor.
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at
fr.emn.bn.collections.metier.CollectionBN.class$(CollectionBN.java:55)
at
fr.emn.bn.collections.metier.CollectionBN.<clinit>(CollectionBN.java:55)
at java.io.ObjectStreamClass.hasStaticInitializer(Native Method)
at
java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1557)
at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:47)
at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:173)
at java.security.AccessController.doPrivileged(Native Method)
at
java.io.ObjectStreamClass.getSerialVersionUID(ObjectStreamClass.java:170)
at
kodo.enhance.JDOEnhancer.addSerializationCode(JDOEnhancer.java:1841)
at kodo.enhance.JDOEnhancer.enhance(JDOEnhancer.java:262)
at kodo.enhance.JDOEnhancer.run(JDOEnhancer.java:2186)
at kodo.enhance.JDOEnhancer.run(JDOEnhancer.java:2122)
at kodo.enhance.JDOEnhancer.main(JDOEnhancer.java:2094)
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Class
org.apache.commons.logging.impl.SimpleLog does not implement Log -
Kodo enhancer throws ConcurrentModificationException
Attached is the stacktrace i get during enhancement, inside ant build
process.
Kodo suddenly fails on classes that were enhanced correctly before, so I
guess its some internal bug.
Does anyone know why it happens?
raczer.
I use:
- kodo 2.4.0
- ant 1.5.1
begin 666 stacktrace.txt
M6RXN+ET-"B @(" @6VID;V-=(&IA=F$N=71I;"Y#;VYC=7)R96YT36]D:69I
M8V%T:6]N17AC97!T:6]N#0H@(" @(%MJ9&]C72 @(" @870@:F%V82YU=&EL
M+E1R965-87 D16YT<GE)=&5R871O<BYN97AT16YT<GDH5')E94UA<"YJ879A
M.C$P,C(I#0H@(" @(%MJ9&]C72 @(" @870@:F%V82YU=&EL+E1R965-87 D
M2V5Y271E<F%T;W(N;F5X="A4<F5E36%P+FIA=F$Z,3 T-RD-"B @(" @6VID
M;V-=(" @("!A="!C;VTN<V]L87)M971R:6,N:V]D;RYM971A+D-L87-S365T
M841A=&$N9FEN:7-H*$-L87-S365T841A=&$N:F%V83HS-#4I#0H@(" @(%MJ
M9&]C72 @(" @870@8V]M+G-O;&%R;65T<FEC+FMO9&\N;65T82Y#;&%S<TUE
M=&%$871A+FYE=TEN<W1A;F-E*$-L87-S365T841A=&$N:F%V83HR-C@I#0H@
M(" @(%MJ9&]C72 @(" @870@8V]M+G-O;&%R;65T<FEC+FMO9&\N;65T82Y#
M;&%S<TUE=&%$871A+F=E=$EN<W1A;F-E*$-L87-S365T841A=&$N:F%V83HQ
M.3(I#0H@(" @(%MJ9&]C72 @(" @870@8V]M+G-O;&%R;65T<FEC+FMO9&\N
M;65T82Y#;&%S<TUE=&%$871A+G9A;&ED871E4W5P97)C;&%S<RA#;&%S<TUE
M=&%$871A+FIA=F$Z-#0V*0T*(" @("!;:F1O8UT@(" @(&%T(&-O;2YS;VQA
M<FUE=')I8RYK;V1O+FUE=&$N0VQA<W--971A1&%T82YF:6YI<V@H0VQA<W--
M971A1&%T82YJ879A.C,S,RD-"B @(" @6VID;V-=(" @("!A="!C;VTN<V]L
M87)M971R:6,N:V]D;RYM971A+D-L87-S365T841A=&$N;F5W26YS=&%N8V4H
M0VQA<W--971A1&%T82YJ879A.C(V."D-"B @(" @6VID;V-=(" @("!A="!C
M;VTN<V]L87)M971R:6,N:V]D;RYM971A+D-L87-S365T841A=&$N9V5T26YS
M=&%N8V4H0VQA<W--971A1&%T82YJ879A.C$Y,BD-"B @(" @6VID;V-=(" @
M("!A="!C;VTN<V]L87)M971R:6,N:V]D;RYE;FAA;F-E+DI$3T5N:&%N8V5R
M+CQI;FET/BA*1$]%;FAA;F-E<BYJ879A.C(R-"D-"B @(" @6VID;V-=(" @
M("!A="!C;VTN<V]L87)M971R:6,N:V]D;RYE;FAA;F-E+DI$3T5N:&%N8V5R
M+F5N:&%N8V4H2D1/16YH86YC97(N:F%V83HQ.#<I#0H@(" @(%MJ9&]C72 @
M(" @870@8V]M+G-O;&%R;65T<FEC+FMO9&\N96YH86YC92Y*1$]%;FAA;F-E
M<BYE;FAA;F-E*$I$3T5N:&%N8V5R+FIA=F$Z,3,U*0T*(" @("!;:F1O8UT@
M(" @(&%T(&-O;2YS;VQA<FUE=')I8RYM;V1U;&5S+FEN=&5G<F%T:6]N+F%N
M="Y*1$]%;FAA;F-E<E1A<VLN97AE8W5T94]N*$I$3T5N:&%N8V5R5&%S:RYJ
M879A.C0S*0T*(" @("!;:F1O8UT@(" @(&%T(&-O;2YS;VQA<FUE=')I8RYM
M;V1U;&5S+FEN=&5G<F%T:6]N+F%N="Y487-K0F%S92YE>&5C=71E*%1A<VM"
M87-E+FIA=F$Z,3$X*0T*(" @("!;:F1O8UT@(" @(&%T(&]R9RYA<&%C:&4N
M=&]O;',N86YT+E5N:VYO=VY%;&5M96YT+F5X96-U=&4H56YK;F]W;D5L96UE
M;G0N:F%V83HQ-C8I#0H@(" @(%MJ9&]C72 @(" @870@;W)G+F%P86-H92YT
M;V]L<RYA;G0N5&%S:RYP97)F;W)M*%1A<VLN:F%V83HS,3DI#0H@(" @(%MJ
M9&]C72 @(" @870@;W)G+F%P86-H92YT;V]L<RYA;G0N5&%R9V5T+F5X96-U
M=&4H5&%R9V5T+FIA=F$Z,S Y*0T*(" @("!;:F1O8UT@(" @(&%T(&]R9RYA
M<&%C:&4N=&]O;',N86YT+E1A<F=E="YP97)F;W)M5&%S:W,H5&%R9V5T+FIA
M=F$Z,S,V*0T*(" @("!;:F1O8UT@(" @(&%T(&]R9RYA<&%C:&4N=&]O;',N
M86YT+E!R;VIE8W0N97AE8W5T951A<F=E="A0<F]J96-T+FIA=F$Z,3,P-BD-
M"B @(" @6VID;V-=(" @("!A="!O<F<N87!A8VAE+G1O;VQS+F%N="Y0<F]J
M96-T+F5X96-U=&5487)G971S*%!R;VIE8W0N:F%V83HQ,C4P*0T*(" @("!;
M:F1O8UT@(" @(&%T(&]R9RYA<&%C:&4N=&]O;',N86YT+DUA:6XN<G5N0G5I
M;&0H36%I;BYJ879A.C8Q,"D-"B @(" @6VID;V-=(" @("!A="!O<F<N87!A
M8VAE+G1O;VQS+F%N="Y-86EN+G-T87)T*$UA:6XN:F%V83HQ.38I#0H@(" @
M(%MJ9&]C72 @(" @870@;W)G+F%P86-H92YT;V]L<RYA;G0N36%I;BYM86EN
H*$UA:6XN:F%V83HR,S4I#0H-"D)524Q$($9!24Q%1 T*6RXN+ET-"@``
`
endThis sounds like a manifestation of
http://bugzilla.solarmetric.com/show_bug.cgi?id=472 to me. Do you have
circular dependencies between classes defined in multiple metadata
files? For example, do you have a class Foo whose metadata is defined in
Foo.jdo, and a class Bar whose metadata is in Bar.jdo, and do Foo and
Bar have references to each other?
If this is the bug, the only current workaround is to put those classes
that have circular references into the same metadata file (a package.jdo
file or a system.jdo file).
-Patrick
Rafa__ Czerwi__ski wrote:
Attached is the stacktrace i get during enhancement, inside ant build
process.
Kodo suddenly fails on classes that were enhanced correctly before, so I
guess its some internal bug.
Does anyone know why it happens?
raczer.
I use:
- kodo 2.4.0
- ant 1.5.1
[jdoc] java.util.ConcurrentModificationException
[jdoc] at
java.util.TreeMap$EntryIterator.nextEntry(TreeMap.java:1022)
[jdoc] at java.util.TreeMap$KeyIterator.next(TreeMap.java:1047)
[jdoc] at
com.solarmetric.kodo.meta.ClassMetaData.finish(ClassMetaData.java:345)
[jdoc] at
com.solarmetric.kodo.meta.ClassMetaData.newInstance(ClassMetaData.java:268)
[jdoc] at
com.solarmetric.kodo.meta.ClassMetaData.getInstance(ClassMetaData.java:192)
[jdoc] at
com.solarmetric.kodo.meta.ClassMetaData.validateSuperclass(ClassMetaData.java:446)
[jdoc] at
com.solarmetric.kodo.meta.ClassMetaData.finish(ClassMetaData.java:333)
[jdoc] at
com.solarmetric.kodo.meta.ClassMetaData.newInstance(ClassMetaData.java:268)
[jdoc] at
com.solarmetric.kodo.meta.ClassMetaData.getInstance(ClassMetaData.java:192)
[jdoc] at
com.solarmetric.kodo.enhance.JDOEnhancer.(JDOEnhancer.java:224)
[jdoc] at
com.solarmetric.kodo.enhance.JDOEnhancer.enhance(JDOEnhancer.java:187)
[jdoc] at
com.solarmetric.kodo.enhance.JDOEnhancer.enhance(JDOEnhancer.java:135)
[jdoc] at
com.solarmetric.modules.integration.ant.JDOEnhancerTask.executeOn(JDOEnhancerTask.java:43)
[jdoc] at
com.solarmetric.modules.integration.ant.TaskBase.execute(TaskBase.java:118)
[jdoc] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:166)
[jdoc] at org.apache.tools.ant.Task.perform(Task.java:319)
[jdoc] at org.apache.tools.ant.Target.execute(Target.java:309)
[jdoc] at
org.apache.tools.ant.Target.performTasks(Target.java:336)
[jdoc] at
org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[jdoc] at
org.apache.tools.ant.Project.executeTargets(Project.java:1250)
[jdoc] at org.apache.tools.ant.Main.runBuild(Main.java:610)
[jdoc] at org.apache.tools.ant.Main.start(Main.java:196)
[jdoc] at org.apache.tools.ant.Main.main(Main.java:235)
BUILD FAILED
Patrick Linskey [email protected]
SolarMetric Inc. http://www.solarmetric.com -
Metadata problem with JSP/servlet application
Hi,
I developed a JSP/servlet test application that makes
use of kodo 2.2.3 STANDARD EDITION for its persitence.
I successfully compile and annotate the application.
I am also able to successfully generate the db
schema with schematool.
Unfortunately, when I run the application using
Resin 2.0.2, Kodo is unable to initialize properly.
Initially it was not able to find "system.prefs" file.
I fixed that by putting "system.prefs" in WEB-INF\classes.
Unfortunately, Kodo is still unable to initialize and
gives the following message:
The system could not initialize; the following registered
persistent types are missing metadata
or have not been enhanced:
[class com.dpov.purchaseorder.PurchaseOrder,
class com.dpov.catalog.Product,
class com.dpov.uidgen.counter.Counter,
class com.dpov.catalog.dao.jdo.CategoryHierarchyEntry,
class com.dpov.catalog.dao.jdo.CategoryHierarchyDAO,
class com.dpov.pricelist.PriceInfo,
class com.dpov.pricelist.PriceList,
class com.dpov.catalog.Category,
class com.dpov.lineitem.LineItem,
class com.dpov.dealer.Dealer,
class com.dpov.user.User,
class com.dpov.customer.Customer].
I use "system.jdo" to describe metadata for the enhancer.
I tried to put it both in WEB-INF\lib and WEB-INF\classes but
it still fails.
Please note that:
1) my classpath variable is not set
2) my application's class file are in WEB-INF\classes
3) kodo jars are in WEB-INF\lib
4) mysql jdbc driver is in WEB-INF\lib
5) system.prefs is in WEB-INF\classes
6) system.jdo is in WEB-INF\classes
Thanks in advance,
Andrea
system.prefs
<?xml version="1.0"?>
<prefs>
<kodo-license-key>VALID KEY!</kodo-license-key>
<db>
<username></username>
<password></password>
<url>jdbc:mysql://localhost/kodo</url>
<driver>org.gjt.mm.mysql.Driver</driver>
<dictionary>
com.solarmetric.kodo.impl.jdbc.schema.dict.MySQLDictionary
</dictionary>
<warn-on-persistent-type-failure>true</warn-on-persistent-type-failure>
</db>
<tm-location>java:/TransactionManager</tm-location>
</prefs>
system.jdo
<?xml version="1.0"?>
<jdo>
<package name="com.dpov.uidgen.counter">
<class name="Counter" />
</package>
<package name="com.dpov.customer">
<class name="Customer" />
</package>
<package name="com.dpov.user">
<class name="User" />
</package>
<package name="com.dpov.dealer">
<class name="Dealer" />
</package>
<package name="com.dpov.catalog">
<class name="Product" />
</package>
<package name="com.dpov.catalog">
<class name="Category" />
</package>
<package name="com.dpov.catalog.dao.jdo">
<class name="CategoryHierarchyDAO">
<field name="categories">
<collection element-type="com.dpov.catalog.Category"/>
</field>
</class>
</package>
<package name="com.dpov.catalog.dao.jdo">
<class name="CategoryHierarchyEntry">
<field name="attributeValues">
<map key-type="String" value-type="CategoryHierarchyEntry"/>
</field>
<field name="productIds">
<collection element-type="String"/>
</field>
</class>
</package>
<package name="com.dpov.lineitem">
<class name="LineItem" />
</package>
<package name="com.dpov.purchaseorder">
<class name="PurchaseOrder">
<field name="lineItems">
<collection element-type="com.dpov.lineitem.LineItem"/>
</field>
</class>
</package>
<package name="com.dpov.pricelist">
<class name="PriceInfo" />
</package>
<package name="com.dpov.pricelist">
<class name="PriceList">
<field name="priceInfos">
<map key-type="String" value-type="PriceInfo"/>
</field>
</class>
</package>
</jdo>Hi,
I fixed my problem by setting the system wide variable (WindowsXP)
CLASSPATH to r:\\dealershop\\WEB-INF\\classes.
Thanks,
Andrea
andrea costantinis wrote:
Hi,
I developed a JSP/servlet test application that makes
use of kodo 2.2.3 STANDARD EDITION for its persitence.
I successfully compile and annotate the application.
I am also able to successfully generate the db
schema with schematool.
Unfortunately, when I run the application using
Resin 2.0.2, Kodo is unable to initialize properly.
Initially it was not able to find \"system.prefs\" file.
I fixed that by putting \"system.prefs\" in WEB-INF\\classes.
Unfortunately, Kodo is still unable to initialize and
gives the following message:
The system could not initialize; the following registered
persistent types are missing metadata
or have not been enhanced:
[class com.dpov.purchaseorder.PurchaseOrder,
class com.dpov.catalog.Product,
class com.dpov.uidgen.counter.Counter,
class com.dpov.catalog.dao.jdo.CategoryHierarchyEntry,
class com.dpov.catalog.dao.jdo.CategoryHierarchyDAO,
class com.dpov.pricelist.PriceInfo,
class com.dpov.pricelist.PriceList,
class com.dpov.catalog.Category,
class com.dpov.lineitem.LineItem,
class com.dpov.dealer.Dealer,
class com.dpov.user.User,
class com.dpov.customer.Customer].
I use \"system.jdo\" to describe metadata for the enhancer.
I tried to put it both in WEB-INF\\lib and WEB-INF\\classes but
it still fails.
Please note that:
1) my classpath variable is not set
2) my application\'s class file are in WEB-INF\\classes
3) kodo jars are in WEB-INF\\lib
4) mysql jdbc driver is in WEB-INF\\lib
5) system.prefs is in WEB-INF\\classes
6) system.jdo is in WEB-INF\\classes
Thanks in advance,
Andrea
Maybe you are looking for
-
Advance Procurement through Sale Order
Dear All, I required detail infromation pertaining to advance procurement of ROH items against sale order. If manual Purchase requisitions are being created by assigning sale order as account assignment, exception-20 is coming. I also like to inform
-
[SOLVED]Conky Align Text Center
I am trying to align my conky so that the middle of the text is in the middle of the top of the screen. My screen is 1200x800. Any suggestions? use_xft yes xftfont cure:size=8 update_interval 1 own_window_colour black own_window_hints undecorated,bel
-
Issue with passing param's from ME POD to MII.
I have an interesting issue. I have a customer with POD screen in ME that has a command button to open an MII screen. The POD screen has the workstation ID in the URL. The MII screen needs that workstation id. Normally I would use window.open
-
Dear PP Gurus, I have a finished Product FG01 , which contains SF01 and SF02 assemblies , these assemblies comes from differnt department in the plant. Ihave defined differnt order types for example zp01 and zp01 for assemblies coming f
-
Good morning! I have to allow access to users to the sales orders backorder processing, but I cannot provide access to modifications. I thought about the tcode CO06 (which fully suits our purposes), but once there the users can change the reservation