I use the enhancer provided by jdori (com.sun.jdori.enhancer) and db-ojb-1.0.rc6.
I don't know, because I have a similar class without problem during enhancement and running.
Here my class file :
public final class CFile {
private long id; // primary-key, autoincrement
private String fileName;
private String contentFile; protected CFile() {
}protected CFile(final String fileName, final String contentType, final InputStream fileStream) {
this();
try {
contentFile = IOUtils.toString(fileStream);
} catch (IOException ex) {
ex.printStackTrace();
}
this.fileName = fileName;
this.contentType = contentType;
}
public long getId() {
return id;
}
protected String getContentType() {
return contentType;
}
public String getFileName() {
return fileName;
}public InputStream getContentFile() {
return (InputStream) new ByteArrayInputStream(contentFile.getBytes());
}
public String toString() {
return "File : id=" + id + " ; fileName=" + fileName + " ; contentType=" + contentType;
}
}
Nicolas Arni-Bloch wrote:
Hi Alexandre, could you send the java class ? wish version of the jdo enhancer do you use ?
Le 26 avr. 04, � 09:00, Alexandre BOISSEAU a �crit :
Hi,--
I have a class file with an 'long id' autoincrementally. During byte-code enhancement, I get the following error :
[java] Error while enhancing: JDO ENHANCER: At least one error occurred while enhancing input class for Transparent Persistence; detailed message(s): nested exception: com.sun.jdori.model.ModelFatalException: ReflectionJavaField.ensureInitializedField: cannot find reflection field instance for field id.
[java] com.sun.jdori.enhancer.EnhancerUserException: JDO ENHANCER: At least one error occurred while enhancing input class for Transparent Persistence; detailed message(s): nested exception: com.sun.jdori.model.ModelFatalException: ReflectionJavaField.ensureInitializedField: cannot find reflection field instance for field id.
[java] at com.sun.jdori.enhancer.filter.Enhancer.enhanceClassFile(Unknown Source)
[java] at com.sun.jdori.enhancer.Main.enhanceClassFile(Unknown Source)
[java] at com.sun.jdori.enhancer.Main.enhanceInputFiles(Unknown Source)
[java] at com.sun.jdori.enhancer.Main.process(Unknown Source)
[java] at com.sun.jdori.enhancer.Main.main(Unknown Source)
Contents of XML Metadate file :
<jdo>
<package name="org.esupportail.portal.channels.CPracticeChannel">
<class name="CFile">
<extension vendor-name="ojb" key="table" value="file" />
<field name="id">
<extension vendor-name="ojb" key="column" value="id" />
<extension vendor-name="ojb" key="jdbc-type" value="BIGINT" /> </field>
...
</class>
Please help me ? And if you need other details ...
Regards, Alexandre.
-- Alexandre BOISSEAU University of Rennes1 - France
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Nicolas Arni-Bloch Groupe MATIS, Centre Universitaire d'Informatique
24 rue General-Dufour
CH-1204 Gen�ve
eMail : [EMAIL PROTECTED]
phone : +41 22 379 76 80
fax : +41 22 379 77 80
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Alexandre BOISSEAU Universit� de Rennes1
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
