Using JFS SDK and Web UI together
Hi,
I ran into some problem setting up my project to use the JFS SDK and Web UI together. I am currently running a program very similar to the Task List example with some refactoring, but the core services are the same.
I first add the JFS SDK features package to the target platform environment. Compile the program. It runs perfectly fine.
Then I add the Web UI SDK to the target platform and there is a compile error in the ServiceBase.java class. The error occurs with the HttpClientService with 2 error messages:
1. Discouraged access to the .jar file (com.ibm.team.http.client.impl_0.6.0.I200905140448.jar)
2. "The type com.ibm.team.http.cache.HttpCacheService cannot be resolved. It is indirectly referenced from the required class files."
Here is the code snippet with the error:
The error is at this line
So I figured that this may be due to the fact that both JFS SDK and Web UI SDK have some plugins and features that are identical. So in the target platform definition, I manually unchecked the features in the Web UI package that are already checked in the JFS SDK package (I gave higher priority to the JFS SDK because that's where the main development is). So basically, the boxes that checked from Web UI SDK are:
1. net.jazz.*
2. org.dojotoolkit.*
3. com.ibm.sistdase.json
4. org.mozilla.rhino
Once I have done that, the error went away and the program compiled. However, I got a different error during runtime. When I access the program through the web browser, I get the error:
When I remove the Web UI SDK and rebuild the workspace, the error 500 went away and had no problem running the program again.
Am I doing something wrong here? Please help.
JFS SDK Version: I20090516-0007
Web UI SDK Version: I20090604-1731
Thank you in advance,
Pongtip
I ran into some problem setting up my project to use the JFS SDK and Web UI together. I am currently running a program very similar to the Task List example with some refactoring, but the core services are the same.
I first add the JFS SDK features package to the target platform environment. Compile the program. It runs perfectly fine.
Then I add the Web UI SDK to the target platform and there is a compile error in the ServiceBase.java class. The error occurs with the HttpClientService with 2 error messages:
1. Discouraged access to the .jar file (com.ibm.team.http.client.impl_0.6.0.I200905140448.jar)
2. "The type com.ibm.team.http.cache.HttpCacheService cannot be resolved. It is indirectly referenced from the required class files."
Here is the code snippet with the error:
private static IHttpClientService createHttpClientService() {
ICache cache = new CommonCache();
IHttpCacheService httpCacheService = new HttpCache(cache);
IHttpClientService httpClientService = new HttpClientService(httpCacheService);
return httpClientService;
}
The error is at this line
IHttpClientService httpClientService = new HttpClientService(httpCacheService);
So I figured that this may be due to the fact that both JFS SDK and Web UI SDK have some plugins and features that are identical. So in the target platform definition, I manually unchecked the features in the Web UI package that are already checked in the JFS SDK package (I gave higher priority to the JFS SDK because that's where the main development is). So basically, the boxes that checked from Web UI SDK are:
1. net.jazz.*
2. org.dojotoolkit.*
3. com.ibm.sistdase.json
4. org.mozilla.rhino
Once I have done that, the error went away and the program compiled. However, I got a different error during runtime. When I access the program through the web browser, I get the error:
HTTP ERROR: 500
com.ibm.team.http.client.impl.HttpClientService.<init>(Lcom/ibm/team/jfs/app/http/cache/IHttpCacheService;)V
RequestURI=/jfsSamples/questions
When I remove the Web UI SDK and rebuild the workspace, the error 500 went away and had no problem running the program again.
Am I doing something wrong here? Please help.
JFS SDK Version: I20090516-0007
Web UI SDK Version: I20090604-1731
Thank you in advance,
Pongtip
3 answers
This might be a bug in Eclipse 3.4. I see the similar issue in 3.4 but not on 3.5. If you have chance, please check with Eclipse 3.5.
The fundamental problem is version mismatch between Server SDK and Web UI SDK. We are now working on it. https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/84915
The fundamental problem is version mismatch between Server SDK and Web UI SDK. We are now working on it. https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/84915
Still got the same problem with eclipse 3.5.
I have also tried manually removing (deleting) the overlapping plugins from the package itself. I manually deleted any plugin jar files in the Web UI SDK package that overlaps with the JFS SDK and edited the feature.xml accordingly.
When I open up eclipse 3.4 or 3.5, the error went away. However, the app would not run. The program compiled fine and all the javascript and web ui components loaded fine. But when I open the web through the web browser, the page would not load and I get this error from the console in eclipse.
I have also tried manually removing (deleting) the overlapping plugins from the package itself. I manually deleted any plugin jar files in the Web UI SDK package that overlaps with the JFS SDK and edited the feature.xml accordingly.
When I open up eclipse 3.4 or 3.5, the error went away. However, the app would not run. The program compiled fine and all the javascript and web ui components loaded fine. But when I open the web through the web browser, the page would not load and I get this error from the console in eclipse.
ERROR t.jazz.ajax.service.internal.util.RootServicesUtil - 403 response when fetching root services document
Actually the manual removal of the plugin features worked as it compiled and loaded all the components. However, I had to reconfigure the plugin.xml and define the page as an "ajax-module" instead of "application".
Initially, in the plugin.xml, I defined the main "application" as
where I have a mainapp.js with the following code:
I basically took this entire code snippet from the Jazz Ajax Framework example (I downloaded JazzAjaxFramework-Source-M20090225-1543.zip).
It seems that defining the "application" in plugin.xml didn't work. So, I redefined the page as:
The web ui runs fine now, with some problem registering the actions. It might be a problem with the path issues.
Initially, in the plugin.xml, I defined the main "application" as
<extension id="application" point="net.jazz.ajax.applications">
<application alias="/web/mainapp"
jsclass="com.ibm.prep.ui.mainapp"/>
</extension>
where I have a mainapp.js with the following code:
(function() {
dojo.provide("com.ibm.prep.ui.mainapp");
dojo.require("net.jazz.ajax.ui._Application");
dojo.require("net.jazz.ajax.ui.PageContainer");
dojo.require("net.jazz.ajax.ui.PageList");
dojo.require("net.jazz.ajax.ui.PlatformUI");
dojo.require("net.jazz.ajax.ui.ProgressIndicator");
function workbenchRootNode(){
return net.jazz.ajax.ui.PlatformUI.getWorkbench().rootNode();
}
dojo.declare("com.ibm.prep.ui.mainapp", net.jazz.ajax.ui._Application, {
init: function() {
// create the top-level UI elements for the example application
this._createUI();
// set application name
this.setName("MCIF Selfcheck Application");
// tell the framework to begin processing events (mandatory)
this.start();
},
_createUI: function() {
var header = document.createElement("div");
workbenchRootNode().appendChild(header);
var pageList = new net.jazz.ajax.ui.PageList();
header.appendChild(pageList.domNode);
var pageArea = new net.jazz.ajax.ui.PageContainer();
workbenchRootNode().appendChild(pageArea.domNode);
var progressIndicator = new net.jazz.ajax.ui.ProgressIndicator();
pageArea.domNode.appendChild(progressIndicator.domNode);
progressIndicator.domNode.className =
"net-jazz-ajax-examples-ProgressIndicator";
}
});
})();
I basically took this entire code snippet from the Jazz Ajax Framework example (I downloaded JazzAjaxFramework-Source-M20090225-1543.zip).
It seems that defining the "application" in plugin.xml didn't work. So, I redefined the page as:
<extension point="net.jazz.ajax.ajaxModules">
<ajaxModule id="main"
widgetClass="com.ibm.prep.web.ui.internal.page.main"
internalPathInfo="/">
</ajaxModule>
</extension>
The web ui runs fine now, with some problem registering the actions. It might be a problem with the path issues.