The script service is configured in the otml file.  So if you are 
getting this error, it is probably because the script service bundle 
didn't get copied over from the original otml file.

If you look in the bundles or services property of the OTSystem object 
in the original otml file, you should see the script service being 
setup.   

Scott

Geoffrey Kwan wrote:
> The fixes to Otrunk worked. Now I have a problem with a 
> NullPointerException I can't figure out how to resolve. I open up the 
> authoring tool with my generated otml, and then click on the preview 
> button to open up the project with the VLE. Then I click on the dragon 
> model step. The dragon model step has a "Click here to begin" link so 
> then I click that and then I get this exception.
>
> java.lang.NullPointerException
>     at 
> org.concord.otrunk.script.ui.OTScriptObjectView.getComponent(OTScriptObjectView.java:51)
>     at 
> org.concord.otrunk.view.OTJComponentServiceImpl.getComponent(OTJComponentServiceImpl.java:57)
>     at 
> org.concord.otrunk.view.OTViewContainerPanel.createJComponent(OTViewContainerPanel.java:360)
>     at 
> org.concord.otrunk.view.OTViewContainerPanel$CreateComponentTask.run(OTViewContainerPanel.java:460)
>     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
>     at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
>     at 
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
>     at 
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
>     at 
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
>     at 
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
>     at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
>
>
> In my otml file I have all 3 of these view entries. I thought maybe 
> having multiple view entries loaded might cause the problem but I 
> tried running the otml file with each of the 3 entries, one at a time 
> and I still received the null pointer.
>
> <OTViewEntry local_id="script-view" 
> objectClass="org.concord.otrunk.script.ui.OTScriptObject" 
> viewClass="org.concord.otrunk.script.ui.OTScriptObjectView" />
> <OTViewEntry objectClass="org.concord.otrunk.script.ui.OTScriptObject" 
> viewClass="org.concord.otrunk.script.ui.OTScriptObjectView" />
> <OTViewEntry objectClass="org.concord.otrunk.script.ui.OTScriptObject" 
> viewClass="org.concord.otrunk.script.ui.OTScriptObjectView" />
>
>
> The code that is throwing the null pointer is from 
> OTScriptObjectView.java when the code below is executed (scriptManager 
> is null after getViewService() is called).
>
> OTScriptManager scriptManager = (OTScriptManager) 
> getViewService(OTScriptManager.class);
> scriptInstance  = (OTScriptObjectInterface) 
> scriptManager.instantiate(script, contextMap, 
> OTScriptObjectInterface.class);
>  
> here are the values of the arguments to scriptManager.instantiate() if 
> it helps
>
> value of script
> org.concord.otrunk.script.js.OTJavascript#%f645bbfd-371c-11dd-a1ea-6fba59f6d3e0/[EMAIL
>  PROTECTED]
>
> value of contextMap
> {destination=OTFolderObject Static Organisms 
> [EMAIL PROTECTED], 
> [EMAIL PROTECTED], 
> [EMAIL PROTECTED], 
> [EMAIL PROTECTED], 
> [EMAIL PROTECTED], 
> [EMAIL PROTECTED], 
> [EMAIL PROTECTED], 
> [EMAIL PROTECTED], 
> [EMAIL PROTECTED], 
> [EMAIL PROTECTED], 
> button=javax.swing.JButton[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.5,[EMAIL
>  
> PROTECTED],flags=16777504,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=Back
>  
> to Meiosis,defaultCapable=true], 
> [EMAIL PROTECTED]
>
> I have also attached my otml file.
>
> Thanks,
> Geoff
>
> On Thu, Jun 5, 2008 at 10:31 AM, Scott Cytacki <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>
>     Ok now it should be fully fixed if you update the otrunk project.  The
>     copying code was not handling the refid or href attributes inside of
>     compound documents correctly.
>
>     The "%" infront of the id is put there on purpose.    If you use the
>     toString method of the OTID you will get a string starting with a %.
>     This is because you should not use the toString method to get string
>     version of the id.  Instead you should use the toExternalForm()
>     method.    The toExternalForm verifies that this ID actually has a
>     valid
>     String representation.   Some IDs are temporary so toExternalForm
>     throws
>     an exception in this case.
>
>     So if you are seeing "%" infront of ids it means there is some code
>     calling toString on the id when it shouldn't be.   In this
>     particular it
>     was a problem in the OTrunk project itself using the toString method.
>
>     Scott
>
>     Scott Cytacki wrote:
>     > Ok, if you update the otrunk project, the refid part of this
>     should be
>     > fixed.
>     >
>     > I still need to fix the href part.
>     >
>     > Scott
>     >
>     > Scott Cytacki wrote:
>     >
>     >> This looks like a bug in the copy code.  I created this issue
>     to track
>     >> my work on it:
>     >> http://jira.concord.org/browse/OTK-54
>     >>
>     >> Scott
>     >>
>
>
>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SAIL-Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/SAIL-Dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to