• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getting errors in STS for imports in client side app java code

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am trying to create an RMI service using Spring. The IDE I am using is the latest version of Spring Tool Suite.

I am following instructions as per this URL--> http://www.onlinetechvision.com/?p=510

Now, I have created the server-side code correctly, and the RMI server app context XML file is as below-->

Now, I have created the client side app also, and in it this is the code-- (I have omitted the imports/package name)--basically a single variable of integer type is passed as command line param to the client JAR file. This parm is then used as param during call to RMI Service. (It is the only param in RMI invocation).

public class TestClient {

private static Logger logger = Logger.getLogger(TestClient .class);

/** * Main method of the RMI Service Client * */ public static void main(String[] args) {

logger.debug("RMI Service Client is starting...");

//RMI Client Application Context is started... ApplicationContext context = new ClassPathXmlApplicationContext("rmiClientAppContex t.xml");

//Remote User Service is called via RMI Client Application Context... SampleTaskrmiClient = (SampleTask) context.getBean("SampleTask"); int userid; //get the user id for whom RMI is to be used...this was passed as an argument to the client JAR file... if(args.length!=1) System.exit(1); else userid= Integer.parseInt(args[0]);

rmiClient.run(userid);

logger.debug("RMI Service Client is stopped..."); } }

Also, the RMI Client App context XML file is as below--

However I am getting errors in Eclipse-- basically for the 2 imports in client side java code-- the imports for "com.test.SampleTask" and "com.test.Task" are showing this error--> The import _ _ _ _ _ cannot be resolved.

What is wrong in my code? Is there some config/setting change that I have to make?

Thanks,
Arvind.
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this the exact code you are using? There are missing reference variables etc... here.

So it's good to post the proper code with code tags so that everyone can see what could be wrong in it.
 
Ranch Hand
Posts: 296
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the neighbour thread people say that there is no place for RMI in a modern systems. Do you really need to use RMI?
 
surlac surlacovich
Ranch Hand
Posts: 296
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Arvind Ik Chari, do you have any success in fixing the errors?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic