-->
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.  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Sat Jan 30, 2010 4:34 am 
Newbie

Joined: Thu Feb 14, 2008 3:26 am
Posts: 18
Hello,

I'm seeing to migrate the project that i'm working on to JPA2 using hibernate. Now, the project is working with 3.3.2.GA.

I've downloaded Hibernate Core 3.5.0-Beta-4, and replace the jar's to test it, and I've this log error on deploy:

[#|2010-01-30T09:26:01.096+0100|SEVERE|glassfishv3.0|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=23;_ThreadName=Thread-1;|Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
java.lang.IllegalArgumentException: Cannot determine java-type from given member [null]
at org.hibernate.ejb.metamodel.AttributeFactory$BaseAttributeMetadata.<init>(AttributeFactory.java:597)
at org.hibernate.ejb.metamodel.AttributeFactory$SingularAttributeMetadataImpl.<init>(AttributeFactory.java:677)
at org.hibernate.ejb.metamodel.AttributeFactory$SingularAttributeMetadataImpl.<init>(AttributeFactory.java:667)
at org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(AttributeFactory.java:539)
at org.hibernate.ejb.metamodel.AttributeFactory.buildAttribute(AttributeFactory.java:84)
at org.hibernate.ejb.metamodel.MetadataContext.wrapUp(MetadataContext.java:179)
at org.hibernate.ejb.metamodel.MetamodelImpl.buildMetamodel(MetamodelImpl.java:66)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:79)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:850)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:181)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:96)
at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:269)
at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:79)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:131)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:129)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:197)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:206)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:235)
at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:129)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
|#]

What I'm doing worng?

Lot of thanks


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Mon Feb 01, 2010 3:43 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
1. Do you use java 1.5 or higher ?
Hibernate3.5 requires this.

2. Did you remove old hiberante-entitymanager.jar and hibernate-annotations.jar from classpath ?
N.B.: hibernate3.jar version 3.5 contains also hiberante-entitymanager and hibernate-annotations!


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Mon Feb 01, 2010 6:30 am 
Newbie

Joined: Thu Feb 14, 2008 3:26 am
Posts: 18
i use jdk 6u18,and i've remove old jars and use only the hibernate jar from 4beta. i'm lost, the logs don't tell me nothing.
the pproject jas over 200 hibernate entities


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Mon Feb 01, 2010 6:57 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
In your situation, I would:
1. get the sources of entity manager version 3.5.beta4
http://repository.jboss.org/maven2/org/hibernate/hibernate-entitymanager/3.5.0-Beta-4/hibernate-entitymanager-3.5.0-Beta-4-sources.jar

2. Debug your application with a breakpoint at AttributeFactory.java line 597

In this way you should easily discover who of the 200 entity classes is the responsible for this error
(provided that you use a decent debugger)


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Mon Feb 01, 2010 11:32 am 
Newbie

Joined: Thu Feb 14, 2008 3:26 am
Posts: 18
Hi,

Lot of thanks for your reply.

I've downloaded de sources. With eclipse I've attach this sources to the class of hibernate. But when I go to make a break point into line 597, it only let me do into line 571
Code:
private abstract class BaseAttributeMetadata<X,Y> implements AttributeMetadata<X,Y> {


I've increase the log level to finest, and after the above exception I've these lines:
Code:
[#|2010-02-01T16:25:57.450+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Not setting field ftId to null in object of class org.kyrian.entity.gnomo.GnFestivoTipo because the referenced object was of type java.math.BigDecimal which was not loaded by this WebappClassLoader.|#]

[#|2010-02-01T16:25:57.451+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field ftDescripcion to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.451+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field ftColor to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.452+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field ftPrioridad to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.452+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field ftAlias to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.453+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field gnFestivoCollection to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.454+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Not setting field ftId to null in object of class org.kyrian.entity.gnomo.GnFestivoTipo because the referenced object was of type java.math.BigDecimal which was not loaded by this WebappClassLoader.|#]

[#|2010-02-01T16:25:57.454+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field ftDescripcion to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.455+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field ftColor to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.455+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field ftPrioridad to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.456+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field ftAlias to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.456+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field gnFestivoCollection to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.457+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Not setting field ftId to null in object of class org.kyrian.entity.gnomo.GnFestivoTipo because the referenced object was of type java.math.BigDecimal which was not loaded by this WebappClassLoader.|#]

[#|2010-02-01T16:25:57.457+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field ftDescripcion to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.458+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field ftColor to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]

[#|2010-02-01T16:25:57.458+0100|FINE|glassfishv3.0|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=25;_ThreadName=Thread-1;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=nullInstance;|Set field ftPrioridad to null in class org.kyrian.entity.gnomo.GnFestivoTipo|#]


The source of this entity is:
Code:
package org.kyrian.entity.gnomo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;

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

/**
*
* @author marcial
*/
@Entity
@Table(name = "GN_FESTIVO_TIPO",schema="GNOMO")
public class GnFestivoTipo implements Serializable {
   
   /**
    *
    */
   private static final long serialVersionUID = -2521128574802059738L;
   // Constantes
   public final static GnFestivoTipo NACIONAL = new GnFestivoTipo(new BigDecimal(1));
    public final static GnFestivoTipo CCAA = new GnFestivoTipo(new BigDecimal(2));
    public final static GnFestivoTipo PROVINCIA = new GnFestivoTipo(new BigDecimal(3));
    public final static GnFestivoTipo LOCAL = new GnFestivoTipo(new BigDecimal(4));
    public final static GnFestivoTipo PUESTE = new GnFestivoTipo(new BigDecimal(5));
    public final static GnFestivoTipo DIA_RARO = new GnFestivoTipo(new BigDecimal(6));
   
   
    @Id
    @Column(name = "FT_ID", nullable = false)
    private BigDecimal ftId;
    @Column(name = "FT_DESCRIPCION", nullable = false)
    private String ftDescripcion;
    @Column(name = "FT_COLOR", nullable = false)
    private String ftColor;
    @Column(name = "FT_PRIORIDAD", nullable = false)
    private BigInteger ftPrioridad;
    @Column(name = "FT_ALIAS", nullable = false)
    private String ftAlias;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "fesTipo")
    private Collection<GnFestivo> gnFestivoCollection;

    public GnFestivoTipo() {
    }

    public GnFestivoTipo(BigDecimal ftId) {
        this.ftId = ftId;
    }

    public GnFestivoTipo(BigDecimal ftId, String ftDescripcion, String ftColor, BigInteger ftPrioridad, String ftAlias) {
        this.ftId = ftId;
        this.ftDescripcion = ftDescripcion;
        this.ftColor = ftColor;
        this.ftPrioridad = ftPrioridad;
        this.ftAlias = ftAlias;
    }

    public BigDecimal getFtId() {
        return ftId;
    }

    public void setFtId(BigDecimal ftId) {
        this.ftId = ftId;
    }

    public String getFtDescripcion() {
        return ftDescripcion;
    }

    public void setFtDescripcion(String ftDescripcion) {
        this.ftDescripcion = ftDescripcion;
    }

    public String getFtColor() {
        return ftColor;
    }

    public void setFtColor(String ftColor) {
        this.ftColor = ftColor;
    }

    public BigInteger getFtPrioridad() {
        return ftPrioridad;
    }

    public void setFtPrioridad(BigInteger ftPrioridad) {
        this.ftPrioridad = ftPrioridad;
    }

    public String getFtAlias() {
        return ftAlias;
    }

    public void setFtAlias(String ftAlias) {
        this.ftAlias = ftAlias;
    }

    public Collection<GnFestivo> getGnFestivoCollection() {
        return gnFestivoCollection;
    }

    public void setGnFestivoCollection(Collection<GnFestivo> gnFestivoCollection) {
        this.gnFestivoCollection = gnFestivoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ftId != null ? ftId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
if (!(object instanceof GnFestivoTipo)) {
            return false;
        }
        GnFestivoTipo other = (GnFestivoTipo) object;
        if (this.ftId != other.ftId && (this.ftId == null || !this.ftId.equals(other.ftId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.kyrian.entity.gnomo.GnFestivoTipo[ftId=" + ftId + "]";
    }

}


The mapped by goes:
Code:
    @JoinColumn(name = "FES_TIPO", referencedColumnName = "FT_ID")
    @ManyToOne
    private GnFestivoTipo fesTipo;


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Mon Feb 01, 2010 11:48 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
I've downloaded de sources. With eclipse I've attach this sources to the class of hibernate. But when I go to make a break point into line 597, it only let me do into line 571


I use Eclipse 3.5.1 and can successfully set a breakpoint on org.hibernate.ejb.metamodel.AttributeFactory.java line 571


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Mon Feb 01, 2010 11:50 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
I use Eclipse 3.5.1 and can successfully set a breakpoint on org.hibernate.ejb.metamodel.AttributeFactory.java line 597


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Mon Feb 01, 2010 11:59 am 
Newbie

Joined: Thu Feb 14, 2008 3:26 am
Posts: 18
I get it to debug.

I take this with debug:
propertyMapping: _org_kyrian_entity_muvale_Prcontra_empresa
owner: Empre

In Empre I've this code:
Code:
   
    @OneToMany(mappedBy = "empresa")
    private Collection<Prcontra> prcontraCollection;


Fields doc, nif in Empre:
Code:
        @Column(name = "DOC", nullable = false)
   private BigInteger doc;
   @Column(name = "NIF", nullable = false)
   private String nif;


PK in Empre:
Code:
        @Id
   @Column(name = "NUM", nullable = false)
   @GeneratedValue(generator="SeqEmpre")
        @SequenceGenerator(name="SeqEmpre",sequenceName="MUVALE.NUME", allocationSize=1)
   private Long num;



In PrContra,

Code:
@ManyToOne(fetch=FetchType.LAZY)
   @JoinColumns(
         {
            @JoinColumn(name = "DOC", referencedColumnName = "DOC",nullable=false),
            @JoinColumn(name = "NIF", referencedColumnName = "NIF",nullable=false)
         })            
   private Empre empresa;


Pk en Prcontra:
Code:
        @EmbeddedId
   protected PrcontraPK prcontraPK;


Bean PrcontraPK:
Code:
@Embeddable
public class PrcontraPK implements Serializable {
    /**
    *
    */
   private static final long serialVersionUID = 7441961985141369232L;
   @Column(name = "NUMERO", nullable = false)
    private BigInteger numero;
    @Column(name = "RENOV", nullable = false)
    private BigInteger renov;
    @Column(name = "TIPO", nullable = false)
    private BigInteger tipo;

    public PrcontraPK() {
    }

    public PrcontraPK(BigInteger numero, BigInteger renov, BigInteger tipo) {
        this.numero = numero;
        this.renov = renov;
        this.tipo = tipo;
    }

    public BigInteger getNumero() {
        return numero;
    }

    public void setNumero(BigInteger numero) {
        this.numero = numero;
    }

    public BigInteger getRenov() {
        return renov;
    }

    public void setRenov(BigInteger renov) {
        this.renov = renov;
    }

    public BigInteger getTipo() {
        return tipo;
    }

    public void setTipo(BigInteger tipo) {
        this.tipo = tipo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (numero != null ? numero.hashCode() : 0);
        hash += (renov != null ? renov.hashCode() : 0);
        hash += (tipo != null ? tipo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
if (!(object instanceof PrcontraPK)) {
            return false;
        }
        PrcontraPK other = (PrcontraPK) object;
        if (this.numero != other.numero && (this.numero == null || !this.numero.equals(other.numero))) {
            return false;
        }
        if (this.renov != other.renov && (this.renov == null || !this.renov.equals(other.renov))) {
            return false;
        }
        if (this.tipo != other.tipo && (this.tipo == null || !this.tipo.equals(other.tipo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.kyrian.entity.muvale.PrcontraPK[numero=" + numero + ", renov=" + renov + ", tipo=" + tipo + "]";
    }

}


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Mon Feb 01, 2010 12:05 pm 
Newbie

Joined: Thu Feb 14, 2008 3:26 am
Posts: 18
In Empre.java I've this constants:
Code:
   public static final BigInteger AUTONOMO = BigInteger.valueOf(2);
   public static final BigInteger EMPRESA = BigInteger.valueOf(1);
   public static final BigInteger EMPRESA_CAPTACION = BigInteger.valueOf(3);


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Mon Feb 01, 2010 12:16 pm 
Newbie

Joined: Thu Feb 14, 2008 3:26 am
Posts: 18
Hi,

I don't know how to interpret the debug information.

Member is null, but I don't know why.

With 3.3.2.GA the code worked. I'm very loosed with this problem.

Lot of thanks for your help and replies.


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Mon Feb 01, 2010 12:42 pm 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
Member is null, but I don't know why.


You must investigate in this direction. Why is member null.
If it worked with 3.3.2 GA, then you should open a Bug-report on Hibernate Jira
(with testcase if possible)


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Mon Feb 01, 2010 1:04 pm 
Newbie

Joined: Thu Feb 14, 2008 3:26 am
Posts: 18
I've post a issue on Jira:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4870


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Thu Feb 04, 2010 7:41 pm 
Newbie

Joined: Thu Feb 04, 2010 7:36 pm
Posts: 2
I have ran in to this same problem. I believe the problem is when classes have a constructor explicitly defined. The code below is checking for either a Field or a Method. However a Constructor also implements the Memeber Interface and will cause this error to happen.

snippet is (Line: 590 from org.hibernate.ejb.metamodel.AttributeFactory)

Code:
if ( Field.class.isInstance( member ) ) {
            declaredType = ( (Field) member ).getType();
         }
         else if ( Method.class.isInstance( member ) ) {
            declaredType = ( (Method) member ).getReturnType();
         }
         else {
            throw new IllegalArgumentException( "Cannot determine java-type from given member [" + member + "]" );
         }



Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Fri Feb 05, 2010 4:58 am 
Newbie

Joined: Thu Feb 14, 2008 3:26 am
Posts: 18
Hi,

Lot of thanks for your reply. I've constructor in both affected entities, but there is any common attribute between them.


Top
 Profile  
 
 Post subject: Re: Proble migrating to JPA2: Hibernate Core 3.5.0-Beta-4
PostPosted: Fri Feb 05, 2010 2:12 pm 
Newbie

Joined: Thu Feb 04, 2010 7:36 pm
Posts: 2
Hi, please disregard my previous post. That is indeed not the issue. I spent some time debugging the code but I am also not able to find an answer. For now i will be going back to Beta-2. please post if you find any answers.

Thanks,
Shaun


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page 1, 2  Next

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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.