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 217274 - endless loop in j2ee.persistence.spi.jpql.Type.haveInHierarchy()
Summary: endless loop in j2ee.persistence.spi.jpql.Type.haveInHierarchy()
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.2
Hardware: All All
: P1 normal (vote)
Assignee: Tomas Hurka
URL: http://netbeans.org/projects/profiler...
Keywords: PERFORMANCE, REGRESSION
Depends on:
Blocks:
 
Reported: 2012-08-23 07:40 UTC by rjdkolb
Modified: 2012-09-10 07:33 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
visual vm screenshot (100.59 KB, image/png)
2012-08-23 07:40 UTC, rjdkolb
Details
Application snapshot (24.89 KB, application/octet-stream)
2012-08-24 08:23 UTC, rjdkolb
Details
Application snapshot apps (49.96 KB, application/octet-stream)
2012-08-24 08:28 UTC, rjdkolb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rjdkolb 2012-08-23 07:40:42 UTC
Created attachment 123445 [details]
visual vm screenshot

I am having a major issues with Netbeans 7.2
It is something I have never experienced with Netbeans over the years.

This sometime happens a few minutes after starting the IDE, but it sees to happen on code completion.
I try to use the code completion and the entire GUI goes blank. It never restores.

The last log I get is :
INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 65 source roots took: 4,218 ms (New or modified files: 2, Deleted files: 0) [Adding listeners took: 201 ms]
INFO [org.netbeans.core.ui.focus]: External Changes Refresh on focus gain disabled
INFO [org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultHttpClient]: I/O exception (java.net.SocketException) caught when processing request: Connection timed out
INFO [org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultHttpClient]: Retrying request
INFO [org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultHttpClient]: I/O exception (java.net.SocketException) caught when processing request: Connection timed out
INFO [org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultHttpClient]: Retrying request



If you have a look at the screen shot you will see :
org.netbeans.modules.j2ee.persistence.spi.jpql.Type.haveInHierarchy()	


I am on Linux 64 bit and using Oracle Java 7u6.
I also have JRebel installed, but I don't have to use it for this to happen.

I have an application snapshot as well.
Comment 1 rjdkolb 2012-08-23 09:41:12 UTC
I downgraded to Netbeans 7.1.2 using the same projects and plugins.
And I have no issue so far.
Comment 2 Marian Mirilovic 2012-08-23 16:24:06 UTC
reassign for further evaluation ...
Comment 3 Petr Cyhelsky 2012-08-24 08:12:06 UTC
please take cpu sampling snapshot and attach the whole VisualVM application snapshot.
Comment 4 rjdkolb 2012-08-24 08:23:11 UTC
Created attachment 123511 [details]
Application snapshot
Comment 5 rjdkolb 2012-08-24 08:28:40 UTC
Created attachment 123513 [details]
Application snapshot apps
Comment 6 rjdkolb 2012-08-24 08:33:59 UTC
Please let me know if the attachment are what you need.
Comment 7 Petr Cyhelsky 2012-08-24 11:04:45 UTC
yes, we are somewhat closer to the root of the problem, but we are still not able to reproduce the problem, can you please somehow (even privately) provide us with the project (we need to see the named queries which trigger the JPQL processing problem) or at least give us a heap dump from the time.
Comment 8 rjdkolb 2012-08-24 11:57:36 UTC
I hope this heap dump can help. 
http://196.36.57.140/jpql_heapdump-1345807526453.hprof.zip

In this case the IDE did not freeze, but code completion does not work for any class. (Code completion seems to be the trigger). I can't even call this.<tab> in a simple class that extends Object

It does not seem to recover ever from this state,

The CPU is going nuts, which also happened when the entire IDE locked up. 
I guess there must be a tight loop someplace.

Things that may help :
1) I do not have very complex JPQL
2) The database I am using (TCP H2) is not running
3) I do use some inheritance in my JPA, but it is not complex and this is not in my JPQL
Comment 9 Tomas Hurka 2012-08-24 15:35:04 UTC
Heap dump is available at <http://netbeans.org/projects/profiler/downloads/download/Heapdumps/heapdump_217274.zip>
Comment 10 Tomas Hurka 2012-08-24 15:41:04 UTC
There is an endless loop in org.netbeans.modules.j2ee.persistence.spi.jpql.Type.haveInHierarchy() caused by the following named query:
SELECT new za.co.enerweb.ebr.richhierarchys.domain.NodeCalculation(d.id,d.name) FROM NodeCalculation d order by d.name
Comment 11 rjdkolb 2012-08-24 16:29:38 UTC
Thanks Tomas,

Let me know if you need more help.
I will remove this query and see if I get the same issue.
Comment 12 rjdkolb 2012-08-24 18:06:16 UTC
I removed this query and it seems to be fine now.

Snips from the class are  :
@NamedQueries({
    @NamedQuery(
    name = "NodeCalculation.findAllShells",
    query = "SELECT new za.co.enerweb.ebr.richhierarchys.domain.NodeCalculation(d.id,d.name) FROM NodeCalculation d order by d.name")
})
public class NodeCalculation implements NamedObject {
    @GeneratedValue(strategy = GenerationType.TABLE)
    @Id
    protected Long id;
    protected String name;
    protected String desciption;
    @OneToMany(mappedBy = "nodeCalculation", cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
    protected List<NodeCalculationRelation> relations = new ArrayList<NodeCalculationRelation>();
    @ManyToOne
    protected SeriesType seriesType;

    public NodeCalculation() {}

    public NodeCalculation(Long id, String name) {
        this.id = id;
        this.name = name;
    }
}
public interface NamedObject extends Serializable {
    public Long getId();
    public void setId(Long id);
    public String getName();
    public void setName(String name);
}
Comment 13 Tomas Hurka 2012-08-27 08:10:29 UTC
Fixed in profiler-main

changeset:   229511:d62e0cdd3038
user:        Tomas Hurka <thurka@netbeans.org>
date:        Mon Aug 27 10:09:30 2012 +0200
summary:     bugfix #217274, fix endless loop in haveInHierarchy()
Comment 14 Quality Engineering 2012-08-28 02:38:09 UTC
Integrated into 'main-golden', will be available in build *201208280001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d62e0cdd3038
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #217274, fix endless loop in haveInHierarchy()
Comment 15 Petr Cyhelsky 2012-08-28 08:40:44 UTC
verified in:
Product Version: NetBeans IDE Dev (Build 201208280001)
Java: 1.7.0_06; Java HotSpot(TM) 64-Bit Server VM 23.2-b09
System: Linux version 3.2.0-29-generic running on amd64; UTF-8; en_US (nb)
Comment 16 Tomas Hurka 2012-08-28 11:09:27 UTC
Transplanted to release72.

changeset:   236965:6a88449aadba
branch:      release72
user:        Tomas Hurka <thurka@netbeans.org>
date:        Mon Aug 27 10:09:30 2012 +0200
summary:     bugfix #217274, fix endless loop in haveInHierarchy()
Comment 17 Quality Engineering 2012-09-01 11:06:09 UTC
Integrated into 'releases', will be available in build *201209010822* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/6a88449aadba
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #217274, fix endless loop in haveInHierarchy()
(transplanted from d62e0cdd3038456fb01b7f3a21de10cd9599f23a)
Comment 18 Tomas Danek 2012-09-03 11:57:46 UTC
(In reply to comment #15)
> verified in:
> Product Version: NetBeans IDE Dev (Build 201208280001)
> Java: 1.7.0_06; Java HotSpot(TM) 64-Bit Server VM 23.2-b09
> System: Linux version 3.2.0-29-generic running on amd64; UTF-8; en_US (nb)