Socket Error

Hi, I get the following error when I run my app -
has anyone seen this before? Thanks in advance,

Mark
----------------------------------------------------------

ScrapeCommandServer exception: access denied (java.net.SocketPermission 127.0.0.
1:1099 connect,resolve)
java.security.AccessControlException: access denied (java.net.SocketPermission 1
27.0.0.1:1099 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:269)
at java.security.AccessController.checkPermission(AccessController.java:
401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1026)
at java.net.Socket.connect(Socket.java:446)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.(Socket.java:309)
at java.net.Socket.(Socket.java:124)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
SocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
SocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185
)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at ScrapeCommandServer.main(ScrapeCommandServer.java:81)

403 warning

Thanks, I got the issue with the port resolved. I was trying to run the RMI registry and did not set the security policy correctly.

I am getting a warning however, in the logfile:

Starting scraper.
Running scraping session: TCPL_north
Processing scripts before scraping session begins.
Scraping file: "Login"
Login: Preliminary URL: https://services.tcpl.ca/cor/ext/IRMenuIndexML.htm
Login: Resolved URL: https://services.tcpl.ca/cor/ext/IRMenuIndexML.htm
Using username: gusercwi and password: ******
Login: Sending request.
Login: Warning! Received a status code of: 403.
Scraping file: "Daily Report"
Daily Report: Preliminary URL: https://services.tcpl.ca/custrel/gms/gcrmlreportpage
Daily Report: POST data: StartDate=20080301&EndDate=20080325&stnNumber=ALL&format=markup&format=soap-csv&freq=d&stnList=50036&pageDate=2006-01-17+10%3A28%3A08.696&submitted=true
Daily Report: Resolved URL: https://services.tcpl.ca/custrel/gms/gcrmlreportpage
Daily Report: Sending request.
Daily Report: Extracting data for pattern "reportData1"
Daily Report: Saving data set "reportData1" into a session variable.
Daily Report: Saving the data set for the first time.

Socket Error

Hi,

That last stack trace is different from the one you initially gave, and, fortunately, provides a big clue. It looks like screen-scraper is refusing the connection from your app. Hopefully this FAQ will give you the resolution

http//www.screen-scraper.com/support/faq/faq.php#ServerRefusingConnections

If not, feel free to post a reply back.

Thanks,

Todd

Socket Error

I also tried to connect on another server, and got a different error:

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.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at com.screenscraper.scraper.RemoteScrapingSession.setupNetworkConnection(RemoteScrapingSession.java:86)
at com.screenscraper.scraper.RemoteScrapingSession.(RemoteScrapingSession.java:40)
at TCPLScraper.scrapeTCPLReport(TCPLScraper.java:438)
at TCPLScraper.(TCPLScraper.java:167)
at Scrape.main(Scrape.java:171)
Exception in thread "main" java.lang.NullPointerException
at TCPLScraper.scrapeTCPLReport(TCPLScraper.java:450)
at TCPLScraper.(TCPLScraper.java:167)
at Scrape.main(Scrape.java:171)

Socket Error

On line 81 is where the exception happens:

Naming.rebind(name, engine);

I think maybe the RMI has trouble binding to the proper port?

Here is the entire file:

import java.rmi.Naming;
import java.rmi.RMISecurityManager;
import java.rmi.RemoteException;

import java.rmi.server.UnicastRemoteObject;
import java.util.Date;

/**
* @author robertp
*
*/
public class ScrapeCommandServer extends UnicastRemoteObject implements ScrapeCommands
{
private Date startDate;
private Date endDate;

/**
*
*/
private static final long serialVersionUID = -7350822919272099288L;

protected ScrapeCommandServer() throws RemoteException
{
super();

}

/**
* @see ScrapeCommands#setStartDate(java.util.Date)
*/
public void setStartDate(Date start)
{
startDate = start;
}

/** \
* @see ScrapeCommands#setEndDate(java.util.Date)
*/
public void setEndDate(Date end)
{
endDate = end;

}

/**
* @return boolean indicating success (true) or failure (false)
* @throws badScrapeDate
* @throws DatabaseConnectionException
* @see ScrapeCommands#startScrape()
*/
public boolean startScrape() throws badScrapeDate, DatabaseConnectionException
{
TCPLScraper scraper = new TCPLScraper(startDate, endDate,null);
return true; // a future implementation should funnel back the error message.
}

/**
* @param args
* Command entry point for application RMI invocation.
*/
public static void main(String[] args)
{
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
String name = "ScrapeCommandServer";
try {
ScrapeCommandServer engine = new ScrapeCommandServer();
Naming.rebind(name, engine);
System.out.println("ScrapeCommandServer bound");
} catch (Exception e) {
System.err.println("ScrapeCommandServer exception: " +
e.getMessage());
e.printStackTrace();
}
}

}

Socket Error

Hi Mark,

Scott asked that I jump in on this one. Within your stack trace, I can't see that any screen-scraper methods or classes are being invoked. Could you include the snippet of Java code that's producing that exception?

Thanks,

Todd

Socket Error

I am running on Windows Server 2003, and have previously run workbench 2.6 with no issues.

access error

I am using Screen-Scraper Professional Edition, version 4.0
I have requested they open port 1099 through the Windows Firewall, I also tried to manually add the port under Windows Networking. I still get
the following port access error. Has anyone encountered this or have any ideas?

ScrapeCommandServer exception: access denied (java.net.SocketPermission 127.0.0.
1:1099 connect,resolve)
java.security.AccessControlException: access denied (java.net.SocketPermission 1
27.0.0.1:1099 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(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 sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
ource)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
ource)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at ScrapeCommandServer.main(ScrapeCommandServer.java:81)

Socket Error

markv,

To help us look into this could you tell me what operating system you're running and what version screen-scraper, as well?

Are you using a shell or batch script to start your session or does this error occur the very first time you launch screen-scraper? Have you ever successfully run the screen-scraper workbench?

Thanks,
Scott