Error while invoking Session from Java App..

hi
I am trying to invoke the scrapingsession from a java class file...

com.screenscraper.scraper.RemoteScrapingSession scraperSession = new com.screenscraper.scraper.RemoteScrapingSession("Shopping Site");
scraperSession.setVariable("SEARCH","dvd");
scraperSession.setVariable( "PAGE", "1" );
scraperSession.scrape();

but as soon as it encouters the like "scraperSession.setVariable("SEARCH","dvd");"
I get the message ...

java.lang.NoSuchMethodError: java.lang.String: method replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
at com.screenscraper.scraper.RemoteScrapingSessionCommand.replaceCarriageReturnsAndNewLines(RemoteScrapingSessionCommand.java:164)
at com.screenscraper.scraper.RemoteScrapingSession.setVariable(RemoteScrapingSession.java:262)
at ScreenScraperClass.scraperCLient(ScreenScraperClass.java:24)
at ScreenScraperClass.main(ScreenScraperClass.java:34)
Exception in thread "main"

but if I dont have the setvariable.. I dont get any error message but the purpose is not served...

thanks
Athreya

Error while invoking Session from Java App..

Hi Athreya,

My apologies for the trouble. I'm still unable to reproduce the problem. Here are the steps I took:

1. Completely un-install screen-scraper.
2. Install version 2.6 of screen-scraper.
3. Import the "Shopping Site" scraping session. Email me if you'd like me to send you a copy. My email address is my first name at screen-scraper.com.
4. Start screen-scraper in server mode.
5. Invoke a simple Java class that runs the "Shopping Site" scraping session. The directory that contains this class also contains a copy of the screen-scraper.jar file I copied from the screen-scraper instance I installed in step 2.

The full code for my class is as follows:

import com.screenscraper.scraper.*;

public class StartTest
{
public static void main( String args[] )
{
try
{
com.screenscraper.scraper.RemoteScrapingSession scraperSession = new com.screenscraper.scraper.RemoteScrapingSession("Shopping Site");
scraperSession.setVariable("SEARCH","dvd");
scraperSession.setVariable( "PAGE", "1" );
scraperSession.scrape();

scraperSession.disconnect();
}
catch( Exception e )
{
System.err.println( e.getMessage() );
}
}

}

If you follow those steps do you still get the error? Thanks for your patience and please let me know how it goes.

Best,

Todd

Error while invoking Session from Java App..

hi todd
I tried what you mentioned but I continue to get the same error.
I downloaded the SW 3 days ago and that is the only ver of screen-scrapper I have.
Is there any other alternative you can suggest.
I am using Ver 2.6
thanks
ATHREYA

Error while invoking Session from Java App..

Hi Athreya,

This is most likely occurring because you've upgraded your instance of screen-scraper, but are referencing a slightly old screen-scraper.jar file from your Java class. Be sure that the screen-scraper.jar file you're referencing from your code is the same screen-scraper.jar file that's found in the screen-scraper installation directory.

Hopefully that does the trick. If not, please don't hesitate to post a reply.

Kind regards,

Todd Wilson