Hi,

i try to install one more PPC device to my GMS. And the Browser shows me
after the login to http://sync.company.com/install following code. Any
ideas ?

i tried to install GroupWise Monitor on the GMS-Machine but it dosn't
work, so i have uninstalled the GWMonitor. But now i get this "Error".
JavaVM damaged ?

---------------------------------------------------------------
<%@ page language="java" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.net.*" %>
<%@ page import="manager.*" %>
<%@ page import="util.*" %>
<%@ page import="pkgapi.*" %>
<%@ page import="impersist.*" %>
<%@ page session="false" %>
<%@ page errorPage="PkgBuilderError.jsp" %>
<%@ include file="PkgCommon.jsi" %>


<%!

/////////////////////////////////////////////////////////////////
////////
// This is the main OTA software delivery page
//
// You can browse here directly using the web browser on the
device, or
// a link to this page might be sent to your device via SMS

/////////////////////////////////////////////////////////////////
////////

private void HandleRequest(PkgBuilderContext pbContext) throws
Exception
{
pbContext.GetJspResponse().setContentType("text/html;
charset=UTF-8");

JspWriter out = pbContext.GetJspOut();

IPkgManager pkgManager = pbContext.GetPkgManager();

IPkgFinder pkgFinder = pkgManager.CreatePkgFinder();

pkgFinder.setAppName(pbContext.GetAppName());
pkgFinder.setUserName(pbContext.GetUserName());
pkgFinder.setUserLanguage(pbContext.GetUserLanguag e());

boolean bAutoDetected = AutoDetectDeviceInfo(pbContext,
pkgFinder);

IMPersistSessionPool pool = null;
IMPersistSession persistSession = null;
IPkgInfoCollection candidatePkgs = null;
IPkgInfo pkgInfo = null;

try
{
pool = Manager.getIMPersistSessionPool();
persistSession = pool.get();
candidatePkgs =
pkgManager.ResolvePkgInfoFromNamedConfigurationsEx (pkgFinder,
persistSession);
}
finally
{
if (persistSession != null)
pool.returnToPool(persistSession);
}

out.println("<html><title>");
String title = pbContext.LoadString(162);
out.println(title);
out.println("</title><body>");

if (!bAutoDetected)
{
out.println("<p>");
String warning = pbContext.LoadString(196);
out.print(warning);
out.print("</p>");
}

int numCandidates = candidatePkgs.GetCount();

if (numCandidates > 0)
{
out.println("<p>");

String prompt;

if (numCandidates == 1)
{
prompt = pbContext.LoadString(219);
}
else
{
prompt = pbContext.LoadString(163);
}

out.print(prompt);

// create the help link

String allPlatformIds = new String("");

for (int i = 0; i < numCandidates; ++i)
{
pkgInfo = candidatePkgs.GetPkgInfo(i);
String platformId =
pkgInfo.getPlatformId();
if (i != 0)
allPlatformIds += ",";
allPlatformIds += platformId;
}

String helpArgs = "platformid=" +
allPlatformIds;
String helpUrl =
pbContext.MakePkgBuilderRelativeUrl("PkgBuilderHel p.jsp", helpArgs);
out.print("&nbsp;<a href=\"" + helpUrl
+ "\">");
String moreInfo = pbContext.LoadString(192);
out.print(moreInfo);
out.print("</a></p>");

int platformType;
String platformId;
String link;
String downloadPage;
String args;
String url;

if (numCandidates == 1)
{
pkgInfo = candidatePkgs.GetPkgInfo(0);

platformType = pkgInfo.getPlatformType
();

platformId = pkgInfo.getPlatformId();

link = pbContext.LoadString(220) +
pkgInfo.getAppDisplayName();

downloadPage = MakeDownloadPage
(platformType);
args = "platformid=" + platformId;

url =
pbContext.MakePkgBuilderRelativeUrl(downloadPage, args);

out.print("<p>•&nbsp;<a
href=\"" + url + "\"><b>" + link + "</b></a></p>");

if (platformType ==
PkgPlatformTypes.PKG_PLATFORM_PALM)
{
out.print
("<p><i>&nbsp;&nbsp;&nbsp;&nbsp;");
out.print
(pbContext.LoadString(221));
out.print("</i></p>");
}
}
else
{
// print out the list of choices

for (int i = 0; i < numCandidates;
++i)
{
pkgInfo =
candidatePkgs.GetPkgInfo(i);

platformType =
pkgInfo.getPlatformType();

platformId =
pkgInfo.getPlatformId();
link =
pkgInfo.getAppDisplayName();

downloadPage =
MakeDownloadPage(platformType);
args = "platformid=" +
platformId;

url =
pbContext.MakePkgBuilderRelativeUrl(downloadPage, args);

// can't install PC software
OTA at the moment (maybe one day...)

if (platformType !=
PkgPlatformTypes.PKG_PLATFORM_PC)
{
out.print
("<p>•&nbsp;<a href=\"" + url + "\"><b>" + link + "</b></a></p>");
}
else
{
out.print("");
}
}
}
}
else
{
pbContext.GetPkgManager().Log("PkgBuilder.jsp:
no matching platform ids!!!");
}

out.println("</body>");
out.println("</html>");
}

/////////////////////////////////////////////////////////////////
////////

private boolean AutoDetectDeviceInfo(PkgBuilderContext
pbContext, IPkgFinder pkgFinder)
{
HttpServletRequest request = pbContext.GetJspRequest();
IPkgManager pkgManager = pbContext.GetPkgManager();

int platformType = PkgPlatformTypes.PKG_PLATFORM_ANY;
int cpuType = PkgCPUTypes.PKG_CPU_ANY;
int signedBy = PkgSignedByTypes.PKG_SIGNEDBY_ANY;
String osVersion = "";

// debugging override

String dbgDeviceTypeStr = pbContext.GetArgStr
("dbgdevicetype");
if (dbgDeviceTypeStr != null)
{
String deviceTypeStr =
dbgDeviceTypeStr.toLowerCase();

if (deviceTypeStr.indexOf("palm") != -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_PALM;
}
else if (deviceTypeStr.indexOf("symbian60") !
= -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SYMBIAN;
osVersion = "Symbian60";
}
else if (deviceTypeStr.indexOf("symbian80") !
= -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SYMBIAN;
osVersion = "Symbian80";
}
else if (deviceTypeStr.indexOf("symbianuiq") !
= -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SYMBIAN;
osVersion = "SymbianUIQ";
}
else if (deviceTypeStr.indexOf("symbian") != -
1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SYMBIAN;
}
else if (deviceTypeStr.indexOf
("pocketpc2002") != -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_POCKETPC;
osVersion = "CE3X";
}
else if (deviceTypeStr.indexOf
("pocketpc2003") != -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_POCKETPC;
osVersion = "CE4X";
}
else if (deviceTypeStr.indexOf
("smartphone2002") != -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SMARTPHONE;
osVersion = "CE3X";
}
else if (deviceTypeStr.indexOf
("smartphone2003") != -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SMARTPHONE;
osVersion = "CE4X";
}
else if (deviceTypeStr.indexOf("pocketpc") != -
1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_POCKETPC;
}
else if (deviceTypeStr.indexOf("smartphone") !
= -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SMARTPHONE;
}
else if (deviceTypeStr.indexOf("standardsdk") !
= -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_CESTANDARDSDK;
}
else if (deviceTypeStr.indexOf("rim37") != -1)
{
platformType = PkgPlatformTypes.PKG_PLATFORM_RIM;
osVersion = "RIM37";
}
else if (deviceTypeStr.indexOf("rim402") != -1)
{
platformType = PkgPlatformTypes.PKG_PLATFORM_RIM;
osVersion = "RIM402";
}
else if (deviceTypeStr.indexOf("rim40") != -1)
{
platformType = PkgPlatformTypes.PKG_PLATFORM_RIM;
osVersion = "RIM40";
}
else if (deviceTypeStr.indexOf("rim") != -1)
{
platformType = PkgPlatformTypes.PKG_PLATFORM_RIM;
}
else if (deviceTypeStr.indexOf("pc") != -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_PC;
}

if (platformType !=
PkgPlatformTypes.PKG_PLATFORM_ANY)
{
pkgFinder.setPlatformType
(platformType);
pkgFinder.setOSVersionStr(osVersion);
return true;
}

return false;
}

// look at http-user-agent and ua-os headers

String uaHdr = request.getHeader("user-agent");
if (uaHdr == null)
{
pkgManager.Log("No user agent header!");
return false;
}

String userAgent = uaHdr.toLowerCase();

String uaosHdr = request.getHeader("ua-os");
String userOS = "";

if (uaosHdr != null)
userOS = uaosHdr.toLowerCase();

if (userAgent.indexOf("windows nt") != -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_ANY;
}
else if ((userAgent.indexOf("palmos") != -1) ||
(userAgent.indexOf("palmsource") != -
1) ||
(userAgent.indexOf("palmone") != -1)
||
(userAgent.indexOf("blazer") != -1))
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_PALM;
}
else if (userAgent.indexOf("windows ce") != -1)
{
if ((userOS.indexOf("pocket pc") != -1) ||
(userOS.indexOf("pocketpc") != -1))
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_POCKETPC;

if ((userOS.indexOf("version 4") != -
1) ||
(userOS.indexOf("version
5") != -1))
{
osVersion = "CE4X";
}
else if (userOS.indexOf("version 3") !
= -1)
{
osVersion = "CE3X";
}
}
else if (userOS.indexOf("smartphone") != -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SMARTPHONE;

if ((userOS.indexOf("version 4") != -
1) ||
(userOS.indexOf("version
5") != -1))
{
osVersion = "CE4X";
}
else if (userOS.indexOf("version 3") !
= -1)
{
osVersion = "CE3X";
}
}
}
else if (userAgent.indexOf("series60") != -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SYMBIAN;
osVersion = "Symbian60";
}
else if (userAgent.indexOf("series80") != -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SYMBIAN;
osVersion = "Symbian80";
}
else if ((userAgent.indexOf("p800") != -1) ||
(userAgent.indexOf("p900") != -1) ||
(userAgent.indexOf("p910") != -1) ||
(userAgent.indexOf("a920") != -1) ||
(userAgent.indexOf("a925") != -1) ||
(userAgent.indexOf("a1000") != -1) ||
(userAgent.indexOf("a1010") != -1) ||
(userAgent.indexOf("m1000") != -1) ||
(userAgent.indexOf("benq p30") != -1) ||
(userAgent.indexOf("benq p31") != -1) ||
(userAgent.indexOf("arima u300") != -1) ||
(userAgent.indexOf("arima asp805") != -1))
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SYMBIAN;
osVersion = "SymbianUIQ";
}
else if (userAgent.indexOf("symbian") != -1)
{
platformType =
PkgPlatformTypes.PKG_PLATFORM_SYMBIAN;

pkgManager.Log("Unrecognized Symbian request headers:
userAgent = " + userAgent + ", userOS = " + userOS);

}
else if (userAgent.indexOf("blackberry") != -1)
{
platformType = PkgPlatformTypes.PKG_PLATFORM_RIM;

if (userAgent.indexOf("/3.7") != -1)
{
osVersion = "RIM37";
}
else if (userAgent.indexOf("/4.0.2") != -1)
{
osVersion = "RIM402";
}
else if (userAgent.indexOf("/4.0") != -1)
{
osVersion = "RIM40";
}
else
{
pkgManager.Log("Unrecognized BlackBerry request headers:
userAgent = " + userAgent + ", userOS = " + userOS);
}
}

pkgFinder.setPlatformType(platformType);
pkgFinder.setPlatformId("");
pkgFinder.setCPUType(cpuType);
pkgFinder.setOSVersionStr(osVersion);
pkgFinder.setOSPlatform("");
pkgFinder.setSignedBy(signedBy);

if (platformType == PkgPlatformTypes.PKG_PLATFORM_ANY)
{
pkgManager.Log("Unrecognized device request
headers: userAgent = " + userAgent + ", userOS = " + userOS);
return false;
}

return true;
}

/////////////////////////////////////////////////////////////////
////////

private String MakeDownloadPage(int platformType)
{
StringBuffer pageName = new StringBuffer(100);

pageName.append("PkgDownload");

if (platformType == PkgPlatformTypes.PKG_PLATFORM_PALM)
{
pageName.append(".prc");
}
else if (platformType ==
PkgPlatformTypes.PKG_PLATFORM_POCKETPC ||
platformType == PkgPlatformTypes.PKG_PLATFORM_SMARTPHONE ||
platformType == PkgPlatformTypes.PKG_PLATFORM_CESTANDARDSDK)
{
pageName.append(".cab");
}
else if(platformType ==
PkgPlatformTypes.PKG_PLATFORM_SYMBIAN)
{
pageName.append(".sis");
}
else if (platformType == PkgPlatformTypes.PKG_PLATFORM_RIM)
{
pageName.append(".jad");
}
else
{
pageName.append(".jsp");
}

return pageName.toString();
}

/////////////////////////////////////////////////////////////////
////////

%>
---------------------------------------------------------------