A sample would be great yes
Le 1 juin 2013 09:51, "Reinis Vicups" <[email protected]> a écrit :

> Hi,
>
> I bootstrap from persistence.xml that has entity definition for Permission
> and NO entity definition for AbstractBaseEntity (as suggested somewhere on
> forums) like this:
>
> <entity class="my.access.Permission" />
>
> So NO, Abstractbaseentity is not listed in persistence unit. I have tried
> adding it and got different exception (something with field 'id' does not
> have persistence annotations). If this is relevant I can post the exception
> I get if adding AbstractBaseEntity to PU.
>
>
> On 01.06.2013 09:22, Romain Manni-Bucau wrote:
>
>> Abstractbaseentity is listed in the persistence unit?
>>
>> Well you can still enhance it at build time before tests
>> Le 31 mai 2013 23:54, "Reinis Vicups" <[email protected]> a écrit :
>>
>>  Hi,
>>>
>>> I get NoSuchMethodError when testing with ApplicationComposer and
>>> manually
>>> supplied javaagent. When I start container (TomEE) everything works just
>>> fine.
>>>
>>> I enable javaagent for maven test plugin like this:
>>>
>>>                  <plugin>
>>> <groupId>org.apache.maven.****plugins</groupId>
>>> <artifactId>maven-failsafe-****plugin</artifactId>
>>>                      <version>2.14.1</version>
>>>                  <executions>
>>>                      <execution>
>>>                          <goals>
>>> <goal>integration-test</goal>
>>>                              <goal>verify</goal>
>>>                          </goals>
>>>                      </execution>
>>>                  </executions>
>>>                      <configuration>
>>> <groups>de.orbitx.retena.****IntegrationTest</groups>
>>>                          <includes>
>>> <include>**/*.class</include>
>>>                          </includes>
>>> <argLine>-javaagent:${project.****build.directory}/openejb-**
>>> javaagent-${openejb.version}.****jar</argLine>
>>> <workingDirectory>${project.****build.directory}</****workingDirectory>
>>>                      </configuration>
>>>                  </plugin>
>>>
>>> javaagent is added like this (I use maven-dependency-plugin to copy it to
>>> right place):
>>>
>>>              <dependency>
>>>                  <groupId>org.apache.openejb</****groupId>
>>> <artifactId>openejb-javaagent<****/artifactId>
>>>                  <version>4.6.0-SNAPSHOT</****version>
>>>                  <scope>test</scope>
>>>              </dependency>
>>>
>>> The full log I was able to get our of openejb is here :
>>> https://gist.github.com/****anonymous/5688204<https://gist.github.com/**anonymous/5688204>
>>> <https://**gist.github.com/anonymous/**5688204<https://gist.github.com/anonymous/5688204>
>>> >
>>>
>>> My AbstractBaseClass looks like this:
>>>
>>> @MappedSuperclass
>>> public abstract class AbstractBaseEntity implements Serializable {
>>>
>>>      @Id
>>>      @GeneratedValue(strategy = GenerationType.IDENTITY)
>>>      @Column(name = "id")
>>>      private Integer id;
>>>
>>>      // getter setter and so on....
>>> }
>>>
>>> and the Permission class from stack trace like this:
>>>
>>> @Entity
>>> public class Permission extends AbstractBaseEntity {
>>>
>>>      private String permission;
>>>
>>>      // more irrelevant code is here
>>> }
>>>
>>> I bootstrap from persistence.xml that has entity definition for
>>> Permission
>>> and NO entity definition for AbstractBaseEntity (as suggested somewhere
>>> on
>>> forums) like this:
>>>
>>> <entity class="my.access.Permission" />
>>>
>>> I have refactored everything couple of times (removed generics, tried to
>>> change AbstractBaseEntity to a concrete class, moved @Id from here to
>>> there
>>> and now appears that the only option that I have still think of is to
>>> remove BaseEntity.
>>>
>>> Before I do that, I would be happy if someone could help me to avoid
>>> that,
>>> because this is not solution but, rather, workaround that makes my code
>>> worse.
>>>
>>> thank you guys for your help!
>>> reinis
>>>
>>>
>

Reply via email to