Bruce
after a litztle bit of debugging, I've traced this exception to the following code
fragementin Types.java:
public static Class typeFromName( ClassLoader loader, String typeName )
throws ClassNotFoundException
{
for ( int i = 0 ; i < _typeInfos.length ; ++i ) {
if ( typeName.equals( _typeInfos[ i ].shortName ) )
return ( _typeInfos[ i ].primitive != null ? _typeInfos[ i ].primitive
:
_typeInfos[ i ].javaType );
}
if ( loader != null )
return loader.loadClass( typeName );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
else
return Class.forName( typeName );
The exception occurs at the line marked with '�'. Any idea why ?
'org.exolab.castor.types.Duration' is on the classpath, afai can tell.
Werner
==================BEGIN FORWARDED MESSAGE==================
This one time, at band camp, Tomasz Piontek said:
TP>I attached your response to my mail manually (didn't do replay-to), because I
didn't get it directly.
TP>I send several times "subscribe" request, but didn't get any response and any
messages coming from castor-dev mailing list.
TP>I found your response in archive, but unfortunately didn't get it.
TP>
TP>
TP>.... but returning to the issue:
TP>
TP>I modified sources of castor-0.9.5.3.
TP>
TP>I added two convertors Long <-> castor.types.Duration in SQLTypes.java file:
TP>
TP> new TypeConvertorInfo( new SQLTypeConvertor(
org.exolab.castor.types.Duration.class, java.lang.Long.class ) {
TP> public Object convert( Object obj, String param ) {
TP> return new Long( ( (org.exolab.castor.types.Duration) obj
).toLong() );
TP> }
TP> } ),
TP> new TypeConvertorInfo( new SQLTypeConvertor( java.lang.Long.class,
org.exolab.castor.types.Duration.class ) {
TP> public Object convert( Object obj, String param ) {
TP> return new org.exolab.castor.types.Duration( ( ( Long ) obj
).longValue() );
TP> }
TP> } )
TP>
TP>and for following mapping file:
TP>
TP><mapping xmlns="http://castor.exolab.org/" xmlns:cst="http://castor.exolab.org/">
TP> <description>Castor generated mapping file</description>
TP> <class cst:name="grms.castorgen.Dates_time" identity="dbId"
key-generator="MAX">
TP> <description>Default mapping for class
grms.castorgen.Dates_time</description>
TP> <map-to cst:xml="dates_time" table="date_time"/>
TP> <field name="dbId" type="int" direct="true">
TP> <bind-xml name="db-id" node="attribute"/>
TP> <sql name="date_id" type="integer"/>
TP> </field>
TP>
TP> <field cst:name="date_with_time" cst:type="java.util.Date"
cst:required="true">
TP> <bind-xml name="date_with_time" node="element"/>
TP> <sql name="date_time" type="bigint"/>
TP> </field>
TP>
TP> <field cst:name="interval"
cst:type="org.exolab.castor.types.Duration" cst:required="true">
TP> <bind-xml name="interval" node="element"/>
TP> <sql name="interval" type="bigint"/>
TP> </field>
TP>
TP> </class>
TP></mapping>
TP>
TP>
TP>got following exception:
TP>
TP>[test] org.exolab.castor.jdo.DatabaseNotFoundException: Field element,
"org.exolab.castor.types.Duration" not found!
TP>[test] org.exolab.castor.mapping.MappingException: Field element,
"org.exolab.castor.types.Duration" not found!
TP>[test] at org.exolab.castor.persist.DatingService.close(DatingService.java:127)
TP>[test] at org.exolab.castor.persist.ClassMolder.resolve(ClassMolder.java:525)
TP>[test] at org.exolab.castor.persist.LockEngine.<init>(LockEngine.java:164)
TP>[test] at
org.exolab.castor.persist.PersistenceEngineFactory.createEngine(PersistenceEngineFactory.java:82)
TP>[test] at
org.exolab.castor.jdo.engine.DatabaseRegistry.<init>(DatabaseRegistry.java:194)
TP>[test] at
org.exolab.castor.jdo.engine.DatabaseRegistry.<init>(DatabaseRegistry.java:157)
TP>[test] at
org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry.java:283)
TP>[test] at org.exolab.castor.jdo.JDO.getDatabase(JDO.java:603)
TP>[test] at Test.run(Test.java:92)
TP>[test] at Test.main(Test.java:62)
TP>
TP>Any help or hint what to do is welcome.
TP>Which files have to be also modified?
TP>
TP>If it is not a problem please add my emial-address directly in TO: section, as I
wrote I don't get mails from castor-dev.
TP>Werner, sorry that I sent this mail also directly to you, but I did so many
attempts to subscribe and unsubscibe, than I'm not sure if this mail will arrive
to castor-dev.
Tomasz,
Thank you for the patch information. Did the SQLTypeConvertors above work for your
situation?
Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
The Castor Project
http://www.castor.org/
Apache Geronimo
http://incubator.apache.org/projects/geronimo.html
===================END FORWARDED MESSAGE===================
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev