Kettle getStepMetaInterface() function error in Modified Script with MongoDB Output step - mongodb

Using pentaho 5.3, Modified Java Script Value step to inject those data.
I want to dynamically set path and names in the MongoDB Output step. Here is my code
var meta = new org.pentaho.di.trans.TransMeta( source_path );
var mongoStep = meta.findStep("MongoDB Output");
mongoStep.setDescription('This is MongoDB Output by Ray');
Alert(mongoStep.getName()); // code is ok until here.
var mongoStepMeta = mongoStep.getStepMetaInterface() // error occurs here
When I want to get the getStepMetaInterface() to use step functions, the error occurs.
java.lang.LinkageError: loader constraint violation: loader (instance of org/pentaho/di/core/plugins/KettleURLClassLoader) previously initiated loading for a different type with name "org/pentaho/metastore/api/IMetaStore"
This error seems to be generated by the violation of .jar.
But when I use those original steps, like "Microsoft Access Input", I can successfully get getStepMetaInterface(). In this way, I can use all the functions defined in AccessInputMeta.java.
From my point of view, this problem may have a relation to the MongoDB Output step, because this is a plugin for kettle, but I am not sure.
Any response is appreciated!!

Yep, it's because of the plugin system. The Modified Java Script step and the Access Input step (among many others) are all in the Kettle engine and share a classloader. External plugins (like MongoDB Input/Output) have their own isolated classloaders. You have to do some voodoo with thread context classloaders and reflection in order to get at the Meta classes for those steps.
Here's an example of the hoops you have to jump through to get at external plugins (the Big Data plugin in this example) from the Modified Java Script step:
https://github.com/brosander/pentaho-hadoop-shims/blob/verification-2/test/verification/jobs/dependencies/ForceHiveToConnectRemotely.ktr

First, thanks to Mass who solves the problem.
Here is his advice:
This problem is caused by jar file conflict.
In pentaho installation there are two jar files:
-lib/metastore-5.3.0.0-213.jar
-plugins/pentaho-mongodb-plugin/lib/metastore-5.3.0.0-213.jar
Just remove the last jar file, this error will disappear.

Related

distilbert model is not working at ktrain

I tried to use distilbert classifier. but I am getting the following error.
This is my code
(X_train,y_train),(X_test,y_test),prepro
=text.texts_from_df(train_df=data_train,text_column="Cleaned",label_columns=col
,val_df=data_test,maxlen=500,preprocess_mode="distilbert")
and here is the error
OSError: Model name 'distilbert-base-uncased' was not found in tokenizers model name list (distilbert-base-uncased, distilbert-base-uncased-distilled-squad, distilbert-base-cased, distilbert-base-cased-distilled-squad, distilbert-base-german-cased, distilbert-base-multilingual-cased). We assumed 'distilbert-base-uncased' was a path, a model identifier, or url to a directory containing vocabulary files named ['vocab.txt'] but couldn't find such vocabulary files at this path or url._
Due to my office current environmental issue, I can only work on tf 2.2 and python 3.8. Right now I am using 0.19.
Do you think it will affect my current environment if I downgrade it to 0.16?
This error may happen if there is a network or firewall issue preventing download of the tokenizer files. See this FAQ entry for remedies.
Also, when you use preprocess_mode='distilbert', texts_from* functions return TransformerDataset instances, not arrays. You'll need to replace (X_train, y_train) with train_data, for example. See this example notebook.

TYPO3 website doesn't work after changing db

I want to make a copy of my TYPO3 CMS 6.2.18 website - what I did so far:
Copied the entire website folder (including the TYPO3 installation)
Copied the entire database (with a new name)
Created a new db user for the copied db
Adjusted the file /typo3conf/LocalConfiguration.php accordingly to the new DB+User
Now I'm receiving following errors when calling different urls of my copied TYPO3 website:
When I try calling the "Upgrade Wizard" from inside the install tool /typo3/install (which is the only page that currently works):
#1: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/<my-domain>/typo3/sysext/install/Classes/Service/SqlSchemaMigrationService.php line 409
When I call <my-domain>/typo3
#1: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/<my-domain>/typo3/sysext/backend/Classes/Utility/BackendUtility.php line 3022
4 count(NULL)
...
/var/www/vhosts/<my-domain>/typo3/sysext/backend/Classes/Utility/BackendUtility.php:
03020: $signals = array();
03021: $modData = $GLOBALS['BE_USER']->getModuleData('TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getUpdateSignal', 'ses');
03022: if (!count($modData)) {
03023: return '';
03024: }
When I call <my-domain>
#1: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/<my-domain>/typo3/sysext/core/Classes/Database/PreparedStatement.php line 582
...after calling...
TYPO3\CMS\Core\Database\PreparedStatement::convertNamedPlaceholdersToQuestionMarks("SELECT * FROM fe_session_data WHERE hash = :hash", array, array)
What's interesting to me:
After copying the website the copy worked, only after referencing it to the copied db it showed these errors.
Anyone an idea what I could do / be looking for?
I tried deleting all cache, all tables shown in the "Cleanup" part of the install tool and all files in the typoe3temp folder already.
So, as I have said in the comment. Probably the issue with PHP version, because of all the mentioned errors (warning actually ;) ) reflect the incompatible PHP code.
The solution is pretty easy, switch your PHP version according to TYPO3's need :)

Visualize an embedded neo4j instance in a web browser using default visualization

I am using embedded Neo4j, version 3.0.3. Following this guide, I have created Neo4j/Java code. It creates a database, adds two nodes (one for java, one for scala) and adds a relationship.
package examples;
import java.io.File;
import org.neo4j.graphdb.*;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
public class HelloWorld {
public static void main(String[] args) {
GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();
GraphDatabaseService db = dbFactory.newEmbeddedDatabase(new File("Test_DB"));
try (Transaction tx = db.beginTx()) {
Node javaNode = db.createNode(Tutorials.JAVA);
javaNode.setProperty("TutorialID", "JAVA001");
Node scalaNode = db.createNode(Tutorials.SCALA);
scalaNode.setProperty("TutorialID", "SCALA001");
Relationship relationship = javaNode.createRelationshipTo(scalaNode, TutorialRelationships.JVM_LANGUAGES);
relationship.setProperty("Id", "1234");
tx.success();
}
}
}
enum Tutorials implements Label {
JAVA, SCALA, SQL, NEO4J;
}
enum TutorialRelationships implements RelationshipType {
JVM_LANGUAGES, NON_JVM_LANGUAGES;
}
I program using Eclipse, so all the libraries are imported and I can just click the 'run' button on Eclipse to get the code running, and it seems to work without any issues. Upon running the code, I now have a folder Test_DB in the ~/workspace/project_name/Test_DB directory, where project_name is the name of the overall Eclipse folder. My goal is now to visualize this database in a web browser. The guide I linked to earlier shows an example of this; the user was able to look at the nodes in the web browser (see the bottom of the webpage). Unfortunately, I am using a Linux computer with Firefox, and that tutorial was in Windows, and I can't figure out how to get the visualization.
There have been a few other questions related to this. Unfortunately, some of them (such as this one) propose using software other than the default visualization. I don't own the computer and I have to go through a roundabout process to get external code installed. To be clear what I mean, this link discusses the default Neo4j browser. This is what I would like to see.
This question here directly tackles the same issue, and in fact, it uses the exact same tutorial I used! The answer proposes changing the path in the neo4j-server.properties file. Unfortunately, that file doesn't exist, and upon further analysis, it seems like Neo4j 3.0 changed the configuration naming, which I found out by reading the answer to this similar question. There is now a file conf/neo4j.conf with this information. I entered the following information in the first few lines, keeping the other settings the default:
# The name of the database to mount
dbms.active_database=Test_DB
# Paths of directories in the installation.
dbms.directories.data=/home/username/workspace/project_name/
This does not appear to work. Am I using these settings correctly? When I open the neo4j web browser after running ./bin/neo4j start and click on the database symbol in the left hand side, I see "Name: Test_DB", but it also says there are no nodes and no relationships in the database, and returning a match all query provides nothing. Is it possible for the browser to connect to my database so it can see the nodes (e.g., the two nodes in my Java code above)?
Or is it that I'm not using this code correctly; does the code somehow have to avoid quitting (i.e., replace tx.success() with something else?) to keep the data there?
Sorry about answering my own question, but I finally figured out how to do this! Here's what happens: according to the github change log for 3.0.0.RC-1:
Databases are now stored in a directory called databases under the directory specified in dbms.directories.data
So what we actually have to do is make sure our data base is in the following location:
/home/username/workspace/project_name/databases/
The issue is that when we run it in Eclipse, we get the database in the following folder:
/home/username/workspace/project_name/
Thus, the solution is to make sure the new database folder is preceded by a databases name, i.e., I would change one line to:
GraphDatabaseService db = dbFactory.newEmbeddedDatabase(new File("databases/Test_DB"));

SuiteCloud IDE Validator Ignore List

In the SuiteCloud Eclipse IDE for NetSuite, what is the Ignore List setting under Preferences > NetSuite > Validation? Is it a single file that behaves like, say, a .gitignore? Or is it an explicit list of files to ignore?
I suspect this setting is why Eclipse is always building libraries and other files I've explicitly told it not to in my NetSuite projects.
Can anyone provide some clarity on the usage of this field?
Attempt 1
I tried setting this preference to a single file with the following contents:
**/*.min.js
**/*.lib.js
**/docs/**
**/Third Party/**
**/node_modules/**
**/bower_components/**
**/*jquery*
**/*moment*
**/*lodash*
But that does not seem to work as expected. Files that should be caught by these regexes are still validated. One of them in particular (docstrap.lib.js) crashes the entire IDE every single time when the SuiteScript validator encounters it.
Attempt 2
I tried to put a similar string of regexes directly into the field itself:
**/*.min.js,**/*.lib.js,**/docs/**,...
but this just yields an error directly in the dialog itself: Value must be an existing file
Attempt 3
Created a new SuiteScript project with only blanket.min.js in the project root. Added an ignore file with the following contents:
/blanket.min.js
./blanket.min.js
*blanket.min.js
blanket.min.js
"blanket.min.js"
*blanket*
**/blanket*
*/blanket*
.\blanket.min.js
**\blanket*
*\blanket*
\blanket.min.js
\blanket*
.\blanket*
C:\Development\Projects\validator-test\blanket.min.js
C:/Development/Projects/validator-test/blanket.min.js
blanket.min.js still gets validated. Completely lost as to how this ignore file should be formatted.
The ignore list is used by the SuiteCloud IDE (IDE) to avoid having errors in the IDE for non-standard script ids in SuiteScript 1.0 APIs.
As an example...
nlapiLogRecord('customrecord_foo');
Since customrecord_foo is a non-standard record, it will be marked as an error by the IDE.
To tell the IDE to ignore customrecord_foo, the ignore list can be used.
It's a text file, with one script id per line.
customrecord_foo
customrecord_bar
The specified non-standard script ids in the ignore list file will not be flagged as an error by the IDE.

Issue with a topjson object in a Meteor app built with coffeescript

Apologies for the lack of precision in the question, but I'm not completely sure which of possibly many things I'm doing wrong here.
I'm relatively new to Coffeescript and also geo applications in general, but here goes:
I've got a working (simple) Meteor (.7.0.1) application utilizing coffeescript in both client and server. The issue I'm having occurs when attempting to utilize TopoJSON encoded files to create a layer of US congressional districts. (the purpose of the app is to help highlight voter suppression in the US)
So, a few things: Typically in a non-Meteor app, I would just load the topoJSON file like so:
$.getJSON('./data/us-congress-113.json', function (data) {
var congress_geojson = topojson.feature(data, data.objects.districts);
congress_layer.addData(congress_geojson);
});
Now of course this won't work in Meteor because its not asynchronous.
One of the things that was recommended here on SO was to not worry about reading the file, and to instead change the json file to .js, and then set the contents (which are of course just an object) equal to a variable.
Here's what I did:
First, I changed the .json file to a .js file in the server directory, and added the "congress =" to the beginning of the file. It's a huge file so forgive me for omitting the whole object.
congress = {"type":"Topology",
"objects":
{"districts":
{"type":"GeometryCollection","geometries":[{"type":"Polygon"
Now here's where everything starts to give me issues:
In the server.coffee, I've created a variable like so to reference the congress object:
#congress_geojson = topojson.feature(congress, congress.objects.districts)
Notice how I'm putting the # symbol there? I've been told this allows a variable in Coffeescript to be globally scoped? I tried to also use a Meteor feature called "share" where I declare the variable as "share.congress_geojson". That led to the same issues which I will describe below.
Now in the client.coffee file, I'm trying to call this variable to load into a Leaflet map.
congress_layer = L.geoJson(null,
style:
color: "#DE0404"
weight: 2
opacity: 0.4
fillOpacity: 0.1
)
congress_layer.addData(#congress_geojson)
This isn't working, and specifically (despite attempts to find other ways, the errors I'm getting in the console are:
Exception from Deps afterFlush function: TypeError: Cannot read property 'features' of undefined
at o.GeoJSON.o.FeatureGroup.extend.addData (http://localhost:3000/packages/leaflet.js?ad7b569067d1f68c7403ea1c89a172b4cfd68d85:39:16471)
at Object.Template.map.rendered (http://localhost:3000/client/client.coffee.js?37b1cdc5945f3407f2726a5719e1459f44d1db2d:213:18)
I have no doubt that I'm missing something stupidly obvious here. Any suggestions or tips for what I'm doing completely wrong would be appreciated. Is it a case where an object globally declared in a .js file isn't available to code in a .coffee file? Maybe I'm doing something wrong on the Meteor side?
Thanks!
Edit:
So I was able to get things working by putting the .js file containing the congress object in a root /lib folder, causing the object to load first, and then calling the congress object from the client. However, I'm still wanting to know how I could simply share this object from the server? What is the "Meteor way" here?
If you are looking for the Meteor way to order the loading of files, use the Meteor.startup function and put the initialization code there. That function is the $.ready of the Meteor world, i.e., it will execute only after all your files have been successfully loaded on the client.
So in your case:
Meter.startup ->
congress_layer.addData(#congress_geojson)