Screenshot of the issue
Hi guys im using intellij and maven and i was working on my code but when I try to ru it locally im getting this issue, I checked all the configuration but I dont know exactly why this issue appear
This happens when IDE can not connect to mentioned port. It is most likely specified in run debug configuration. This may happen because the port has already been occupied by another process (e.g. There is already Tomcat instance running).
Also if you have antivirus/firewall make sure it does not block IDE process from making connections on localhost: make sure to exclude IDE process, IDE installation home, IDE configuration/system folders, project and library directories from the scan. Try restarting the PC, try using different JMX port in Run/Debug Configuration.
Related
I've got several microservices projects that I'm developing using the Thorntail framework. I'm writing my code using Eclipse. In the past, I've done all of my development using the Wildfly app server, and Eclipse made debugging these apps dead simple. Right Click->Debug As->Debug On Server. Done. Now that I'm using Thorntail, I'm not quite sure how to do it.
From the command line, I would start my Thorntail projects using:
mvn thorntail:run -Dthorntail.useUberJar # Project 1
mvn thorntail:run -Dthorntail.useUberJar -Dthorntail.port.offset=1000 # Project 2
That gets everything up and running, and listening on ports 8080 and 9080. However, the services are not in debug mode and I didn't launch these through Eclipse.
I know I can Right Click->Debug As->Maven Build... and then create a new debug configuration. I've done so, with my goals corresponding to the mvn commands above. However, when I do so no debugger is automatically attached, so breakpoints and such don't work. I'm sure I'm missing a step somewhere, but this is functionality I haven't tried to use before so I'm lost. Any recommendations?
The mvn thorntail:run accepts a system property thorntail.debug.port with a port number. For example, if you run
mvn thorntail:run -Dthorntail.useUberJar -Dthorntail.debug.port=5005
the Java process will wait for remote debugger connection and only then will it continue.
I don't use Eclipse, but I'm pretty sure configuring a remote debugging session isn't hard.
Execute the uberjar with the following parameters. Ensure that all the parameters are specified before the name of the uberjar on the line.
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=$PORT_NUMBER -jar $UBERJAR_FILENAME
$PORT_NUMBER is an unused port number of your choice. Remember this number for the remote debugger configuration.
$UBERJAR_FILENAME is the uberjar.
suspend=y ensures that JVM will pause and wait for remote debugger connection before it starts the application.
To remote debugging it using Eclipse IDE you have to open Eclipse, open source code of the targeted application and create a debug configuration ("Remote Java Application") by specifying the targeted host and port. After this, hit "Debug" button and proceed with the remote debugging.
I am new to using IntelliJ and this seems to be a common problem having gone through similar questions but am still unable to use debugger in a Maven project.
After configuring the Debugger when I click on Debug I see following in my console:
"C:\Program Files\Java\jdk1.8.0_151" -agentLib:jdwp=trasnport=dt_socket,address=127.0.0.1:52485 server=n suspend=y
...//Few project specific environment variables
Connected to target VM 127.0.0.1:52485
Note that the application is up and listening on port 8080 as I can access it from the browser and its a standalone Dropwizard application.
There is a cross on the break point and the debugger doesn't stop over it. Have tried removing Cache, restarting, deleting .idea folder, building Maven project but still the break point doesn't work.
Should the jdwp port also be 8080 and not 50000 something as shown above. I am unable to debug this in Eclipse as well. Can some one help me out what could be the solution. Thanks for any help.
I have a multimodule gwt project that I'm able to start up and run through IntelliJ just fine. But when I go to debug the application (or actually just the act of adding ?gwt.codesvr=127.0.0.1:9997 to the end of the url) causes me to get the dreaded "Plugin failed to connect to Development Mode server at 127.0.0.1:9997.
My current setup is:
Entrypoint has a dependency on several portal modules. I'm unsure of what I'm doing wrong, because the portal runs fine as long as it's not through the code server..
Edit: Here is my current run configuration. I've tried everything including changing the -war directory to target\ROOT and src\main\webapp and I've changed the web facet resource folder to the same, I have no clue what I'm doing wrong.
Note that I've tried removing and adding the bindAddress several times. It doesn't differently either way.
It is not your Project Structure that is at fault here. Most probably your "Run Configuration" has flaws. In "Run/Debug Configurations" you need to create "GWT Configuration" and set up properties correctly. I run with "GWT Module to load" = "All" and with "Dev Mode parameters" set to "-bindAddress 0.0.0.0" to allow accessing my debug config from various hosts, not only from localhost - you may or may not need it. Obviously, for your setup "Use Super Dev mode" should be turned off.
Also you need to check that the port 9997 is not taken up by another process. But if it is, you will see the error in Jetty's startup log in debug console. I assume if it works with Eclipse it should not be.
This is more for reference than anything but i kept hitting my head against the wall for the last few nights.
I kept getting the CONNECTION RESET error back from maven when trying to use FTP to deploy files to an external repo.
All the maven settings were set up correctly.
I eventually decided to try the POM file on my other dev computer and it worked.
This then caused me to look through the setup of the systems, and i realised that my laptop was using JDK1.7 whereas my main computer was using JDK1.6.0r31
If you encounter the same issue trying to deploy your files through FTP (might occur on anything really) then make sure you try JDK1.6.
If you are running Windows 7, could this bug have something to do with it?
Try using the -Djava.net.preferIPv4Stack=true option when running Java with Windows 7 and see if this fixes the problem.
I am getting an error when I try to build my project in NetBeans. I am using JBoss 5.1.0 server and have attached that to my project. The error is -
The following error occurred while executing this line:
.../myPath/build-impl.xml:176: The Java EE server classpath is not correctly set up - server home directory is missing.
Either open the project in the IDE and assign the server or setup the server classpath manually.
For example like this:
ant -Dj2ee.server.home=<app_server_installation_directory>
I am using Mac OS X Lion.
I was missing a library. When I right clicked the project and went to libraries, it showed me library missing. I added the library and did a clean and build and the error disappeared
Clean builds did not help me, either. I took a look at project.properties and found that j2ee.server.home was not set anywhere, although j2ee.platform.classpath depends on it.
I do have Weblogic Server set up under /home (on a Linux machine).
So, I closed the project and added a line to project.properties:
j2ee.server.home=/home/blister/wls/wlserver
(where wlserver = the server name)
And reopened the project. Presto, the app now builds. It still doesn't know where the app server is, but at least I can built my jar and can worry about deploying it later. (I tell it to build a war which deploys nicely to Weblogic.)
If you are using netBeans Ide, then right click on the project. click properties. in the properties menu select Run. in that the first text box is server. There select the server. with which u want to run the project. If the server details are not configured before. configure server details and try. it wil help you to solve the above problem.
This worked for me.
Right click on the Project -> Properties -> Run
And Change the server Setting from the current server to another sever and click OK.
Wait for any background scanning to finish.
Repeat the processes 1 to 3 again this time selecting the actual server you want to run the code on.
Then try Re-Running your application.
I also had this error. However despite adding servers in the Run section of the Properties window, repeatedly no servers showed as being available to add to the Project ( again within the Run section ). The solution to being able to see a server in this server list was to run Netbeans as an admin ( which I saw Rotunba referencing in this thread..It was then possible to add a server and the project built successfully..
I solved it like this, I added in the ANT properties field
"j2ee.server.home=http://localhost/"
tolls>options>java>Ant
this in linux netbeans
It could also be as simple as not running your IDE i.e. netbeans as an administrator on your machine. I had the same problem. Wasted some time.