You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "ivanbdiana-js (via GitHub)" <gi...@apache.org> on 2023/05/24 12:35:44 UTC

[GitHub] [netbeans] ivanbdiana-js opened a new issue, #5986: Unable to properly open Gradle projects that have Gatling tests

ivanbdiana-js opened a new issue, #5986:
URL: https://github.com/apache/netbeans/issues/5986

   ### Apache NetBeans version
   
   Apache NetBeans 17
   
   ### What happened
   
   We work with Gradle projects and some of them have Gatling load tests in them. I noticed that I can only open a few Gradle projects and the rest do have issues on opening.
   These projects are with Java 17 and Java 18, I am using Nebeans 17, MacOS Monterey (corp-allowed latest version).
   
   I spent a day to find out what caused these issues and found that if I remove Gatling mentions from the build.gradle file then I can load the project - AFTER restarting Netbeans.
   
   My suggestion would be - could you please improve the project file parser to kinda "skip" all Gatling-related lines if it is not able to load the project with its original build.gradle file? That way even if there are Gatling-related Netbeans project loader issues I still would be able to work without having to hack around and temporarily modify the build.gradle. This is a dangerous step as I might miss reverting these before checking my changes in and that would cause grave inconvenience to my team.
   
   Additional bug that only comes along with this problem: Tools menu have no contents and does not drop down, all other menus do. I have no idea what could be the connection? Maybe your Gatling plugin - if there is any? (This is not listed in my Plugins list so cannot tell if there's any.)
   
   Thanks for your help.
   
   ### How to reproduce
   
   Have any Gradle project and add the following items to the build.gradle file:
   
   plugins {
     id 'org.springframework.boot' version '2.7.7'
     id 'io.spring.dependency-management' version '1.1.0'
     id 'java'
     id 'groovy'
     id 'jacoco'
     id 'pl.allegro.tech.build.axion-release' version '1.14.3'
     id 'io.gatling.gradle' version "3.8.4"
   }
   
   //[..]
   
   dependencies {
   //[..]
     gatling 'uk.co.sainsburys:manchester-auth-interceptor:2.0.0'
     gatling 'com.typesafe:config:1.4.2'
     gatling 'org.projectlombok:lombok:1.18.24'
     gatlingAnnotationProcessor 'org.projectlombok:lombok:1.18.24'
   }
   
   //[..]
   
   gatling {
     systemProperties = ['config.override_with_env_vars': true]
   }
   
   Use any Java version of your choice, the above build.gradle file works with Java 18 in particular.
   
   Have java classes in the src/main/java location, and in the src/ have a gatling/java/ folder-structure and have a class that uses one of the classes from the src/main/java/ part. For instance we have Session related java files, and these are referred in the Gatling location as "import uk.co.something.someservice.dto.SessionRequest;"
     private SessionRequest somefunctionRequest() {
       return SessionRequest.newBuilder()
           .requestId(UUID.randomUUID().toString())
           .metadata(Map.of("someid", UUID.randomUUID().toString()))
           .build();
     }
   }
   
   Save the file, close and reopen Netbeans. Now you will see that the Projects window will not be able to properly open the project and you shall receive one or two exception in the Notifications window.
   
   I captured this one:
   java.util.MissingResourceException: Can't find resource for bundle org.openide.util.NbBundle$PBundle, key GATLING_
   	at java.base/java.util.ResourceBundle.getObject(ResourceBundle.java:564)
   	at java.base/java.util.ResourceBundle.getString(ResourceBundle.java:521)
   	at org.openide.util.NbBundle.getMessage(NbBundle.java:637)
   	at org.openide.util.NbBundle.getMessage(NbBundle.java:731)
   	at org.openide.util.NbBundle.getMessage(NbBundle.java:653)
   	at org.netbeans.modules.gradle.java.classpath.GradleSourcesImpl.gatlingSourceGroupDisplayName(GradleSourcesImpl.java:249)
   	at org.netbeans.modules.gradle.java.classpath.GradleSourcesImpl.createSourceGroup(GradleSourcesImpl.java:183)
   	at org.netbeans.modules.gradle.java.classpath.GradleSourcesImpl.getSourceGroups(GradleSourcesImpl.java:166)
   	at org.netbeans.spi.project.support.LookupProviderSupport$SourcesImpl.getSourceGroups(LookupProviderSupport.java:160)
   	at org.netbeans.modules.gradle.java.nodes.SourcesNodeFactory$NList.keys(SourcesNodeFactory.java:97)
   	at org.netbeans.spi.project.ui.support.NodeFactorySupport$DelegateChildren$1.run(NodeFactorySupport.java:177)
   	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:287)
   [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
   <img width="1605" alt="Screen Shot 2023-05-24 at 13 09 09" src="https://github.com/apache/netbeans/assets/89849342/49b70c2a-9d62-4476-aced-3e2553137d09">
   
   Bonus: click on the Tools menu and see if it drops down. Id did not for me, everytime I tried when the above project-loading issue happened it failed to.
   
   The first screenshot shows the error, the second screenshows shows that if I comment Gatling-stuff out completely then the project loads properly in the Projects window.
   Since features like "jump to source" only work in the Projects window, it would be really nice if you could implement my suggestion please.
   <img width="970" alt="Screen Shot 2023-05-24 at 13 20 38" src="https://github.com/apache/netbeans/assets/89849342/907207cc-bcfd-47e8-8282-efa833a853a2">
   
   Don't know if this has ever worked in Netbeans or not.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   MacOS Monterey
   
   ### JDK
   
   Java 17 as in jdk-17.0.4.jdk, Java 18 as in adoptium-18-aarch64-hotspot-mac/jdk-18.0.2.1+1
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   This happens all the time with all projects that have Gatling in their build.gradle files.
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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