Skip to main content

Creating Search Engine Friendly URLs - Part 2

Comments

3 comments

  • Zendesk API User
    Author: MarcusDau - 8/5/2014 12:27

    Great article! This will help me for sure. But, I have a question.

    Whe I start the script, I get an NPE:

    Client Version: 5.1.209.63675

    Java Version: 1.7.0_03 Oracle Corporation

    FSVersion=5.1.209.63675#3298;JDK=1.7.0_03 32bit Oracle Corporation;OS=Windows 7 6.1 x86;Date=05.08.2014 13:23:20

    de.espirit.firstspirit.access.script.ExecutionException: null : at Line: 27 : in file: inline evaluation of: ``__execute() { import de.espirit.firstspirit.agency.StoreAgent; import de.espirit . . . '' : .getExtension ( templateSet )

    Target exception: java.lang.NullPointerException: Attempt to invoke method getExtension on null value

    at line 27

        at de.espirit.firstspirit.server.script.BeanshellScriptEngine$BeanshellExecutable.execute(BeanshellScriptEngine.java:109)

        at de.espirit.firstspirit.client.gui.applications.ApplicationTabRegistry$IdentifiableExecutable.execute(ApplicationTabRegistry.java:114)

        at de.espirit.firstspirit.common.ScriptUtil.execute(ScriptUtil.java:106)

        at de.espirit.firstspirit.common.ScriptUtil.executePrivileged(ScriptUtil.java:161)

        at de.espirit.firstspirit.common.ScriptUtil.access$000(ScriptUtil.java:31)

        at de.espirit.firstspirit.common.ScriptUtil$2.run(ScriptUtil.java:148)

        at de.espirit.firstspirit.client.gui.util.GuiUtil$RunnableWrapper.run(GuiUtil.java:1953)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

        at java.lang.Thread.run(Thread.java:722)

    Caused by: java.lang.NullPointerException: Attempt to invoke method getExtension on null value

        at bsh.Reflect.resolveExpectedJavaMethod(Reflect.java:388)

        at bsh.Reflect.invokeObjectMethod(Reflect.java:97)

        at bsh.BSHPrimarySuffix.doName(BSHPrimarySuffix.java:176)

        at bsh.BSHPrimarySuffix.doSuffix(BSHPrimarySuffix.java:120)

        at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:80)

        at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)

        at bsh.BSHAssignment.eval(BSHAssignment.java:77)

        at bsh.BSHBlock.evalBlock(BSHBlock.java:130)

        at bsh.BSHBlock.eval(BSHBlock.java:80)

        at bsh.BSHBlock.eval(BSHBlock.java:46)

        at bsh.BSHEnhancedForStatement.eval(BSHEnhancedForStatement.java:80)

        at bsh.BSHBlock.evalBlock(BSHBlock.java:130)

        at bsh.BSHBlock.eval(BSHBlock.java:80)

        at bsh.BshMethod.invokeImpl(BshMethod.java:371)

        at bsh.BshMethod.invoke(BshMethod.java:267)

        at bsh.BshMethod.invoke(BshMethod.java:170)

        at bsh.PreparsedScript.invoke(PreparsedScript.java:66)

        at de.espirit.firstspirit.server.script.BeanshellScriptEngine$BeanshellExecutable.execute(BeanshellScriptEngine.java:100)

        ... 9 more

    Any idea why and what to do?

    Thx in advance!

    Marcus

    0
  • Zendesk API User
    Author: Peter_Jodeleit - 8/6/2014 11:05

    Thats a script error - as stated in the message "Attempt to invoke method getExtension on null value"

    0
  • Zendesk API User
    Author: MarcusDau - 8/11/2014 10:02

    Funny answer ;-)

    I changed line 35 in the script from

    extension = context.getElement().getExtension(templateSet);

    to

    extension = templateSet.getExtension();

    and now it works!

    0

Please sign in to leave a comment.