Ebean upgrade broke some @MappedSuperclass fields... How to fix?

252 views
Skip to first unread message

Steven Baldasty

unread,
Jan 11, 2018, 9:47:06 AM1/11/18
to Ebean ORM
Hi all,

I updated the Ebean dependencies in a project. I updated Ebean itself from 7.6.1 to 11.7.1 (which is currently the latest version). I updated the "agent" which is responsible for enhancing the bytecode of the beans from 4.9.2 to 11.5.1 (which is currently the latest version). I fixed all the compile errors per the release notes, but issues remains at runtime.

The bean it complains about varies from startup to startup (Is the order the beans are discovered non-deterministic?), but the idea is:

Property a not found in [b, c] for type class MyBean

In all cases I've seen, a comes from a @MappedSuperclass. The message originates BeanDescriptorManager where bean properties are being matched to elements in a field that is added to the bean class during enhancement called _ebean_props. The properties in _ebean_props do not seem to include properties from superclasses.

So really I am not even sure if the problem is on the enhancement side (Should the agent include superclass properties in _ebean_props?) or the runtime side (Should the BeanDescriptorManager look into the _ebean_props of superclasses to find the match it needs?)

Either way, insights about what is happening and how I can fix it would be appreciated. Thanks!


Steven


Rob Bygrave

unread,
Jan 11, 2018, 3:36:27 PM1/11/18
to ebean@googlegroups
This is usually when you are enhancing using an IDE plugin with incremental compile and only part of the inheritance hierarchy was compiled.

You should never see this with a full project rebuild and you should not see it with enhancement via maven or gradle etc.


I have a change to the IDEA enhancement plugin to handle incremental compile cases better and looking to put that out shortly ... but it is not clear that helps the issue you are seeing.

Can you confirm if you see this error via maven or gradle enhancement?  Or are you only seeing this while running in the IDE (make change run test) ?  What IDE are you using.



Cheers, Rob.


--

---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steven Baldasty

unread,
Jan 12, 2018, 10:13:01 AM1/12/18
to Ebean ORM
Well normally I use IDEA to work with this project, but the IDEA enhancement plugin is not coming into play here; I can confirm issue is happening using just Gradle enhancement.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.

Daryl Stultz

unread,
Jan 12, 2018, 10:18:45 AM1/12/18
to eb...@googlegroups.com
On Fri, Jan 12, 2018 at 10:13 AM, Steven Baldasty <sbal...@gmail.com> wrote:
Well normally I use IDEA to work with this project, but the IDEA enhancement plugin is not coming into play here; I can confirm issue is happening using just Gradle enhancement.


To clarify, we're using an Ant task in Gradle to do the enhancement.

/Daryl

Rob Bygrave

unread,
Jan 14, 2018, 3:10:33 PM1/14/18
to ebean@googlegroups
I don't recall ever seeing this issue with the standard Maven or Gradle enhancement.

Are you able to create a cut-down example project that reproduces the problem that I could look at?


Thanks

--

---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+unsubscribe@googlegroups.com.

Steven Baldasty

unread,
Jan 17, 2018, 10:54:32 AM1/17/18
to Ebean ORM
I would really like to create a cut-down example that reproduces the problem... But my cut-down example actually works.

I noticed in my working cut-down example that the _ebean_props of the child entity does not contain @MappedSuperclass fields either, just like in the non-working web application. So it would indeed seem appropriate that the field not be found...

I am also a little surprised to see bytecode being generated at runtime, since enhancement happens during the build process. So should the flow of control actually even reach here?

        at io.ebeaninternal.server.deploy.BeanDescriptorManager.setBeanReflect(BeanDescriptorManager.java:1395)
        at io.ebeaninternal.server.deploy.BeanDescriptorManager.createByteCode(BeanDescriptorManager.java:1351)
        at io.ebeaninternal.server.deploy.BeanDescriptorManager.readDeployAssociations(BeanDescriptorManager.java:1269)
        at io.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityDeploymentAssociations(BeanDescriptorManager.java:746)
        at io.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:360)
        at io.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:154)
        at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:142)
        at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:46)
        at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:107)
        at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:66)


Rob Bygrave

unread,
Jan 17, 2018, 8:02:20 PM1/17/18
to ebean@googlegroups
>I am also a little surprised to see bytecode being generated at runtime, since enhancement happens during the build process. So should the flow of control actually even reach here?


So I presume you mean ... BeanDescriptorManager.createByteCode(BeanDescriptorManager.java:1351)

This is misleading.  This method name was appropriate back in the day when Ebean supported dynamic proxies (generating bytecode on the fly and registering those classes with it's own class loader).  We dropped support for that a few years ago but obviously didn't change that method name to be more appropriate.

So no, bytecode isn't generated at runtime anymore no.



Cheers, Rob.

Steven Baldasty

unread,
Jan 18, 2018, 7:13:44 AM1/18/18
to Ebean ORM
Okay, that makes sense. I learned my way around the code yesterday, and I guess I just have two follow up questions.
  1. Am I correct based on my cut-down example that works, that _ebean_props should not contain fields from @MappedSuperclass superclasses?
  2. If yes, it seems inevitable that gathering all the fields up the entity's class hierarchy to Object in DeployCreateProperties.createProperties(DeployBeanDescriptor, Class, int) and then trying to match those against elements of _ebean_props would fail for entities with fields defined in its superclasses? I therefore spent a bunch of time exploring under the assumption that this matching in BeanDescriptorManager.setBeanReflect(DeployBeanDescriptor) should not be happening in my case... but what could trigger it to be avoided?

Thanks!

Rob Bygrave

unread,
Jan 18, 2018, 3:11:27 PM1/18/18
to ebean@googlegroups
> Am I correct based on my cut-down example that works, that _ebean_props should not contain fields from @MappedSuperclass superclasses?

No, not correct.  _ebean_props should contain properties from the MappedSuperclass

If you make that available I can have a look at it.




Example:

Contact extends BaseModel

https://github.com/ebean-orm-examples/example-java8/blob/master/src/main/java/org/example/domain/Contact.java
https://github.com/ebean-orm-examples/example-java8/blob/master/src/main/java/org/example/domain/BaseModel.java


In IntelliJ I have the "ASM Bytecode outline" plugin installed.

So with Ebean IDEA enhancement plugin I can ...

goto Contact source code - Right Mouse - Show bytecode outline ...



  // access flags 0x8
  static <clinit>()V
   L0
    LINENUMBER 1 L0
    BIPUSH 10
    ANEWARRAY java/lang/String
    DUP
    ICONST_0
    LDC "id"
    AASTORE
    DUP
    ICONST_1
    LDC "version"
    AASTORE
    DUP
    ICONST_2
    LDC "whenCreated"
    AASTORE
    DUP
    ICONST_3
    LDC "whenUpdated"              <-- The id, version, whenCreated and whenUpdated properties come the from MappedSuperclass BaseModel
    AASTORE
    DUP
    ICONST_4
    LDC "firstName"                        <-- First property in Contact
    AASTORE
    DUP
    ICONST_5
    LDC "lastName"
    AASTORE
    DUP
    BIPUSH 6
    LDC "email"
    AASTORE
    DUP
    BIPUSH 7
    LDC "phone"
    AASTORE
    DUP
    BIPUSH 8
    LDC "customer"
    AASTORE
    DUP
    BIPUSH 9
    LDC "comments"
    AASTORE
    PUTSTATIC org/example/domain/Contact._ebean_props : [Ljava/lang/String;           <-- Set _ebean_props array
   L1
    LINENUMBER 18 L1
    NEW org/example/domain/finder/ContactFinder
    DUP
    INVOKESPECIAL org/example/domain/finder/ContactFinder.<init> ()V
    PUTSTATIC org/example/domain/Contact.find : Lorg/example/domain/finder/ContactFinder;
    RETURN
    MAXSTACK = 4
    MAXLOCALS = 0




-----------------------------

Note: 

Ebean enhancement does this so that we can use cheap boolean arrays for the loaded status and dirty status of properties on the beans.  There is an issue right now with Kotlin partial compile and the IDEA Plugin related to this - I am looking to release a updated plugin for that (but this issue is related to the IDEA Plugin and not the maven or gradle enhancement.



Cheers, Rob.


Message has been deleted
Message has been deleted

Steven Baldasty

unread,
Jan 19, 2018, 10:22:32 AM1/19/18
to Ebean ORM
This is great progress then, because it means I was looking at the wrong part of the process. Being able to create a server in my cut-down example led me to believe the issue was a runtime one. But this information means that the issue is really an enhancement one! Still not sure how I am able to create a server though...

I will show you my cut-down example because it is simpler and shows how the _ebean_props for a child entity do not contain the properties from its @MappedSuperclass parent. Here are the entity sources:

package beans;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

@MappedSuperclass
public class Parent {

    @Column(name = "inheritedColumn")
    private String inheritedColumn;

    public String getInheritedColumn() {
        return inheritedColumn;
    }

    public void setInheritedColumn(String inheritedColumn) {
        this.inheritedColumn = inheritedColumn;
    }

}


package beans;

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

@Entity
@Table(name = "ImaginaryTable", schema = "imaginary_schema")
public class Child {

    @Id
    @Column(name = "id")
    private Integer id;

}

Here are the enhanced class files, decompiled:

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package beans;

import io.ebean.bean.EntityBean;
import io.ebean.bean.EntityBeanIntercept;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

@MappedSuperclass
public class Parent implements EntityBean {
    @Column(
        name = "inheritedColumn"
    )
    private String inheritedColumn;
    private static String _EBEAN_MARKER;
    public static String[] _ebean_props = new String[]{"inheritedColumn"};
    protected EntityBeanIntercept _ebean_intercept = new EntityBeanIntercept(this);
    protected transient Object _ebean_identity;

    public Parent() {
    }

    public String getInheritedColumn() {
        return this._ebean_get_inheritedColumn();
    }

    public void setInheritedColumn(String inheritedColumn) {
        this._ebean_set_inheritedColumn(inheritedColumn);
    }

    public String _ebean_getMarker() {
        return _EBEAN_MARKER;
    }

    public String[] _ebean_getPropertyNames() {
        return _ebean_props;
    }

    public String _ebean_getPropertyName(int pos) {
        return _ebean_props[pos];
    }

    public EntityBeanIntercept _ebean_getIntercept() {
        return this._ebean_intercept;
    }

    public EntityBeanIntercept _ebean_intercept() {
        if (this._ebean_intercept == null) {
            this._ebean_intercept = new EntityBeanIntercept(this);
        }

        return this._ebean_intercept;
    }

    protected String _ebean_get_inheritedColumn() {
        this._ebean_intercept.preGetter(0);
        return this.inheritedColumn;
    }

    protected void _ebean_set_inheritedColumn(String newValue) {
        this._ebean_intercept.preSetter(true, 0, this._ebean_get_inheritedColumn(), newValue);
        this.inheritedColumn = newValue;
    }

    protected String _ebean_getni_inheritedColumn() {
        return this.inheritedColumn;
    }

    protected void _ebean_setni_inheritedColumn(String _newValue) {
        this.inheritedColumn = _newValue;
        this._ebean_intercept.setLoadedProperty(0);
    }

    public Object _ebean_getField(int index) {
        switch(index) {
        case 0:
            return this.inheritedColumn;
        default:
            throw new RuntimeException("Invalid index " + index);
        }
    }

    public Object _ebean_getFieldIntercept(int index) {
        switch(index) {
        case 0:
            return this._ebean_get_inheritedColumn();
        default:
            throw new RuntimeException("Invalid index " + index);
        }
    }

    public void _ebean_setField(int index, Object o) {
        switch(index) {
        case 0:
            this._ebean_setni_inheritedColumn((String)o);
            return;
        default:
            throw new RuntimeException("Invalid index " + index);
        }
    }

    public void _ebean_setFieldIntercept(int index, Object o) {
        switch(index) {
        case 0:
            this._ebean_set_inheritedColumn((String)o);
            return;
        default:
            throw new RuntimeException("Invalid index " + index);
        }
    }

    public void _ebean_setEmbeddedLoaded() {
    }

    public boolean _ebean_isEmbeddedNewOrDirty() {
        return false;
    }

    public Object _ebean_newInstance() {
        return new Parent();
    }
}


//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package beans;

import io.ebean.bean.EntityBean;
import io.ebean.bean.EntityBeanIntercept;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(
    name = "ImaginaryTable",
    schema = "imaginary_schema"
)
public class Child implements EntityBean {
    @Id
    @Column(
        name = "id"
    )
    private Integer id;
    private static String _EBEAN_MARKER;
    public static String[] _ebean_props = new String[]{"id"};
    protected EntityBeanIntercept _ebean_intercept = new EntityBeanIntercept(this);
    protected transient Object _ebean_identity;

    public Child() {
    }

    public String _ebean_getMarker() {
        return _EBEAN_MARKER;
    }

    public String[] _ebean_getPropertyNames() {
        return _ebean_props;
    }

    public String _ebean_getPropertyName(int pos) {
        return _ebean_props[pos];
    }

    public EntityBeanIntercept _ebean_getIntercept() {
        return this._ebean_intercept;
    }

    public EntityBeanIntercept _ebean_intercept() {
        if (this._ebean_intercept == null) {
            this._ebean_intercept = new EntityBeanIntercept(this);
        }

        return this._ebean_intercept;
    }

    protected Integer _ebean_get_id() {
        this._ebean_intercept.preGetId();
        return this.id;
    }

    protected void _ebean_set_id(Integer newValue) {
        this._ebean_intercept.preSetter(false, 0, this.id, newValue);
        this.id = newValue;
    }

    protected Integer _ebean_getni_id() {
        return this.id;
    }

    protected void _ebean_setni_id(Integer _newValue) {
        this.id = _newValue;
        this._ebean_intercept.setLoadedProperty(0);
    }

    public Object _ebean_getField(int index) {
        switch(index) {
        case 0:
            return this.id;
        default:
            throw new RuntimeException("Invalid index " + index);
        }
    }

    public Object _ebean_getFieldIntercept(int index) {
        switch(index) {
        case 0:
            return this._ebean_get_id();
        default:
            throw new RuntimeException("Invalid index " + index);
        }
    }

    public void _ebean_setField(int index, Object o) {
        switch(index) {
        case 0:
            this._ebean_setni_id((Integer)o);
            return;
        default:
            throw new RuntimeException("Invalid index " + index);
        }
    }

    public void _ebean_setFieldIntercept(int index, Object o) {
        switch(index) {
        case 0:
            this._ebean_set_id((Integer)o);
            return;
        default:
            throw new RuntimeException("Invalid index " + index);
        }
    }

    private Object _ebean_getIdentity() {
        synchronized(this) {
            if (this._ebean_identity != null) {
                return this._ebean_identity;
            } else {
                Object tmpId = this._ebean_getField(0);
                if (tmpId != null) {
                    this._ebean_identity = tmpId;
                } else {
                    this._ebean_identity = new Object();
                }

                return this._ebean_identity;
            }
        }
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } else if (!this.getClass().equals(obj.getClass())) {
            return false;
        } else {
            return obj == this ? true : this._ebean_getIdentity().equals(((Child)obj)._ebean_getIdentity());
        }
    }

    public int hashCode() {
        return this._ebean_getIdentity().hashCode();
    }

    public void _ebean_setEmbeddedLoaded() {
    }

    public boolean _ebean_isEmbeddedNewOrDirty() {
        return false;
    }

    public Object _ebean_newInstance() {
        return new Child();
    }
}

I also think the build.gradle would be interesting to see.

group 'mygroup'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

configurations {
    enhanceEbean
}

dependencies {
    compile("io.ebean:ebean:11.7.1")
    compile 'org.postgresql:postgresql:9.3-1103-jdbc4'
    compile 'org.slf4j:slf4j-simple:1.7.21'
    compile 'org.apache.openjpa:openjpa:1.2.1'
    runtime files('src/resources')
    enhanceEbean 'io.ebean:ebean-agent:11.5.1'
}


def enhanceEbean(entityClassDir, component) {
    logger.lifecycle("Enhancing Ebean ${component} class files at " + file(entityClassDir))

    ant.taskdef(
            name: 'enhanceEbean'
            , classname: "io.ebean.enhance.ant.AntEnhanceTask"
            , classpath: configurations.enhanceEbean.asPath
    )

    def ebeanPackages = []
    ebeanPackages << "beans/**"
    ant.enhanceEbean(
            classSource: entityClassDir
            , packages: ebeanPackages.join(', ')
            , transformArgs: "debug=3"
    )

    logger.lifecycle("Enhancing Ebean ${component} class files is finished.")
}

compileJava.doLast {
    enhanceEbean("${buildDir}/classes/java/main", 'main')
}

Rob Bygrave

unread,
Jan 21, 2018, 8:47:18 PM1/21/18
to ebean@googlegroups
public class Child { 

 .... does NOT extend Parent in your example above ... so you are not proving much there either way there right ?


To move forward I would be expecting you to put up the full example project on github or somewhere like that.  You can then give that to someone like me who and clone and run exactly as you do. 

The first thing someone is likely to then do is once they have that is confirm that they can reproduce the behavior.  Then they are likely to replace the enhancement task you have defined in your gradle project and instead use the Ebean supplied gradle plugin and see if the behavior changes.

Do you want to do that?




Steven Baldasty

unread,
Jan 22, 2018, 10:23:24 AM1/22/18
to Ebean ORM
 .... does NOT extend Parent in your example above ... so you are not proving much there either way there right ?

Yikes, how embarrassing! But even now that I have fixed that particular issue, I am still seeing the same result.

Do you want to do that?

Yes please, let's proceed. I uploaded the cut-down example with instructions to GitHub. I am not sure though what you mean about replacing my enhancement task with the Ebean supplied Gradle plugin?

Jasper Lankhorst

unread,
Jan 24, 2018, 4:37:11 AM1/24/18
to eb...@googlegroups.com
I have got a similar issue on Intellij 2017.3.3 Ultimate edition using Ebean 11.5.4 Plugin, and using Ebean:

<ebean.maven-plugin.version>11.5.1</ebean.maven-plugin.version>
<ebean.version>11.8.1</ebean.version>
<ebean.querybean.version>11.1.1</ebean.querybean.version>
<ebean.querybean-generator.version>11.1.1</ebean.querybean-generator.version>

Simple sample;

@Entity
@table(name="Sometable")
@Cache(enableQueryCache = true)
@XmlRootElement
public class User  extends baseID {
     // all variables.
     @Basic(optional =false)
     @Column(name="name")
     private String name;
}

@MappedSuperclass
public abstract class baseID implements Serializable {
   @Id
   @Column(name = "ID", length= 19)
   @GeneratedValue
   public Long id;

  //equal / hashCode functions.
}

Problem: 
when changing the User and updating it, effectively changing the code of User,
by adding an adress field for example, It does not find the ID field, it seems disconnected from each other?
By using maven to clean, package install, and debug, it will enhance the beans again and its fine.

The error I have:

24-Jan-2018 10:26:35.959 WARNING [RMI TCP Connection(3)-127.0.0.1] org.springframework.web.context.support.AnnotationConfigWebApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfig': Unsatisfied dependency expressed through field 'databaseAuthenticationProvider'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ebeanFactoryBean': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Property id not found in [ name ] for type class com.some.class.example.User
24-Jan-2018 10:26:35.965 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Context initialization failed
 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfig': Unsatisfied dependency expressed through field 'databaseAuthenticationProvider'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ebeanFactoryBean': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Property id not found in [ name ] for type class com.some.class.example.User

Also:

Caused by: java.lang.IllegalStateException: Property id not found in [ name ]

at io.ebeaninternal.server.deploy.BeanDescriptorManager.setBeanReflect(BeanDescriptorManager.java:1395)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.createByteCode(BeanDescriptorManager.java:1351)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.readDeployAssociations(BeanDescriptorManager.java:1269)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityDeploymentAssociations(BeanDescriptorManager.java:746)
at io.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:360)
at io.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:154)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:142)
at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:46)
at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:107)
at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:66)
at com.banktrade.clienttrade.service.EbeanFactoryBean.getObject(EbeanFactoryBean.java:138)
at com.banktrade.clienttrade.service.EbeanFactoryBean.getObject(EbeanFactoryBean.java:42)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)


Op donderdag 11 januari 2018 15:47:06 UTC+1 schreef Steven Baldasty:

Rob Bygrave

unread,
Jan 25, 2018, 4:42:02 PM1/25/18
to ebean@googlegroups
> I have got a similar issue on Intellij 2017.3.3 Ultimate edition using 11.5.4 Plugin.

Try the new 11.9.1 plugin.  That has specific handling of 'partial compilation' with MappedSuperclass ... so hopefully that fixes your issue.




> Yes please, let's proceed. I uploaded the cut-down example with instructions to GitHub.

Sorry Steven, hadn't quite looked at this yet.



> I am not sure though what you mean about replacing my enhancement task with the Ebean supplied Gradle plugin?


On 24 January 2018 at 22:37, Jasper Lankhorst <jasper.l...@gmail.com> wrote:
I have got a similar issue on Intellij 2017.3.3 Ultimate edition using 11.5.4 Plugin.


Simple sample;

@Entity
@table(name="Sometable")
@Cache(enableQueryCache = true)
@XmlRootElement
public class User  extends baseID {
     // all variables.
     @Basic(optional =false)
     @Column(name="name")
     private String name;
}

@MappedSuperclass
public abstract class baseID implements Serializable {
   @Id
   @Column(name = "ID", length= 19)
   @GeneratedValue
   public Long id;
}

Problem: 
when changing the User and updating it, effectively changing the code of User,
by adding an adress field for example, It does not find the ID field, it seems disconnected from each other?
By using maven to clean, compile, and install, it will enhance the beans again and its fine.

André Camilo

unread,
Jan 29, 2018, 2:35:51 PM1/29/18
to eb...@googlegroups.com
I'm using the 11.9.1 plugin and still having the same problem.

Doing "Rebuild project" fixes the issues, but the partial compilation problem still exists.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.

Rob Bygrave

unread,
Jan 30, 2018, 12:40:44 AM1/30/18
to ebean@googlegroups
> Yes please, let's proceed. I uploaded the cut-down example with instructions to GitHub.

Hi Steven, yes had a look - sent you a PR using the ebean gradle plugin ... I suspect the issue is related to the ANT task wrt classPath but would prefer use of the gradle plugin so getting you to look at that PR and try that.

Note that the docs have been updated: http://ebean-orm.github.io/docs/tooling/gradle




> I'm using the 11.9.1 plugin and still having the same problem.

Andrea, in IDEA when you look at 0:Messages that shows the details we need to review.  Note that we have kind of taken over Steven's thread here (with a slightly related but ultimately different issue) so perhaps get the output from 0:Messages and start a new thread?



Thanks, Rob.



On 30 January 2018 at 08:35, André Camilo <coolz...@gmail.com> wrote:
I'm using the 11.9.1 plugin and still having the same problem.

Doing "Build project" fixes the issues, but the partial compilation problem still exists.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+unsubscribe@googlegroups.com.

Steven Baldasty

unread,
Feb 1, 2018, 5:10:59 PM2/1/18
to Ebean ORM
You solved it, the Gradle plugin's bytecode enhancements contain the parent's fields! I just finished the rest of the upgrade. Would it make sense for me to submit a bug nonetheless, or are the ebean-agent and its Ant task old things that are just no longer supported?

Rob Bygrave

unread,
Feb 1, 2018, 5:34:30 PM2/1/18
to ebean@googlegroups

Great. So yes, I don't think we bother logging a bug on the Ant task.


> the ebean-agent

Just to clarify but the agent is used everywhere for enhancement - it is used in all the enhancement tools / plugins (maven, gradle, Idea, Eclipse) ... but yes, the problem isn't with the agent.




> Ant task old things that are just no longer supported?

Yes I think we should deprecate / decommission the Ant task for enhancement.  I have removed the ANT task from the documentation.  Unless someone pipes up with a really good reason we shouldn't use the Ant task and consider it obsolete (and use the maven or gradle plugins instead).

To a large extent the problem as I see it was the lack of documentation and support for Gradle. So I think we have addressed that and the docs are all better now covering Gradle etc (not awesome but getting better).  So yes I don't think there is a need for Ant task support now so someone is going to have to explicitly request that to bring it back as a supported approach.



Cheers, Rob.




On 2 February 2018 at 11:10, Steven Baldasty <sbal...@gmail.com> wrote:
You solved it, the Gradle plugin's bytecode enhancements contain the parent's fields! I just finished the rest of the upgrade. Would it make sense for me to submit a bug nonetheless, or are the ebean-agent and its Ant task old things that are just no longer supported?

--
Reply all
Reply to author
Forward
0 new messages