DPR-ERR-2008

本文详细介绍了如何解决全新安装的Cognos在登录管理页面时遇到的问题,包括配置IIS7.0以适配Cognos需求,具体步骤涉及创建虚拟目录、启用网关并设置相关模块和属性等,最终成功解决DashboardException异常。
全新安装的Cognos 在登录管理页面时候登录
My Home

Administer Cognos content

遇到不能进入页面 并且出错
DPR-ERR-2008 error The request is directed to an unknown service name: .
却没告诉服务名

Administer Cognos content页面抛出DashboardException异常

查询了相关网站找到以下

个人感觉最主要的解决步骤是最后的
C:\Windows\System32\inetsrv\config\applicationhost.config
内容里头
<add name="CGI-cognos" path="*.cgi" verb="*" modules="CgiModule" resourceType="Unspecified" />
添加 allowPathInfo="true" 变成
<add name="CGI-cognos" path="*.cgi" verb="*" modules="CgiModule" resourceType="Unspecified" allowPathInfo="true" />


按照以下全部重新配置了一遍就好了~顺利解决问题

Enclosed a short Documentation on how to Configure IIS 7.0 for Cognos:
In IIS Manager, create the Cognos 8 virtual directories, enable the gateway under ISAPI and CGI Restrictions, and add a Handler Mapping for the gateway. Edit the IIS configuration file and add the attribute allowPathInfo="true".
Steps:
1. In the left Connections pane, expand the server node, expand Sites, right-click on Default Website, and click Add Virtual Directory.
2. Enter "cognos8" for the Alias and enter the path to the c8/webcontent directory in Physical Path (default C:\Program Files\cognos\c8\webcontent). Click OK.
3. Right click on the newly-created cognos8 Virtual Directory and click Add Virtual Directory
4. Enter "cgi-bin" for the Alias and enter the path to the c8/cgi-bin directory in Physical Path (default C:\Program Files\cognos\c8\cgi-bin). Click OK.
5. Right click on the cognos8 Virtual Directory again and click Add Virtual Directory
6. Enter "help" for the Alias and enter the path to the c8/webcontent/documentation directory in Physical Path (default C:\Program Files\cognos\c8\webcontent\documentation). Click OK.
7. In the left Connections pane, select the server node, then double-click ISAPI and CGI Restrictions in the right pane.
8. In the Actions pane click Add, enter the path to either cognosisapi.dll or cognos.cgi depending on which you will use (default C:\Program Files\cognos\c8\cgi-bin\cognosisapi.dll or C:\Program Files\cognos\c8\cgi-bin\cogno.cgi), check the "Allow extension path to execute" box, then click OK.
9. In the left Connections pane, select the cgi-bin virtual directory, then double-click Handler Mappings in the right pane.
10. In the Actions pane click Add Module Mapping, then enter either "cognos.cgi" or "cognosisapi.dll" for the Request Path, choose either CGIModule or ISAPIModule for the Module, give it an identifiable name like "CGI-cognos" then click OK.
11. In order for Cognos Administration to function properly, the directive added to the IIS configuration file by step 11 has to be edited manually. Depending on how IIS is set up, this will have been written either to C:\Windows\System32\inetsrv\config\applicationhost.config or to <cognos_home>/c8/cgi-bin/web.config. Check those files for the following entry:
<add name="CGI-cognos" path="*.cgi" verb="*" modules="CgiModule" resourceType="Unspecified" />
and add allowPathInfo="true" to it like this:
<add name="CGI-cognos" path="*.cgi" verb="*" modules="CgiModule" resourceType="Unspecified" allowPathInfo="true" /


这篇解决方法引用了http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos8-l/unable-to-access-admin-tools-in-cognos-83-bi-1919409
不对,为什么保存的图片是空白的:downloadFile(url) { return new Promise((resolve, reject) => { if (url.startsWith('wxfile://')) { resolve(url) } else { uni.downloadFile({ url, success: (res) => { if (res.statusCode === 200) resolve(res.tempFilePath) else reject(new Error(`下载失败: ${res.statusCode}`)) }, fail: (err) => { reject(new Error(`网络错误: ${JSON.stringify(err)}`)) } }) } }) }, getImageInfo(src) { return new Promise((resolve, reject) => { uni.getImageInfo({ src, success: resolve, fail: reject }) }) }, getRect(selector) { return new Promise((resolve, reject) => { this.$nextTick(() => { uni .createSelectorQuery() .in(this) .select(selector) .boundingClientRect((rect) => { if (rect) resolve(rect) else reject(new Error(`无法获取 ${selector} 的布局信息`)) }) .exec() }) }) }, canvasToTempFilePath(canvas, opts) { return new Promise((resolve, reject) => { uni.canvasToTempFilePath( { ...opts, canvas, success: (res) => resolve(res.tempFilePath), fail: (err) => reject(err) }, this ) }) }, async saveAndPreview() { if (!this.fileImage) { return uni.showToast({ title: '请先上传图片', icon: 'none' }) } showLoading('正在生成') try { // Step 1: 下载用户图片到本地 const imgLocalPath = await this.downloadFile(this.fileImage) const modalLocalPath = await this.downloadFile(this.modalArr[this.currentIndex].imgUrl) // Step 2: 获取原图信息 const imageInfo = await this.getImageInfo(imgLocalPath) const { width: imgW, height: imgH } = imageInfo // Step 3: 获取容器尺寸(.upload-view) const rect = await this.getRect('.upload-view') const viewW = rect.width const viewH = rect.height // Step 4: 设置 canvas 大小(放大2倍以提高清晰度) const dpr = uni.getSystemInfoSync().pixelRatio || 2 const canvasW = viewW * dpr const canvasH = viewH * dpr // Step 5: 创建 2D Canvas 并获取 context const query = uni.createSelectorQuery().in(this) const res = await new Promise((resolve, reject) => { query .select('#previewCanvas') .node((result) => { resolve(result) }) .exec() }) const canvas = res.node const ctx = canvas.getContext('2d') // 设置 canvas 实际绘制分辨率 canvas.width = canvasW canvas.height = canvasH // 清屏并填充白色背景 ctx.clearRect(0, 0, canvasW, canvasH) ctx.fillStyle = '#ffffff' ctx.fillRect(0, 0, canvasW, canvasH) // 计算图片显示尺寸(保持比例) const imgAspect = imgW / imgH const viewAspect = viewW / viewH let displayWidth, displayHeight if (imgAspect > viewAspect) { displayWidth = viewW displayHeight = viewW / imgAspect } else { displayHeight = viewH displayWidth = viewH * imgAspect } // 缩放到 canvas 分辨率 displayWidth *= dpr displayHeight *= dpr // 中心点 + 偏移(也乘以 dpr) const centerX = canvasW / 2 + this.imageTransform.translateX * dpr const centerY = canvasH / 2 + this.imageTransform.translateY * dpr // 开始绘制变换:平移 -> 旋转 -> 缩放(含镜像) ctx.save() ctx.translate(centerX, centerY) ctx.rotate((this.imageTransform.rotate * Math.PI) / 180) // 注意:scale 控制缩放与翻转(负值表示镜像) ctx.scale( this.imageTransform.scale * this.imageTransform.flipHorizontal * dpr, this.imageTransform.scale * this.imageTransform.flipVertical * dpr ) // 绘制用户图片(以中心为基准) const img = canvas.createImage() img.src = imgLocalPath ctx.drawImage( img, -displayWidth / 2 / dpr / this.imageTransform.scale, // 调整坐标适应 scale -displayHeight / 2 / dpr / this.imageTransform.scale, displayWidth / dpr / this.imageTransform.scale, displayHeight / dpr / this.imageTransform.scale ) ctx.restore() // 绘制模板层(覆盖整个 canvas) const modalImg = canvas.createImage() modalImg.src = modalLocalPath ctx.drawImage(modalImg, 0, 0, canvasW, canvasH) // Step 6: 导出为临时文件路径 setTimeout(async () => { try { // 将 canvas 内容转为临时文件路径 const tempFilePath = await this.canvasToTempFilePath(canvas, { x: 0, y: 0, width: canvasW, height: canvasH, destWidth: canvasW, destHeight: canvasH, fileType: 'png', quality: 1 }) // 调用你的上传逻辑 this.getPhotoUpload({ width: canvasW, height: canvasH, src: tempFilePath }) uni.hideLoading() } catch (err) { console.error('导出失败:', err) uni.hideLoading() uni.showToast({ title: '保存失败,请查看控制台', icon: 'none' }) } }, 500) console.log('🔍 当前图片变换参数:', { ...this.imageTransform }) } catch (err) { uni.hideLoading() console.error('【详细错误】', { message: err.message, stack: err.stack, name: err.name, toString: err.toString() }) uni.showToast({ title: '处理失败', icon: 'none' }) } } 修复这个代码
最新发布
09-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值