Error when running XSLT with eclipse - eclipse-plugin

When I use eclipse xsl development tools to run xsl transformation, it reports the following error. But using saxon there is no problem. SIt would be appreciated if some expert can provide possible solution.
12:44:14,714 INFO [main] Main - javax.xml.transform.TransformerFactory=null
12:44:14,725 INFO [main] Main - java.endorsed.dirs=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/endorsed
12:44:14,744 INFO [main] Main - launchFile: /gpfs/work01/work/scratch/users/feifan_liu/.metadata/.plugins/org.eclipse.wst.xsl.jaxp.launching/launch/launch.xml
12:44:14,945 ERROR [main] JAXPSAXProcessorInvoker - Error checking type of the expression 'funcall(tokenize, [variable-ref(rColNames/result-tree), literal-expr(\|)])'.
12:44:14,953 ERROR [main] JAXPSAXProcessorInvoker - Could not compile stylesheet
javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:843)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:632)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformerHandler(TransformerFactoryImpl.java:918)
at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.addStylesheet(JAXPSAXProcessorInvoker.java:136)
at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.addStylesheet(JAXPSAXProcessorInvoker.java:127)
at org.eclipse.wst.xsl.jaxp.debug.invoker.PipelineDefinition.addStyleSheet(PipelineDefinition.java:161)
at org.eclipse.wst.xsl.jaxp.debug.invoker.PipelineDefinition.configure(PipelineDefinition.java:152)
at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.Main.main(Main.java:72)
12:44:14,954 FATAL [main] Main - Error with stylesheet: file:/gpfs/work01/work/scratch/users/feifan_liu/com.nuance.xslt.ahfs/files/acp2detagged.xsl
org.eclipse.wst.xsl.jaxp.debug.invoker.internal.ConfigurationException: Error with stylesheet: file:/gpfs/work01/work/scratch/users/feifan_liu/com.nuance.xslt.ahfs/files/acp2detagged.xsl
at org.eclipse.wst.xsl.jaxp.debug.invoker.PipelineDefinition.addStyleSheet(PipelineDefinition.java:163)
at org.eclipse.wst.xsl.jaxp.debug.invoker.PipelineDefinition.configure(PipelineDefinition.java:152)
at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.Main.main(Main.java:72)

Eclipse seems to use Xalan Java which is an XSLT 1.0 processor and it simply complains about code in your stylesheet using the tokenize function which is new in XSLT/XPath 2.0 and that way not supported by Xalan. If you want to use XSLT 2.0 with Java then try Saxon 9. I don't know details however as to set up Eclipse to use Saxon.

Related

Databricks Connect: Unable to run scala program in databricks cluster from IntelliJ

Followed the steps mentioned in this docs. databricks-connect test command works fine. However, when I launch the test scala program from Intellij, I'm seeing following error:
Exception in thread "main" java.lang.NoSuchMethodError: com.databricks.spark.util.MetricDefinitions$.EVENT_INITIAL_CONFIG_LOG()Lcom/databricks/spark/util/MetricDefinition;
at com.databricks.spark.util.InitialConfigLogging$.recordInitialConfigs(InitialConfigLogging.scala:47)
at org.apache.spark.sql.internal.SQLConf.recordSessionInitialConfs(SQLConf.scala:4166)
at org.apache.spark.sql.SparkSession.<init>(SparkSession.scala:150)
at org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:1033)
at com.srikanth.Demo$.main(Demo.scala:13)
at com.srikanth.Demo.main(Demo.scala)
Environment details:
python - 3.8
java - 1.8
databricks-connect - 9.1
I had the same error message, turns out I did not add the databricks-connect library properly. You should add the library like described here: https://docs.databricks.com/dev-tools/databricks-connect.html#intellij-scala-or-java

IntelliJ IDEA 2020.1 Build #IU-201.6668.121 PsiAnnotationStubImpl Error

After upgrading to the version in the title, i get the following exception and can't find out what's the problem. It seems like an annotation and parsing error inside of intellij.
To run the application i am using OpenJ9. Intellij itself runs with 11.0.6 like mentioned in the exception below.
2020-04-09 08:49:53,688 [1843359] ERROR - ubs.impl.PsiAnnotationStubImpl - Bad annotation in jar:///home/.m2/repository/org/checkerframework/jdk8/2.8.1/jdk8-2.8.1.jar!/java/util/List.class
com.intellij.util.IncorrectOperationException: Incorrect annotation '#jdk.Profile+Annotation(value=1)'
at com.intellij.psi.impl.PsiJavaParserFacadeImpl.newException(PsiJavaParserFacadeImpl.java:389)
at com.intellij.psi.impl.PsiJavaParserFacadeImpl.createAnnotationFromText(PsiJavaParserFacadeImpl.java:103)
at com.intellij.psi.impl.PsiElementFactoryImpl.createAnnotationFromText(PsiElementFactoryImpl.java:661)
at com.intellij.psi.impl.java.stubs.impl.PsiAnnotationStubImpl.getPsiElement(PsiAnnotationStubImpl.java:56)
at com.intellij.psi.impl.compiled.ClsAnnotationImpl$2.compute(ClsAnnotationImpl.java:55)
at com.intellij.psi.impl.compiled.ClsAnnotationImpl$2.compute(ClsAnnotationImpl.java:50)
at com.intellij.openapi.util.AtomicNotNullLazyValue.getValue(AtomicNotNullLazyValue.java:37)
at com.intellij.psi.impl.compiled.ClsAnnotationImpl.getParameterList(ClsAnnotationImpl.java:94)
at com.intellij.psi.impl.compiled.ClsAnnotationImpl.appendMirrorText(ClsAnnotationImpl.java:65)
at com.intellij.psi.impl.compiled.ClsElementImpl.appendText(ClsElementImpl.java:232)
at com.intellij.psi.impl.compiled.ClsModifierListImpl.appendMirrorText(ClsModifierListImpl.java:88)
at com.intellij.psi.impl.compiled.ClsElementImpl.appendText(ClsElementImpl.java:224)
at com.intellij.psi.impl.compiled.ClsClassImpl.appendMirrorText(ClsClassImpl.java:333)
at com.intellij.psi.impl.compiled.ClsElementImpl.appendText(ClsElementImpl.java:224)
at com.intellij.psi.impl.compiled.ClsFileImpl.appendMirrorText(ClsFileImpl.java:275)
at com.intellij.psi.impl.compiled.ClsFileImpl.lambda$decompile$2(ClsFileImpl.java:545)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:864)
at com.intellij.psi.impl.compiled.ClsFileImpl.decompile(ClsFileImpl.java:545)
at jd.ide.intellij.JavaDecompilerService.decompile(JavaDecompilerService.java:58)
at jd.ide.intellij.CachingJavaDecompilerService$2.load(CachingJavaDecompilerService.java:81)
at jd.ide.intellij.CachingJavaDecompilerService$2.load(CachingJavaDecompilerService.java:77)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
at com.google.common.cache.LocalCache.get(LocalCache.java:3932)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806)
at jd.ide.intellij.CachingJavaDecompilerService.accessToDecompiledText(CachingJavaDecompilerService.java:62)
at jd.ide.intellij.CachingJavaDecompilerService.decompile(CachingJavaDecompilerService.java:53)
at jd.ide.intellij.JavaLightClassDecompiler.getText(JavaLightClassDecompiler.java:22)
at com.intellij.psi.impl.compiled.ClassFileDecompiler.decompile(ClassFileDecompiler.java:26)
at com.intellij.openapi.fileEditor.impl.LoadTextUtil.loadText(LoadTextUtil.java:470)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.getDocument(FileDocumentManagerImpl.java:202)
at com.intellij.psi.impl.compiled.ClsFileImpl.getMirror(ClsFileImpl.java:337)
at com.intellij.psi.impl.compiled.ClsElementImpl.getMirror(ClsElementImpl.java:144)
at com.intellij.debugger.impl.DebuggerUtilsImpl.getPsiClassAndType(DebuggerUtilsImpl.java:145)
at com.intellij.debugger.ui.tree.render.CachedEvaluator.initEvaluatorAndChildrenExpression(CachedEvaluator.java:50)
at com.intellij.debugger.ui.tree.render.CachedEvaluator.lambda$getEvaluator$1(CachedEvaluator.java:89)
at com.intellij.psi.impl.PsiDocumentManagerBase.lambda$commitAndRunReadAction$6(PsiDocumentManagerBase.java:524)
at com.intellij.psi.impl.PsiDocumentManagerBase.lambda$commitAndRunReadAction$7(PsiDocumentManagerBase.java:549)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:898)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:61)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitAndRunReadAction(PsiDocumentManagerBase.java:547)
at com.intellij.psi.impl.PsiDocumentManagerBase.commitAndRunReadAction(PsiDocumentManagerBase.java:524)
at com.intellij.debugger.ui.tree.render.CachedEvaluator.getEvaluator(CachedEvaluator.java:89)
at com.intellij.debugger.ui.tree.render.ExpressionChildrenRenderer.isExpandable(ExpressionChildrenRenderer.java:156)
at com.intellij.debugger.ui.tree.render.CompoundNodeRenderer.isExpandable(CompoundNodeRenderer.java:74)
at com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl.calcRepresentation(ValueDescriptorImpl.java:293)
at com.intellij.debugger.ui.impl.watch.NodeDescriptorImpl.updateRepresentationNoNotify(NodeDescriptorImpl.java:69)
at com.intellij.debugger.ui.impl.watch.NodeDescriptorImpl.updateRepresentation(NodeDescriptorImpl.java:61)
at com.intellij.debugger.engine.JavaValue$1.contextAction(JavaValue.java:178)
at com.intellij.debugger.engine.events.SuspendContextCommandImpl.action(SuspendContextCommandImpl.java:57)
at com.intellij.debugger.engine.events.DebuggerCommandImpl.run(DebuggerCommandImpl.java:43)
at com.intellij.debugger.engine.DebuggerManagerThreadImpl.processEvent(DebuggerManagerThreadImpl.java:151)
at com.intellij.debugger.engine.DebuggerManagerThreadImpl.processEvent(DebuggerManagerThreadImpl.java:29)
at com.intellij.debugger.impl.InvokeThread.lambda$run$0(InvokeThread.java:138)
at com.intellij.openapi.project.DumbService.runWithAlternativeResolveEnabled(DumbService.java:376)
at com.intellij.debugger.impl.InvokeThread.run(InvokeThread.java:125)
at com.intellij.debugger.impl.InvokeThread.access$100(InvokeThread.java:19)
at com.intellij.debugger.impl.InvokeThread$WorkerThreadRequest.lambda$run$0(InvokeThread.java:49)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:210)
at com.intellij.debugger.impl.InvokeThread$WorkerThreadRequest.run(InvokeThread.java:48)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:255)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.AssertionError: Unexpected token: '+'
at com.intellij.lang.java.parser.JavaParserUtil.parseFragment(JavaParserUtil.java:193)
at com.intellij.psi.impl.source.tree.JavaElementType$JavaDummyElementType.parseContents(JavaElementType.java:263)
at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$0(LazyParseableElement.java:192)
at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:565)
at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:191)
at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:242)
at com.intellij.psi.impl.source.JavaDummyElement.getFirstChildNode(JavaDummyElement.java:69)
at com.intellij.psi.impl.PsiJavaParserFacadeImpl.createAnnotationFromText(PsiJavaParserFacadeImpl.java:101)
2020-04-09 08:49:53,690 [1843361] ERROR - ubs.impl.PsiAnnotationStubImpl - IntelliJ IDEA 2020.1 Build #IU-201.6668.121
2020-04-09 08:49:53,690 [1843361] ERROR - ubs.impl.PsiAnnotationStubImpl - JDK: 11.0.6; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-04-09 08:49:53,690 [1843361] ERROR - ubs.impl.PsiAnnotationStubImpl - OS: Linux
2020-04-09 08:49:53,690 [1843361] ERROR - ubs.impl.PsiAnnotationStubImpl - Last Action: ChooseRunConfiguration
This happens when i try to debug my application and some fields have an error value like:
Does anyone have an idea how to fix this?
Edit:
Installed over snap. Maybe i should install it manually to prevent the snap-auto-update.
After disabling
Settings -> Build, Execution, Deployment -> Debugger -> Data Views -> Java -> Enable alternative view for Collections classes
i am able to debug the nested collections. I think this is still a workaround and should be fixed by JetBrains.
Edit:
The approach above works, but at this point it looks like a Java Decompiler plugin does not work correctly. Thus no intellij bug.

Karate 0.9.1 - Exception in thread "main" java.lang.StackOverflowError

When I'm trying to run *.feature file or a single scenario with "right-click" (IntelliJ Idea), I've always received an exception:
Exception in thread "main" java.lang.StackOverflowError
at java.util.HashMap.<init>(HashMap.java:457)
at java.util.LinkedHashMap.<init>(LinkedHashMap.java:347)
at java.util.HashSet.<init>(HashSet.java:162)
at java.util.LinkedHashSet.<init>(LinkedHashSet.java:154)
at jdk.nashorn.internal.runtime.ScriptObject$KeyIterator.init(ScriptObject.java:2467)
at jdk.nashorn.internal.runtime.ScriptObject$ScriptObjectIterator.hasNext(ScriptObject.java:2441)
at jdk.nashorn.api.scripting.ScriptObjectMirror$13.call(ScriptObjectMirror.java:368)
at jdk.nashorn.api.scripting.ScriptObjectMirror$13.call(ScriptObjectMirror.java:363)
at jdk.nashorn.api.scripting.ScriptObjectMirror.inGlobal(ScriptObjectMirror.java:858)
at jdk.nashorn.api.scripting.ScriptObjectMirror.entrySet(ScriptObjectMirror.java:363)
at net.minidev.json.reader.JsonWriter$7.writeJSONString(JsonWriter.java:135)
at net.minidev.json.reader.JsonWriter$7.writeJSONString(JsonWriter.java:128)
at com.intuit.karate.JsonUtils$NashornObjectJsonWriter.writeJSONString(JsonUtils.java:77)
at com.intuit.karate.JsonUtils$NashornObjectJsonWriter.writeJSONString(JsonUtils.java:67)
...
Same scenario works fine if I run with TestRunner.java. Looks like that problem is in IJ cucumber plugin.
Maybe someone has a solution or workaround for this issue.
I'm using karate 0.9.1, cucumber for Java plugin: v183.4284.148, Idea 2018.3.3
No one has reported this - and from the stack-trace it looks like some JSON that you are using is being printed to the console - has some circular references, maybe you are using a Map of object references. But yes I can't explain why this works fine in the runner.
Can you follow the instructions here and submit a sample project, we can try open it in IntelliJ: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
EDIT: this was a cyclic reference, but we have fixed it to be safe in future.

sbt.compiler.EvalException: Type Error in Expression

I'm quite new with IntelliJ (and on this site too tbh) and have been using it for only a couple of days. When I tried to build my project this exception came up. I tried to solve the problem but to no avail. I tried to see if the same problem occured on a newly created project and yes it does. So the code I've written should have no influence on the build. IƤve also checked if there might be a problem with the sbt version but I am up to date.
This is what the error looks like. I have absolutely no clue how to solve this so any help would be very much appreciated.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[warn] Executing in batch mode.
[warn] For better performance, hit [ENTER] to switch to interactive mode, or
[warn] consider launching sbt without any commands, or explicitly passing 'shell'
[info] Loading global plugins from C:\Users\Johner-Institut\.sbt\0.13\plugins
Waiting for lock on C:\Users\Johner-Institut\.ivy2\.sbt.ivy.lock to be available...
[info] Loading project definition from C:\Users\Johner-Institut\Desktop\Project\project
C:\Users\Johner-Institut\Desktop\Project\build.sbt:5: error: recursive value project needs type
lazy val `project` = (project in file(".")).enablePlugins(PlayScala)
^
sbt.compiler.EvalException: Type error in expression
[error] sbt.compiler.EvalException: Type error in expression
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
Don't use project as a name for sbt project, that's why the recursion error. Try something like:
lazy val root = (project in file(".")).enablePlugins(PlayScala)

"URI is not registered" of default xmlns in faces-config and MyFaces 2.2

I am in the process of updating the JSF implementation of our project from JSF 1.1 to JSF 2.2. I mainly use Migrating from JSF 1.2 to JSF 2.0 as a guide.
When updating the root element of the faces-config.xml according to JSF 2.2 faces-config: Unknown Schema version: 2.2 to
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
my IDE - IntelliJ - marks the default XML namespace xmlns="http://xmlns.jcp.org/xml/ns/javaee" red and when hovering over it gives me the error message:
URI is not registered
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd also gets marked as erroneous, showing the following error message when hovering over it:
Cannot resolve symbol 'http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd'
I use MyFaces 2.2.12 as JSF implementation and IntelliJ IDEA Community 2017.1 as IDE. (I am aware that the CE of IntelliJ does not feature the same level of JSF support as the Ultimate Edition, but this is not really a JSF problem, but rather a XML problem, isn't it?)
Can anyone tell me what I need to change to make IntelliJ recognize the xmlns-URI?
Edit:
I tried to "Manually setup external resource" like described in JSF xmlns URI not registered in IntelliJ IDEA, but if I do this for web-facesconfig_2_2.xsd, every element in faces-config.xml gets marked with an error. When I hover over the marked elements I get the following error message: