Using Saxon 9.5.1-4 as my XSLT transformation engine in a JUnit test, I see the following warning:
Warning: Stylesheet module file:/C:/svn/prime/code/trunk/xslt/target/main/classes/xsl/common/to-common-result.xsl is included or imported more than once. This is permitted, but may lead to errors or unexpected behavior
But when this runs under Apache-Camel 2.13.1, it fails after the warning.
15:11:29,714 WARN [org.apache.camel.builder.xml.XsltErrorListener] (ServerService Thread Pool -- 90) Stylesheet module ../common/to-common-result.xsl is included or imported more than once. This is permitted, but may lead to errors or unexpected behavior
15:11:29,714 ERROR [org.apache.camel.builder.xml.XsltErrorListener] (ServerService Thread Pool -- 90) A stylesheet cannot import itself; SystemID: ; Line#: 11; Column#: 53: net.sf.saxon.trans.XPathException: A stylesheet cannot import itself
at net.sf.saxon.style.StyleElement.compileError(StyleElement.java:1961) [Saxon-HE-9.5.1-4.jar:]
at net.sf.saxon.style.XSLGeneralIncorporate.checkForRecursion(XSLGeneralIncorporate.java:234) [Saxon-HE-9.5.1-4.jar:]
at net.sf.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:123) [Saxon-HE-9.5.1-4.jar:]
at net.sf.saxon.style.StylesheetModule.spliceIncludes(StylesheetModule.java:143) [Saxon-HE-9.5.1-4.jar:]
at net.sf.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:210) [Saxon-HE-9.5.1-4.jar:]
What might account for the difference?
The import structure looks like this:
A imports B, C;
B imports D, E, F;
C imports G;
F imports G;
G is to-common-result.xsl in this example
I think the clue is that in the error message
15:11:29,714 ERROR [org.apache.camel.builder.xml.XsltErrorListener] (ServerService Thread Pool -- 90) A stylesheet cannot import itself; SystemID: ; Line#: 11; Column#: 53: net.sf.saxon.trans.XPathException: A stylesheet cannot import itself
the SystemId is blank. This suggests that the stylesheet is somehow being compiled without knowledge of the correct URI for each module, which means that Saxon is liable to think that a module is importing itself, because both have a blank URI.
So you need to look at how Apache-Camel is invoking the transformation, and why it hasn't supplied Saxon with a correct base URI for the stylesheet.
Related
I'm a beginner on pyflink framework and I would like to know if my use case is possible with it ...
I need to make a tumbling windows and apply a python udf (scikit learn clustering model) on it.
The use case is : every 30 seconds I want to apply my udf on the previous 30 seconds of data.
For the moment I succeeded in consume data from a kafka in streaming but then I'm not able to create a 30seconds window on a non-keyed stream with the python API.
Do you know some example for my use case ? Do you know if the pyflink API allow this ?
Here my first shot :
from pyflink.common import Row
from pyflink.common.serialization import JsonRowDeserializationSchema, JsonRowSerializationSchema
from pyflink.common.typeinfo import Types
from pyflink.datastream import StreamExecutionEnvironment
from pyflink.datastream.connectors import FlinkKafkaConsumer, FlinkKafkaProducer
from pyflink.common.watermark_strategy import TimestampAssigner, WatermarkStrategy
from pyflink.common import Duration
import time
from utils.selector import Selector
from utils.timestampAssigner import KafkaRowTimestampAssigner
# 1. create a StreamExecutionEnvironment
env = StreamExecutionEnvironment.get_execution_environment()
# the sql connector for kafka is used here as it's a fat jar and could avoid dependency issues
env.add_jars("file:///flink-sql-connector-kafka_2.11-1.14.0.jar")
deserialization_schema = JsonRowDeserializationSchema.builder() \
.type_info(type_info=Types.ROW_NAMED(["labelId","freq","timestamp"],[Types.STRING(),Types.DOUBLE(),Types.STRING()])).build()
kafka_consumer = FlinkKafkaConsumer(
topics='events',
deserialization_schema=deserialization_schema,
properties={'bootstrap.servers': 'localhost:9092'})
# watermark_strategy = WatermarkStrategy.for_bounded_out_of_orderness(Duration.of_seconds(5))\
# .with_timestamp_assigner(KafkaRowTimestampAssigner())
ds = env.add_source(kafka_consumer)
ds.print()
ds = ds.windowAll()
# ds.print()
env.execute()
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.flink.api.java.ClosureCleaner (file:/home/dorian/dataScience/pyflink/pyflink_env/lib/python3.6/site-packages/pyflink/lib/flink-dist_2.11-1.14.0.jar) to field java.util.Properties.serialVersionUID
WARNING: Please consider reporting this to the maintainers of org.apache.flink.api.java.ClosureCleaner
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Traceback (most recent call last):
File "/home/dorian/dataScience/pyflink/project/__main__.py", line 35, in <module>
ds = ds.windowAll()
AttributeError: 'DataStream' object has no attribute 'windowAll'
Thx
I am trying to run simulation with nothingFor function under Gatling 3.4.1. However, compilation fails with the error could not find implicit value for evidence parameter of type io.gatling.core.controller.inject.InjectionProfileFactory[Product with Serializable]
Simulation
package abs
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
class DefaultSimulation extends Simulation {
...
val httpProtocol = http
.baseUrl(Setting.baseUrl)
.userAgentHeader("Gatling/3.4.1")
setUp(
getScenario.inject(
nothingFor(20 seconds),
rampConcurrentUsers(0) to(20) during(10 seconds),
constantConcurrentUsers(20) during (600 seconds)
),
setScenario.inject(
rampConcurrentUsers(0) to(20) during(30 seconds),
constantConcurrentUsers(20) during (600 seconds)
)
).protocols(httpProtocol)
}
Compilation error
[ERROR] i.g.c.ZincCompiler$ - C:/Installation/gatling-3.4.1/user-files/simulations/DefaultSimulation.scala:50:30: could not find implicit value for evidence parameter of type io.gatling.core.controller.inject.InjectionProfileFactory[Product with Serializable]
getScenario.inject(
^
[ERROR] i.g.c.ZincCompiler$ - one error found
[ERROR] i.g.c.ZincCompiler$ - Compilation crashed
xsbt.InterfaceCompileFailed: null
at xsbt.CachedCompiler0.handleErrors(CompilerBridge.scala:183)
at xsbt.CachedCompiler0.run(CompilerBridge.scala:172)
at xsbt.CachedCompiler0.run(CompilerBridge.scala:134)
at xsbt.CompilerBridge.run(CompilerBridge.scala:39)
at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:89)
at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:185)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:240)
at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:175)
at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:156)
at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:232)
at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:156)
at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:203)
at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:571)
at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:571)
at sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:174)
at sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:172)
at sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:459)
at sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:115)
at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:248)
at sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:414)
at sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:499)
at sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:401)
at sbt.internal.inc.Incremental$.apply(Incremental.scala:166)
at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:571)
at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:489)
at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:419)
at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
at io.gatling.compiler.ZincCompiler$.doCompile(ZincCompiler.scala:258)
at io.gatling.compiler.ZincCompiler$.delayedEndpoint$io$gatling$compiler$ZincCompiler$1(ZincCompiler.scala:265)
at io.gatling.compiler.ZincCompiler$delayedInit$body.apply(ZincCompiler.scala:40)
at scala.Function0.apply$mcV$sp(Function0.scala:39)
at scala.Function0.apply$mcV$sp$(Function0.scala:39)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
at scala.App.$anonfun$main$1$adapted(App.scala:80)
at scala.collection.immutable.List.foreach(List.scala:431)
at scala.App.main(App.scala:80)
at scala.App.main$(App.scala:78)
at io.gatling.compiler.ZincCompiler$.main(ZincCompiler.scala:40)
at io.gatling.compiler.ZincCompiler.main(ZincCompiler.scala)
I have tried to implicitly specify imports, but compilation fails with the same exception
import io.gatling.core.Predef.{nothingFor, rampConcurrentUsers, constantConcurrentUsers, _}
This simulation compiles and works without nothingFor(20 seconds).
Gatling has 2 different families of injection profiles steps:
open, where you control users arrival rate
closed where you control the number of concurrent users
You can't mix them because those are 2 completely different and incompatible behaviors.
nothingFor belongs to the open family while rampConcurrentUsers belongs to the closed one.
Use constantConcurrentUsers(0) during (20) instead.
I am getting this errorr while taking android build react-native, screenshot provided below
TASK: react-native-doc-viewer compileDebugJavaWithJavac FAILED
package com.facebook.react.views.webview does not exist
https://i.stack.imgur.com/H17A8.png
The deprecated class com.facebook.react.views.webview is not actually being used. It is just a redundant import. Could be fixed by removing the import in node_modules/react-native-doc-viewer/android/src/main/java/com/reactlibrary/RNReactNativeDocViewerModule.java
Remove the ununsed import:
import com.facebook.react.views.webview.ReactWebViewManager;
In a bare bones project, I added these build hints:
android.gradleDep=compile 'com.erikagtierrez.multiple_media_picker:multiple-media-picker:1.0.5'
android.min_sdk_version=23
I would like to import the following Android library to make a CN1Lib (that requires at least Android SDK 23):
https://github.com/erikagtierrez/multiple-media-picker
To be short: I spent one day trying to import that, I also experimented with Android Studio and with suggestions found on Stack Overflow (trying to make a custom .aar), without success.
Could you help me to import that library? There is manifest merger error.
In fact, the issue reported by the build server is:
* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed : Attribute application#label value=(BareBones) from AndroidManifest.xml:15:17-42
is also present at [com.erikagtierrez.multiple_media_picker:multiple-media-picker:1.0.5] AndroidManifest.xml:23:9-41 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:15:3-43:103 to override.
I also tried to add the build hint:
android.xapplication_attr=tools:replace="android:label"
as suggested by the previous error, without success.
In the last case, I get:
Merging result: ERROR
/tmp/build1659178556337293135xxx/Test/src/main/AndroidManifest.xml:15:3-43:103 Error:
tools:replace specified at line:15 for attribute android:label, but no new value specified
/tmp/build1659178556337293135xxx/Test/src/main/AndroidManifest.xml Error:
Validation failed, exiting
-- Merging decision tree log ---
The last full log is here: https://gist.github.com/jsfan3/dd6c23f86a2ac949f996910c8cece62b
Thank you
This is happening because our code things you injected android:label on your own and doesn't inject it to avoid collision...
Change the code to this:
android.xapplication_attr=tools:replace="android:label" android:label="App Name"
I am wondering why the Biopython release in Macports does not contain the Phylo.TreeConstruction module as told here?
With iPython I tried :
In [1]: from Bio import Phylo
In [2]: Phylo. <-- hit tab here
Phylo.BaseTree Phylo.NexusIO Phylo.draw_graphviz
Phylo.CDAO Phylo.PhyloXML Phylo.parse
Phylo.NeXML Phylo.PhyloXMLIO Phylo.read
Phylo.NeXMLIO Phylo.convert Phylo.to_networkx
Phylo.Newick Phylo.draw Phylo.write
Phylo.NewickIO Phylo.draw_ascii
In [4]: ?Phylo
Type: module
String form: <module 'Bio.Phylo' from '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Phylo/__init__.pyc'>
File: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Phylo/__init__.py
Docstring:
Package for working with phylogenetic trees.
See also: http://biopython.org/wiki/Phylo
That's the Macports installation
I need this urgently to turn a distance matrix to a newick format for further analysis.
Thanks,
EL
Well, it's there, but for some reason it doesn't show up in dir(Bio.Phylo) and is thus not completed automatically by IPython.
Try:
/opt/local/bin/python2.7 -c 'from Bio.Phylo.TreeConstruction import _Matrix'
That's not something MacPorts did -- it seems this is either a deliberate or accidental decision made upstream. You should file a bug and request that these packages are properly exported.