karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Freeman Fang (JIRA)" <j...@apache.org>
Subject [jira] [Work started] (KARAF-3335) Endorsed org.apache.karaf.exception-3.0.2 jar causes issues with Java 8 Nashorn scripts
Date Tue, 28 Oct 2014 08:36:34 GMT

     [ https://issues.apache.org/jira/browse/KARAF-3335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Work on KARAF-3335 started by Freeman Fang.
-------------------------------------------
> Endorsed org.apache.karaf.exception-3.0.2 jar causes issues with Java 8 Nashorn scripts
> ---------------------------------------------------------------------------------------
>
>                 Key: KARAF-3335
>                 URL: https://issues.apache.org/jira/browse/KARAF-3335
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 3.0.2
>            Reporter: Adam Davis
>            Assignee: Freeman Fang
>
> I have been trying to get our application up and running within Karaf-3.0.2, and have
run into an issue with the exception-3.0.2 jar within the lib/endorsed folder.  Our application
relies heavily on Nashorn scripts, and these scripts will no longer run.  
> When executing the following code, an exception is generated and the script fails to
execute:
> h6. Nashorn Script
> {code}
> topic.modify(function(s) {
>     s.roleList.add().userRoleKey = 1;
> });
> {code}
> h6. Java code
> _The topic variable above is an instance of ModificationContext_
> {code}
> class ModificationContext
> {
>     public <S extends DataObject> ModificationContext modify(Consumer<S>
consumer)
>     {
>         ... //the contents here are unimportant, as it never actually gets this far
>     }
> }
> {code}
> h6. Stack Trace
> {noformat}
> java.lang.NoSuchMethodError: java.lang.Exception: method <init>(Ljava/lang/String;Ljava/lang/Throwable;ZZ)V
not found
>         at java.lang.RuntimeException.<init>(RuntimeException.java:117)
>         at jdk.internal.dynalink.support.TypeConverterFactory$NotCacheableConverter.<init>(TypeConverterFactory.java:379)
>         at jdk.internal.dynalink.support.TypeConverterFactory.createConverter(TypeConverterFactory.java:370)
>         at jdk.internal.dynalink.support.TypeConverterFactory$1$1.computeValue(TypeConverterFactory.java:120)
>         at jdk.internal.dynalink.support.TypeConverterFactory$1$1.computeValue(TypeConverterFactory.java:116)
>         at jdk.internal.dynalink.support.ClassMap.get(ClassMap.java:150)
>         at jdk.internal.dynalink.support.TypeConverterFactory.getCacheableTypeConverter(TypeConverterFactory.java:330)
>         at jdk.internal.dynalink.support.TypeConverterFactory.getCacheableTypeConverterNull(TypeConverterFactory.java:317)
>         at jdk.internal.dynalink.support.TypeConverterFactory.getTypeConverterNull(TypeConverterFactory.java:323)
>         at jdk.internal.dynalink.support.TypeConverterFactory.asType(TypeConverterFactory.java:224)
>         at jdk.internal.dynalink.support.LinkerServicesImpl.asType(LinkerServicesImpl.java:126)
>         at jdk.nashorn.internal.runtime.linker.NashornBeansLinker$NashornBeansLinkerServices.asType(NashornBeansLinker.java:84)
>         at jdk.internal.dynalink.beans.SingleDynamicMethod.createConvertingInvocation(SingleDynamicMethod.java:289)
>         at jdk.internal.dynalink.beans.SingleDynamicMethod.getInvocation(SingleDynamicMethod.java:189)
>         at jdk.internal.dynalink.beans.SingleDynamicMethod.getInvocation(SingleDynamicMethod.java:132)
>         at jdk.internal.dynalink.beans.DynamicMethodLinker.getGuardedInvocation(DynamicMethodLinker.java:118)
>         at jdk.internal.dynalink.beans.BeansLinker.getGuardedInvocation(BeansLinker.java:252)
>         at jdk.nashorn.internal.runtime.linker.NashornBeansLinker.getGuardedInvocation(NashornBeansLinker.java:67)
>         at jdk.nashorn.internal.runtime.linker.NashornBeansLinker.getGuardedInvocation(NashornBeansLinker.java:54)
>         at jdk.internal.dynalink.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:124)
>         at jdk.internal.dynalink.support.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:144)
>         at jdk.internal.dynalink.DynamicLinker.relink(DynamicLinker.java:232)
>         at jdk.nashorn.internal.scripts.Script$\^eval\_.runScript(<eval>:1)
>         at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:498)
>         at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:206)
>         at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378)
>         at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:546)
>         at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:528)
>         at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:524)
>         at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:194)
>         at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
> {noformat}
> If I remove the exception jar from the endorsed folder and run the same script, it executes
correctly



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message