How to utilize/import Flink's TestHarness class with bazel? - maven
My intuition might have been right to use the packaging and/or Classifier. For finding the correct import Tag for the Build File I recommending visting the .cache/bazel/bazel_user/.../external/maven/BUILD file
EDITED the Post into working setup
I want to test my own async flink Stream Operator RichAsyncFunction using a Bazel Build Tool.
This is basicly the same questions as How to utilize Flink's TestHarness class?
The main problem is that i can not find the import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness
And all the other Code needed for testing Steaming Operators.
I tried to follow the provided answer, but I struggle with the bazel syntax, asking myself if it is even possible to use those imports with bazel.
I am using newest Bazel Version and IntelliJ 2019.3.4 with the bazel plugin.
The linked Answer supposes this Maven Dependencies:
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils-junit</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_2.11</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-runtime_2.11</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
My WORKSPACE looks like this
...
http_archive(
name = "rules_jvm_external",
sha256 = RULES_JVM_EXTERNAL_SHA,
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)
load("#rules_jvm_external//:defs.bzl", "maven_install")
load("#rules_jvm_external//:defs.bzl", "artifact")
load("#rules_jvm_external//:specs.bzl", "maven")
load("#io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS")
load("#io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS")
maven_install(
artifacts = [
...
"org.apache.commons:commons-lang3:3.9",
"org.javatuples:javatuples:1.2",
"junit:junit:4.13",
"org.testcontainers:testcontainers:1.14.1",
"org.testcontainers:kafka:1.14.1",
"org.testcontainers:postgresql:1.14.1",
"commons-io:commons-io:2.6",
"com.google.code.findbugs:jsr305:1.3.9",
"com.google.errorprone:error_prone_annotations:2.0.18",
"com.google.j2objc:j2objc-annotations:1.1",
"com.google.protobuf:protobuf-java:3.11.1",
"com.google.protobuf:protobuf-java-util:3.6.1",
"info.picocli:picocli:4.1.0",
"org.slf4j:slf4j-log4j12:1.7.5",
"org.slf4j:slf4j-api:1.7.28",
"com.github.jasync-sql:jasync-postgresql:1.0.11",
"com.github.jasync-sql:jasync-common:1.0.11",
"org.postgresql:postgresql:42.2.5",
"org.mongodb:mongodb-driver-reactivestreams:4.0.2",
"org.mongodb:mongodb-driver-core:4.0.2",
"org.mongodb:bson:4.0.2",
"org.reactivestreams:reactive-streams:1.0.3",
"joda-time:joda-time:2.9.7",
"org.apache.kafka:kafka-clients:2.4.0",
# "io.grpc:grpc-netty-shaded:%s" % GRPC_JAVA_VERSION,
# "io.grpc:grpc-protobuf:%s" % GRPC_JAVA_VERSION,
# "io.grpc:grpc-stub:%s" % GRPC_JAVA_VERSION,
"org.apache.flink:flink-core:%s" % FLINK_VERSION,
"org.apache.flink:flink-java:%s" % FLINK_VERSION,
"org.apache.flink:flink-streaming-java_%s:%s" % (SCALA_VERSION, FLINK_VERSION),
"org.apache.flink:flink-connector-kafka-0.11_%s:%s" % (SCALA_VERSION, FLINK_VERSION),
"org.apache.flink:flink-cep_2.11:%s" % FLINK_VERSION,
] + IO_GRPC_GRPC_JAVA_ARTIFACTS,
generate_compat_repositories = True,
override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS,
repositories = [
"https://jcenter.bintray.com/",
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)
maven_install(
name = "testing",
artifacts = [
maven.artifact(
group = "org.apache.flink",
artifact = "flink-runtime_2.11",
version = FLINK_VERSION,
classifier = "tests",
packaging = "test-jar",
),
maven.artifact(
group = "org.apache.flink",
artifact = "flink-streaming-java_2.11",
version = FLINK_VERSION,
classifier = "tests",
packaging = "test-jar",
),
maven.artifact(
group = "org.apache.flink",
artifact = "flink-test-utils-junit",
version = FLINK_VERSION,
),
"org.apache.flink:flink-tests:%s" % FLINK_VERSION,
],
repositories = [
"https://jcenter.bintray.com/",
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)
load("#maven//:compat.bzl", "compat_repositories")
compat_repositories()
...
The testing maven install "group" is my try on figuring out how to get the needed Dependencies imported, since there is no explicit "type" and "scope" in Bazels maven syntax as far as i know.
The test BUILD files looks like this
load("#rules_java//java:defs.bzl", "java_test")
load("#rules_jvm_external//:specs.bzl", "maven")
load("#rules_jvm_external//:defs.bzl", "artifact", "maven_install")
java_test(
name = "some_module",
size = "medium",
srcs = ["DataOperatorTests.java"],
tags = [
"docker",
"integration",
],
test_class = "org.some.project.DataOperatorTests",
deps = [
"#maven//:com_google_protobuf_protobuf_java",
"#maven//:junit_junit_4_13",
"#maven//:org_apache_flink_flink_connector_kafka_0_11_2_11",
"#maven//:org_apache_flink_flink_core",
"#maven//:org_apache_flink_flink_java",
"#maven//:org_javatuples_javatuples",
"#maven//:org_mongodb_bson",
"#maven//:org_mongodb_mongodb_driver_core",
"#maven//:org_mongodb_mongodb_driver_reactivestreams",
"#maven//:org_testcontainers_kafka",
"#maven//:org_testcontainers_testcontainers",
"#maven//:org_apache_flink_flink_streaming_java_2_11",
"#testing//:org_apache_flink_flink_runtime_2_11_tests",
"#testing//:org_apache_flink_flink_streaming_java_2_11_tests",
"#testing//:org_apache_flink_flink_test_utils_junit",
"#testing//:org_apache_flink_flink_tests",
],
)
test_suite(name = "smoke",tags = ["-docker","-internal",],)
test_suite(name = "unit",tags = ["-internal","unit",],)
test_suite(name = "integration",tags = ["-internal","integration",],)
test_suite(name = "internal")
With the above setup the following Error does no longer occur - leaving it for reference
The Packages seem to exist but in the actual test BUILD file i get this error on the sync process.
Error:(5, 1) no such target '#testing//:org_apache_flink_flink_streaming_java_2_11': target 'org_apache_flink_flink_streaming_java_2_11' not declared in package '' defined by /home/user/.cache/bazel/_bazel_user/7b62e4e31c70ee640c6d33972433da28/external/testing/BUILD and referenced by '//core/src/test/java/org/some/project/some_module:some_module'
I solved the issue by myself. Adjusted the above Code to be a suitable solution.
To sum it up.
When a maven Repository is give like this:
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils-junit</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_2.11</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-runtime_2.11</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
The corresponding Bazel WORKSPACE file has to have entries like this:
load("#rules_jvm_external//:defs.bzl", "maven_install")
load("#rules_jvm_external//:defs.bzl", "artifact")
load("#rules_jvm_external//:specs.bzl", "maven")
maven_install(
...
artifacts = [
maven.artifact(
group = "org.apache.flink",
artifact = "flink-runtime_2.11",
version = FLINK_VERSION,
classifier = "tests",
packaging = "test-jar",
),
maven.artifact(
group = "org.apache.flink",
artifact = "flink-streaming-java_2.11",
version = FLINK_VERSION,
classifier = "tests",
packaging = "test-jar",
),
maven.artifact(
group = "org.apache.flink",
artifact = "flink-test-utils-junit",
version = FLINK_VERSION,
),
"org.apache.flink:flink-tests:%s" % FLINK_VERSION,
],
repositories = [
"https://jcenter.bintray.com/",
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)
The Detailed Dependencies explanation can be found here:
https://github.com/bazelbuild/rules_jvm_external#detailed-dependency-information-specifications
and here:
https://github.com/bazelbuild/rules_jvm_external/blob/master/docs/api.md#mavenartifact
To find the resulting targets for import in the Build files use like mentioned by #Jin
bazel query #maven//:all | grep flink_flink_streaming
In most cases the target might have just the suffix _tests
Here the necessary imports for the BUILD File:
load("#rules_jvm_external//:specs.bzl", "maven")
load("#rules_jvm_external//:defs.bzl", "artifact", "maven_install")
java_test(
name = "some_module",
size = "medium",
srcs = ["DataOperatorTests.java"],
tags = [
"docker",
"integration",
],
test_class = "org.some.project.DataOperatorTests",
deps = [
...
"#maven//:org_apache_flink_flink_runtime_2_11_tests",
"#maven//:org_apache_flink_flink_streaming_java_2_11_tests",
"#maven//:org_apache_flink_flink_test_utils_junit",
"#maven//:org_apache_flink_flink_tests",
],
)
The Harness files are part of the "flink-streaming-java_2.12" artifact with type test-jar.
So if you project code is using both the test and source library, then better to use a classifier for your test dependency.
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_2.12</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
<type>test-jar</type>
</dependency>
Check the External Libraries in intellij to see if you have 2 jars now, one for source and other for tests.
Related
Unable to build bazel - Getting error running bazel with gin package
I'm trying to add the gin package in the BUILD file. When I build the file I get the following error no such package '#com_github_gin_gonic_gin//go_default_library': The repository '#com_github_gin_gonic_gin' could not be resolved: Repository '#com_github_gin_gonic_gin' is not defined and referenced by load("#io_bazel_rules_go//go:def.bzl", "go_library") load("#bazel_gazelle//:def.bzl", "gazelle") package(default_visibility = ["//visibility:public"]) go_library( name = "", srcs = [""], importpath = "", visibility = ["//visibility:public"], deps = [ "#com_github_gin_gonic_gin//go_default_library", "#io_k8s_client_go//kubernetes", "#io_k8s_client_go//tools/clientcmd", "#io_k8s_client_go//util/homedir", ], )
In your workspace file try calling go_rules_dependencies() first and then load other dependencies with respect to gin packages.
cargo check fails to build actix-cors
I'm following the guides at https://docs.near.org/docs/tutorials/near-indexer to test out an indexer. However, when I run cargo check An error shows up when building actix-cors: Checking actix-cors v0.6.0-beta.2 (https://github.com/near/actix-extras.git?branch=actix-web-4-beta.6#eb38fbcc) error[E0053]: method `error_response` has an incompatible type for trait --> /<MY HOME DIR>/.cargo/git/checkouts/actix-extras-c37ac6c43c868d63/eb38fbc/actix-cors/src/error.rs:53:5 ... Looking at some actix issue here: https://github.com/actix/actix-web/issues/2185 I think it's due to something wrong in actix beta versioning. Is there a more stable version to use? My Cargo toml file looks like this: [package] name = "example-indexer" version = "0.1.0" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] near-indexer = { git = "https://github.com/nearprotocol/nearcore", rev="a668e4399655af513b0d90e0be694dad2448e6cd" } actix = "=0.11.0" openssl-probe = { version = "0.1.2" } tokio = { version = "1.1", features = ["sync"] } serde = { version = "1", features = [ "derive" ] } serde_json = "1.0.55"
no such target '#maven//:io_lettuce_lettuce_core': target 'io_lettuce_lettuce_core' not declared in package
I am trying to write a very simple example in kotlin to interact with redis. I want to use bazel to drive the build process. Here is the WORKSOPACE file workspace( name = "com_ahwkong_kotlin", managed_directories = {}, ) load("#bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") RULES_KOTLIN_VERSION = "legacy-1.4.0-rc3" RULES_KOTLIN_SHA = "da0e6e1543fcc79e93d4d93c3333378f3bd5d29e82c1bc2518de0dbe048e6598" http_archive( name = "io_bazel_rules_kotlin", urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/%s/rules_kotlin_release.tgz" % RULES_KOTLIN_VERSION], sha256 = RULES_KOTLIN_SHA, ) load("#io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains") kotlin_repositories() # if you want the default. Otherwise see custom kotlinc distribution below kt_register_toolchains() # to use the default toolchain, otherwise see toolchains below # maven RULES_JVM_EXTERNAL_TAG = "2.8" RULES_JVM_EXTERNAL_SHA = "79c9850690d7614ecdb72d68394f994fef7534b292c4867ce5e7dec0aa7bdfad" http_archive( name = "rules_jvm_external", strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, sha256 = RULES_JVM_EXTERNAL_SHA, url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, ) load("#rules_jvm_external//:defs.bzl", "maven_install") maven_install( artifacts = [ "com.google.code.findbugs:jsr305:1.3.9", "com.google.errorprone:error_prone_annotations:2.0.18", "com.google.j2objc:j2objc-annotations:1.1", ], repositories = [ "https://jcenter.bintray.com/", "https://repo1.maven.org/maven2", ], ) This is my BUILD file load("#io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_compiler_plugin", "kt_jvm_library", "kt_jvm_binary") kt_compiler_plugin( name = "open_for_testing_plugin", id = "org.jetbrains.kotlin.allopen", options = { "annotation": "plugin.allopen.OpenForTesting", }, deps = [ "#com_github_jetbrains_kotlin//:allopen-compiler-plugin", ], ) kt_jvm_library( name = "ex1_lib", srcs = glob(["ex1*/src/**/*.kt"]), deps = [ "#maven//:io_lettuce_lettuce_core", ] ) java_binary( name = "ex1", main_class = "ex1.App", srcs = glob(["ex1*/src/**/*.kt"]), visibility = ["//visibility:public"], runtime_deps = [":ex1_lib"], ) This is my kotlin file package ex1 import io.lettuce.core.RedisClient import io.lettuce.core.RedisReactiveCommandsImpl import io.lettuce.core.RedisURI import io.lettuce.core.api.StatefulRedisConnection import io.lettuce.core.api.reactive.RedisReactiveCommands import java.time.Duration class ConnectionFactory { // https://kotlinlang.org/docs/tutorials/kotlin-for-py/objects-and-companion-objects.html // If you need a function or a property to be tied to a class rather than to instances of it // (similar to #staticmethod in Python), you can declare it inside a companion object: companion object { fun createConnection(port: Int = 6380, host: String = "127.0.0.1"): RedisClient = RedisClient.create(RedisURI.builder() .withTimeout(Duration.ofMinutes(1)) .withHost(host) .withPort(port) .build()) } } Without the maven dependency I will not be able to compile the above code. Here is the error message: $ bazel build ex1 ERROR: /Users/antkong/dev/canva/kongakong-experiments.3.diagrams/tech_talk/kotlin/BUILD:26:1: no such target '#maven//:io_lettuce_lettuce_core': target 'io_lettuce_lettuce_core' not declared in package '' defined by /private/var/tmp/_bazel_antkong/3496a0772a2021d0f0b3c230bf912ab1/external/maven/BUILD and referenced by '//:ex1_lib' ERROR: Analysis of target '//:ex1' failed; build aborted: Analysis failed If the issue is "no such target '#maven//:io_lettuce_lettuce_core', how can I define this target?
I need to add this rule to the WORKSPACE maven_repositories = [ "https://repo.maven.apache.org/maven2/", "https://s3.amazonaws.com/maven.canva-build.com/release/", "https://github.com/getdyspatch/dyspatch-java-mvn/raw/master/releases/", ] maven_install( artifacts = [ "io.lettuce:lettuce-core:jar:5.3.4.RELEASE", ], repositories = maven_repositories, )
How to resolve the MSBI dependency error Cannot load class 'com.microsoft.sqlserver.jdbc.SQLServerDriver'?
I have maven based interface, I need to connect MSBI database and fetch the data into mule. I have added the required jar sqljdbc42.jar to build path. PFB is the MSBI connection configuration: <poll doc:name="Poll"> <schedulers:cron-scheduler expression="${msbi.poll.schedule.cdo}"/> <db:select config-ref="MSBI_Database_Configuration" streaming="true" fetchSize="1000" doc:name="MSBI Select Contact CDO data"> <db:parameterized-query><![CDATA[SELECT [Cstmr_Acct_Id] AS SAP_Account_ID1 ,[Accnt_Nm] AS CRM_Account_Name1 ,[Accnt_Type] AS APL_Account_Attributes___Account_Type1 ,[Cstmr_Sgmnt] AS CRM_Customer_Segment1 ,[Trnprttn_role] AS CRM_Transportation_Role1 ,CASE WHEN [Accnt_Stts]='A' THEN 'Active' WHEN [Accnt_Stts]='I' THEN 'Inactive' ELSE NULL END AS CRM_Account_Status1 ,[Rgn] AS Region1 ,[Rgn_desc] AS Region_Text1 ,[Clster] AS Cluster1 ,[Clster_desc] AS Cluster_Text1 ,[Dstrct] AS District1 ,[Dstrct_desc] AS District_Text1 ,[Cntry] AS Country1 ,[Cntry_desc] AS Country_Text1 ,[Brnch] AS Branch1 ,[Brnch_desc] AS Branch_Text1 ,[Trrtry] AS Territory1 ,[Trrtry_desc] AS Territory_Desc1 ,[New_BT_Cd] AS BT_Code1 ,[Lgcy_BT_Cd] AS Legacy_BTCode1 ,[Last_Update_Dt] AS LAST_UPDATE_Date1 FROM [dbo].[vw_elqa_CRM_Accnt_Sales_Hierarchy] WHERE ( CAST(Last_Update_Dt AS date) >= CAST(GETDATE() AS date) OR CAST(Last_Update_Dt AS date) >= CAST(#[server.systemProperties['mule.env']=='dev'?server.systemProperties['msbi.debug.csr.query.filterDate']:'2100-01-01'] AS date) ) AND Cstmr_Acct_Id IS NOT NULL]]></db:parameterized-query> </db:select> </poll> When i run the interface it is deployed successfully but while triggering the MSBI throwing below error ERROR 2017-10-30 20:58:26,792 [nol-integration-v1.3-polling://MSBItoEloquaContactCDODataUpdate/541182371_Worker-1] org.mule.exception.DefaultSystemExceptionStrategy: ******************************************************************************** Message : org.mule.module.db.internal.domain.connection.ConnectionCreationException: Error trying to load driver: com.microsoft.sqlserver.jdbc.SQLServerDriver : Cannot load class 'com.microsoft.sqlserver.jdbc.SQLServerDriver' (java.sql.SQLException) Element : /MSBI_Database_Configuration # app:bulk-integration.xml:26 (Generic Database Configuration) -------------------------------------------------------------------------------- Root Exception stack trace: java.sql.SQLException: Error trying to load driver: com.microsoft.sqlserver.jdbc.SQLServerDriver : Cannot load class 'com.microsoft.sqlserver.jdbc.SQLServerDriver' at org.enhydra.jdbc.standard.StandardDataSource.getConnection(StandardDataSource.java:184) at org.enhydra.jdbc.standard.StandardDataSource.getConnection(StandardDataSource.java:144) at org.mule.module.db.internal.domain.connection.SimpleConnectionFactory.doCreateConnection(SimpleConnectionFactory.java:30) at org.mule.module.db.internal.domain.connection.AbstractConnectionFactory.create(AbstractConnectionFactory.java:23) at org.mule.module.db.internal.domain.connection.TransactionalDbConnectionFactory.createDataSourceConnection(TransactionalDbConnectionFactory.java:84) at org.mule.module.db.internal.domain.connection.TransactionalDbConnectionFactory.createConnection(TransactionalDbConnectionFactory.java:53) at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.process(AbstractDbMessageProcessor.java:72) at org.mule.transport.polling.MessageProcessorPollingMessageReceiver$1.process(MessageProcessorPollingMessageReceiver.java:165) at org.mule.transport.polling.MessageProcessorPollingMessageReceiver$1.process(MessageProcessorPollingMessageReceiver.java:149) at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16) at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35) at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22) at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30) at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14) at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67) at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44) at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50) at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40) at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41) at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48) at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28) at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13) at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110) at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30) at org.mule.transport.polling.MessageProcessorPollingMessageReceiver.pollWith(MessageProcessorPollingMessageReceiver.java:148) at org.mule.transport.polling.MessageProcessorPollingMessageReceiver.poll(MessageProcessorPollingMessageReceiver.java:139) at org.mule.transport.AbstractPollingMessageReceiver.performPoll(AbstractPollingMessageReceiver.java:216) at org.mule.transport.PollingReceiverWorker.poll(PollingReceiverWorker.java:84) at org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:48) at org.mule.modules.schedulers.cron.CronJob.execute(CronJob.java:33) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) Getting the below error after adding dependency ERROR ******************************************************************************** Message : Response code 500 mapped as failure. Payload : org.glassfish.grizzly.utils.BufferInputStream#cb5d5af Payload Type : org.mule.module.db.internal.result.resultset.ResultSetIterator Element : /MSBItoEloquaContactCDODataUpdate/input/0/0/EloquaLookupContactsCDOBulk/subprocessors/1/EloquaLookupFields/subprocessors/0/0/1/2 # nol-integration-v1:bulk-integration.xml:92 (Eloqua Get CDO fields) Element XML : <http:request config-ref="Eloqua_Bulk_API" path="/customObjects/{customObjectId}/fields" method="GET" doc:name="Eloqua Get CDO fields"> <http:request-builder> <http:uri-param paramName="customObjectId" value="#[flowVars.cdo.id]"></http:uri-param> </http:request-builder> </http:request> -------------------------------------------------------------------------------- Root Exception stack trace: org.mule.module.http.internal.request.ResponseValidatorException: Response code 500 mapped as failure. at org.mule.module.http.internal.request.SuccessStatusCodeValidator.validate(SuccessStatusCodeValidator.java:37) at org.mule.module.http.internal.request.DefaultHttpRequester.validateResponse(DefaultHttpRequester.java:413) at org.mule.module.http.internal.request.DefaultHttpRequester.innerProcess(DefaultHttpRequester.java:401) at org.mule.module.http.internal.request.DefaultHttpRequester.processBlocking(DefaultHttpRequester.java:221) at org.mule.processor.AbstractNonBlockingMessageProcessor.process(AbstractNonBlockingMessageProcessor.java:43)
It seems sqljdbc4.jar is not found at runtime. If you are using Maven build(pom.xml) Add the dependency to the pom.xml <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc4</artifactId> <version>4.0</version> </dependency> Note :Just for information- If any jar is not in Maven repo you are referring in your pom.xml , you need to add it yourself to your local repository/company repository. To add to your local repository, 1.Please check if you are having correct version of driver jar. 2.Execute below to add it to local Maven repository mvn install:install-file -Dfile=<jar_name>.jar -DgroupId=<group_id_of_jar> -DartifactId=<artifact_id_of_jar> -Dversion=<version_of_jar> -Dpackaging=jar
I'm using Mulesoft, and using the answer above and #Mahesh_Loya's comment, I was able to get this working. Add dependency to pom.xml, just before closing </dependencies> tag: <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc4</artifactId> <version>4.0</version> </dependency> Add the Clojars repo to pom.xml, just before closing </repositories> tag <repository> <id>Clojars</id> <name>Clojars</name> <url>http://clojars.org/repo/</url> <layout>default</layout> </repository> Save pom.xml and rerun Maven, and all should be working. Happy times.
map reduce word count example
I want to run a simple example of word count with map reduce. but I have this problem and have no idea how to solve it. Exception in thread "main" java.lang.VerifyError: Bad type on operand stack Exception Details: Location: org/apache/hadoop/mapred/JobTrackerInstrumentation.create(Lorg/apache/hadoop/mapred/JobTracker;Lorg/apache/hadoop/mapred/JobConf;)Lorg/apache/hadoop/mapred/JobTrackerInstrumentation; #5: invokestatic Reason: Type 'org/apache/hadoop/metrics2/lib/DefaultMetricsSystem' (current frame, stack[2]) is not assignable to 'org/apache/hadoop/metrics2/MetricsSystem' Current Frame: bci: #5 flags: { } locals: { 'org/apache/hadoop/mapred/JobTracker', 'org/apache/hadoop/mapred/JobConf' } stack: { 'org/apache/hadoop/mapred/JobTracker', 'org/apache/hadoop/mapred/JobConf', 'org/apache/hadoop/metrics2/lib/DefaultMetricsSystem' } Bytecode: 0000000: 2a2b b200 03b8 0004 b0
I had the same problem and it got solved by removing some unneeded references in Maven (hadoop-common and hadoop-hdfs). I'm using hadoop 2.2.0 from Windows, connecting to Linux hadoop single-node cluster.
the below order for dependencies solved the problem for me. hadoop-core 1.2.1 hadoop-common 2.6.0
The below dependencies worked for me <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-core</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>2.6.0</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-client</artifactId> <version>2.6.0</version> </dependency> </dependencies>