After some time (Of idle or after some run launches) the proccess Eclipse.exe is using my specific wanted port.
It obvious that when Java program is running the proccess "javaw" is need to run and this process is using the port (In case of serversocket).
Why does suddenly Eclipse using my port?
So when I running my application I get the predictable exception:
java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
But when I restart Eclipse it release the port
I can't think of a reason why Eclipse would use port 1617. (It is reserved for "Nimrod Inter-agent Communication".)
I suspect that what has happened is that you have used Eclipse to run your application or some unit tests ... within the Eclipse JVM ... and there is a live ServerSocket still hanging around from the tests.
Try restarting Eclipse.
It is also possible that you are using a dodgy plugin which is ignoring the rules on port reservation ... just like your application is doing.
Related
I am unable to start mule standalone server 3.5.0. in my Windows7 PC. My java version installed is "1.6.0_45" and it is 64 bit. I have set the Path, JAVA_HOME, MULE_HOME environment variables in system settings. While starting the mule server by running mule.exe from bin folder I am getting the following error.
Can you please anyone suggest me to get rid of this error.
C:\Applications\mule-standalone-3.5.0\bin>mule
MULE_HOME is set to C:\Applications\mule-standalone-3.5.0
Running in console/foreground mode by default, use Ctrl-C to exit...
--> Wrapper Started as Console
Launching a JVM...
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main"
JVM exited while loading the application.
CTRL-C trapped. Shutting down.
<-- Wrapper Stopped
Terminate batch job (Y/N)?
The exceptions java.lang.UnsupportedClassVersionError are very often 100% right. I would triple check that you are not using an older version.
Mule 3.5 is built with Java 1.6 so it's very unlikely there is a problem unless you have the wrong JVM.
Sometimes yo have everything setted properly, but it's getting the java from somewhere else.
tyy to run a
C:\Applications\mule-standalone-3.5.0\bin>java -version
just in case, to see if you are using the correct java version.
By the way, the exception is on a mule class or is in a project of yours deployed in this mule runtime? (seems like the log you copied is truncated).
We have a webstart swing application running on our multiple remote desktop servers for a lot of customers. Suddenly, on one of our servers the customers started getting a java.lang.NoClassDefFoundError. Not on startup, the applications starts up fine, but when doing specific tasks, eg sending a mail through our software, it popups up in the console like this:
java.lang.NoClassDefFoundError: pos/MailSenderInterface
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
......
Caused by: java.lang.ClassNotFoundException: pos.MailSenderInterface
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 56 more
The problem is, this only happens on ONE of our servers. On all the other servers the webstart application runs just fine! But on this single terminal server, I get the error, even though the java version is the same, and the link to the jnlp-file is the same.
I have of course tried deleting temporary internet files in the java control panel, to no avail.
I then started toying around a bit, and found out something very strange.
Our customers start the application from an icon pointing to a batch-file in c:\drift
This batchfile only contains the following:
#start javaws http://ourserver/ourapplication.jnlp
Typing the link outside the batch-file gives the same error. Then I typed cd .. so that my current path was c:\ instead of c:\drift and started javaws from there. And surprise, no errors! I then tried cd drift again and the error occured again. I have tried this many times now, with the same result. So somehow the path from WHERE I start javaws have something to say for if I get the NoClassDefFoundError or not. But neither c:\ or c:\drift contains any .jar-files (although subdirectories may). I am very perplexed by this. What on earth is wrong? Our java version is 1.7.0_67
Aha! The path c:\drift\ actually had a directory "pos" from a couple of years back, with an old version of MailSender.class but with no MailSenderInterface.class Deleting this directory solved the problem. :-)
(Remember that the error was about a missing pos/MailSenderInterface)
Apparently the newest javaws in java 1.7.0_67 tries to load classes from a subdirectory of the place where you started javaws if such a directory is found, instead of loading the files from the correctly downloaded jar-files.
I have moved my project into my webapps directory under the tomcat 6.0 directory and am running this under the updated url using port 8080.
Has anyone ever seen this error?
**java.lang.UnsatisfiedLinkError: Native Library D:\oracle\product\10.2.0\client_1\BIN\ocijdbc10.dll already loaded in another classloader**
java.lang.ClassLoader.loadLibrary0(Unknown Source)
java.lang.ClassLoader.loadLibrary(Unknown Source)
java.lang.Runtime.loadLibrary0(Unknown Source)
java.lang.System.loadLibrary(Unknown Source)
oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3147)
java.security.AccessController.doPrivileged(Native Method)
oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3143)
oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:221)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:132)
oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:78)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
I am curious to find out what the first line of this stack trace is.
What does this mean?
Please let me know if more information is required from my program.
Thank you in advance.
Sonny
As error saying - you can not load dll lirary from two separate class loaders. Most likely you have two separate Web Applications using connection to Oracle.
Please try to move oracle library jar to Tomcat shared/lib folder, so library will be loaded only once by Tomcat Common Class Loader.
Hello all I solved my own issue. I had to change the path of the oracle database to a jdbc thin client url as opposed to directly connecting to the oracle database.
originally I was using the statement: intfdb.JDBCOCIDRV=jdbc:oracle:oci:#GPSTRKPD.na.jnj.com
to connect which was causing the error.
I change my statement to: jdbc:oracle:thin:#psgtwp0.na.jnj.com:1531:gpstrkpd and it works fine now. Thanks for all of your input.
Sonny
At one point, the remote debug used to work. But for the life of me, I don't seem to be able to figure out what broke it.
I have a flex/Java application. There is a wrapper that starts the tomcat server. I modified the wrapper.conf file to include
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
In my flex debug configurations, on the left, I have Remote Java Application. On the right, I have Standard (Socket Attach) as the connection type, 127.0.0.1 (I have tried localhost too) as Host, and 8000 as Port.
The following is the stack trace.
!ENTRY org.eclipse.jdt.launching 4 113 2013-09-03 11:30:49.109
!MESSAGE Failed to connect to remote VM. Connection refused. !STACK 0
java.net.ConnectException: Connection refused: connect at
java.net.PlainSocketImpl.socketConnect(Native Method) at
java.net.PlainSocketImpl.doConnect(Unknown Source) at
java.net.PlainSocketImpl.connectToAddress(Unknown Source) at
java.net.PlainSocketImpl.connect(Unknown Source) at
java.net.SocksSocketImpl.connect(Unknown Source) at
java.net.Socket.connect(Unknown Source) at
java.net.Socket.connect(Unknown Source) at
java.net.Socket.(Unknown Source) at
java.net.Socket.(Unknown Source) at
org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:136)
at java.lang.Thread.run(Unknown Source)
Here is a screen shot of the debug configurations.
After much struggles, I finally got it figured out. I had to make two changes.
I added tomcat.enable.debug=true to my catalina.properties file.
In my wrapper.conf, I had the following lines.
wrapper.java.additional.9="-Xmx2048m"
wrapper.java.additional.10="-XX:MaxPermSize=1024m"
My MaxPermSize was set to a smaller size than Xmx. I had to change that 1024 to 2048.
I then restarted my tomcat and it worked, finally!
Each debug argument must be placed in a line by itself, after the -vm argument. This should do the trick:
-vmargs
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
Eclipse is not very verbose for this error "Connection refused". One has to check three entries here.
1. Fully qualified host name or IP
2. Correct port number.
3. At Tomcat level heck below:
Some versions of Tomcat has "dt_shmem" entry instead of "dt_socket". Change it to dt_socket in catalina.bat.
The line should looks like this:
set JPDA_TRANSPORT=dt_socket
We must start Tomcat in remote mode rightly, otherwise just setting related variable cannot solve the problem. My solution is below and that works for my situation:
Connection refused problem solution
If you validate Eclipse configuration settings and see that both hostname/IP and port name are correct, try to restart eclipse
when I run my server application on eclipse it doesn't work and the error is shown as following:
java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at MyServer.main(MyServer.java:17)
Exception in thread "main" java.lang.NullPointerException
at MyServer.main(MyServer.java:26)
I think you forgot to initialize the port and you are trying to connect to port=0 that is invalid. I thing that your application receives port via command line. When you are running it from eclipse you forgot to provide it. Do it using the run/debug configuration.
It is just a theory. I do not see your code.