This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 119907 - [60cat] Named queries can be defined only on... error message after renaming entity
Summary: [60cat] Named queries can be defined only on... error message after renaming ...
Status: RESOLVED DUPLICATE of bug 221330
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: Sergey Petrov
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2007-10-24 14:12 UTC by jlaskowski
Modified: 2012-11-22 15:06 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jlaskowski 2007-10-24 14:12:26 UTC
[ BUILD # : Beta 2 ]
[ JDK VERSION : 1.6.0_02 ]

1. Create an jpa entity (Entity Class)
2. Rename it using Ctrl-R while on the class name in java editor
3. Press Enter => Error message (red exclamation mark's displayed on
the "type strip"): Named queries can be defined only on...

Change the tab to another and suddenly the error...disappears.
Comment 1 Pavel Buzek 2007-10-29 18:57:40 UTC
Works for me. What did you change the name to? Can you reproduce it every time? Thanks.
Comment 2 pslechta 2008-09-12 10:58:10 UTC
Not able to reproduce. Closing as WORKSFORME.
Reporter, please reopen if you still can reproduce on NB 6.5.
Comment 3 emc42 2010-11-20 15:09:22 UTC
I bumped into this bug again with NB6.9.1 when following the E-Commerce tutorial (http://netbeans.org/kb/docs/javaee/ecommerce/entity-session.html).

When creating the EJBs there with "Entity Classes from Database" it creates 6 EJBs from the DB tables.
At first glance they seem ok, since NB doesn't show any error marks for the files in the project tab. However, if you open the files, some of them (2 in my case: Customer.java and CustomerOrder.java) showed the mentioned error message on the "public class ..." line.

I managed to "fix" the false errors by editing the files (added a empty line before the class and removed it again) and switching tabs to another file afterward. When I returned to the edited file, the error was gone.

Looks very much like an NB editor bug to me...
Comment 4 Petr Jiricka 2011-10-04 16:00:19 UTC
Sergey, can you please evaluate?
Comment 5 Sergey Petrov 2011-10-04 16:11:09 UTC
I saw this issues before just a few times, seems very rare and it was always hard to reproduce, sometimes something is happened with entites metamodel update.
Comment 6 ade8310 2011-11-30 19:01:28 UTC
(In reply to comment #3)
> I bumped into this bug again with NB6.9.1 when following the E-Commerce
> tutorial (http://netbeans.org/kb/docs/javaee/ecommerce/entity-session.html).
> 
> When creating the EJBs there with "Entity Classes from Database" it creates 6
> EJBs from the DB tables.
> At first glance they seem ok, since NB doesn't show any error marks for the
> files in the project tab. However, if you open the files, some of them (2 in my
> case: Customer.java and CustomerOrder.java) showed the mentioned error message
> on the "public class ..." line.
> 
> I managed to "fix" the false errors by editing the files (added a empty line
> before the class and removed it again) and switching tabs to another file
> afterward. When I returned to the edited file, the error was gone.
> 
> Looks very much like an NB editor bug to me...

Hi,
I got the same compilation error with netbeans 6.9.1. Thanks for the tips.
I've resolved the error just like you said.
Tks
Comment 7 Sergey Petrov 2012-04-19 09:40:02 UTC
don't see for a long time, relatively easy to fix/workaround, >p4 for now
Comment 8 Sergey Petrov 2012-11-22 15:06:29 UTC

*** This bug has been marked as a duplicate of bug 221330 ***