-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: problem deploying following use of InstrumentTask
PostPosted: Sun Mar 29, 2009 8:00 am 
Newbie

Joined: Fri Feb 13, 2009 8:42 am
Posts: 1
Location: montreal
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]

_________________
An Phong Do
www.solabs.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.