Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Decrypting error message

Hi Laird,

The only way I recreate this problem is to create an EntityManager more than once. As a result, I am surprised you don't see something logged earlier.

The way I see the problem is to write a persistence unit that contains a named query with incorrect JPQL. I then deploy and use an EntityManager. The use of that EntityManager fails with an exception that tells me what is wrong with my JPQL. I then try to use a new EntityManager based on the same persistence unit. This time, I get the exception you describe.

If you are using EclipseLink 2.3 or later, you may be able to see the actual issue by setting the persistence unit property "eclipselink.deploy-on-startup" to true. Otherwise, you may be able to do something like what I have described above to see the actual problem - make sure you set your logging to FINEST and you have not turned off exception logging.

-Tom

Laird Nelson wrote:
On Tue, Aug 9, 2011 at 11:11 AM, Tom Ware <tom.ware@xxxxxxxxxx <mailto:tom.ware@xxxxxxxxxx>> wrote:

     Where is the query defined?  Annotations?


Yes, as a @NamedQuery.

    Is it on an Entity?


An @Entity.

    MappedSuperclass? Can you provide a snippet of how it is defined and
    include the annotations/XML that define the Entity itself?


Cut and paste (preserving whitespace):

@NamedQuery(name="Minor.findAll", query="SELECT o FROM Minor o")

@Entity(name="Minor")
@Table(name="minor_table")
public class MinorEntity implements DateConstrained
{
    @Id @Basic @Column(name="minor", length=4)
    String minor;
@Basic @Column(name="txt", length=24)
    String description;
@Basic @Column(name="cip_no", length=8)
    String cipNumber;
@Temporal(TemporalType.DATE) @Column(name="active_date")
    Date activeDate;
@Temporal(TemporalType.DATE) @Column(name="inactive_date")
    Date inactiveDate;

Pretty basic stuff.
     Also, I am still interested in what happens if you change the name.


Nothing, reports the developer. She's also pointed out that we've had the problem in the past, and that in point of fact it is /not/ the query that is reported that is the problem. She's said that she's had to comb through all our named queries looking for one that is syntactically invalid. When she fixes that error, then this phantom error goes away.

Best,
Laird


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

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top