Is quartz from camel 3 really the same thing as quartz2 from camel 2? - apache-camel

I am trying to upgrade camel from 2 to 3. I had previously had camel-quartz2 from camel 2 included in my pom.xml, but because quartz2 is apparently called quartz now, I have added this to my pom.xml:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-quartz</artifactId>
<version>3.17.0</version>
</dependency>
I removed quartz2.
The problem is that I now receive this error.
Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'startDelayedSeconds' of bean class [org.apache.camel.component.quartz.QuartzComponent]: Bean property 'startDelayedSeconds' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
I looked and saw that the the StartDelayedSeconds method is not part of quartz as it was with quartz2. Does this mean that they are really not the same? If this is the case, then why is the newest version of quartz2 so far behind the newest version of quartz. Is there some sort of workaround that I could do, or some part of quartz that I should use?

From the Came 3 migration guide:
The quartz2 component has been renamed to quartz, and it’s corresponding component package from org.apache.camel.component.quartz2 to org.apache.camel.component.quartz. The supported scheme is now quartz.
Source: https://camel.apache.org/manual/camel-3-migration-guide.html
When I run command mvn dependency:tree with project that contains camel-quartz dependency I get the following:
[INFO] +- org.apache.camel:camel-quartz:jar:3.4.4:compile
[INFO] | +- org.quartz-scheduler:quartz:jar:2.3.2:compile
[INFO] | | +- com.mchange:mchange-commons-java:jar:0.2.15:compile
[INFO] | | \- com.zaxxer:HikariCP-java7:jar:2.4.13:compile
[INFO] | \- com.mchange:c3p0:jar:0.9.5.5:compile
Based on that I would say its safe to assume that camel-quartz in camel 3.x uses quartz scheduler version 2.x. The option StartDelayedSeconds has likely been moved or changed during one of the major or minor version changes.
A lot of components have gone through some changes to use more up to date libraries and to make them easier to use or just consistent with other components.
[Edit] Regarding the StartDelayedSeconds option found this from one of the many Apache Camel upgrade guides.
UPGRADING CAMEL 3.14 TO 3.15
Removed the option startDelaySeconds as this does not work correctly and causes problems if in use.
Source: Upgrading camel 3.14 TO 3.15

Related

Apache CXF Plugin 3.3.12 & 3.4.5 not working under Java 11?

I am trying to update my tool chain from Java 8 to 11.
Doing so I run into issues compiling WSDLs to java using the Apache CXF maven plugin.
I tried with the latest two available versions:
org.apache.cxf:cxf-codegen-plugin:3.3.12 and
org.apache.cxf:cxf-codegen-plugin:3.4.5
When I run the wsdl2java goal (phase generate-sources) it first seems to read all the WSDLs and XSDs ok but at the end it invariably ends in compile errors (see below). So it seems as if it generates code that can't be compiled under Java 11!?!
What dependencies do I need to add? Or what other steps are necessary to get this working again?
Error:
...
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/Projects/KStA_ZH_ZHQuest/code/application/zhquest-sam-web-service/target/generated-sources/cxf/ch/adnovum/nevisidm/ws/services/v1_37/AdminServicePortImpl.java:[10,17] package javax.jws does not exist
...
[ERROR] /D:/Projects/KStA_ZH_ZHQuest/code/application/zhquest-sam-web-service/target/generated-sources/cxf/ch/adnovum/nevisidm/ws/services/v1_37/AdminServicePortImpl.java:[14,22] package javax.jws.soap does not exist
[ERROR] /D:/Projects/KStA_ZH_ZHQuest/code/application/zhquest-sam-web-service/target/generated-sources/cxf/ch/adnovum/nevisidm/ws/services/v1_37/AdminServicePortImpl.java:[15,33] package javax.xml.bind.annotation does not exist
Note: I am aware of these threads: CXF codegen maven plugin doesn't work OpenJDK 11 and What dependencies do I need to run Apache CXF with Spring Boot on Java 11? but the dependencies suggested in either did not fix my issue.

Flink 1.4 throws errors

just trying to migrate from flink 1.3 into 1.4 and getting this exception on
linux machine:
(not reproducing at windows).
i've import this package also:
// https://mvnrepository.com/artifact/org.apache.flink/flink-shaded-hadoop2
compile group: 'org.apache.flink', name: 'flink-shaded-hadoop2', version: '1.4.0'
any help?
at flink console:
TriggerWindow(TumblingProcessingTimeWindows(10000), ReducingStateDescriptor{serializer=org.apache.flink.api.java.typeutils.runtime.TupleSerializer#cb6c5dba, reduceFunction=com.clicktale.reducers.MetricsReducer#4e406694}, ProcessingTimeTrigger(), WindowedStream.reduce(WindowedStream.java:241)) -> Sink: Unnamed (1/1)
java.util.ServiceConfigurationError: org.apache.hadoop.fs.FileSystem: Provider org.apache.hadoop.fs.LocalFileSystem not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at org.apache.hadoop.fs.FileSystem.loadFileSystems(FileSystem.java:2364)
at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2375)
at org.apache.flink.runtime.fs.hdfs.HadoopFsFactory.create(HadoopFsFactory.java:99)
at org.apache.flink.core.fs.FileSystem.getUnguardedFileSystem(FileSystem.java:401)
at org.apache.flink.streaming.connectors.fs.bucketing.BucketingSink.createHadoopFileSystem(BucketingSink.java:1154)
at org.apache.flink.streaming.connectors.fs.bucketing.BucketingSink.initFileSystem(BucketingSink.java:411)
at org.apache.flink.streaming.connectors.fs.bucketing.BucketingSink.initializeState(BucketingSink.java:355)
at org.apache.flink.streaming.util.functions.StreamingFunctionUtils.tryRestoreFunction(StreamingFunctionUtils.java:178)
at org.apache.flink.streaming.util.functions.StreamingFunctionUtils.restoreFunctionState(StreamingFunctionUtils.java:160)
at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.initializeState(AbstractUdfStreamOperator.java:96)
at org.apache.flink.streaming.api.operators.AbstractStreamOperator.initializeState(AbstractStreamOperator.java:259)
at org.apache.flink.streaming.runtime.tasks.StreamTask.initializeOperators(StreamTask.java:694)
at org.apache.flink.streaming.runtime.tasks.StreamTask.initializeState(StreamTask.java:682)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:253)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:718)
at java.lang.Thread.run(Thread.java:748)
I faced a similar (not specifically this, but dependencies related) issues migrating from 1.3 to 1.4.
In my case, I had to re-generate a fresh POM file using maven archetype and then add the needed dependencies one by one.
See Java Quickstart or Scala Quickstart.
Reason being that there has been a major rework on dependency structure. See Release notes for more information.
Note that Flink 1.4 will load any Hadoop jars found via the "hadoop classpath" shell command, and these will be first on the classpath. So if you have an incompatible version of Hadoop installed that the "hadoop" command points at, you can run into this kind of problem.

Issue installing hazelcast 3.6.5 in Jboss Fuse 6.2.1 (Fabric Managed)

I'm trying to install hazelcast-all-3.6.5 version in Jboss Fuse 6.2.1 server (Fabric Managed). Upon installation it throws the following error.
Unable to update agent org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root]
osgi.identity; osgi.identity=appid1-hazelcast; type=karaf.feature; version=0
[caused by: Unable to resolve appid1-hazelcast/3.0.1.release: missing requirement [appid1-hazelcast/3.0.1.release]
osgi.identity; osgi.identity=com.hazelcast; type=osgi.bundle; version="[3.6.5,3.6.5]"; resolution:=mandatory
[caused by: Unable to resolve com.hazelcast/3.6.5: missing requirement [com.hazelcast/3.6.5]
osgi.wiring.package; filter:="(osgi.wiring.package=sun.misc)"]]
Tried installing fragment bundle to expose sun.misc package but got the following error "Error: Resource has no uri".
Fragment bundle : mvn:com.diffplug.osgi/com.diffplug.osgi.extension.sun.misc/0.0.0
2017-03-16 18:02:22,814 | INFO | 2.0.1-1-thread-1 | Agent | 72 - io.fabric8.fabric-agent - 1.2.0.redhat-621166 | null
2017-03-16 18:02:22,814 | ERROR | 2.0.1-1-thread-1 | DeploymentAgent | 72 - io.fabric8.fabric-agent - 1.2.0.redhat-621166 | Unable to update agent
java.lang.IllegalStateException: Resource has no uri
at io.fabric8.agent.service.Deployer.getBundleInputStream(Deployer.java:1466)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
at io.fabric8.agent.service.Deployer.deploy(Deployer.java:812)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
at io.fabric8.agent.service.Agent.provision(Agent.java:366)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
at io.fabric8.agent.service.Agent.provision(Agent.java:199)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
at io.fabric8.agent.DeploymentAgent.doUpdate(DeploymentAgent.java:733)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
at io.fabric8.agent.DeploymentAgent$4.run(DeploymentAgent.java:289)[72:io.fabric8.fabric-agent:1.2.0.redhat-621166]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_55]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_55]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_55]
Note: The same approach works fine in Fuse 6.1.0 version (both standalone and fabric).
You need to activate access to sun.misc.Unsafe package in jboss. Normally the OSGi framework has some configuration where you can enable packages from the system classloader into bundles (boot class delegation). Not sure though how it exactly works in fabric8 but this older post fixed it in the past, guess the config is still the same: https://developer.jboss.org/message/884503#884503
Initially I have appended sun.misc package to "org.osgi.framework.system.packages.extra" property in etc/config.properties file, but this didn't solve the issue. (This should work 90% of the case) .
Later figured out that there was one another property named "org.osgi.framework.system.packages.extra" present in /etc/custom.properties file, adding sun.misc package to /etc/custom.properties file fixed the issue.
# Branding
org.osgi.framework.system.packages.extra = org.apache.karaf.branding,com.sun.xml.bind.v2.model.core,sun.misc

Upgrade Camel on Servicemix

I've version of servicemix: 4.3.1-fuse-03.01 with Camel 2.6.0-fuse-03-01. I would like to upgrade Camel to version 2.8.0. Is it any easy and SAFE way to do this without upgrading whole Servicemix?
I upgraded the camel in serviceMix 7.0.0.M2 as follows. Related to your ServiceMix version, commands may be vary.
feature:feature:repo-list
you will get list of available repo-urls as an example
standard-4.0.5 |
mvn:org.apache.karaf.features/standard/4.0.5/xml/features
jclouds-1.9.1 |
mvn:org.apache.jclouds.karaf/jclouds-karaf/1.9.1/xml/features
camel-2.16.3 |
mvn:org.apache.camel.karaf/apache-camel/2.16.3/xml/features
feature:repo-add [upgraded_camel_repo_url]
As an example
feature:repo-add mvn:org.apache.camel.karaf/apache-camel/3.16.3/xml/features
feature:feature:repo-list
Should display newly added repo url
feature:list
Should display the upgraded camel version
feature:install [upgraded_camel_name with version]
As an example feature:install camel/2.16.3
Refer http://www.andrejkoelewijn.com/blog/2010/06/15/upgrade-apache-camel-in-servicemix-to-version-2-3-0/ for older servicemix versions

xmlBeans dependancy in Fuse source ESB - how to resolve?

We are trying to transform data coming into a route from java objects to XML. For this we need xmlBeans and there is a dependancy on DataFormatResolver.
When we try to deploy the project, the package does not start, the status shows as GracePeriod.
In the error log we get the following message:
11:00:24,210 | ERROR | rint Extender: 1 | BlueprintContainerImpl
| 10 - org.apache.aries.blueprint - 0.3.1.fuse-70-097
| Unable to start blueprint container for bundle POC-3.0 due to
unresolved dependencies (&(dataformat=xmlBeans)
(objectClass=org.apache.camel.spi.DataFormatResolver))
We have tried to add this class in the POM file as a dependancy, but there is a duplicate class within Fuse!
Any ideas please?
You may have to repackage the jars to remove the duplicate classes. We've had to do this with the Tika jar since it included many dependencies that were stale, including XmlBeans, which conflicted with our classpath.
You need to install the camel-xmlbeans feature first.
In the Fuse ESB shell you can type
features:install camel-xmlbeans
And then after this has been installed, you can install and start your bundle.
I realize this is old, but Claus' answer is correct and should be accepted. As an addendum, note that you will probably want to create a <feature> (or several) for your business logic, and then make a top-level <feature> that is dependent on all. Something like:
(features.xml)
...
<feature name="com.yourbusiness::Application_Name">
...
<feature>camel-xmlbeans</feature>
<feature>com.yourbusiness::feature_one</feature>
<feature>com.yourbusiness::feature_two</feature>
...
</feature>
<feature name="com.yourbusiness::feature_one">
...
</feature>
<feature name="com.yourbusiness::feature_two">
...
</feature>
...
hope that provides some additional insight.
Cheers,
Hans

Resources