Getting error while runnign gatling project "object gatling is not a member of package io import io.gatling.app.Gatling" - gatling

I am trying to run a test recorded as har script from browser and imported to the project in Intellij IDE. When I am running the project it is giving error:
object gatling is not a member of package io import io.gatling.app.Gatling
Below is the screenshot attached.
Any leads would be helpful.

As noted in my comment on your question, you need to add the Gatling package into your Maven build configuration in the pom.xml file. The IntelliJ Idea help page on Maven has instructions to add a Maven package:
Add a new Maven module to an existing project
You can add a Maven module to the project in which you are already
working.
In the Project tool window, right-click the project folder and select
New | Module.
Alternatively, from the main menu, select File |
New | Module to open the New Module wizard.
If you used main menu to add a module then the process of adding a module is the same as Creating a new Maven project.
If you are adding sub modules by right-clicking the root folder then the process of adding a new module is shorter.
You need to specify the name of your module in the Name field.
The rest of the information is added automatically and you can use either the default settings or change them according to your preferences.

Related

import / opening existing Codenameone project from Netbeans / Eclipse to IntelliJ does not work

Finally, I thought of moving my project from Eclipse to IDE to IntelliJ. So, I carried out the following steps:
1. Installed Codenameone plugin in IntelliJ.
2. Import existing project to IntelliJ. Now I project structure is as shown in the figure.
Here, CodenameOne-Project is the main project including source folders images and all. The common and barcode-common consists of java classes required for main project(i.e.CodenameOne-Project). So, I am able to import CodenameOne-Project in IntelliJ, and if I add other folder as module by adding dependency and all, it dont look like CodenameOne project anymore. I cant properly import complete project. Any help on this would be very helpful. Thanks
P.S: I want to maintain same project structure.
We don't support importing projects between IDE's as our project structure is IDE agnostic. The IDE won't recognize that and would fail. The right thing to do is create a new project with the same package name/main class name as your existing project then copy your src & res directories on top of the new project and copy codenameone_settings.properties on top of the new project file.

Netbeans JSF - Creating executable JAR file

I'm working at the moment on an JSF Project project. Everything is working fine. Creating .war-file, deploying it.
What I actually want is, to create a executable JAR-file for a single Class. In this Class I have a Main-method that sends an email after executing it.
I the past I have worked with Eclipse. And that was very easy.
Now I am working with Netbeans. I have red a lot of posts with the information to clean and build the project. Next to that checking the .dist folder for the JAR-files.
I have either the .dist folder, or any JAR-files in my Project folder for that correlate file.
How can I easily create that JAR-file in Netbeans?
Assuming you are using a native NetBeans project rather than Maven:
The build artefact of a project is defined by it's project type. A JSB/Web project is always build into a WAR file.
If there is one class in your project that you want to put into a JAR file, the clean solution would be to create a new "Java" project with that class (as your class clearly has no dependencies to your Web Application this should work).
For such a project NetBeans will automatically create a runnable JAR file if you configure the main method.
In your JSF project you can simply include that project as a library. If you enable "Build projects on classpath", the jar will automatically be build when you build the web application.
Another approach would be to customize the Ant script NetBeans uses internally and add a target that builds your executable JAR file from that single class.
Details on how to customize the IDE generated Ant script can be found in the manual:
https://docs.oracle.com/netbeans/nb82/netbeans/NBDAG/create_japps.htm#CHDDAHEB

How can I use Angular 2 with NetBeans?

I have tried every tutorial I could find to try to make a HTML/JS project with Angular 2 working on NetBeans, but none have worked. Maybe is my npm that is bugged (search, for example, doesn't work).
The node_modules folder that is created with npm install is grey on NetBeans and have some errors in some files (I don't know if this is normal). Any .js I try to import from node_modules folder gives the error Failed to load resource: net::ERR_EMPTY_RESPONSE / Uncaught ReferenceError: System is not defined.
Does anyone have any idea what could I be doing wrong? Or does anyone knows any tutorial that have the code to download so I can compare with what I'm doing and see what is the correct? Every tutorial I have found doesn't have any code to download, just some pieces of codes in the page for explanation.
Sory if this isn't a good question, but I have been trying to make this work since yesterday without success and I'm completely out of idea.
First I recommend to upgrade to the last version of NodeJS and NPM, to minimize the errors in your node_modules folder
Install the Everlaw's Typescript plugin from https://github.com/Everlaw/nbts/releases . If you are using Netbeans 8.1 I think you can install it directly from the Plugins installer. I'm using NetBeans 8.2 and there is no problems installing the plugin manually.
Then on NetBeans go to Tools -> Options -> HTML/JS -> Node.js and write the right Node and NPM Paths and Sources, I would recommend check-on the three check-boxes in that panel.
For a quick start try the QuickStart demo from the angular.io page, it is not necessary make any change in the package.json.
The first time I tried to debug an Angular 2 application I put the index.html file directly in the project folder in order to do not make any changes in the index.html script sources nor change the project files structure but you need to change some properties of the project:
In the project window right click the project and select properties.
In sources change the Site Root Folder using the Browse button and select the project folder (You can ignore the warning that appears).
In Run select Run As: Web Application.
I recommend select Browser: Chrome with NetBeans Connector
Using the Browse button go to the project folder and select index.html as your Start File.
Select Web Server: Embedded Lightweight.
And finally in Web Root write /Your_Project_Folder
run npm install from NetBeans
Click the run button and your web application must open in chrome, if you edit your html or typescript files and save them you could see the changes in the browser in real time without re-debuggind your application and can use the Browser DOM window to explore your elements created from Angular 2.
You still see some errors in your files because NetBeans is not fully compatible with the HTML Angularized syntax. But it runs flawlessly.
You can also run the start script directly from Netbeans to run your project using lite-Server.
Screenshot NetBeans - Angular 2
I would recommend you to install the angular cli: npm install -g angular-cli#webpack
Fore more infos regarding this tool, take a look here: https://cli.angular.io/
Then create a new Angular2 app with ng new <app-name>
This will create a complete and working Angular2 application in the current folder.
cd <app-name> and start the app with ng serve.
Check your new created app in your browser on localhost:4200.
If this works, you can try to get started with your NetBeans! :)

Import existing file or directory into intellij idea project

I'm using Intellij Idea 15.0.3. I tried to use it to develop a MEAN stack application.
I first File -> New -> Project -> Empty Project to create an empty project. Then in Intellij Idea's terminal I type npm init -y, a package.json is generated. However, when I tried to edit this generated package.json, a window pops up, saying: These files do not belong to the project, and asks me if I want to edit it anyway.
Also, after I edited the package.json, I run npm install in the terminal, a new directory node_modules is generated, but it's not shown in the Intellij Idea.
How can I add package.json and node_modules into project? Do I have to manually created file or folder through Intellij Idea project UI and give up using its terminal?
You need to create a new project from existing source so..
File->New Project - Select HTML5/Javascript application then select one of the options at the bottom with "Existing Sources" at the end of it, you then just specify the folder that it's already and in and you should be good to go.

Maven Plugin Working Directory Not Constant

I wrote a Maven Plugin that creates some XML files on the classpath of my project. The Maven Project is fairly complex and has one master project with many sub projects (think services for a larger application).
The plugin takes a directory argument in the pom.xml, which is something relative to the classpath like this:
<docDestination>src/main/webapp/static/</docDestination>
However, when I try to access this folder via new File(docDestination), the resulting directory depends on the project (or sub-project) from which I ran the mvn install command that triggered the plugin.
The plugin is only specified in the pom.xml of one of the sub-projects, but if I run mvn-install from the parent it creates the XML files in the src/main/... folder of the parent application. How do I get the plugin to use the filesystem of the project in which it is declared rather than the filesystem of the parent project?
I should note that if I navigate to the sub-project in Terminal and run mvn install in that directory the files are created in the right place, which explains the title of my post.
Use the ${basedir} variable:
<docDestination>${basedir}/src/main/webapp/static</docDestination>
This should use the basedir currently used by the respective module (regardless of whether this is the top-level or a sub-module).

Resources