Page 1 of 1
1.5 Pro Win Install - no smartfoxserver.jar
Posted: 10 Feb 2007, 01:02
by truantduck
It seems that SFSPRO_1_5_windows.exe installer does not install the smartfoxserver.jar file.
Posted: 10 Feb 2007, 07:11
by Lapo
yes, that's correct.
The library layout changed a little in the latest version.
If you need to compile java classes, point your classpath (or java editor classpath) to the lib/jysfs.jar file.
Posted: 11 Feb 2007, 21:19
by rcox
Lapo wrote:yes, that's correct.
The library layout changed a little in the latest version.
If you need to compile java classes, point your classpath (or java editor classpath) to the lib/jysfs.jar file.
Given that this change could break older setups, is there a reason that it was omitted from releaseNotes.txt and other documentation on changes from 1.4? Nor is the new jar file mentioned in any example for the server-side Java API.
Furthermore, if smartfoxserver.jar is no longer used, why does the Windows installer for 1.5 not remove smartfoxserver.jar from the previous installation? It is detrimental to users of the newer version if a deprecated jar file is silently left in place.
Posted: 12 Feb 2007, 11:26
by Lapo
Given that this change could break older setups, is there a reason that it was omitted from releaseNotes.txt and other documentation on changes from 1.4? Nor is the new jar file mentioned in any example for the server-side Java API.
Sorry for the inconvenience, it should have been reported in the release notes.
Furthermore, if smartfoxserver.jar is no longer used, why does the Windows installer for 1.5 not remove smartfoxserver.jar from the previous installation? It is detrimental to users of the newer version if a deprecated jar file is silently left in place.
The 1.5.0 installer does not touch any of the older files. It installs in its own folder so that you can still use any other previous versions.
Posted: 14 Feb 2007, 00:22
by truantduck
I can no longer compile using this new .jar.
I get this error when using
sendResponse():
Code: Select all
cannot access org.json.JSONObject
file org\json\JSONObject.class not found
sendResponse(mesg, -1, null, sfRecipients);
All my java extensions compile and run without errors using the old smartfoxserver.jar.
Are there any potential problems reverting back?
Thanks.
Posted: 14 Feb 2007, 07:29
by vylcho
When compile add in your class path also and json.jar ( from lib directory)
example:
.../javac -classpath "../lib/json.jar;../lib/jysfs.jar" Example.java
Posted: 14 Feb 2007, 08:35
by Lapo
exactly! it just seem that you don't have the json package added to your classpath
Posted: 14 Feb 2007, 20:09
by rcox
Lapo wrote:exactly! it just seem that you don't have the json package added to your classpath
I get the same problem. I am not
using the json package in any of our code, thus we should
not have to include it in our classpath. The problem is caused by the fact that classes in jysfs.jar link to the json package without including the necessary class files in jysfs.jar.
This is a bug. The SF classes in jysfs.jar should either not link to json, or should include the class file linked to.
Posted: 14 Feb 2007, 21:57
by Lapo
This is a bug. The SF classes in jysfs.jar should either not link to json, or should include the class file linked to.
It's a dependency issue, not a bug

(A bug is a programming error that prevents the software from working as expected.)
We'll provide better documentation about library dependencies but it's not a good idea to include them inside our packages. (Libraries are created to be standalone units of code, encapsulating them inside other libraries would break this concept)
Posted: 15 Feb 2007, 18:48
by rcox
Lapo wrote:(Libraries are created to be standalone units of code, encapsulating them inside other libraries would break this concept)
So does linking to them in jysfs.jar without adding it to the class-path of jysfs.jar. It breaks our ability to compile without tracking down SF dependencies that our code doesn't use. The point of an API is to hide the internals, not force us to hunt them down.
Any of these are adequate solutions:
1) Including a copy of the particular class file inside jysfs.jar
2) Writing a wrapper class for the json class so that the json package stays internal use only
3) Adding the json jar file to the class-path in the manifest of jysfs.jar
The 3rd solution is obviously the cleanest and most recommended by java experts. That way you don't force developers to make links to SF's dependencies which they themselves are not using. And yes that IS a bug, because breaking existing code solutions without documentation is always considered a bug, and the packaging/manifest are part of the programmer's responsibility.
In any of these cases, the json object documentation should be included along with SF documentation if you expect people to use it. An undocumented API is the same as a broken API.
Posted: 16 Feb 2007, 11:01
by vylcho
Posted: 16 Feb 2007, 11:18
by Lapo
ok, no prob. It's funny

dunno, if it's also meant to be sarcastic. In such case please post your comments, it's definitely much more helpful for us

Posted: 18 Feb 2007, 17:25
by Lapo
We have added a new article to the online docs about Java extension development -->
http://forums.smartfoxserver.com/viewtopic.php?t=1187
hope it helps