RE: Re: Introduction to Profiling Java Applications in NetBeans IDE

2022-01-29 Thread John
In light of your first set of comments, I dived in and just felt around the UI as it bore little resemblance to the document. As you point out, I did get the offer to do an initial calibration when I first asked to do a profile.   Fortunately, I did not see the issues you reported below and as a novice to this tool, can’t be of much help as to interpreting your exceptions. The profiler did present views for each of its options in the drop-down (part of Profile button) and found the ‘Method’ option to be the most useful. I had deliberately, during coding, left a sequential scan within the code that I knew needed optimising to see if the Profiler would spot it. The good news is that it did and reported that most of the time was spent inside this method. I was optimistically hoping to see a count for each line of code visited as that would be ideal for my analysis, as given a specific test set of data, I know how often I am expecting each piece of code to be executed and so if the number of iterations were high then I could investigate further. The ‘hot spots’ icon allowing a quick drill down into the methods and sorting them by the time spent within each method. I did find a column for the number of ‘hits’, as opposed to Total Time, by selecting the drop down arrow on the far right hand side.  However, the number presented was meaningless to me as was way too low. To prove this, I wrote my own debug method to log iterations for specific methods to evaluate a true figure. For example, a method ‘FindDuplicateRow’ reported 403 hits, yet by counting the number of executions of this method I had 48,219! So, while my initial requirement was not met (number of times each line of code executed), the time spent in each of the main methods at least gave an indicator of where inefficiencies may be.  When I first looked around, I can see that there are several plugins to purchase but as a amateur developer, I can’t justify the expense and so this built in one is probably a reasonable substitute. The only issue that I have currently discovered is that it appears that you can profile a specific class or method, which the online documentation also discusses. The UI for this is very clean (right click the suspect routine and select ‘Profile method’ or ‘Profile class’) but if I then run the profiler again, it runs but never displays anything, regardless of what method / class I pick and so I can only profile the whole project. The Output window appears to think that everything is not as it should be as I get the following output with several ‘Profiler engine warning: ...’ messages (see below)  -< com.propertymanagement:propertyManagement >--Building propertyManagement 1.0[ jar ]- --- exec-maven-plugin:3.0.0:exec (default-cli) @ propertyManagement ---Profiler Agent: Waiting for connection on port 5140, timeout 10 seconds (Protocol version: 18)Profiler Agent: Established connection with the tool*** Profiler engine warning: Cannot use ClassLoader.findLoadedClass() and/or ClassLoader.findBootstrapClass() in ClassLoaderManagerProfiler Agent: Local accelerated sessionProfiler Agent: Initializing...Profiler Agent: Options: >C:\Development\Netbeans\Netbeans-12.6\profiler\lib,5140,10

Strange surefire problem using wrong Java version

2022-01-29 Thread Peter Nabbefeld



Hello,

though I've configured my project to use JDK 1.8, surefire outputs
syntax errors about module-info.java, which does even not exist:

Jan 29, 2022 8:29:36 PM
org.netbeans.modules.settings.RecognizeInstanceObjects$MSL 
WARNUNG: Not listening on module system
Jan 29, 2022 8:29:36 PM org.netbeans.modules.masterfs.watcher.Watcher
getNotifierForPlatform
INFORMATION: Native file watcher is disabled
Jan 29, 2022 8:29:36 PM
org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork
getDone
INFORMATION: Resolving dependencies took: 18 ms
Jan 29, 2022 8:29:36 PM
org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$AbstractRootsWork
scanBinaries
INFORMATION: Complete indexing of 0 binary roots took: 1 ms
Jan 29, 2022 8:29:36 PM
org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$AbstractRootsWork
scanSources
INFORMATION: Complete indexing of 0 source roots took: 0 ms (New or
modified files: 0, Deleted files: 0) [Adding listeners took: 0 ms]
/module-info.java:1: error: class, interface, or enum expected
module java.base {
^
/module-info.java:3: error: class, interface, or enum expected
    exports java.applet;
    ^
/module-info.java:4: error: class, interface, or enum expected
    exports java.util.spi;
    ^
/module-info.java:5: error: class, interface, or enum expected
    exports java.text.spi;
    ^
/module-info.java:6: error: class, interface, or enum expected
    exports java.awt.image;
[...]


I've already tried to fix the problem by adding
"/usr/lib64/jvm/java-8-openjdk/jre/bin/java" to the
configuration element, but that doesn't work either. The project is of
"NetBeans Module" type. If surefire needs its own Java version
configuration, this should be done automatically (as long as I'm using
the "Project properties" dialog), so it may be a bug.

Any help appreciated.

Kind regards
Peter


-
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Re: Updating an Old Plugin and Having Issues

2022-01-29 Thread Eric Bresie
Assume this may have to do with the module's public/private/friend API
(i.e. if not accessible may appear missing).  May want to check out some of
the references below.

(1) https://netbeans.apache.org/wiki/API_Design.asciidoc
(2)
https://cwiki.apache.org/confluence/display/NETBEANS/Public+vs+Friend+API
(3) https://www.mail-archive.com/dev@netbeans.apache.org/msg09274.html

Eric Bresie
ebre...@gmail.com


On Thu, Jan 27, 2022 at 10:19 PM Peter Blemel  wrote:

> Sean,
>
> I'm back to working on my old platform applications ... I have a form
> using AbsoluteLayout.  When I try to edit it, it throws the following.  The
> work around is to pick another layout other than Absolute, but I'm curious
> whether you've had any more luck with that module?
>
> Thanks,
> Peter
>
> java.io.IOException: no module org.netbeans.modules.form
> at
> org.netbeans.modules.apisupport.project.queries.ModuleProjectClassPathExtender.addLibraries(ModuleProjectClassPathExtender.java:108)
> at
> org.netbeans.spi.java.project.classpath.ProjectClassPathModifierImplementation$Accessor.addLibraries(ProjectClassPathModifierImplementation.java:401)
> at
> org.netbeans.api.java.project.classpath.ProjectClassPathModifier.addLibraries(ProjectClassPathModifier.java:86)
> at
> org.netbeans.modules.nbform.project.ClassSourceResolver$LibraryEntry.addToProjectClassPath(ClassSourceResolver.java:208)
> at
> org.netbeans.modules.form.project.ClassSource.addToProjectClassPath(ClassSource.java:89)
> at
> org.netbeans.modules.form.project.ClassPathUtils$2.run(ClassPathUtils.java:245)
> at
> org.netbeans.modules.progress.ui.RunOffEDTImpl$ProgressBackgroundRunner.runBackground(RunOffEDTImpl.java:465)
> at
> org.netbeans.modules.progress.ui.AbstractWindowRunner.call(AbstractWindowRunner.java:86)
> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
> at
> org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
> at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
> at
> org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
> Caused by:
> 
> From: Peter Blemel 
> Sent: Wednesday, January 19, 2022 1:27 AM
> To: d...@netbeans.apache.org ; NetBeans Mailing
> List 
> Subject: Re: Updating an Old Plugin and Having Issues
>
> I'm making a little progress on this.  When compiling a different,
> unrelated module, I was getting the following error:
>
> The module C:\Program
> Files\NetBeans-12.6\netbeans\java\modules\org-netbeans-modules-form.jar has
> no public packages and so cannot be compiled against
>
> I assume that in your case, the lack of any public packages is why you
> can't find the FormEditorSupport class. In my case, I found an offending
> module of mine that was depending on the "Form Editor" module for no reason
> that I can remember. My application doesn't edit Forms and I don't recall
> ever having any such dependency.  I removed the dependency, and am no
> longer getting any errors related to the org.netbeans.modules.form module.
>
> Does your application edit forms?  I found a GitHub repot for it at
>
> https://github.com/szymach/incubator-netbeans/blob/master/form.nb/src/org/netbeans/modules/nbform/FormEditorSupport.java
> if it helps you.
>
> Not much help, I'm sure ... but the cobwebs are slowly clearing for me. As
> for my application, it now launches in 12.6 .  My application startup,
> custom project type, and custom file types all seem to be working, which is
> encouraging.  My menus are not arranged the way that they were previously,
> which probably has something to do with the layers.
>
> Unfortunately, when I open one of my files the TopComponent briefly shows
> and then disappears.  I set breakpoints in both componentShowing() and
> componentClosed().  The debugger stops in both, so some kind of error must
> be silently causing my TC to close.  Unfortunately, there's nothing in the
> logs.
>
> I guess I need to go work through the latest MultiView tutorial and see if
> something has changed that I need to be aware of.
>
> I hope you're also making progress.
>
> Cheers,
> Peter
>
> 
> From: Peter Blemel 
> Sent: Tuesday, January 18, 2022 10:59 AM
> To: d...@netbeans.apache.org ; NetBeans Mailing
> List 
> Subject: Re: Updating an Old Plugin and Having Issues
>
> Just to be clear, I am working in Netbeans 12.6 on both computers.
> Absolute Layout works at home, but at my office it throws
>
> java.io.IOException: no module org.netbeans.modules.form
> at
> org.netbeans.modules.apisupport.project.queries.ModuleProjectClassPathExtender.addLibraries(ModuleProjectClassPathExtender.java:108)
> at
> org.netbeans.spi.java.project.classpath.ProjectClassPathModifierImplementation$Accessor.addLibraries(ProjectClassPathModifierImplementation.java:401)
> at
>