I have a problem deploying jar that have been javassist with InstrumentTask
I am using Jboss 4.2.3
I have write a simple entity and SLSB
here is the code of my entity:
Code:
@Entity
@Table(name="FileEntity")
public class FileEntity {
private Integer id;
private String path;
private String name;
private Blob data;
private long size;
public long getSize() {
return size;
}
public void setSize(long size) {
this.size = size;
}
public FileEntity() {}
@Id
@GeneratedValue
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Lob
@Basic(fetch = FetchType.LAZY)
public Blob getData() {
return data;
}
public void setData(Blob data) {
this.data = data;
}
@Transient
public InputStream getDataStream() throws SQLException {
if (getData() == null)
return null;
return getData().getBinaryStream();
}
@Transient
public void setDataStream(InputStream sourceStream) throws IOException {
setData(Hibernate.createBlob(sourceStream));
}
}
I execute the javassist target with:
Code:
<target name="instrument">
<taskdef name="instrument" classname="org.hibernate.tool.instrument.javassist.InstrumentTask">
<classpath path="bin"/>
<classpath refid="lib.class.path"/>
</taskdef>
<instrument verbose="true">
<fileset dir="bin/com/solabs/test">
<include name="FileEntity.class"/>
</fileset>
</instrument>
</target>
The target is executed with success.
When I deploy my generated jar that include the instrumented code I got the following error:
Code:
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: persistence.units:jar=Alibaba2Test.jar,unitName=alibabaDS
State: FAILED
Reason: javax.persistence.PersistenceException: org.hibernate.MappingException
: [b]Could not determine type for: org.hibernate.bytecode.javassist.FieldHandler, f
or columns: [org.hibernate.mapping.Column(fieldHandler)][/b]
I Depend On:
jboss.jca:service=DataSourceBinding,name=alibabaDS
Depends On Me:
jboss.j2ee:jar=Alibaba2Test.jar,name=Tester,service=EJB3
Note that I got the same problem if I remove the blob object and methods from the entity.
Do you have an Idea what I do wrong?
thanks for you help
An Phong Do
[/code]