Java Socket Permission error - java

Please help me resolve the following Java error msg when attempting to make a remote connection to a device in my office. I can connect from another CPU to the device, but not from my laptop. So, I know its a file in my laptop config somewhere. I have updated Java several times. Can someone tell me which file it is and exactly how to resolve this?
Also, the URL socket is supposed to be 5800...but the error msg shows socket 5900 for some reason!
Error: access denied (“java.netSocketPermission””172.30.150.88:5900””connect,resolve”)

Can someone tell me which file it is and exactly how to resolve this?
It is not possible. The location of that configuration file depends entirely on the Java application you are running.
If you were running Linux, I would say "use find and grep to search for the file".
The other thing to note is that you appear to have a Java security exception. That suggests that on your laptop the code is being run in a security sandbox. If that is the case, there is a distinct possibility that it is blocking all connects ... and that fixing the port number won't solve the problem.

Related

Java Program failing to connect to MQ "unable to connect to queue manager, check remote access to MQ installation"

To clarify the issue. I am running an MQ simulator jar given to us by a vendor (essentially to verify or MQ setup prior to them delivering MQ functionality).
The program works, when I run it from my laptop.
I get "unable to connect to queue manager, check remote access to MQ installation" when I run it from the linux dev server (which is where we actually want to verify the connectivity from). Same exact MQ properties as when I run from my windows laptop. I ran telnet from the server to the host and port and confirmed that worked. So I imagine there shouldn't be any firewall rule preventing the connection.
The program doesn't actually print out an error code, just the message (which I am pretty sure is the first question that is going to get asked of me).
I've been talking to the folks that set up MQ, and they are really making it sound like it isn't an issue on their end despite the fact most everything I can find on this message is indicating it is probably a problem with configuration there.
Not super linux savvy so any tips on any way I can monitor and get more information on a root cause other than this error message I am seeing would be great.

Deploying webservice on remote machine

This might sound a very basic question for the N/W gurus so please try to help me here.
I have developed a simple Webservice in Java and deployed it on a local machine using Eclipse/Ant. The path looks like this -
http://localhost:8284/myws?wsdl
Now, I have provided a static IP for the local machine say XX.XX.XXX.XX and I can ping it from any remote machine over internet.
In my Java program, I have provided endpoint name as -
"http://localhost:8284/myws" and it works fine on local machine and opens the wsdl just fine in a browser.
Now, I want to deploy this webservice in a way that, I can access it remotely using my static IP i.e XX.XX.XXX.XX
Problem 1:
When I try to assign the endpoint as
"http://XX.XX.XXX.XX:8284/myws" my Java program gives error saying
Server Runtime Error: java.net.BindException: Cannot assign requested address: bind
Problem 2:
If I deploy it as "http://localhost:8284/myws", I am not able to access it over internet using URL like http://XX.XX.XXX.XX:8284/myws?wsdl.
Things I have did so far - -
a. Turned off the firewall
b. Created 2 rules inbound/outbound with port 8284 allowed.
My question is, will I need a router to do a port-forwarding thing? Or will I need an IIS to deploy it?
I really want to ignore both of them. If there is any simple way to do that please let me know. Am I missing something? I am able to ping the IP and can also connect through RDC.
Info -
Machine is on Windows 7.
Any help will be greatly appreciated.
Thanks.
I got it solved. I used http://0.0.0.0:8284/cal while binding and not localhost:8284/cal
Works like a gem now! Hope it helps someone.
Regards,
Bhushan.

FTP.changeWorkingDirectory not working when tried to FTP from Server

I am using FTP to transfer files from India to Germany.
When I try to transfer the files from my PC, everything works fine.
But, when I deploy the application in the Linux server in India and try to transfer,
the code ftp.changeWorkingDirectory("/") gives 'false' result.
However, I can do this transfer to another FTP setup in India.
The Server in Germany seems to have all the rights required when I check using FTPClient.
What may be the reason? What can I do to solve this problem?
You probably just do not have any permissions to visit the directory / (root). Try the same with a directory you definitely have access to.
If it works locally but not remotely, usually the problem is that you are not using PASSIVE mode in a situation where the server cannot connect back to you.
But here you already get an error when doing changeWorkingDirectory. Can you do ftp.cwd("/") (which returns an int, the FTP reply code) and show which error code you get?
Sorry..
It was was escape sequence error..
As it is different in Windows and Linux Systems.
Thanks for the help

Java server software not recieving connections when compiled to executable Jar

I have written code for a tcp (SSL) server which receives client connections and distributes data to the clients. the server GUI is based on JavaFX. When i run the server software from within Net Beans or Eclipse it works fine, receives client connections and sends and receives data. But when i compile the code into an executable Jar the server does not receive connections and client code throws: Connection refused exception.
I have tried pinging the server and it seems the server does not listen to the specific port when it is run from the executable Jar but DOES when run from within the IDE.
to be honest , I have no idea what could be causing this behavior. would appreciate any insights , suggestions or leads into how to fix this issue. I dont think the specific code is relevant but if somone thinks it is i will post the server code.
Well, turns out the problem was that the relevant keystores were not being loaded right. They were being loaded as FileInputStreams which will not work when embedded inside a Jar file.
I reverted them to being loaded as InputStreams , which work just as well with the SSL context and everything seems to be working right now.
Thanks a bunch for all the suggestions they defiantly helped me eliminate things along the way.

Unable to connect to server database from java desktop application

I created a java desktop application. I am trying to connect this application to mysql
server database. But it is throwing socket exception. I tried in all the ways to solve this issue
but none of them worked for me. The problem which I got is mentioned in this link http://ubuntuforums.org/archive/index.php/t-849637.html
Please help me in this regard.
Will be really thankful..
According to your respnose on Oct 3'12 at 10:27, you already found out this is not Java related.
Fix your network problem:
ensure MySQL is really running
ensure you use correct IP/port
ensure no firewall is blocking traffic

Categories

Resources