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.
Related
I'm wanting to run tests on another more powerful machine to speed up testing time, so I've created a run configuration on Intellij which targets my Ubuntu machine rather than my local one.
If I don't use rsync to copy the files to the remote target, the tests all work fine, however when I enable rsync in IntelliJ, I get the following exception when the tests attempt to start:
Error: Could not find or load main class com.intellij.rt.junit.JUnitStarter
Caused by: java.lang.ClassNotFoundException: com.intellij.rt.junit.JUnitStarter
Process finished with exit code 1
Although I could run without rsync enabled, the copy process to the remote host takes longer than running the tests on my local machine.
For context, my local machine is running Windows 10, and my remote machine is running Ubuntu 20.04.
Thanks in advance!
EDIT:
After doing a bit more digging, I found that rsync is copying files in the maven repository and Intellij Ultimate folder using the MS-DOS file structure style. This means that as part of the copy, it's using backslashes instead of forward slashes resulting in linux thinking it's part of the name of the .jar file. In result, it means that the copied maven repository folder is in the wrong file structure:
Changing the file structure manually fixed the issue and tests run successfully however it's just a work around and doesn't directly fix the problem but at least points in the right direction.
This is a bug: https://youtrack.jetbrains.com/issue/IDEA-270106
Will be helpful if you can vote for it and attach idea logs there
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.
I have developed a java webservice application that I have been running on my dev-computer and in the meanwhile been setting up a dedicated ubuntu based linux server.
I have installed oracle-jre, mysql and apache tomcat 7 on this linux server and
after reading documentation I understand that I can either copy the deployed project archive (.WAR) or I can simply copy the project folder, into the servers /webapps/ folder from my development computer. Then restart tomcat7 and it should automatically run the webapp.
On my dev-computer with Eclipse IDE the webservice works properly as expected, but I cannot access the POST URL methods at all on the server
e.g. localhost:8080/Webservice/rest/account/login
(The installation on the server seems to be O.K as the Apache examples all work properly.)
I cannot see any logs in the /logs/ directory, in fact the folder is completely empty, so I cannot debug whats actually happening. Why aren't logs writing to the Catalina.out file?
Am I deploying this correctly as explained above?
Do I need to configure Eclipse or any project settings to reflect the change from the eclipse IDE / dev-computer to the server? E.g Is there any real difference?
A lot of questions there, but I wanted to clarify as much as possible,
Cheers,
Oliver
I fixed this issue by reinstalling tomcat.
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.
My tomcat 5.5 start fine when I start it by itself. When I try to start it in eclipse, it times out. It just sits at "Starting Tomcat v5.5...at localhost". I even changed the timeout to 5 minutes and it still won't start. I've tried reinstalling my tomcat in eclipse multiple times and that hasn't helped at all. Please help.
You can specify the timeout in the server configuration screen in Eclipse which you can get by doubleclicking the server entry in the Servers view. You could try to increase it to 100 seconds or something. But I don't think that this will fix the real problem.
You need to ensure that Tomcat which is started externally is completely shutdown before you start it from inside Eclipse. To verify this, go in your webbrowser to the address where Tomcat should be listening on, e.g. http://localhost:8080. If you get a browser default connection timeout error, then it's fine. This way you should be able to start it from inside Eclipse.
If in vain, you could try to clean the Tomcat working directory by rightclicking the server entry and choosing Clean. If still in vain, try restarting Eclipse as eclipse.exe -clean.
After days of messing with this, I finally figured out that it was a specific project that I had added to the server. It somehow caused the server to never start. When I switched the jdk from the workbench default, to version 6 which I downloaded, it worked fine. I'm still not exactly sure if there is a jar in that project that is causing the problem.
I know it's an old post but I had the same problem when I updated to eclipse indigo and the problem was fixed when I changed JDK version to 1.6.0_36.
In my case (kepler) switching between jdks didn't work, but putting just one webapp at a time (when debugging) did the trick.