Initialising a connection to a socket server
Hi
I am developing an application that is an on-line temperature & humidity monitoring system. A customer has the
requirement for data to be sent to his socketServer every hour. The code below works fine as long as the
serverSocket program is running but crashes on the new Socket instruction if the interconnection is not there.
The uploadToSocket method is called from a timeline every hour or from a button to test the system.
I have tried to make sense of the literature on the subject but there seems to be a number of different
solutions all with examples that are more complex than I need and are difficult to follow. I seem to have to
run in a different thread and words like tasks and servers are used although one tutorial used listeners. Does
anyone have a simple solution to this.
// socket for connection to server
static private Socket socket = null ;
// for writing to the server
static PrintWriter out = null;
static boolean initSocket(){
boolean bOK = true ;
try {
socket = new Socket(sSocket, Integer.parseInt(sPort));
// socket = new Socket("192.168.1.102", 4444);
out = new PrintWriter(socket.getOutputStream(),true);
Ecowand3.lSocket.setText("Socket"); // to say socket is active
catch (Exception ex) { ex.printStackTrace();
Ecowand3.lSocket.setText("Socket not found");
System.err.println("no socket");
bOK = false ;
return bOK ;
static void uploadToSocket(boolean demoMode){
if (!demoMode){
boolean bSocketOK = initSocket();
System.out.println("In upload " + bSocketOK);
if (bSocketOK){
try (BufferedReader br = new BufferedReader(new FileReader("socketdata.csv")))
System.out.println("Trying upload");
String sCurrentLine ;
while ((sCurrentLine = br.readLine()) != null){
System.out.println(sCurrentLine + " upload");
out.println(sCurrentLine);
br.close();
socket.close();
out.close();
File f = new File("socketdata.csv");
boolean bD = f.delete();
System.out.println("file deleted = " + bD);
catch(IOException e) { System.err.println("Eco-wand - error with Reading Socket File");}
}Thanks
ABG
Here is one way to do this. The code below neither crashes nor throws an exception for me. Perhaps you could study the code below and apply some of the concepts to your case.
import java.io.IOException;
import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.nio.*;
import java.nio.channels.*;
import java.nio.charset.*;
import java.text.*;
import java.util.*;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.stage.*;
import java.util.Timer;
import java.util.logging.*;
import javafx.event.*;
import javafx.geometry.Pos;
import javafx.scene.layout.VBox;
public class PingApp extends Application {
private static final DateFormat TIMESTAMP_FORMAT = new SimpleDateFormat("HH:mm:ss.SSS");
private static final int PORT = 8442;
private Client client = new Client("localhost", PORT);
private Server server = new Server("localhost", PORT);
@Override public void start(Stage stage) {
server.start();
Button pingButton = new Button("Ping Now");
pingButton.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent event) {
client.pingNow();
Button startServer = new Button("StartServer");
startServer.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent event) {
server.start();
Button stopServer = new Button("StopServer");
stopServer.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent event) {
server.stop();
VBox layout = new VBox(10);
layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10px;");
layout.setAlignment(Pos.CENTER);
layout.getChildren().setAll(
startServer,
stopServer,
pingButton
stage.setScene(new Scene(layout));
stage.show();
class Client {
private final CharsetEncoder encoder = Charset.forName("US-ASCII").newEncoder();
private final InetSocketAddress address;
private static final int MILLISECONDS_PER_PING = 5 * 1000;
public Client(String hostname, int port) {
address = new InetSocketAddress(hostname, port);
new Timer("sched-comm").scheduleAtFixedRate(pingTask, 0, MILLISECONDS_PER_PING);
public void pingNow() {
Thread thread = new Thread(pingTask, "adhoc-comm");
thread.setDaemon(true);
thread.start();
private final TimerTask pingTask = new TimerTask() {
private int nCalls = 0;
@Override public void run() {
doPing();
private synchronized void doPing() {
try (SocketChannel channel = SocketChannel.open()) {
String msg = createLogMessage("Ping " + nCalls++);
channel.connect(address);
System.out.println(createLogMessage("send => '" + msg + "'"));
channel.write(encoder.encode(CharBuffer.wrap(msg)));
} catch (ConnectException c) {
System.out.println(createLogMessage("ping failed => 'Unable to Connect to " + address + "'"));
} catch (IOException ex) {
Logger.getLogger(PingApp.class.getName()).log(Level.SEVERE, null, ex);
class Server {
private final CharsetDecoder decoder = Charset.forName("US-ASCII").newDecoder();
private final InetSocketAddress address;
private Thread thread;
private boolean shuttingDown = false;
private final Runnable serverTask = new Runnable() {
@Override public void run() {
ServerSocketChannel server;
try {
server = ServerSocketChannel.open();
server.socket().bind(address);
} catch (IOException ex) {
Logger.getLogger(PingApp.class.getName()).log(Level.SEVERE, null, ex);
return;
ByteBuffer incoming = ByteBuffer.allocateDirect(1024);
incoming.clear();
while (true) {
try (SocketChannel channel = server.accept()) {
if (Thread.currentThread().isInterrupted()) {
return;
channel.read(incoming);
incoming.flip();
CharBuffer charBuffer = decoder.decode(incoming);
System.out.println(createLogMessage("received => '" + charBuffer.toString() + "'"));
incoming.compact();
} catch (ClosedByInterruptException ie) {
return;
} catch (IOException ex) {
Logger.getLogger(PingApp.class.getName()).log(Level.SEVERE, null, ex);
public Server(String hostname, int port) {
address = new InetSocketAddress(hostname, port);
synchronized private void start() {
System.out.println("Server started");
if (thread == null) {
thread = new Thread(serverTask, "server");
thread.start();
synchronized private void stop() {
System.out.println("Server shutting down");
if (thread != null && !shuttingDown) {
shuttingDown = true;
thread.interrupt();
Thread shutdownWaiter = new Thread(new Runnable() {
@Override
public void run() {
try {
thread.join();
thread = null;
shuttingDown = false;
} catch (InterruptedException ex) {
// no action required.
System.out.println("Server shutdown");
}, "shutdown waiter");
shutdownWaiter.setDaemon(true);
shutdownWaiter.start();
private String createLogMessage(String message) {
return
TIMESTAMP_FORMAT.format(new Date()) + " " +
Thread.currentThread().getName() +
" " +
message;
public static void main(String[] args) { launch(args); }
}
Similar Messages
-
Design question for database connection in multithreaded socket-server
Dear community,
I am programming a multithreaded socket server. The server creates a new thread for each connection.
The threads and several objects witch are instanced by each thread have to access database-connectivity. Therefore I implemented factory class which administer database connection in a pool. At this point I have a design question.
How should I access the connections from the threads? There are two options:
a) Should I implement in my server class a new method like "getDatabaseConnection" which calls the factory class and returns a pooled connection to the database? In this case each object has to know the server-object and have to call this method in order to get a database connection. That could become very complex as I have to safe a instance of the server object in each object ...
b) Should I develop a static method in my factory class so that each thread could get a database connection by calling the static method of the factory?
Thank you very much for your answer!
Kind regards,
Dak
Message was edited by:
dakgerSo your suggestion is to use a static method from a
central class. But those static-methods are not realy
object oriented, are they?There's only one static method, and that's getInstance
If I use singleton pattern, I only create one
instance of the database pooling class in order to
cionfigure it (driver, access data to database and so
on). The threads use than a static method of this
class to get database connection?They use a static method to get the pool instance, getConnection is not static.
Kaj -
I have used php to write a socket server(text chat server),
then I use xmlsocket to write a client, I put this swf file in my html page, erverything of this client swf were ok: ervery clients could send or receive messages, but the other http request in this html page was unable to send(or receive) data from webserver,
webserver and chat server were on the same server,
and I have tried to use socket to instead if xmlsocket in my flash, but the new swf can only work in flash cs3, but it couldn't work in html page as the chat server can't send the security xml file to this swf, and I have also use Security.loadPolicyFile("http://192.168.139.128/crossdomain.xml"); to load security file, but it took none effect.
Is there anyone can suggest me ?
That's very kind of you!Hi Franco,
Yes, I solved that by reinstalling Java 6 Update 21.
There are three versions for Solaris namely, SPARC, x64 and x86. Our platform is SPARC and I think System admin has installed the wrong version instead of installing SPARC version of Java.
After installing SPARC version of Java this got resolved. And I confirmed everything is fine by running a small program as below. You can run this program from command line using the -d64 flag. If the installation is wrong you will get the same exception as I mentioned.
public class Analyzer {
public static void main(String args[]) throws Exception{
InputStream fin = new FileInputStream(args[0]);
int iSize = fin.available();
byte mvIn[] = new byte[iSize];
fin.read(mvIn,0,iSize);
fin.close();
String strText = new String(mvIn);
PrintStream fout = new PrintStream(new FileOutputStream(args[0]+".csv"));
fout.println("Before,After,Seconds");
Pattern p = Pattern.compile("\\[(?:Full |)GC (\\d*)K->(\\d*)K\\(\\d*K\\), ([\\d.]*) secs\\]");
Matcher m = p.matcher(strText);
while(m.find()){
fout.println(m.group(1)+ "," + m.group(2) + "," + m.group(3));
fout.close();
}Hope this helps.
Regards,
Prabhu -
Problem with socket connections through a proxy server.
People,
I set the system properties to use a proxy server so my application can fetch data from servers located outside my local network:
System.setProperty("socksProxyPort", port);
System.setProperty("socksProxyHost", proxy_addy);Then, when I attempt to stabilish a connection:
s = new Socket(this.getHost(), port);It hangs.
I appreciate any help since my available Java documentation is quite obscure regarding proxy servers.Is the proxy on another machine? Try it's IP. If
not, replace 'proxy' with 'localhost'.
- SaishYes, it is another machine.
byte x[] = {(byte)aaa,(byte)bbb,(byte)ccc,(byte)ddd};
s = new Socket(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(InetAddress.getByAddress(x), 8080)));
s.connect(new InetSocketAddress(this.getHost(), port));Again, it hung. -
Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'
I'm using the pre-installed versions of php and mysql under Mac OS X Server 10.4.4 running on a G4 and am unable to get anything involving mysql to work.
I ssh to the server and enter various commands in Terminal:
on typing "mysql" I get
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
and on typing "mysqladmin version" I get
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/mysql/mysql.sock' exists!
On typing "sudo mysqld_safe" I get
Starting mysqld daemon with databases from /var/mysql
STOPPING server from pid file /var/mysql/MyServer.local.pid
070722 16:06:05 mysqld ended
/var/mysql/MyServer.local.err contains
070722 16:06:04 mysqld started
070722 16:06:04 [Warning] Setting lowercase_tablenames=2 because file system for /var/mysql/ is case insensitive
070722 16:06:04 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
070722 16:06:05 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43634.
/var/mysql has permissions 775.
The line
mysql.default_socket = /var/mysql/mysql.sock
is in /etc/php.ini
whereis mysqladmin ->
/usr/bin/mysqladmin
whereis mysql ->
/usr/bin/mysql
ls /var/mysql ->
MyServer.local.err
ib_logfile1
mysql
ib_logfile0
ibdata1
test
Can't find my.cnf or my.ini anywhere
Can't find mysql.sock anywhere
I'm trying to get a bug database running (mantis) under Mac OS X Server 10.4.4 that I can access from local clients.
I'm trying to follow directions at http://www.mantisbugtracker.com/manual/manual.installation.php
without knowing anything about mysql or php and I'm stuck on step 3:
"Next we will create the necessary database tables and a basic configuration
file."
I get a message saying
"Does administrative user have access to the database? ( Lost connection to MySQL server during query )"
I don't even know if following the mantis directions has resulted in the creation of a database or not. Where would it be?
Thanks for any help.
Intel iMac Mac OS X (10.4.10)I've just done a clean install of OSX Server and added the latest MYSQL packaged installer. Afterwards I found the lock file in /private/tmp/mysql.lock
The easiest way to solve this problem is to create a symbolic link so that the lock file appears to be in right place.
e.g.
cd /var
sudo mkdir mysql <== this assumes the directory is missing
cd mysql
sudo ln -s /private/tmp/mysql.sock mysql.sock
After this msql commands should work fine, and you've not fiddled with the security settings on users/groups.
HTH
Christian -
"Can't connect to local MySQL server through socket '/tmp/mysql.sock'"
Data Services=3.1
Repository=12.2.2.0000
Red Hat Enterprise 5
Designer,Job Server,Job Engine=12.2.2.3
After an unscheduled server reboot with DS up and running when trying to start a job in either Data Services Management Console or DS Designer getting the following:
"Can't connect to local MySQL server through socket '/tmp/mysql.sock'"
The mysql.sock have never been in /tmp and on the production server it does not exist there and the production server is up and running correctly. If a link is created to mysql.sock(/home/user/boedge31/bobje/mysql) the job will start but return this message:
"Cannot retrieve <Version> from the repository. Additional database information: <SQL submitted to ODBC data source <localrepo> resulted in error <MySQL ODBC 3.51 Driver mysqld-5.0.46-enterprise No database selected>. The SQL submitted is <select VERSION, SECURITYKEY, GUID from AL_VERSION where NAME = 'Repository Version'"
I checked and AL_VERSION and the Version field exist.
Before the shut down DS was working correctly and had no issues. My best guess is a part of the repository was corrupted during the unscheduled shut down. It seems like DS has "forgotten" some of the settings.
Any suggestions on a possible solution?The issue has been solved.
There was a bad path in $LD_LIBRARY_PATH.
Removed the path and DS started working again. -
Connection Error in Presentation Server log file - Socket:524
Hi All,
Earlier I had issues with starting presentation server , so i installed OBIEE again.
I started all the services and Started oc4j.
And i'm able to open the Administrator tool. But get error in IE while opening presentation server.
When i opened the saw0log file from this location "C:\OracleBIData\web\log" ,this is the error i see
Type: Error
Severity: 42
Time: Thu Apr 08 11:08:06 2010
File: project/webcomm/socket.cpp Line: 892
Properties: ThreadID-1736
Location:
saw.rpc.client.impl.verify
saw.rpc.client.impl.initFixedRPC
saw.rpc.client.endpoint.noncluster.initFixedLenRPC
saw.rpc.ping.send
saw.threads
An error occurred during execution of "connect". No connection could be made because the target machine actively refused it.
[Socket:524]
Type: Error
Severity: 42
Time: Thu Apr 08 11:10:08 2010
File: project/webcomm/socket.cpp Line: 892
Properties: ThreadID-1736
Location:
saw.rpc.client.impl.verify
saw.rpc.client.impl.initFixedRPC
saw.rpc.client.endpoint.noncluster.initFixedLenRPC
saw.rpc.ping.send
saw.threads
An error occurred during execution of "connect". No connection could be made because the target machine actively refused it.
[Socket:524]
Type: Error
Severity: 42
Time: Thu Apr 08 11:12:10 2010
File: project/webcomm/socket.cpp Line: 892
Properties: ThreadID-1736
Location:
saw.rpc.client.impl.verify
saw.rpc.client.impl.initFixedRPC
saw.rpc.client.endpoint.noncluster.initFixedLenRPC
saw.rpc.ping.send
saw.threads
An error occurred during execution of "connect". No connection could be made because the target machine actively refused it.
[Socket:524]
Please help me where to change the connection details.
Thanks
MehaboobStep : 1: Check your NQSCONFIG.ini file and in Repository section should be like
[ REPOSITORY ]
Star = bise1.rpd, DEFAULT;
or
[ REPOSITORY ]
bise1 = bise1.rpd, DEFAULT;
Step : 2 : Open ODBC Data source Administration ->System DSN and then Select AnalyticsWeb - Oracle BI Server
In Oracle BI Server LoginId and Password window you should check and enable the Change the default repository to
Here the name should be Star or bise1 ( Refer step:1:)
Click next and enable Change the default catalog to and select the Database (highlighted gray to blue color)
Leave others are default.
Note : whatever repository will be put under change Default repository section will be override by the DEFAULT settings in NQSCONFIG.ini .You can tick “Connect to Oracle BI Server to obtain default settings for the additional configuring”, so that RPD connection will be established as per the definition in .ini file after BI server restart.
Plz award points, if it helpful,
Thanks,
Balaa... -
Can't connect java socket server in MAC OS
Does any know what settings need to be done in order to connect socket server written in java on MACOS.
my socket server is running on 5000 port, i've tried on running server on linux, and my program is able to receive the request from remote unix server.
but when the server is running on mac OS, the the unix server couldn' connect to the socket.
is this a port blocking problem?
can someone tell me what to do to make server on MAC OS available for receiving request?
ThanksWho is the sys/net admin for the Mac?
-
Keep a Socket Server connection/port open for incoming requests
Hi,
I have a socket server which listens to the incoming messages. The problem is that the socket server terminates the socket connection once it receives a message.
I want this Socket server to keep on running and process all the requests it receives.
Can you please advise which stream shall be kept open for this to be achieved? Below is the code for your reference.
Thanks!
import java.net.*;
import java.io.*;
public class SocketServer
public static void main(String[] args) throws IOException
ServerSocket serverSocket = null;
String result = null;
SocketServer sockServer = new SocketServer();
try
serverSocket = new ServerSocket(4444);
catch (IOException e)
System.exit(1);
Socket clientSocket = null;
try
clientSocket = serverSocket.accept();
clientSocket.setSoTimeout(30000);
catch (IOException e)
System.exit(1);
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
String inputLine;
inputLine = in.readLine();
if((inputLine == null) || (inputLine.length() < 1))
throw new IOException("could not read from request stream");
else
result = sockServer.parseString(inputLine);
out.println("|0|OK|");
InputStream is = null;
FileOutputStream fout=null;
BufferedInputStream bufIn = null;
HttpURLConnection con = null;
ByteArrayOutputStream baos = null;
try
URL url = new URL("http","10.176.96.64",8080,result);
con = (HttpURLConnection)url.openConnection();
is = con.getInputStream();
bufIn = new BufferedInputStream(is);
fout=new FileOutputStream("Z:\\Clips\\Cache\\"+result);
baos = new ByteArrayOutputStream();
int c = bufIn.read();
while(c != -1)
baos.write(c);
c = bufIn.read();
baos.writeTo(fout);
catch(MalformedURLException mue)
System.err.println ("*********In Download File: Invalid URL");
catch (IOException ioe)
System.err.println ("*********In Download File: I/O Error - " + ioe);
finally
try
baos.close();
bufIn.close();
fout.close();
is.close();
con.disconnect();
catch(Exception ex)
System.out.println("*********In Download File: Exception Occured: "+ex.toString());
out.close();
in.close();
clientSocket.close();
serverSocket.close();
}In a truly unexpected turn of events.. this question has been crossposted.
http://forum.java.sun.com/thread.jspa?threadID=5127579
Good job singalg. I highly recommend that instead of accepting that there is anything wrong with your understanding of how this should work and reviewing the tutorials you should instead repost this question daily, Each day choosing a different forum. -
./mysqlshow: Can't connect to local MySQL server through socket '/tmp/mysql
hi all ,I install mysql on Solaris 10 at first it work fine , but after I restart my PC and go back again I got error on
./mysqlshow: Can't connect to local MySQL server through socket '/tmp/mysql
I google , but still not sure how to deal with it
Thank youI've just done a clean install of OSX Server and added the latest MYSQL packaged installer. Afterwards I found the lock file in /private/tmp/mysql.lock
The easiest way to solve this problem is to create a symbolic link so that the lock file appears to be in right place.
e.g.
cd /var
sudo mkdir mysql <== this assumes the directory is missing
cd mysql
sudo ln -s /private/tmp/mysql.sock mysql.sock
After this msql commands should work fine, and you've not fiddled with the security settings on users/groups.
HTH
Christian -
Connect to socket server behind proxy?
My socket server is behind proxy.
Can client connect to server?
ThanksHi Sojan !
Server work,
but when run behind proxy=Exception.
Hier is part of code.
public static final int PORT=780;//port number
static Socket soc;
PrintWriter out;
BufferedReader in;
static boolean flag;//check connection
try{
ServerSocket ss=new ServerSocket(PORT);
flag=true;
while(flag){
soc=ss.accept();
v.in=new BufferedReader(new InputStreamReader(soc.getInputStream()));
Thread d=new Thread(v);
d.start();
}catch(Exception z){z.toString();
public void run() {
try{
while(flag){
String g="";
g=in.readLine();
if(g==null){break;}
//System.out.println(g);
jTextArea1.append(g+"\n");
catch(Exception c){
System.out.println("soc2 closed");
try{
soc.close();
}catch(IOException f){System.out.println("soc2 not closed");}
... -
Assign unique id to client of socket server
HI
I am in the process of developing a xml socket server application and have hit on a problem. I have managed to create a server that listens for connections and once a request is recieved creates a new client on a seperate thread with the reference being stored in a vector in the server.
However I want to be able to assign an id to a client when it is created so that I can broadcast messages to specific users.my apologies my question was poorly stated..
When i meant unique i mean that they will have already been prdefined i.e for example the following users
Name David
UserId *(Unique) 0138868
Name sarah
UserId *(Unique) 4138868
Name rob
UserId *(Unique) 7138868
what i want to be able to is when the users connect they can be refeneced by their Userid so that if rob wants to say something to sarah without david knowing. The problem I have is that I do not know how to provide the userid to the server such that the server can create a new client thread with a specified id.
Hope that makes sense ;> -
MySQL System DSN: Host is not allowed to connect to this MySQL Server
Hi all,
I'm creating a FileMaker database to keep track of support and to-do items, for a large forum-site I'm managing here in Denmark.
The site runs on our webhosts servers, but I have a MacMini server we use for development. I'd like to connect the MacMini's MySQL server to FileMaker, and have purchased Actuals ODBC pack witch works great. I can connect to the MySQL server on the MacMini via Navicat, by enabling an SHH Tunnel.
When trying to create a System DSN via the Actual ODBC drivers, to connect to the MacMini, I get this error:
Link to screenshot: http://img.skitch.com/20100104-82xe6j7x9b8cjmj357t33p9sb1.png
The one very strange thing is, that the Mac I'm trying to connect from, is at 192.168.1.15 and not 10.0.0.5! The MacMini is at 10.0.0.2 so it makes no sense what so ever, and as I said, I can connect fine to 10.0.0.2 via Navicat, even though it only works when I enable SSH Tunneling.
But of course the Actual ODBC (or any for that matter?!) drivers does not support creating an SSH Tunnel, so I need to be able to connect directly to the MacMini's SQL-server, but when I try I get the above error.
Port 3306 IS open on the server, so I must be overlooking something obvious. I've tried to change the socket when setting up the System DSN to /var/mysql/mysql.sock or /var/mysql but that changes nothing.Ohh yeah, that is ignored for remote servers by the way!
Can anyone help? How do you guys setup your System DSN to a Mac-server with Snow Leopard Server on it?
Thank you so much in advance
Thomas
PS: I can connect fine to our Webhosts MySQL server with the Actual Drivers, but to decrease load on that server, I'd like to get the data for the FileMaker Support Database from our development-server instead!bump
Anyone got an idea on this? If I've posted in the wrong forum, please advise, because I was a little in doubt as to where this was to be placed -
SSRS 2012 with SharePoint 2010: Unable to connect to the remote server
We had originally installed SSRS 2012 with SP 2010 and I did not like how the installation was configured, so we uninstalled everything and removed the SSRS server from the SharePoint farm and uninstalled all the SQL bits (SSRS was deployed to web tier in
sharepoint mode).
I've since added a new application server to host the SSRS SharePoint Mode and Installed the reporting services add-in on the WFE. For reference, I have 1 WFE and 2 App Servers. the WFE has the Reporting Service Add-in and both App Servers have
the SharePoint mode of SSRS installed as described here: https://msdn.microsoft.com/en-us/library/hh479774(v=sql.110).aspx
I've also installed the Service Application and all seems to work well up until I make an attempt to create a report or data source on the WFE.
It looks like somewhere, the WFE is still looking to connect to the original SSRS machine we installed. I've gone through registry, config files and the SharePoint config database to see if I can see where the reference value is. Still can't
find it anywhere. None of the Reporting commandlets are helping.
Technically what is occurring;
Add Reporting service content types and create a New Reporting Data Source through UI
ULS Logs go after the url: /_layouts/ReportServer/NewSharedDataSource.rsds
Exception occurs after some time because it times out trying to connect to wrong host. Exception below:
Exception encountered for SOAP method GetSystemProperties: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond <WRONG HOST IP>:80
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) -
-- End of inner exception stack trace ---
at Microsoft.SqlServer.ReportingServices2010.RSConnection2010.SetConnectionProtocol()
at Microsoft.SqlServer.ReportingServices2010.RSConnection2010.SoapMethodWrapper`1.ExecuteMethod(Boolean setConnectionProtocol)
No powershell commands or any of the settings in the service application allow me to set this. Any help would be appreciated.
20 Bay Windows Home Server (Not Vail!)
http://piroozjavan.blogspot.com/Issue an iisreset on the WFE, and validate that SSRS Service is running on the App servers.
Trevor Seward
Follow or contact me at...
  
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs. -
CLI0615E Error receiving from socket, server is not responding.
We recently changed a web application using DB2 5.2 tables from ODBC to JDBC. We are using the COM.ibm.db2.jdbc.net.driver. We are using a
connection pool and running on iPlanet.
We are getting intermittant "CLI0615E Error receiving from socket, server is not responding errors". We have looked in the JDBC forum and DB2 support and cannot find a reasonable answer to this problem. It is NOT always on sql statements that take a long time to execute, so I don't think it is a timeout issue.
I read something about "stale connections". Does anyone know how to check to see if this is a problem?
When we first converted the app, we had a lot of problems also with "invalid handle or statement is closed" which we have determined was being caused by the user submitting the page again before it had time to finish the first time. We have put in javascript code to prevent multiple submits. Could this server not responding problem be caused by double submits that we have not located yet?
The error is NOT occuring on any one page, and the same page will run correctly once and the next time throw this error.
Any suggestions would be greatly appreciated.
Thanks.
[29/Apr/2003:11:00:20] info (42196): COM.ibm.db2.jdbc.net.DB2Exception: [IBM][JDBC Driver] CLI0615E Error receiving from socket, server is not responding. SQLSTATE=08S01
at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.throwReceiveError(SQLExceptionGenerator.java(Compiled Code))
at COM.ibm.db2.jdbc.net.DB2Request.receive(DB2Request.java(Compiled Code))
at COM.ibm.db2.jdbc.net.DB2Request.sendAndRecv(DB2Request.java(Compiled Code))
at COM.ibm.db2.jdbc.net.DB2RowObject.next(DB2RowObject.java(Compiled Code))
at COM.ibm.db2.jdbc.net.DB2ResultSet.next(DB2ResultSet.java(Compiled Code))
at bom.Bom.getDefs(Bom.java(Compiled Code))
at jsps.bbapps._eng._ENGJGLT0_jsp._jspService(_ENGJGLT0_jsp.java(Compiled Code))
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:897)
at com.iplanet.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:464)hi,
lemme try to tell u what i thinkk..i dont think its' a solution
Usually this error code means that there was some problem while the driver tried establishsing a socket connection to the remote server. You could very well avoid this by tracking out what is preventing the socket connection.. it may be network congestion or some other onfiguration problems with the network, or with the DB2 server...
But if the same application could work perfectly with jdbc-odbc driver in same environment,then it needs some attention.either the ibm driver isn't throwing the error as expected by the iplanet or iplanet isn't acting as needed when such an error is thrown.
contact them and they may provide and explanation..
wishes,
Jer
Maybe you are looking for
-
I have an old apple ID I no longer use can I consolidate it into my current ID?
Five years ago when I was teaching public school, I established an Apple ID for my Mac computer at school. At that time I purchased some itunes. Years later I bought my first Apple product for personal use (my iPhone) and set up a new Apple ID. Tonig
-
anyone have any ideas? The only way I can get around this is export the photo back into iPhoto and try to edit out the mess.
-
Problem in Webcenter Portal application with High Availability changes
Jdeveloper Version: 11.1.1.5 JROCKET MDS is pointing to IBM/DB2 database. Weblogic Domain 10.3 with 1 cluster - 2 manage servers. BigIP - Load Balancing Database: IBM DB2 I am facing below issues in webcenter portal application after making high avai
-
Error -20020 when using Express "Filter" VI?
The help for Error -20020 says the cutoff frequency Fc must meet 0 <= Fc <= Fs/2. Set Up Using LIFA to read an Arduino Uno analog input signal at approximately 125 samples per second. Using Express "Filter" VI to filter the data. The filter is set t
-
Dosbox ZMBV codec in Premiere Pro CS5.5?
I have captured a few vids under dosbox and I believe they were encoded as ZMBV. Despite that I've installed the codec by clicking "install codec" under doxbox menu, CS Premiere pro 5.5 can't recognize these vids and treated them as audio files. My o