首页 \ 问答 \ 尝试在worklight 6.1中调试适配器Java代码(Trying to debug adapter Java Code in worklight 6.1)

尝试在worklight 6.1中调试适配器Java代码(Trying to debug adapter Java Code in worklight 6.1)

我正在尝试调试worklight 6.1适配器代码(java)。 我认为最合乎逻辑的方法是在调试模式下重启嵌入式自由服务器。 这失败了一条消息:

ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
Error occurred during initialization of VM
agent library failed to init: jdwp

在Workging Server记录和调试Java时遵循了6.0中记录的过程,但我在那里遇到了同样的问题。


I'm trying to debug worklight 6.1 adapter code (java). I figured the most logical way would be to restart the imbedded liberty server in debug mode. That fails with a message:

ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
Error occurred during initialization of VM
agent library failed to init: jdwp

I followed the process documented for 6.0 at Logging and debugging Java on Worklight Server but I get the same issue there.


原文:https://stackoverflow.com/questions/21191965
更新时间:2022-05-26 13:05

最满意答案

好的,我已经找到了解决方案。 基本上,createPattern()可以将image或canvas元素作为其第一个参数。 所以你需要做以下事情:

var pattern_canvas = document.createElement('canvas');

pattern_canvas.width = texture_width;
pattern_canvas.height = texture_height;

var pattern_context = pattern_canvas.getContext('2d');

pattern_context.drawImage(img , texture_sx , texture_sy , texture_width , texture_height);

var final_pattern = canvas_context.createPattern(pattern_canvas , "repeat");

canvas_context.fillStyle = final_pattern;
canvas_context.fillRect( 0 , 0 , canvas.width , canvas.height );

如果执行此操作,则canvas元素将重复绘制pattern_canvas以覆盖其尺寸。


Okay I've worked out the solution to this. Basically, createPattern() can take either an image or canvas element as its first argument. So you need to do the following:

var pattern_canvas = document.createElement('canvas');

pattern_canvas.width = texture_width;
pattern_canvas.height = texture_height;

var pattern_context = pattern_canvas.getContext('2d');

pattern_context.drawImage(img , texture_sx , texture_sy , texture_width , texture_height);

var final_pattern = canvas_context.createPattern(pattern_canvas , "repeat");

canvas_context.fillStyle = final_pattern;
canvas_context.fillRect( 0 , 0 , canvas.width , canvas.height );

If you do this then your canvas element will have pattern_canvas repeatedly drawn to cover its dimensions.

相关问答

更多
  • 好的,我已经找到了解决方案。 基本上,createPattern()可以将image或canvas元素作为其第一个参数。 所以你需要做以下事情: var pattern_canvas = document.createElement('canvas'); pattern_canvas.width = texture_width; pattern_canvas.height = texture_height; var pattern_context = pattern_canvas.getContext( ...
  • 查看错误控制台,我看到它充满了SecurityError 。 这是因为当您绘制到画布时,您会使用跨原始图像污染它。 这将禁止您出于安全原因调用getImageData ,因此“质朴”的结果。 Viewing the error console, I see it full of SecurityErrors. This is because when you draw to the canvas, you are tainting it with a cross-origin image. This wil ...
  • 这个怎么样? 唯一的缺点是你需要一个可写的图像版本来标记访问过的像素,否则洪水填充永远不会终止。 Process each* scan line in turn For each scanline, walk from left to right, until you find a non-transparent pixel P. If the location of P is already inside a known bounded box Continue to the ri ...
  • 将上下文模式视为画布上的背景图像。 模式始终从画布原点[0,0]开始。 如果图案重复,则图案在向右和向下重复的图块中填充画布。 因此,如果在画布周围移动三角形,则三角形将始终显示图案的不同部分。 有三种方法可以使三角形始终显示图案图像的相同部分。 选项#1 - context.translate 将画布原点从其默认[0,0]位置移动到三角形位置[loc.x,loc.y]。 您可以使用画布转换执行此操作。 特别是,translate命令将移动原点。 移动原点也会移动图案的左上角起始位置,以使图案始终以相对于移 ...
  • 你不能。 一个节点只能有一个父节点。 如果创建批处理节点并将其添加到一个图层,则无法将其添加到另一个图层。 如果您将引用传递给批处理节点,那么它会使图层变得毫无意义,因为精灵将是添加批处理节点的图层的子节点。 您可以使用单个批处理节点并通过向批处理节点添加带有空纹理rect的“图层精灵”,然后将实际精灵添加到图层精灵来对精灵进行分组。 要创建具有空纹理的sprite,请使用initWithTexture:rect:方法并使用CGRectZero。 或者,如果这不再起作用,你也可以使用一个非常小的矩形并将精灵 ...
  • 任何在Canvas中拍摄图像的东西都可以使用Canvas元素。 下面是一个制作模式的绘图代码示例,以及一个自定义模式函数,以防您想要更细致的控制。 这里要注意的关键是创建的画布只有40x40像素,只是足够大以保持图案。 http://jsfiddle.net/UxDVR/7/ Anything that takes an image in Canvas can take a Canvas element too. Here is an example of your drawing code making ...
  • 您将画布对象作为可重复图像传递给模式,您应该将其更改为您想要重复的图像(在这种情况下我假设是草)。 So I managed to solve this myself after a lot of head scratching, and it was much simpler than I thought. before drawing on the canvas that has been created on the HTML file, create another canvas inside th ...
  • 在xcode 7中,您可以使用Images.xcassets创建精灵地图集。 单击Images.xcassets 单击左下角的加号底部 选择“新精灵地图集” 然后,您可以将所有图像拖放到地图集中 如果使用正确的后缀(@ 2x和@ 3x)拖动所有三种图像尺寸,它将自动为您填充图像。 然后在代码中使用这些资产只需写: let atlas = SKTextureAtlas(named: "Sprites") let texture = atlas.textureNamed("ball") let sprite = ...
  • 我想你想要将精灵表加载到Texture(kivy.graphics.Texture)中,然后在你的循环中使用你精灵的纹理坐标创建一系列TextureRegions。 然后,您可以通过Rectangle图形指令显示这些内容。 您还需要正确设置纹理的纹理插值,可能是“最近”。 I think you'd want to load the sprite sheet into a Texture (kivy.graphics.Texture), then in your loop create a series o ...
  • 根据循环中的i值进行位置计算。 像这样的东西应该工作: for (var i =0; i < 26; i++) { var xModifier = i%3; var yModifier = Math.floor(i/3); ElemObjects[ElemObjects.length] = new Elem(380 * xModifier, 340 * yModifier); } 这将为您提供循环浏览列表时所需的正确值。 xModifier基于将当前i值除以3后剩余的余数,而yM ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)