|
|
|
|||||
|
Hello,
sorry but I'm a absolut Java ICE beginner. E.g. demoj\book\printer The printer example: How is it possible to add a method getDate() like the existing printString("Hello World!") method to all files. I'v added but I've got an error by compiling it with the existing ant script: Code:
compile:
[mkdir] Created dir: C:\Ice-2.1.2\demoj\book\printer\classes
[javac] Compiling 11 source files to C:\Ice-2.1.2\demoj\book\printer\classes
[javac] Compiling 14 source files to C:\Ice-2.1.2\demoj\book\printer\classes
[javac] C:\Ice-2.1.2\demoj\book\printer\Client.java:28: cannot find symbol
[javac] symbol : method getDate(java.lang.String)
[javac] location: interface Demo.PrinterPrx
[javac] printer.getDate("Test");
[javac] ^
[javac] 1 error
BUILD FAILED
C:\Ice-2.1.2\demoj\book\printer\build.xml:47: Compile failed; see the compiler error output for details.
Thank you very much !!!! surfer |
|
|||||
|
How can the client invoke the method?
Hi and thanks but how invokes the client the method?
That's my Client changes: Code:
printer.printString("Hello World!");
printer.getDate("Test");
that's my Printerl changes: Code:
public class PrinterI extends Demo._PrinterDisp {
public void
printString(String s, Ice.Current current)
{
System.out.println(s);
}
public void
getDate(String st,Ice.Current current)
{
System.out.println(st);
}
}
that's my Printer.ice changes: Code:
interface Printer
{
void printString(string s);
void getDate(string st);
};
Thanks a lot. surfer Last edited by surfer : 07-07-2005 at 10:16 AM. |
|
||||||
|
Was the slice file retranslated by slice2java? Try removing all the generated code and the .class files and re-run ant to see what is going on.
Regards, Matthew |
|
|||||
|
Hello,
I remove the folders "generated" and "classes" all the time so that I've only the sample files without these folders. But I've had an folder called old_files, where my old class and java files are. That was the problem. Thank you very much surfer |
|
|||||
|
In regards to Matthew's reply:
Try removing all the generated code and the .class files and re-run ant to see what is going on. ___ I am running into the same problem and have since removed all the generated .class files. After that, I recompiled my java code and tried to run the server/client, but I am still getting an error. What does it mean to "re-run ant"? Is that different than rebuilding the java code with "javac"? Thanks for your help. e |
|
||||||
|
Quote:
The most likely reason for a compile error after changing a Slice file is a CLASSPATH problem, specifically the compiler finds an obsolete definition of a class. If you've removed all of the generated files and compiled class files, recompiled your Slice files and double-checked your CLASSPATH, the next step would be to create a self-contained archive of your project and attach it so that we can take a look at it. Take care, - Mark |
|
||||||
|
In the Ice for Java demo directories, we place the generated files (i.e., the files created by slice2java) in the "generated" subdirectory. After you modify the Slice definitions, you must re-run slice2java and recompile the source files in the generated subdirectory.
Hope that helps, - Mark |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question about proxy's factory methods. | rc_hz | Help Center | 7 | 09-05-2006 08:58 AM |
| "NoObjectFactoryException" when call methods in interface by java | richardma | Help Center | 8 | 12-02-2005 09:46 AM |
| C# code generated for comparison methods | kwaclaw | Comments | 3 | 10-11-2005 02:54 PM |
| Local or server private methods | dashie | Help Center | 6 | 12-22-2004 03:31 AM |
| Calling methods of a client from the server | Baloo | Help Center | 2 | 09-28-2004 06:31 PM |