I am having problems with JanusGraph connecting to Solr: I have the following:
application.java
public static void main(String args[]) {
JanusGraph g = JanusGraphFactory.open("/path/to/file/janusgraph-solr.properties");
GraphOfTheGodsFactory.load(g);
g.close();
}
janushgraph-solr.properties
# Change to the directory where JanusGraph was extracted. Later commands
# use relative paths to the Solr config files shipped with the JanusGraph
# distribution.
cd $JANUSGRAPH_HOME
# The name must be URL safe and should contain one dot/full-stop
# character. The part of the name after the dot must not conflict with
# any of JanusGraph's internal CF names. Starting the part after the dot
# "solr" will avoid a conflict with JanusGraph's internal CF names.
CORE_NAME=testt
# Where to upload collection configuration and send CoreAdmin requests.
SOLR_HOST=localhost:8983
# The value of index.[X].solr.http-urls in JanusGraph's config file
# should match $SOLR_HOST and $CORE_NAME. For example, given the
# $CORE_NAME and $SOLR_HOST values above, JanusGraph's config file would
# contain (assuming "search" is the desired index alias):
#
index.search.solr.http-urls=http://localhost:8983/solr/testt
#
# The stock JanusGraph config file conf/janusgraph-cassandra-solr.properties
# ships with this http-urls value.
storage.backend=cassandrathrift
GraphOfTheGods file: https://github.com/JanusGraph/janusgraph/blob/master/janusgraph-core/src/main/java/org/janusgraph/example/GraphOfTheGodsFactory.java
I get the following error:
Exception in thread "main" java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager
Caused by: org.janusgraph.diskstorage.TemporaryBackendException: Temporary failure in storage backend
Caused by: java.net.ConnectException: Connection refused (Connection refused)
How do i get rid of storage.backend=cassandrathrift and use solr as the backend? replacing "cassandrathrift" with solr as the document suggests fails for me. This results in the solr class not being found. Any help would be appreciated
Enable thrift server on cassandra
nodetool enablethrift
Change your storage backend configuration from
storage.backend=cassandrathrift
to:
storage.backend=cql
Related
I am using ESAPI to encode the string, when using with Oracle JDBC. I Get following error even though i have ESAPI.Properties in my project.
final var queryString =
String.format("SELECT * FROM %1$s WHERE %2$s = '%3$s'",
ESAPI.encoder().encodeForSQL(new OracleCodec(),tableName),
ESAPI.encoder().encodeForSQL(new OracleCodec(),columnName),
ESAPI.encoder().encodeForSQL(new OracleCodec(),columnValue));
Caused by: java.lang.ClassNotFoundException: org.owasp.encoder.esapi.ESAPIEncoder
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at org.owasp.esapi.util.ObjFactory.loadClassByStringName(ObjFactory.java:158)
at org.owasp.esapi.util.ObjFactory.make(ObjFactory.java:81)
... 108 common frames omitted
Here is my project structure.
Version:
implementation 'org.owasp.esapi:esapi:2.2.1.1'
here is my ESAPI.properties file
# Properties based on ESAPI 2.2.1.1's configuration/esapi/ESAPI.properties file.
ESAPI.Encoder=org.owasp.encoder.esapi.ESAPIEncoder
# Log4JFactory Requires log4j.xml or log4j.properties in classpath - http://www.laliluna.de/log4j-tutorial.html
# Note that this is now considered deprecated!
#ESAPI.Logger=org.owasp.esapi.logging.log4j.Log4JLogFactory
# To use JUL, you need to obtain ESAPI's esapi-java-logging.properties and drop
# it somewhere into your class path. You can get it from the ESAPI configuration
# jar. (See Release 2.2.1.1 under GitHub for ESAPI/esapi-java-legacy.)
ESAPI.Logger=org.owasp.esapi.logging.java.JavaLogFactory
# To use the new SLF4J logger in ESAPI (see GitHub issue #129), set
#ESAPI.Logger=org.owasp.esapi.logging.slf4j.Slf4JLogFactory
# and do whatever other normal SLF4J configuration that you normally would do for your application.
# Note: The uncommented out ones are those needed for SLF4J. Others may be
# needed if you change the ESAPI logger.
#===========================================================================
# ESAPI Logging
# Set the application name if these logs are combined with other applications
Logger.ApplicationName=sql-service
# If you use an HTML log viewer that does not properly HTML escape log data, you can set LogEncodingRequired to true
Logger.LogEncodingRequired=false
# Determines whether ESAPI should log the application name. This might be clutter in some single-server/single-app environments.
Logger.LogApplicationName=true
# Determines whether ESAPI should log the server IP and port. This might be clutter in some single-server environments.
Logger.LogServerIP=false
# LogFileName, the name of the logging file. Provide a full directory path (e.g., C:\\ESAPI\\ESAPI_logging_file) if you
# want to place it in a specific directory.
#Logger.LogFileName=ESAPI_logging_file
# MaxLogFileSize, the max size (in bytes) of a single log file before it cuts over to a new one (default is 10,000,000)
#Logger.MaxLogFileSize=10000000
# Determines whether ESAPI should log the user info.
Logger.UserInfo=false
# Determines whether ESAPI should log the session id and client IP
Logger.ClientInfo=false
Any Help would be appreciated.
I am trying mysql to hdfs data ingestion using gobblin. While running mysql-to-gobblin.pull using steps below:
1) start hadoop:
sbin\start-all.cmd
2) start mysql service:
sudo service mysql start
3) set GOBBLIN_WORK_DIR:
export GOBBLIN_WORK_DIR=/mnt/c/users/name/incubator-gobblin/GOBBLIN_WORK_DIR
4) set GOBBLIN_JOB_CONFIG_DIR
export GOBBLIN_JOB_CONFIG_DIR=/mnt/c/users/name/incubator-gobblin/GOBBLIN_JOB_CONFIG_DIR
5) Start standalone
bin/gobblin.sh service standalone start --jars /mnt/C/Users/name/incubator-gobblin/build/gobblin-sql/libs/gobblin-sql-0.15.0.jar
gives below error
ERROR [JobScheduler-0] org.apache.gobblin.scheduler.JobScheduler$NonScheduledJobRunner 637 - Failed to run job GobblinMySql
org.apache.gobblin.runtime.JobException: Failed to run job GobblinMySql
Caused by: java.lang.ClassNotFoundException: org.apache.gobblin.source.extractor.extract.jdbc.MysqlSource
below is the mysql-to-gobblin.pull file
# Job properties
job.name=GobblinMySql
job.group=MySql
job.description=Data pull from MySql
# Extract properties
extract.table.type=snapshot_only
extract.table.name=user
# Property to consider the extract as full dump
extract.is.full=true
# Source properties
# Source properties - source class to extract data from Mysql Source
source.class=org.apache.gobblin.source.extractor.extract.jdbc.MysqlSource
# Source properties
source.max.number.of.partitions=1
source.querybased.partition.interval=1
source.querybased.is.compression=true
source.querybased.watermark.type=timestamp
# Converter properties - Record from mysql source will be processed by the below series of converters
converter.classes=gobblin.converter.avro.JsonIntermediateToAvroConverter
# date columns format
converter.avro.timestamp.format=yyyy-MM-dd HH:mm:ss'.0'
converter.avro.date.format=yyyy-MM-dd
converter.avro.time.format=HH:mm:ss
# Qualitychecker properties
qualitychecker.task.policies=gobblin.policies.count.RowCountPolicy,gobblin.policies.schema.SchemaCompatibilityPolicy
qualitychecker.task.policy.types=OPTIONAL,OPTIONAL
# Publisher properties
data.publisher.type=gobblin.publisher.BaseDataPublisher
source.querybased.schema=praveen_schema
source.entity=user
source.querybased.extract.type=snapshot
writer.builder.class=org.apache.gobblin.writer.SimpleDataWriterBuilder
writer.file.path.type=tablename
writer.destination.type=HDFS
writer.output.format=txt
data.publisher.type=org.apache.gobblin.publisher.BaseDataPublisher
mr.job.max.mappers=1
metrics.reporting.file.enabled=true
metrics.log.dir=/gobblin-kafka/metrics
metrics.reporting.file.suffix=txt
bootstrap.with.offset=earliest
fs.uri=hdfs://localhost:9000
writer.fs.uri=hdfs://localhost:9000
state.store.fs.uri=hdfs://localhost:9000
mr.job.root.dir=/gobblin-kafka/working
state.store.dir=/gobblin-kafka/state-store
task.data.root.dir=/jobs/kafkaetl/gobblin/gobblin-kafka/task-data
data.publisher.final.dir=/gobblintest/job-output
I am running this command from /mnt/c/users/name/incubator-gobblin/build/gobblin-distribution/distributions/gobblin-dist directory.
What changes I need to do here? How can i solve it?
solution is to add this jar or dependency to get rid of Caused by: java.lang.ClassNotFoundException: org.apache.gobblin.source.extractor.extract.jdbc.MysqlSource
<dependency>
<groupId>com.linkedin.gobblin</groupId>
<artifactId>gobblin-core</artifactId>
<version>0.8.0</version>
</dependency>
download jar from this mvn website.
Hope this helps.
I downloaded neo4j.zip from its site and extract it.
I downloaded and installed jdk 7, I have two folders in :
C:\Program Files\Java\jdk1.7.0_75
and
C:\Program Files\Java\jre7
And I clicked on New and made a variable named JAVA_HOME and its value is
C:\Program Files\Java\jdk1.7.0_75
I have added
org.neo4j.server.startup_timeout=0
line to my neo4j-server.properties file because of timeout error and
I have changed the port number in neo4j-server.properties file from 7474 to 80 and 8085, this is my neo4j-server.properties now:
################################################################
# Neo4j
#
# neo4j-server.properties - runtime operational settings
#
################################################################
#***************************************************************
# Server configuration
#***************************************************************
# location of the database directory
org.neo4j.server.database.location=data/graph.db
# Low-level graph engine tuning file
org.neo4j.server.db.tuning.properties=conf/neo4j.properties
# Database mode
# Allowed values:
# HA - High Availability
# SINGLE - Single mode, default.
# To run in High Availability mode, configure the neo4j.properties config file, then uncomment this line:
#org.neo4j.server.database.mode=HA
# Let the webserver only listen on the specified IP. Default is localhost (only
# accept local connections). Uncomment to allow any connection. Please see the
# security section in the neo4j manual before modifying this.
#org.neo4j.server.webserver.address=0.0.0.0
# Require (or disable the requirement of) auth to access Neo4j
dbms.security.auth_enabled=true
#
# HTTP Connector
#
# http port (for all data, administrative, and UI access)
org.neo4j.server.webserver.port=8085
#
# HTTPS Connector
#
# Turn https-support on/off
org.neo4j.server.webserver.https.enabled=true
# https port (for all data, administrative, and UI access)
org.neo4j.server.webserver.https.port=7473
# Certificate location (auto generated if the file does not exist)
org.neo4j.server.webserver.https.cert.location=conf/ssl/snakeoil.cert
# Private key location (auto generated if the file does not exist)
org.neo4j.server.webserver.https.key.location=conf/ssl/snakeoil.key
# Internally generated keystore (don't try to put your own
# keystore there, it will get deleted when the server starts)
org.neo4j.server.webserver.https.keystore.location=data/keystore
# Comma separated list of JAX-RS packages containing JAX-RS resources, one
# package name for each mountpoint. The listed package names will be loaded
# under the mountpoints specified. Uncomment this line to mount the
# org.neo4j.examples.server.unmanaged.HelloWorldResource.java from
# neo4j-server-examples under /examples/unmanaged, resulting in a final URL of
# http://localhost:7474/examples/unmanaged/helloworld/{nodeId}
#org.neo4j.server.thirdparty_jaxrs_classes=org.neo4j.examples.server.unmanaged=/examples/unmanaged
#*****************************************************************
# HTTP logging configuration
#*****************************************************************
# HTTP logging is disabled. HTTP logging can be enabled by setting this
# property to 'true'.
org.neo4j.server.http.log.enabled=false
# Logging policy file that governs how HTTP log output is presented and
# archived. Note: changing the rollover and retention policy is sensible, but
# changing the output format is less so, since it is configured to use the
# ubiquitous common log format
org.neo4j.server.http.log.config=conf/neo4j-http-logging.xml
#*****************************************************************
# Administration client configuration
#*****************************************************************
# location of the servers round-robin database directory. possible values:
# - absolute path like /var/rrd
# - path relative to the server working directory like data/rrd
# - commented out, will default to the database data directory.
org.neo4j.server.webadmin.rrdb.location=data/rrd
org.neo4j.server.startup_timeout=0
but again when I run Neo4j.bat by double clicking on it, cmd window will open and java window will open and will close after some seconds and cmd window will close after it and
http://localhost:8085/browser/
is unavailable.
This is my error from
C:\Users\Fereshteh\Desktop\neo4j-enterprise-2.2.0-windows\neo4j-enterprise-2.2.0\data\graph.db\messages
2015-04-10 01:56:42.689+0000 ERROR [o.n.s.e.EnterpriseBootstrapper]: Failed to start Neo Server on port [8085]
org.neo4j.server.ServerStartupException: Starting Neo4j Server failed: Wanted record LOG_VERSION, but this record wasn't read since the neostore didn't contain it
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:255) ~[neo4j-server-2.2.0.jar:2.2.0]
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:117) [neo4j-server-2.2.0.jar:2.2.0]
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:69) [neo4j-server-2.2.0.jar:2.2.0]
Caused by: java.lang.IllegalStateException: Wanted record LOG_VERSION, but this record wasn't read since the neostore didn't contain it
at org.neo4j.kernel.impl.store.record.NeoStoreUtil.getValue(NeoStoreUtil.java:127) ~[neo4j-kernel-2.2.0.jar:2.2.0]
at org.neo4j.kernel.impl.store.record.NeoStoreUtil.getLogVersion(NeoStoreUtil.java:150) ~[neo4j-kernel-2.2.0.jar:2.2.0]
at org.neo4j.kernel.impl.recovery.StoreRecoverer.recoveryNeededAt(StoreRecoverer.java:57) ~[neo4j-kernel-2.2.0.jar:2.2.0]
at org.neo4j.server.preflight.PerformRecoveryIfNecessary.run(PerformRecoveryIfNecessary.java:62) ~[neo4j-server-2.2.0.jar:2.2.0]
at org.neo4j.server.preflight.PreFlightTasks.run(PreFlightTasks.java:71) ~[neo4j-server-2.2.0.jar:2.2.0]
at org.neo4j.server.AbstractNeoServer.runPreflightTasks(AbstractNeoServer.java:387) ~[neo4j-server-2.2.0.jar:2.2.0]
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:195) ~[neo4j-server-2.2.0.jar:2.2.0]
And in my C:\Users\Fereshteh\Desktop\neo4j-enterprise-2.2.0-windows\neo4j-enterprise-2.2.0\data\log
I have just README and windows-wrapper.0.0.txt and windows-wrapper.0.0.log.lck
what should I do to be able to run Neo4j and work with it?
I have windows 7 x86
thanks in advance.
I had the same error today. In my case, it was because the files in the database directory were corrupted (I unzipped an existing graph which failed on first try). After I unzipped the existing graph database correctly - and the database files were fine - it worked. So, maybe your database directory is also corrupted.
Move the neo4j folder to another directory -> \Program'thisblankisbad'Files\ <- was the cause for me. I was trying to reinstall the service on Windows with
neo4j install-service
and neo4j threw:
neo4j Error: mainclass org.neo4j.server.startup.Neo4jCommand could not be found or loaded cause: java.lang.ClassNotFoundException: org.neo4j.server.startup.Neo4jCommand
after i moved the neo4j folder to another directory (NO BLANKS!!!) it was fine
windows 10, neo4j v4.4.9
I'am using debian distribution.I write a code in windows but I have no error and I create a database.Despite I prepare libraries in Debian, my database is not created and data is not added and in java program there was no error.
My Database Path.
dbPath=/var/lib/neo4j/data/graph.db
I guess error occurs about database proporties.
I have 2 different proporties so I don't know how can I set this settings.
-etc/neo4j
-/var/lib/neo4j/conf
You should have the /etc/neo4j/neo4j-server.properties file that typically begins like
################################################################
# Neo4j configuration
#
################################################################
#***************************************************************
# Server configuration
#***************************************************************
# location of the database directory
org.neo4j.server.database.location=data/graph.db
...
...
Where database path is relative.
If you want to have an absolute path, you should have this line:
org.neo4j.server.database.location=/var/lib/neo4j/data/graph.db
When I try and connect it my mysql database with JDBC in java, it doesn't go to my web server.
Here is the code
String dbtime;
String dbUrl = "jdbc:mysql://184.172.176.18:3306/dcsoft_dcsoft_balloon";
String dbUser = "myuser";
String dcPass = "mypass";
String dbClass = "com.mysql.jdbc.Driver";
String query = "Select * FROM users";
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(dbUrl, dbUser, dcPass);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {
dbtime = rs.getString(1);
System.out.println(dbtime);
}
con.close();
} catch(ClassNotFoundException e) {
e.printStackTrace();
} catch(SQLException e) {
e.printStackTrace();
}
This code is supposed to go to my web server but it gives this error
java.sql.SQLException: Access denied for user 'dcsoft_dcsoft_java'#'jamesposse.force9.co.uk' (using password: YES)
jamesposse.force9.co.uk is the not the address im trying to connect to I'm trying to connect to 184.172.176.18:3306.
Thanks.
The hosts file contents is -
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
and lmhosts is -
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample LMHOSTS file used by the Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to computernames
# (NetBIOS) names. Each entry should be kept on an individual line.
# The IP address should be placed in the first column followed by the
# corresponding computername. The address and the computername
# should be separated by at least one space or tab. The "#" character
# is generally used to denote the start of a comment (see the exceptions
# below).
#
# This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
# files and offers the following extensions:
#
# #PRE
# #DOM:<domain>
# #INCLUDE <filename>
# #BEGIN_ALTERNATE
# #END_ALTERNATE
# \0xnn (non-printing character support)
#
# Following any entry in the file with the characters "#PRE" will cause
# the entry to be preloaded into the name cache. By default, entries are
# not preloaded, but are parsed only after dynamic name resolution fails.
#
# Following an entry with the "#DOM:<domain>" tag will associate the
# entry with the domain specified by <domain>. This affects how the
# browser and logon services behave in TCP/IP environments. To preload
# the host name associated with #DOM entry, it is necessary to also add a
# #PRE to the line. The <domain> is always preloaded although it will not
# be shown when the name cache is viewed.
#
# Specifying "#INCLUDE <filename>" will force the RFC NetBIOS (NBT)
# software to seek the specified <filename> and parse it as if it were
# local. <filename> is generally a UNC-based name, allowing a
# centralized lmhosts file to be maintained on a server.
# It is ALWAYS necessary to provide a mapping for the IP address of the
# server prior to the #INCLUDE. This mapping must use the #PRE directive.
# In addtion the share "public" in the example below must be in the
# LanManServer list of "NullSessionShares" in order for client machines to
# be able to read the lmhosts file successfully. This key is under
# \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
# in the registry. Simply add "public" to the list found there.
#
# The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
# statements to be grouped together. Any single successful include
# will cause the group to succeed.
#
# Finally, non-printing characters can be embedded in mappings by
# first surrounding the NetBIOS name in quotations, then using the
# \0xnn notation to specify a hex value for a non-printing character.
#
# The following example illustrates all of these extensions:
#
# 102.54.94.97 rhino #PRE #DOM:networking #net group's DC
# 102.54.94.102 "appname \0x14" #special app server
# 102.54.94.123 popular #PRE #source server
# 102.54.94.117 localsrv #PRE #needed for the include
#
# #BEGIN_ALTERNATE
# #INCLUDE \\localsrv\public\lmhosts
# #INCLUDE \\rhino\public\lmhosts
# #END_ALTERNATE
#
# In the above example, the "appname" server contains a special
# character in its name, the "popular" and "localsrv" server names are
# preloaded, and the "rhino" server name is specified so it can be used
# to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
# system is unavailable.
#
# Note that the whole file is parsed including comments on each lookup,
# so keeping the number of comments to a minimum will improve performance.
# Therefore it is not advisable to simply add lmhosts file entries onto the
# end of this file.
jamesposse.force9.co.uk is the machine that you're connecting from.
When MySQL complains Access denied for user 'dcsoft_dcsoft_java'#'jamesposse.force9.co.uk', it means that the user dcsoft_dcsof_java was not authorized to connect from the host jamesposse.force9.co.uk.
In MySQL, you are authenticated by the username you try to connect to, and the hostname you're trying to connect from. This is why you grant access to users like:
grant access to 'dcsoft_dcsoft_java'#'localhost' identified by 'whatever'
This user can only connect from the same machine as the MySQL server (e.g. from webapps hosted on the same machine, or when you SSH into the machine and use the mysql commandline from there).
If you want to grant access to a specific machine, identify it by hostname or IP address.
grant access to 'dcsoft_dcsoft_java'#'184.172.176.18' identified by 'whatever'
To grant access from anywhere on the internet, use '%' as the host:
grant access to 'dcsoft_dcsoft_java'#'%' identified by 'whatever'
This might be a mysql on redhat password issue. I'm not sure why it's not using the username you're providing it though, unless you're not actually using:
String dbUser = "myuser";
String dcPass = "mypass";
And using
dcsoft_dcsoft_java
as your username.
Can you give some more details on your environment?
In mysql make sure that you have whateverUserNameYourUsing#% otherwise, you'll get this error. You can also replace the % with the IP address and/or domain name, but it has to be every domain name your database will allow access from.