Compiling from the command line.
Windows XP, JDK1.5.0:
C:\projects\jive\jive_messenger_src\build>ant
Buildfile: build.xml
init:
Expanding: C:\projects\jive\jive_messenger_src\build\lib\merge\whack
.jar into C:\projects\jive\jive_messenger_src\target\whack
compile:
Compiling 273 source files to C:\projects\jive\jive_messenger_src\ta
rget\classes
C:\projects\jive\jive_messenger_src\src\java\org\jivesoftware\database\JNDIData SourceProvider.java:113: cannot find symbol
symbol : constructor InitialContext(java.util.Properties)
location: class javax.naming.InitialContext
context = new InitialContext(contextProperties);
^
Note: * uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
BUILD FAILED
C:\projects\jive\jive_messenger_src\build\build.xml:238: Compile failed; see the
compiler error output for details.
Total time: 5 seconds
C:\projects\jive\jive_messenger_src\build>which javac
/cygdrive/c/Program Files/Java/jdk1.5.0/bin/javac
As I said, the InitialContext constructor barfs because it’'s getting passed a
Properties rather than a Hashtable–apparently because the InitialContext Hashtable argument is parameterized to be a <String, ?> and a Properties object constructor can take an (Object, Object) argument:
InitialContext(Hashtable<String,?> environment)
Constructs an initial context using the supplied environment.
While Properties is a subclass of Hashtable, this particular constructor has a narrower view of what can be in Hashtables.
I fixed this by simply changing the declaration of the object being passed
in to a Hashtable and changing the method for adding to the contents
of the container.