You need to bootstrap the runtime. There are two ways of doing this:
1) run from the command line using the launcher:
java -jar launcher.jar ${your-executable-jar}
2) configure your IDE to run the launcher (with the appropriate
classpath and params)
--
Jeremy
On Oct 5, 2006, at 7:17 PM, Luciano Resende wrote:
I have created a simple schedule service (SchedulerService
interface and
SchedulerServiceImpl)...
And I was trying to build a simple java client to consume the
service like
this :
public class SchedulerServiceClient {
@Context
CompositeContext compositeContext;
/**
* @param args
*/
public static void main(String[] args) {
try {
CompositeContext context =
CurrentCompositeContext.getContext();
SchedulerService schedulerService = context.locateService(
SchedulerService.class, "SchedulerServiceComponent");
String[] courseWeekdays = { "Mon", "Wed" };
Course course = new Course(courseWeekdays, "CSCI-E-280",
new
Date(), new Date(), "Database course");
List scheduleDates = schedulerService.processCourseSchedule
(course);
Iterator scheduleIterator = scheduleDates.iterator();
while (scheduleIterator.hasNext()) {
Date d = (Date) scheduleIterator.next();
System.out.println(d.toString());
}
} catch (Exception e) {
e.printStackTrace(System.out);
}
}
}
The issue is that i keep getting NPE trying to get a reference to
context...
Any ideas on what i'm doing wrong ? Should i be using it in a
different way
?
- Luciano
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]