Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] StaticWeavingAntTask didn't weave my classes

Hi Tom, 

Below are what my Person class looks like:

-------------------------------------------------------------
package example.phonebook.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="TBL_PERSON")
public class Person {
	private Integer id;
	private String  name;

	@Id @Column
	public Integer getId() { return id;}
	public void setId(Integer id) {this.id = id;}
	@Column
	public String getName() {return name;}
	public void setName(String name) {this.name = name;}
}
----------------------------------------------------------------------------

The weaver detected  the class but it skipped the class during the weaving.
I tried to change the path of the class in persistence.xml to
<class>example.phonebook.model.Userz</class>, it showed
ClassNotFoundException. It didn't showed any error after I revert it  but my
class stayed unwoven.

Do I need to package all of them to jar files before I try to weave it? 

Thanks

Regards,



Donny



Tom Ware wrote:
> 
> What does your Person class look like?
> 
> fenrir wrote:
>> Hi, everyone, I need your help.
>> 
>> I tried to use the Static Weaving and somehow it didn't weave my classes.
>> 
>> The weave taskdef is configured like this:
>> 
>> <weave source="target/classes" target="bin/weaved"
>>                        loglevel="FINEST" />
>> 
>> all the compiled classes are located in target/classes
>> the META-INF/persistence.xml is located in target/classes
>> (target/classes/META-INF/persistence.xml)
>> 
>> My persistence.xml is like this:
>> 
>> <persistence xmlns="http://java.sun.com/xml/ns/persistence";
>>            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>            xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
>> 
>> http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd";
>>            version="1.0">
>>       <persistence-unit name="testJpa" transaction-type="RESOURCE_LOCAL">
>>               <class>example.phonebook.model.Person</class>
>>       </persistence-unit>
>> </persistence>
>> 
>> Below are the output of the weaving:
>> 
>> weave:
>>   [weave] [EL Finer]: 2008.07.17
>> 23:31:42.275--ServerSession(4300037)--Thread(Thread[main,5,main])--Searching
>> for default mapping file in file:/C:/my_jpa_project/target/classes/
>>   [weave] [EL Finer]: 2008.07.17
>> 23:31:43.267--ServerSession(4300037)--Thread(Thread[main,5,main])--Searching
>> for default mapping file in file:/C:/my_jpa_project/target/classes/
>> BUILD SUCCESSFUL
>> Total time: 6 seconds
>> 
>> There are no messages of my Person.class being weaved. .
>> The new Person class in the weaved dir was exactly the same unweaved
>> Person.class
>> (I compared both through winmerge).
>> 
>> I don't think I did any mistake in the Entity class because this class
>> works nice and
>> weaved properly with OpenJPA compiler.
>> 
>> Look forward to your help!! Thank you very much!!!
>> 
>> Regards,
>> 
>> 
>> Donny
>> 
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> 
> 

-- 
View this message in context: http://www.nabble.com/StaticWeavingAntTask-didn%27t-weave-my-classes-tp18512604p18513885.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top