NullPointerException while using oteleporter with config file - orientdb

I am trying to import tables from RDBMS with a JSON config file which stated the edge relationship. But when I am trying to run the command, it throws a NullPointerException.
Command -
oteleporter.bat -jdriver mysql -jurl jdbc:mysql://localhost:3306/hive_catalog_test_db -juser root -jpasswd root -ourl plocal:C:\Users\ME\desktop\OrientDB\orientdb-community-importers-2.2.27\databases\HiveCatalog_D02_TeleTest -s naive -nr java -v 1 -include "tbls,columns_v2" -conf "C:\Users\ME\desktop\Catalog_POC\Inheritance_and_edge_loaders\migration-config.json"
Exception -
Exception in thread "main" java.lang.NullPointerException
at com.orientechnologies.teleporter.context.OTeleporterContext.printExceptionMessage(OTeleporterContext.java:152)
at com.orientechnologies.teleporter.util.OMigrationConfigManager.loadMigrationConfigFromFile(OMigrationConfigManager.java:64)
at com.orientechnologies.teleporter.main.OTeleporter.execute(OTeleporter.java:250)
at com.orientechnologies.teleporter.main.OTeleporter.main(OTeleporter.java:219)
However, when I am running the command without the config attribute, it is executing fine.
Sample JSON -
{
"edges": [
{
"HasColumns": {
"mapping": {
"fromTable": "Tbls",
"fromColumns": ["tbId"],
"toTable": "ColumnsV2",
"toColumns": ["cdId"],
"direction": "direct"
}
}
}
]
}

There's something wrong with your json config file of course. Maybe the path is wrong?
By the way, you can enjoy a new visual tool in order to build your custom configuration. You can find it in the server management area of Studio.
Here is the doc link:
https://orientdb.com/docs/2.2/Studio-Teleporter.html
Good luck!

Related

How to copy specific headers in Soong

How can I extract specific files in Soong to use as headers?
I was recently writing a blueprint (Android.bp) file for paho-mqtt-c. My consumers require MQTTClient.h which paho-mqtt-c stores in src/ - what I would consider a "private" location. Reading their CMakeLists.txt file, it actually installs this and some other headers to include/.
As far as I can tell, Soong doesn't have this concept of installing so it seems like I could export_include_dirs the src directory - which seems wrong, or use a cc_genrule to copy these headers elsewhere.
But that's where I hit another issue: I can't seem to figure out how to create a cc_genrule that takes n inputs and writes n outputs (n-to-n). i.e.
cc_genrule {
name: "paho_public_headers",
cmd: "cp $(in) $(out)",
srcs: [ "src/MQTTAsync.h", "src/MQTTClient.h", "src/MQTTClientPersistence.h", "src/MQTTLogLevels.h" ]
out: [ "public/MQTTAsync.h", "public/MQTTClient.h", "public/MQTTClientPersistence.h", "public/MQTTLogLevels.h" ],
}
results in the failed command cp <all-inputs> <all-outputs>, rather than what I wanted which would be closer to iterating the command over each input/output pairs.
My solution was simply to write four cc_genrules, but that doesn't seem great either.
Is there a better way? (ideally without writing a custom tool)
The solution was to use gensrcs with a shard_size of 1.
For example:
gensrcs {
name: "paho_public_headers",
cmd: "mkdir -p $(genDir) && cat $(in) > $(out)",
srcs: [":paho_mqtt_c_header_files"],
output_extension: "h",
shard_size: 1,
export_include_dirs: ["src"],
}
The export_include_dirs is important, as with gensrcs there is little control over the output filename other than the extension, so it's easiest to keep the directory structure $(in) on the $(out) files.

Code Runner does not work for Python in VsCode

I can run python files in cmd promt and Vscode terminal (cmd prompt). When I try to run any programme with Code runner ("code-runner.runInTerminal": false), I get the following error:
[Running] python "c:\Users\MY PATH INCLUDING WHITESPACE\hello_world.py"
Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640
Here are the user settings (settings.json) I have tried:
"code-runner.executorMap": {
"python": "python",
},
"code-runner.executorMap": {
"python": "$pythonPath $fullFileName",
},
"code-runner.executorMap": {
"python": "$pythonPath -u $fullFileName",
},
..but I always get the same error.
It seems like the problem could be related to code runner, but could have something to do with the setup of python on my machine.
It could potentially have something to do with the fact I have two python files for the location of python.exe:
(base) C:\>where python
C:\Users\<user_name>\AppData\Local\Continuum\anaconda3\python.exe
C:\Users\<user_name>\AppData\Local\Microsoft\WindowsApps\python.exe
This is the only difference I can think of to another machine where this actually works, but can't be sure.
Any ideas what the issue could be?
maybe try the following:
Change the executormap to:
"code-runner.executorMap": {
"python": "\"$pythonPath\" $fullFileName",
}
Also you could try to give a concrete python path, maybe create a venv and try there:
"python.pythonPath": "venv/bin/python"
If your directory tree has spaces - do this:
"code-runner.executorMap": {
"python": "\"$pythonPath\" -u $fullFileName",
}
This is in the case were the "python.pythonPath": "C:\Users\Documents and Settings\appdata\python\code\something something\script.py"
Spaces in the directory structure will abort the script and you'll get a response something like:
"C:\Users\Documents is not a valid directory."
So you need the escape character like someone above explained.

Kafka connect worker missing AbstractConfig and AvroConverterConfig classes

I am trying to use a kafka connect JDBC sink connector with avro. But when i try to start the connector i keep getting the two following errors :
java.lang.NoClassDefFoundError: io/confluent/connect/avro/AvroConverterConfig
and
java.lang.NoClassDefFoundError: io/confluent/common/config/AbstractConfig.
I am a little but confused here because my plugin path is /app/confluent-5.0.0/share/java
confluent-5.0.0/share/java
And we can see the jar corresponding to the missing class is there.
Anyone has an idea about what is causing this missing class ?
Thanks a lot !
basically i have just pulled the binaries for confluent-5.0.0 from confluent, i have a custom script getting the env variable and setting them to the worker variables like that :
if [ "$1" = 'bash' ]; then
exec "$#"
else
if [ -z "$KAFKA_CONNECT_BOOTSTRAP_SERVERS" ]; then
export KAFKA_CONNECT_BOOTSTRAP_SERVERS="kafka:9092"
fi
if [ -z "$KAFKA_CONNECT_GROUP_ID" ]; then
export KAFKA_CONNECT_GROUP_ID="connect-cluster"
fi
and then calling at the end :
exec $SCRIPTS/connect_distributed.sh /tmp/temp.properties

JSDoc Templates - "publish" not found

I've been able to get JSDoc3 working with the default template, however, when I try to run another template (even the one that comes with it,haruki) I get the following error:
js: "/path/to/jsdoc/jsdoc.js", line 308: exception from uncaught JavaScript throw: Error: Unable to load template: Module "haruki/publish" not found.
I've tried several other templates and get the same thing. Goven my freshman status with JSDoc I'm assuming it's some config or call issue that's tripping me up.
try to set full path to template folder with publish.js file (not only template name)
for example command line parameter
-t templates/docstrap-master/template
or in config.json file
{ ...
"opts": {
...
"template": "templates/docstrap-master/template"
}
}
it works for this https://github.com/terryweiss/docstrap
for Haruki it seems to work too ./jsdoc -c conf.json -t templates/haruki but i have another error:
This template only supports output to the console. Use the option "-d
console" when you run JSDoc.
With -d console it prints result to console

mongo --shell file.js and "use" statement

can't find solution for simple question:
I have file text.js
use somedb
db.somecollection.findOne()
When I run this file in cmd with redirection command from file:
"mongo < text.js"
it's work properly
But when I try this way
"mongo text.js" or "mongo --shell test.js"
I got this error message
MongoDB shell version: 2.2.0
connecting to: test
type "help" for help
Wed Dec 05 16:05:21 SyntaxError: missing ; before statement pathToFile\test.js.js:1
failed to load: pathToFile\test.js.js
It's fail on "use somedb". If I remove this line, it's run without error, but console is clear.
is there any idea, what is this and how to fix?
I'm tying to find sollution for this, to create build tool for Sublime Text 2.
default build file was
{
"cmd": ["mongo","$file"]
}
but in this case I get the error above
PS. right after posting this question I find sollution for SublimeText2:
{
"selector": "source.js",
"shell":true,
"cmd": ["mongo < ${file}"]
}
PSS. right after posting this question I find sollution for SublimeText3:
{
"selector": "source.js",
"shell":true,
"cmd": ["mongo","<", "$file"]
}
this build tool work properly
use dbname is a helper function in the interactive shell which does not work when you are using mongo shell with a JS script file like you are.
There are multiple solutions to this. The best one, IMO is to explicitly pass the DB name along with host and port name to mongo like this:
mongo hostname:27017/dbname mongoscript.js // replace 27017 with your port number
A better way to do this would be to define the DB at the beginning of your script:
mydb=db.getSiblingDB("yourdbname");
mydb.collection.findOne();
etc.
The latter is preferable as it allows you to interact with multiple DBs in the same script if you need to do so.
You can specify the database while starting the mongo client:
mongo somedb text.js
To get the output from the client to stdout just use the printjson function in your script:
printjson(db.somecollection.findOne());
Mongo needs to be invoked from a shell to get that mode, with Ansible you would have this:
- name: mongo using different databases
action: shell /usr/bin/mongo < text.js
Instead of this:
- name: mongo breaking
command: /usr/bin/mongo < text.js
This is what finally worked for me on Windows + Sublime Text 2 + MongoDB 2.6.5
{
"selector": "source.js",
"shell":true,
"cmd": ["mongo","<", "$file"],
"working_dir" : "C:\\MongoDB\\bin"
}