CAMEL - SALESFORCE Bulk API - set API version - java

i'm creating a new Job with:
<to id="_slf_send2SC_to_salesforce_1" uri="salesforce:createJob"/>
in camelconfig.
After that, I created a new instance:
JobInfo jobInfo = new JobInfo();
jobInfo.setOperation(OperationEnum.UPSERT);
jobInfo.setContentType(ContentType.CSV);
jobInfo.setObject(objName);
jobInfo.setExternalIdFieldName(externalId);
//Set API Version
jobInfo.setApiVersion("43.0");
But it seems that it doesn't work: api version on salesforce is always 34 (default version).
Could you help me?
Thanks,
Emanuele

I solved in AnypointStudio.ini the variable vm. It should be:
-vm
C:\progra~1\Java\jdk1.8.0_144\bin\
(without java.exe)
By
Emanuele

If you are using springboot, you can set the API version using the below property
camel.component.salesforce.api-version
Example:
camel.component.salesforce.api-version=38.0

Related

Corba call to Register_Initial_Reference Not Found when migrating From Java 8 to Java 11

I am upgrading a legacy application from Java 8 to Java 11 (Oracle Version) and having issue while getting the corbaloc reference.
I have read below
articles here and here that specifies that CORBA support is removed form JAVA 11 and with the help of Glassfish Corba I can use the packages again.
The issue I am facing is with below function call
((com.sun.corba.se.spi.orb.ORB) orb.orb()).register_initial_reference(idStr, ref);
In Eclipse the Error is ORB cannot be resolved to a type.
As I know we should not use any package related to sun but this is old code and not sure about the replacement.
I have changed the package from com.sun.corba.se.spi.orb.ORB to org.omg.CORBA.ORB but the method register_initial_reference(idStr, ref) is not found.
I am not sure what needs to be changed or any example that will help to get the possible alternate change. Any guide or help is highly appreciated. Even I have almost NO idea about CORBA and very less examples are available.
Below is the function that starts the service
final byte[] id = "\u00ffPNS_Service\u0000PNS_Study".getBytes();
final String idStr = new String(id);
final Policy[] policies = new Policy[] {
root.create_lifespan_policy(LifespanPolicyValue.PERSISTENT) };
final POA poa = root.create_POA("PNS_Service",root.the_POAManager(),policies);
poa.the_POAManager().activate();
poa.activate_object(studyService);
final org.omg.CORBA.Object ref = poa.servant_to_reference(studyService);
((com.sun.corba.se.spi.orb.ORB) orb.orb()).register_initial_reference(idStr , ref);```

Issue in addPlugInSingleRowFunction upgrading Esper version from 5.3 to 8.3

In our existing application we are using Esper Version 5.3.
We have added few addPlugInSingleRowFunction() to use it in EPL as below --
final Configuration cepConfiguration = new Configuration();
cepConfiguration.addPlugInSingleRowFunction("toNumber", Double.class.getName(), "parseDouble");
cepConfiguration.addPlugInSingleRowFunction("toBoolean", Boolean.class.getName(), "parseBoolean");
This was working fine in 5.3 version.
Post upgrading to 8.3 above code changed as per Esper documentation --
cepConfiguration.getCompiler().addPlugInSingleRowFunction("toNumber", Double.class.getName(), "parseDouble");
cepConfiguration.getCompiler().addPlugInSingleRowFunction("toBoolean", Boolean.class.getName(), "parseBoolean");
But once the sendEventBean() method is called to send a Event to runtime we are seeing below exception every time.
Surprisingly events are getting matched as per the statements present in runtime even if below exception are coming. Though we are not sure whether some events are not matching or not.
Can someone please help on this?
applog.cls=com.espertech.esper.common.internal.epl.expression.dot.core.ExprDotNodeForgeStaticMethodEval,applog.mthd=staticMethodEvalHandleInvocationException,applog.line=228,applog.msg=Invocation exception when invoking method 'parseDouble' of class 'java.lang.Double' passing parameters [null] for statement 'stmt-0': NullPointerException : null,exc.stack=java.lang.NullPointerException\n\tat sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1838)\n\tat sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)\n\tat java.lang.Double.parseDouble(Double.java:538)\n\tat generated.StatementAIFactoryProvider_a4bd241445010f45474e4598e34521ca1b2836db_stmt450.m8(StatementAIFactoryProvider_a4bd241445010f45474e4598e34521ca1b2836db_stmt450.java:161)\n\tat generated.StatementAIFactoryProvider_a4bd241445010f45474e4598e34521ca1b2836db_stmt450$2.get(ANONYMOUS.java:148)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.FilterParamIndexEquals.matchEvent(FilterParamIndexEquals.java:32)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.FilterHandleSetNode.matchEvent(FilterHandleSetNode.java:100)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.EventTypeIndex.matchType(EventTypeIndex.java:178)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.EventTypeIndex.matchEvent(EventTypeIndex.java:124)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.FilterServiceBase.retryableMatchEvent(FilterServiceBase.java:179)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.FilterServiceBase.evaluateInternal(FilterServiceBase.java:96)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.FilterServiceLockCoarse.evaluate(FilterServiceLockCoarse.java:52)\n\tat com.espertech.esper.runtime.internal.kernel.service.EPEventServiceImpl.processMatches(EPEventServiceImpl.java:610)\n\tat com.espertech.esper.runtime.internal.kernel.service.EPEventServiceImpl.processWrappedEvent(EPEventServiceImpl.java:450)\n\tat com.espertech.esper.runtime.internal.kernel.thread.InboundUnitSendEvent.run(InboundUnitSendEvent.java:43)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)
You could turn on compiler logging (config.getCompiler().getLogging().setEnableCode(true);) and make sure you have INFO level logging. You can inspect "StatementAIFactoryProvider_a4bd241445010f45474e4598e34521ca1b2836db_stmt450.m8" at line 161 to see what the problem is. Sounds like a null value gets passed to Double.parseDouble. But since I don't have the complete code its hard to say.

com.jayway.jsonpath.InvalidPathException: Invalid path $myVar.id

In my mockito test case i'm using the below snippet ,
this.mockMvc.perform(get(myURL + myId).param("mock", "false").param("filter","false")).andDo(print())
.andExpect(status().isOk()).andExpect(jsonPath("$myVar.id", is(SOME_ID)));
at this line i'm getting the below error ,
com.jayway.jsonpath.InvalidPathException: Invalid path $myVar.id
at com.jayway.jsonpath.internal.PathCompiler.compile(PathCompiler.java:76)
at com.jayway.jsonpath.JsonPath.<init>(JsonPath.java:98)
at com.jayway.jsonpath.JsonPath.compile(JsonPath.java:374)
at org.springframework.test.util.JsonPathExpectationsHelper.<init>(JsonPathExpectationsHelper.java:62)
at org.springframework.test.web.servlet.result.JsonPathResultMatchers.<init>(JsonPathResultMatchers.java:63)
at org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath(MockMvcResultMatchers.java:202)
at com.mypackage.MyTest.testMyMetod(MyTest.java:232)
and FYI,
i'm using the json-path and json-path-assert as a dependency with below version
1.1.0
and i tried the latest version 2.4.0 and also the very old version 0.8.1
But i got the same issue.
Help will be really appreciated.
It is look like path should be "$.myVar.id" or "myVar.id". According to source of PathCompiler they are equal.
I have to use below pattern matcher in jsonPath,
.andExpect(jsonPath("$['myVar'].id", is(SOME_ID)));

Neo4j REST API Java binding Uniqueness deprecated

I want to use Uniqueness for my Traversal.
Based on this tutorial, I'm using the following code :
GraphDatabaseService database = new RestGraphDatabase("http://localhost:7474/db/data");
TraversalDescription td = database.traversalDescription().uniqueness(Uniqueness.RELATIONSHIP_GLOBAL);
This code gave me the following error :
Exception in thread "main" java.lang.UnsupportedOperationException: Only values of class org.neo4j.kernel.Uniqueness are supported
at org.neo4j.rest.graphdb.traversal.RestTraversal.restify(RestTraversal.java:63)
at org.neo4j.rest.graphdb.traversal.RestTraversal.uniqueness(RestTraversal.java:54)
at org.neo4j.rest.graphdb.traversal.RestTraversal.uniqueness(RestTraversal.java:50)
at org.neo4j.rest.graphdb.traversal.RestTraversal.uniqueness(RestTraversal.java:37)
I already had to change the Traversal.description() to database.traversalDescription() because of deprecated but now I face the same problem for Uniqueness. In my example I used org.neo4j.graphdb.traversal.Uniquess because org.neo4j.kernel.Uniqueness is deprecated...
When using the package mentionned by the error I have a NullPointerException during the traverse() method, with no stack trace.
I'm using :
REST API : neo4j-rest-graphdb-2.0.0-M06.jar
Neo4j : neo4j-desktop-2.0.0.jar
Best regards.
There have been API changes in Neo4j 2.0 which are not in neo4j-rest-graphdb-2.0.0-M06
If you pull the latest neo4j-rest-graphdb github repo and build it locally it should work against: neo4j-rest-graphdb-2.0.0-SNAPSHOT

getting rid of Hbase configuration deprecated warning

I'm getting this error message in my log file WARN hbase.HBaseConfiguration: instantiating HBaseConfiguration() is deprecated. Please use HBaseConfiguration#create() to construct a plain Configuration how can I get rid of this?
My class extends Configured.class , and I'm instantiating configuration like this :
HBaseConfiguration hBaseConfiguration = new HBaseConfiguration(getConf());
Did anyone have the similar issue? how to fix it ?
EDIT
How can I get this version of HbaseConfiguration :
http://hbase.apache.org/docs/r0.89.20100726/xref/org/apache/hadoop/hbase/HBaseConfiguration.html
I downloaded the latest version from hbase web site(version 0.20.6) but the class is different from this one, its missing create() method and some other too.
Quoting the Javadoc:
Instantinating HBaseConfiguration() is
deprecated. Please use
HBaseConfiguration#create(conf) to
construct a plain Configuration
Instead of doing:
HBaseConfiguration hBaseConfiguration = new HBaseConfiguration(getConf());
You should do:
Configuration configuration = HBaseConfiguration.create(getConf());

Categories

Resources