Extension Block XML WHat it is this problem ?

yoplalala

  • *
  • Posts: 1632
I have this simple blocks .xml with this simple code and I have a java error when I enable this error where could it could from ?

Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>


<palette>
<block tag="activitiesForGraphemeList"
spec="activitiesForGraphemeList"
code="ExternalRessourcesManager.activitiesForGraph()"
help="list of activities for the graph"
type="normal"
color="yellow"
returns="list">
</block>
</palette>

Code: [Select]
ndex: 3, Size: 0
java.lang.RuntimeException: java.lang.IndexOutOfBoundsException: Index: 3, Size: 0
at stencyl.sw.app.tasks.StencylWorker.done(StencylWorker.java:74)
at stencyl.sw.app.tasks.StencylWorker.done(StencylWorker.java:54)
at stencyl.sw.app.tasks.OpenResourceTask.done(OpenResourceTask.java:76)
at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:832)
at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:842)
at javax.swing.Timer.fireActionPerformed(Timer.java:313)
at javax.swing.Timer$DoPostEvent.run(Timer.java:245)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.set(ArrayList.java:444)
at stencyl.sw.editors.snippet.designer.palette.Palette.createAndAddElement(Palette.java:544)
at stencyl.sw.editors.snippet.designer.palette.Palette.createNodes(Palette.java:384)
at stencyl.sw.editors.snippet.designer.palette.Palette.createNodes(Palette.java:403)
at stencyl.sw.editors.snippet.designer.palette.Palette.createSection(Palette.java:292)
at stencyl.sw.editors.snippet.designer.palette.SubcategoryListing.addButton(SubcategoryListing.java:134)
at stencyl.sw.editors.snippet.designer.palette.SubcategoryListing.<init>(SubcategoryListing.java:81)
at stencyl.sw.editors.snippet.designer.palette.SubPaletteContainer.<init>(SubPaletteContainer.java:36)
at stencyl.sw.editors.snippet.designer.palette.CategoryListing.addButton(CategoryListing.java:94)
at stencyl.sw.editors.snippet.designer.palette.CategoryListing.<init>(CategoryListing.java:65)
at stencyl.sw.editors.snippet.designer.palette.PaletteContainer.<init>(PaletteContainer.java:69)
at stencyl.sw.editors.snippet.designer.SnippetDesigner.<init>(SnippetDesigner.java:341)
at stencyl.sw.editors.scene.SceneTab.init(SceneTab.java:164)
at stencyl.sw.editors.scene.SceneTab.<init>(SceneTab.java:119)
at stencyl.sw.app.doc.Workspace.fetchEditorForResource(Workspace.java:758)
at stencyl.sw.app.doc.Workspace.finishOpenResource(Workspace.java:604)
at stencyl.sw.app.tasks.OpenResourceTask.doInBackground(OpenResourceTask.java:67)
at stencyl.sw.app.tasks.OpenResourceTask.doInBackground(OpenResourceTask.java:20)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

gurigraphics

  • Posts: 690
Perhaps the semicolon at the end of the function?

Code: [Select]
activitiesForGraph();

yoplalala

  • *
  • Posts: 1632
no, it's a return fonction. And usually when I do this kind of error , it sees it a compile. But now it's a java problem, it doesn't even want to open my scenes.

gurigraphics

  • Posts: 690
Hum, it is not always so easy. ^ ^


danielle53

  • *
  • Posts: 55
I dont't like the  lines :
Code: [Select]
      at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
Oracle says :
The AccessController class is used for access control operations and decisions.

 More specifically, the AccessController class is used for three purposes:
  • to decide whether an access to a critical system resource is to be allowed or denied, based on the security policy currently in effect,
  • to mark code as being "privileged", thus affecting subsequent access determinations, and
  • to obtain a "snapshot" of the current calling context so access-control decisions from a different context can be made with respect to the saved context.

 The checkPermission method determines whether the access request indicated by a specified permission should be granted or denied.
 A sample call appears below. In this example, checkPermission will determine whether or not to grant "read" access to the file named "testFile" in the "/temp" directory.
Code: [Select]
    FilePermission perm = new FilePermission("/temp/testFile", "read");
    AccessController.checkPermission(perm);
 

If a requested access is allowed, checkPermission returns quietly. If denied, an AccessControlException is thrown. AccessControlException can also be thrown if the requested permission is of an incorrect type or contains an invalid value.

Such information is given whenever possible.

I would guess that the information is ;
Code: [Select]
index: 3, Size: 0
java.lang.RuntimeException: java.lang.IndexOutOfBoundsException: Index: 3, Size: 0

May be in your code, there is simply a line causing you to go out of an index ..

captaincomic

  • *
  • Posts: 6108
The AccessController is just called somewhere in between, the problem is the IndexOutOfBoundsException.

Is there anything else in the blocks.xml? An attached-block field maybe? 

yoplalala

  • *
  • Posts: 1632


No there's nothing at all :(
That's the whole file.

mdotedot

  • Posts: 1654
Shouldn't there be a <fields></fields> in there  as well?
And try ommiting the standalone="no"
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

yoplalala

  • *
  • Posts: 1632
tried it with and without the <fields></fields> , in my other extensions I had some without them and it worked.
Just tried it with yes, but it doesn't work either.

Tried also having a different name in the spec and in the tag ... I'm running out of ideas

captaincomic

  • *
  • Posts: 6108
When I create an extension with that code, I don't get any error. Are you sure it's this extension and not another?

Try with build 8791, that should print a warning now instead of erroring out.

yoplalala

  • *
  • Posts: 1632
Great ! It works now ! ( and my extension didn't block eveything on linux) . And there is no warning .
(or maybe this and I'm not sure but I don't understand it
stencyl.sw.app.doc.Workspace
Trying to open 'null' resource. )
Mysterious ...

captaincomic

  • *
  • Posts: 6108
Hmm, mysterious indeed :) Fwiw, the warning would look like this:
"Could not add attached block " + attached + " to definition " + def + " at position " + i + "."

yoplalala

  • *
  • Posts: 1632
@captaincomic
Oh , indeed. Sorry didn't see it ( I thought it had nothing to do with it as I don't have a block named like this)

Could not add attached block [data-save-success-cyan] to definition activitiesForGraphemeList at position 3 .

which I find in the ecternal data extension

Code: [Select]
<block tag="data-save-success-cyan"
spec="save successful [i:save]"
code="success"
help="Use inside the save image block."
type="normal"
color="cyan"
hidden="true"
returns="boolean">
<fields/>
</block>

Which doesn't help at all. ( but it doesn't seem to bother )


Now I'm having "No enum constant stencyl.sw.editors.snippet.designer.block.Block.BlockType.  "
as i have added two blocks

« Last Edit: November 04, 2015, 11:35:54 am by yoplalala »

captaincomic

  • *
  • Posts: 6108
It's very strange that it's trying to attach that external data block to your block.

The other problem is resolved? http://community.stencyl.com/index.php/topic,45018.0.html