Im trying to switch the pool for my Grails 2.5.4 app for Hikari and found it to make a pretty big performance boost compared to the default Tomcat jdbc!
However, Ive stumbled upon a problem when running some integration tests. This is the test method that is now failing:
def 'Returns the bar with the least foo'() { given:
def foobar = Foobar.build()
and:
def bar1 = Bar.build(foo: 25, foobar: foobar)
def item1 = BarItem.build(state: AVAILABLE)
item1.addToBars(bar1)
and:
def bar2 = Bar.build(foo: 12, foobar: foobar)
def item2 = BarItem.build(state: AVAILABLE)
item2.addToBars(bar2)
when:
def bestBar = foobar.getBestBar()
then:
bestBar.id == bar2.id
when:
item2.state = State.BLACKED_OUT
item2.save(flush: true)
def refreshedFoobar
Foobar.withNewSession {
refreshedFoobar = Foobar.get(foobar.id) //This is returning null
}
and:
bestBar = refreshedFoobar.getBestBar() //null pointer exception here
then:
bestBar.id == bar1.id
}
Why is this happening? Seems like things arent being pushed into the database properly, like its just holding them in session waiting to send them later.
Here is my Hikari config:
def hp = new Properties()
hp.username = ds.username
hp.password = ds.password
hp.connectionTimeout = ds.maxWait
hp.maximumPoolSize = ds.maxActive
hp.minimumIdle = ds.minIdle
hp.jdbcUrl = ds.url
hp.driverClassName = ds.driverClassName
HikariConfig hc = new HikariConfig(hp)
hc.with{
addDataSourceProperty("prepStmtCacheSize", 500)
addDataSourceProperty("prepStmtCacheSqlLimit", 2048)
addDataSourceProperty("cachePrepStmts", true)
addDataSourceProperty("useServerPrepStmts", true)
}
values being
dialect = org.hibernate.dialect.MySQL5InnoDBDialect
driverClassName = 'com.mysql.jdbc.Driver'
username = 'user'
password = 'pass'
maxActive = 250
minIdle = 5
maxWait = 10000
Log:
2016-08-04 17:49:28,070 [main] DEBUG hikari.HikariConfig - HikariPool-1 - configuration:
2016-08-04 17:49:28,071 [main] DEBUG hikari.HikariConfig - allowPoolSuspension.............false
2016-08-04 17:49:28,072 [main] DEBUG hikari.HikariConfig - autoCommit......................true
2016-08-04 17:49:28,072 [main] DEBUG hikari.HikariConfig - catalog.........................null
2016-08-04 17:49:28,072 [main] DEBUG hikari.HikariConfig - connectionInitSql...............null
2016-08-04 17:49:28,072 [main] DEBUG hikari.HikariConfig - connectionTestQuery.............null
2016-08-04 17:49:28,072 [main] DEBUG hikari.HikariConfig - connectionTimeout...............10000
2016-08-04 17:49:28,072 [main] DEBUG hikari.HikariConfig - dataSource......................null
2016-08-04 17:49:28,072 [main] DEBUG hikari.HikariConfig - dataSourceClassName.............null
2016-08-04 17:49:28,073 [main] DEBUG hikari.HikariConfig - dataSourceJNDI..................null
2016-08-04 17:49:28,073 [main] DEBUG hikari.HikariConfig - dataSourceProperties............{password=<masked>}
2016-08-04 17:49:28,073 [main] DEBUG hikari.HikariConfig - driverClassName................."com.mysql.jdbc.Driver"
2016-08-04 17:49:28,073 [main] DEBUG hikari.HikariConfig - healthCheckProperties...........{}
2016-08-04 17:49:28,073 [main] DEBUG hikari.HikariConfig - healthCheckRegistry.............null
2016-08-04 17:49:28,073 [main] DEBUG hikari.HikariConfig - idleTimeout.....................600000
2016-08-04 17:49:28,074 [main] DEBUG hikari.HikariConfig - initializationFailFast..........true
2016-08-04 17:49:28,074 [main] DEBUG hikari.HikariConfig - isolateInternalQueries..........false
2016-08-04 17:49:28,074 [main] DEBUG hikari.HikariConfig - jdbc4ConnectionTest.............false
2016-08-04 17:49:28,074 [main] DEBUG hikari.HikariConfig - jdbcUrl........................."jdbc:mysql://localhost:3306/foo_test?autoReconnect=true"
2016-08-04 17:49:28,074 [main] DEBUG hikari.HikariConfig - leakDetectionThreshold..........0
2016-08-04 17:49:28,074 [main] DEBUG hikari.HikariConfig - maxLifetime.....................1800000
2016-08-04 17:49:28,074 [main] DEBUG hikari.HikariConfig - maximumPoolSize.................250
2016-08-04 17:49:28,074 [main] DEBUG hikari.HikariConfig - metricRegistry..................null
2016-08-04 17:49:28,075 [main] DEBUG hikari.HikariConfig - metricsTrackerFactory...........null
2016-08-04 17:49:28,075 [main] DEBUG hikari.HikariConfig - minimumIdle.....................250
2016-08-04 17:49:28,075 [main] DEBUG hikari.HikariConfig - password........................<masked>
2016-08-04 17:49:28,075 [main] DEBUG hikari.HikariConfig - poolName........................"HikariPool-1"
2016-08-04 17:49:28,075 [main] DEBUG hikari.HikariConfig - readOnly........................false
2016-08-04 17:49:28,075 [main] DEBUG hikari.HikariConfig - registerMbeans..................false
2016-08-04 17:49:28,075 [main] DEBUG hikari.HikariConfig - scheduledExecutorService........null
2016-08-04 17:49:28,075 [main] DEBUG hikari.HikariConfig - threadFactory...................null
2016-08-04 17:49:28,076 [main] DEBUG hikari.HikariConfig - transactionIsolation............null
2016-08-04 17:49:28,076 [main] DEBUG hikari.HikariConfig - username........................"root"
2016-08-04 17:49:28,076 [main] DEBUG hikari.HikariConfig - validationTimeout...............5000
2016-08-04 17:49:28,077 [main] INFO hikari.HikariDataSource - HikariPool-1 - Started.
2016-08-04 17:49:28,287 [main] INFO pool.PoolBase - HikariPool-1 - Driver does not support get/set network timeout for connections. (com.mysql.jdbc.JDBC4Connection.getNetworkTimeout()I)
2016-08-04 17:49:28,312 [HikariPool-1 housekeeper] DEBUG pool.HikariPool - HikariPool-1 - Pool stats (total=0, active=0, idle=0, waiting=0)
2016-08-04 17:49:28,381 [HikariPool-1 connection adder] DEBUG pool.HikariPool - HikariPool-1 - Added connection com.mysql.jdbc.JDBC4Connection#2929ca0e
....
Then I get a lot of these:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
...
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
But I think thats just because of my local mysql settings, since I am using production pool size in settings
Related
I'm currently researching the resilience4j library and for some reason the following code doesn't work as expected:
#Test
public void testRateLimiterProjectReactor()
{
// The configuration below will allow 2 requests per second and a "timeout" of 2 seconds.
RateLimiterConfig config = RateLimiterConfig.custom()
.limitForPeriod(2)
.limitRefreshPeriod(Duration.ofSeconds(1))
.timeoutDuration(Duration.ofSeconds(2))
.build();
// Step 2.
// Create a RateLimiter and use it.
RateLimiterRegistry registry = RateLimiterRegistry.of(config);
RateLimiter rateLimiter = registry.rateLimiter("myReactorServiceNameLimiter");
// Step 3.
Flux<Integer> flux = Flux.from(Flux.range(0, 10))
.transformDeferred(RateLimiterOperator.of(rateLimiter))
.log()
;
StepVerifier.create(flux)
.expectNextCount(10)
.expectComplete()
.verify()
;
}
According to the official examples here and here this should be limiting the request() to 2 elements per second. However, the logs show it's fetching all of the elements immediately:
15:08:24.587 [main] DEBUG reactor.util.Loggers - Using Slf4j logging framework
15:08:24.619 [main] INFO reactor.Flux.Defer.1 - onSubscribe(RateLimiterSubscriber)
15:08:24.624 [main] INFO reactor.Flux.Defer.1 - request(unbounded)
15:08:24.626 [main] INFO reactor.Flux.Defer.1 - onNext(0)
15:08:24.626 [main] INFO reactor.Flux.Defer.1 - onNext(1)
15:08:24.626 [main] INFO reactor.Flux.Defer.1 - onNext(2)
15:08:24.626 [main] INFO reactor.Flux.Defer.1 - onNext(3)
15:08:24.626 [main] INFO reactor.Flux.Defer.1 - onNext(4)
15:08:24.626 [main] INFO reactor.Flux.Defer.1 - onNext(5)
15:08:24.626 [main] INFO reactor.Flux.Defer.1 - onNext(6)
15:08:24.626 [main] INFO reactor.Flux.Defer.1 - onNext(7)
15:08:24.626 [main] INFO reactor.Flux.Defer.1 - onNext(8)
15:08:24.626 [main] INFO reactor.Flux.Defer.1 - onNext(9)
15:08:24.626 [main] INFO reactor.Flux.Defer.1 - onComplete()
I don't see what's wrong?
As already answered in comments above RateLimiter tracks the number of subscriptions, not elements. To achieve rate limiting on elements you can use limitRate (and buffer + delayElements).
For example,
Flux.range(1, 100)
.delayElements(Duration.ofMillis(100)) // to imitate a publisher that produces elements at a certain rate
.log()
.limitRate(10) // used to requests up to 10 elements from the publisher
.buffer(10) // groups integers by 10 elements
.delayElements(Duration.ofSeconds(2)) // emits a group of ints every 2 sec
.subscribe(System.out::println);
This setup was already running and working fine. But something happened: maybe some package got updated, some file corrupted or a network change broke it.
The command bin/gerrit.sh start returns Starting Gerrit Code Review: FAILED.
logs/error_log:
[2018-11-28 11:49:01,135] [main] WARN com.google.gerrit.sshd.SshDaemon : Disabling cipher aes192-ctr: Unable to initialize cipher BaseCipher[AES,16,24,AES/CTR/NoPadding]
[2018-11-28 11:49:01,135] [main] WARN com.google.gerrit.sshd.SshDaemon : Disabling cipher aes256-ctr: Unable to initialize cipher BaseCipher[AES,16,32,AES/CTR/NoPadding]
[2018-11-28 11:49:01,138] [main] WARN com.google.gerrit.sshd.SshDaemon : Disabling cipher arcfour256: Illegal key size or default parameters; try installing unlimited cryptography extension
[2018-11-28 11:49:01,145] [main] WARN com.google.gerrit.sshd.SshDaemon : Disabling cipher aes192-cbc: Unable to initialize cipher BaseCipher[AES,16,24,AES/CBC/NoPadding]
[2018-11-28 11:49:01,145] [main] WARN com.google.gerrit.sshd.SshDaemon : Disabling cipher aes256-cbc: Unable to initialize cipher BaseCipher[AES,16,32,AES/CBC/NoPadding]
[2018-11-28 11:49:01,214] [main] WARN com.google.gerrit.sshd.SshDaemon : Cannot format SSHD host key [EdDSA]: invalid key type
[2018-11-28 11:49:01,227] [main] WARN com.google.gerrit.server.config.GitwebCgiConfig : gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
[2018-11-28 11:49:02,025] [main] INFO org.eclipse.jetty.util.log : Logging initialized #8689ms
[2018-11-28 11:49:02,102] [main] INFO com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 332m
[2018-11-28 11:49:02,121] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_hooks_181128_1116_5514078957117773811.jar
[2018-11-28 11:49:02,121] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_events-log_181128_1116_8975419966674917654.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_download-commands_181128_1116_7149912149640119287.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_replication_181128_1116_3000551844744811569.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_commit-message-length-validator_181128_1116_2800985912637941647.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_reviewnotes_181128_1116_1435979824854811361.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_singleusergroup_181128_1116_4944938881709642049.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loading plugins from /home/gerrit/gerrit_testsite/plugins
[2018-11-28 11:49:02,199] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin commit-message-length-validator, version v2.14.2
[2018-11-28 11:49:02,250] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin download-commands, version v2.14.2
[2018-11-28 11:49:02,484] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin events-log, version e271462
[2018-11-28 11:49:02,550] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin hooks, version v2.14.2
[2018-11-28 11:49:02,638] [main] WARN com.googlesource.gerrit.plugins.replication.ReplicationFileBasedConfig : Config file /home/gerrit/gerrit_testsite/etc/replication.config does not exist; not replicating
[2018-11-28 11:49:02,641] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin replication, version v2.14.2
[2018-11-28 11:49:02,697] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin reviewnotes, version v2.14.2
[2018-11-28 11:49:02,736] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin singleusergroup, version v2.14.2
[2018-11-28 11:49:02,975] [main] INFO com.google.gerrit.server.change.ChangeCleanupRunner : Ignoring missing changeCleanup schedule configuration
[2018-11-28 11:49:02,998] [main] INFO com.google.gerrit.sshd.SshDaemon : Started Gerrit SSHD-CORE-1.4.0 on *:29419
[2018-11-28 11:49:03,002] [main] INFO org.eclipse.jetty.server.Server : jetty-9.3.17.v20170317
[2018-11-28 11:49:03,787] [main] INFO org.eclipse.jetty.server.handler.ContextHandler : Started o.e.j.s.ServletContextHandler#384cd83a{/r,null,AVAILABLE}
[2018-11-28 11:49:43,834] [main] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemon
java.lang.IllegalStateException: Cannot start HTTP daemon
at com.google.gerrit.pgm.http.jetty.JettyServer$Lifecycle.start(JettyServer.java:106)
at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:92)
at com.google.gerrit.pgm.Daemon.start(Daemon.java:323)
at com.google.gerrit.pgm.Daemon.run(Daemon.java:232)
at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:204)
at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:108)
at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:63)
at Main.main(Main.java:24)
Caused by: java.net.SocketException: Unresolved address
at sun.nio.ch.Net.translateToSocketException(Net.java:131)
at sun.nio.ch.Net.translateException(Net.java:157)
at sun.nio.ch.Net.translateException(Net.java:163)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:76)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:317)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:401)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.google.gerrit.pgm.http.jetty.JettyServer$Lifecycle.start(JettyServer.java:92)
... 12 more
Caused by: java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Net.java:101)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:218)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
... 19 more
The configuration file is listed below, we use a LDAP server to authenticate:
[gerrit]
basePath = git
serverId = c3094920-33f3-4219-82cf-0181f4f0c7e7
canonicalWebUrl = http://oururl/r/
[database]
type = h2
database = /home/gerrit/gerrit_testsite/db/ReviewDB
[index]
type = LUCENE
[auth]
type = ldap
gitBasicAuthPolicy = LDAP
[ldap]
server = ldap://ldapserver
accountBase = OU=Usuários Rede,DC=company,DC=com,DC=br
groupBase = OU=Grupos,DC=company,DC=com,DC=br
referral = follow
accountPattern = (mailNickname=${username})
groupPattern = (memberOf=${cn})
accountFullName = cn
accountEmailAddress = mail
localUsernameToLowerCase = true
accountSshUserName = cn
username = ldapread#company.com.br
password = pass
[receive]
enableSignedPush = false
[sendemail]
smtpServer = mail.company.com.br
smtpServerPort = 587
smtpEncryption = tls
sslVerify = false
allowedDomain = company.com.br
smtpUser = gerrit#company.com.br
smtpPass = pass
[container]
user = gerrit
javaHome = /usr/lib/jvm/java-8-oracle/jre
[sshd]
listenAddress = *:29419
[httpd]
listenUrl = http://engenharia.company.com.br:8888/r/
[cache]
directory = cache
[download]
command = checkout
command = cherry_pick
command = format_patch
command = pull
scheme = ssh
[capability]
accessDatabase = group Administrators
[plugins]
allowRemoteAdmin = true
[plugin "events-log"]
storeUrl = jdbc:h2:/tmp/db
What can I do to debug the issue? (I haven't done the Gerrit setup and installation.)
It wasn't related to Gerrit.
A network change disabled Gerrit. After changing the DNS server and gateway of the Gerrit machine, everything is working again.
I have an inverse wish from most other posts regarding log4j2 logging of MyBatis. I am getting the MyBatis SQL logged, but I want to reduce it.
Below is my log4j2.properties file.
At present, I have the rootLogger.level=ALL in effect.
This is nicely displaying all log messages, including the MyBatis Prepare SQL and parameters list.
When I change it to
rootLogger.level=FATAL
all MyBatis messages stop appearing in console and log file, as do other messages.
So this is working well.
But I would like to have MyBatis logging at level=ERROR (or higher) for normal circumstances and the rest staying at ALL.
When I change the
# MyBatis logging configuration...
com.wert.bus.mappers=TRACE
to any other Level, it does not take effect.
I prefixed "log4j", "log4j2", "log4j.logger", "log4j2.logger" before "com.wert"
but it had no effect.
The mappers have namespace com.wert.bus.mappers
The output on the first session:
[DEBUG] 2018-07-21 01:56:35.648 [main] LogFactory - Logging initialized using 'class org.apache.ibatis.logging.log4j2.Log4j2Impl' adapter.
[DEBUG] 2018-07-21 01:56:43.201 [main] PooledDataSource - PooledDataSource forcefully closed/removed all connections.
[DEBUG] 2018-07-21 01:56:43.207 [main] PooledDataSource - PooledDataSource forcefully closed/removed all connections.
[DEBUG] 2018-07-21 01:56:43.213 [main] PooledDataSource - PooledDataSource forcefully closed/removed all connections.
[DEBUG] 2018-07-21 01:56:43.219 [main] PooledDataSource - PooledDataSource forcefully closed/removed all connections.
[DEBUG] 2018-07-21 01:56:43.225 [main] PooledDataSource - PooledDataSource forcefully closed/removed all connections.
[DEBUG] 2018-07-21 01:56:43.231 [main] PooledDataSource - PooledDataSource forcefully closed/removed all connections.
[DEBUG] 2018-07-21 01:56:43.237 [main] PooledDataSource - PooledDataSource forcefully closed/removed all connections.
The output on a query:
[DEBUG] 2018-07-21 02:00:10.047 [main] JdbcTransaction - Opening JDBC Connection
[DEBUG] 2018-07-21 02:00:19.739 [main] PooledDataSource - Created connection 105321150.
[DEBUG] 2018-07-21 02:00:19.823 [main] insertJobStatus - ==> Preparing: insert bus_loc ( loc_date, loc_name, status, start_time, end_time) values ( ?, ?, ?, ?, ?)
[DEBUG] 2018-07-21 02:00:24.512 [main] insertJobStatus - ==> Parameters: 2018-07-21 01:56:26.978(String), Boston(String), Prep(String), 2018-07-21 01:59:41(String), null
[DEBUG] 2018-07-21 02:00:25.034 [main] insertJobStatus - <== Updates: 1
What have I missed?
Thanks in advance for your help.
log4j2.properties
#status = trace for log4j2 startup issues
#status other values: trace, debug, info, warn, error, fatal
status = error
dest = err
#Time interval to check for changes to file in seconds
monitorInterval = 300
name=BusLoggingConfig
property.filename=logs
appenders=console,rolling
# MyBatis logging configuration...
com.wert.bus.mappers=TRACE
appender.console.type=Console
appender.console.name=STDOUT
appender.console.layout.type=PatternLayout
appender.console.layout.pattern=[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %m%n
#appender.console.layout.pattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
appender.rolling.type = RollingFile
appender.rolling.name = RollingFile
appender.rolling.fileName = ${filename}/Bus.log
appender.rolling.filePattern = logs/Bus-%d{yyyyMMdd-HHmmss}-%i.log
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern = [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %m%n
appender.rolling.policies.type = Policies
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.rolling.policies.time.interval = 1
appender.rolling.policies.time.modulate = true
appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
appender.rolling.policies.size.size=10MB
appender.rolling.strategy.type = DefaultRolloverStrategy
appender.rolling.strategy.max = 20
loggers=rolling
logger.rolling.name=com.wert.bus
#logger.rolling.level=debug
logger.rolling.additivity=true
logger.rolling.appenderRef.rolling.ref=RollingFile
rootLogger.level=ALL
rootLogger.appenderRefs=stdout
rootLogger.appenderRef.stdout.ref=STDOUT
One of the problems is using additivity for child logger:
logger.rolling.additivity=true
This settings means that every logging event will be processed twice. First time using appenders and levels for logger com.wert.bus and then by parent (in your case root) logger.
I have an ontology that imports another ontology (both are stored in the same folder on my machine, created using Protege & saved as RDF/XML). When I create the ontology model in my java application through Jena, I get the following
0 [main] DEBUG org.apache.jena.riot.system.stream.JenaIOEnvironment - Failed to find configuration: location-mapping.ttl;location-mapping.rdf;location-mapping.n3;etc/location-mapping.rdf;etc/location-mapping.n3;etc/location-mapping.ttl
297 [main] DEBUG com.hp.hpl.jena.util.FileManager - Add location: LocatorFile
300 [main] DEBUG com.hp.hpl.jena.util.FileManager - Add location: ClassLoaderLocator
301 [main] DEBUG com.hp.hpl.jena.util.LocationMapper - Failed to find configuration: file:location-mapping.rdf;file:location-mapping.n3;file:location-mapping.ttl;file:etc/location-mapping.rdf;file:etc/location-mapping.n3;file:etc/location-mapping.ttl
301 [main] DEBUG com.hp.hpl.jena.util.FileManager - Add location: LocatorFile
301 [main] DEBUG com.hp.hpl.jena.util.FileManager - Add location: LocatorURL
301 [main] DEBUG com.hp.hpl.jena.util.FileManager - Add location: ClassLoaderLocator
301 [main] DEBUG com.hp.hpl.jena.util.FileManager - Add location: LocatorFile
301 [main] DEBUG com.hp.hpl.jena.util.FileManager - Add location: LocatorURL
301 [main] DEBUG com.hp.hpl.jena.util.FileManager - Add location: ClassLoaderLocator
301 [main] DEBUG com.hp.hpl.jena.util.FileManager - Found: file:ont-policy.rdf (ClassLoaderLocator)
1002 [main] DEBUG com.hp.hpl.jena.util.FileManager - readModel(model,http://www.semanticweb.org/myOnt)
1002 [main] DEBUG com.hp.hpl.jena.util.FileManager - readModel(model,http://www.semanticweb.org/myOnt, null)
1002 [main] DEBUG com.hp.hpl.jena.util.FileManager - Not mapped: http://www.semanticweb.org/myOnt
2065 [main] WARN com.hp.hpl.jena.ontology.OntDocumentManager - An error occurred while attempting to read from http://www.semanticweb.org/myOnt. Msg was 'http://www.semanticweb.org/myOnt'.
This exception is also thrown
com.hp.hpl.jena.shared.DoesNotExistException
I understand that it is unable to find the imported ontology, and that one solution might be to create separate models for both ontologies, but there's an objective property in parent ontology which relates one of its class to the classes of imported ontology.
What can I do?
I am using Neo4j 2.3.0-M03 community version. I have created a database using neo4j import tool. Now when I am going to start the neo4j server, its failing. Any advice? Thanks in advance!
Starting Neo4j Server...WARNING: not changing user
process [21597]... waiting for server to be ready......... Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.
The log is as follows:
2015-10-14 14:55:35.438-0400 INFO No SSL certificate found, generating a self-signed certificate..
14:55:35.936 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
14:55:36.105 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
14:55:36.106 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
14:55:36.107 [main] DEBUG i.n.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
14:55:36.107 [main] DEBUG i.n.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: true
14:55:36.108 [main] DEBUG i.n.util.internal.PlatformDependent - Java version: 7
14:55:36.108 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noUnsafe: false
14:55:36.109 [main] DEBUG i.n.util.internal.PlatformDependent - sun.misc.Unsafe: available
14:55:36.109 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noJavassist: false
14:55:36.110 [main] DEBUG i.n.util.internal.PlatformDependent - Javassist: unavailable
14:55:36.110 [main] DEBUG i.n.util.internal.PlatformDependent - You don't have Javassist in your class path or you don't have enough permission to load dynamically generated classes. Please check the configuration for better performance.
14:55:36.110 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.tmpdir: /tmp (java.io.tmpdir)
14:55:36.110 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
14:55:36.110 [main] DEBUG i.n.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
14:55:36.119 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetectionLevel: simple
14:55:36.135 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: unpooled
14:55:36.135 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 65536
2015-10-14 14:55:41.341-0400 INFO Successfully started database
2015-10-14 14:55:41.405-0400 INFO Starting HTTP on port 7474 (32 threads available)
2015-10-14 14:55:41.659-0400 INFO Successfully shutdown Neo4j Server
2015-10-14 14:55:42.224-0400 INFO Successfully stopped database
2015-10-14 14:55:42.227-0400 ERROR Failed to start Neo4j: Starting Neo4j failed: tried to access field org.neo4j.server.rest.repr.RepresentationFormat.mediaType from class org.neo4j.server.rest.repr.RepresentationFormatRepository Starting Neo4j failed: tried to access field org.neo4j.server.rest.repr.RepresentationFormat.mediaType from class org.neo4j.server.rest.repr.RepresentationFormatRepository
org.neo4j.server.ServerStartupException: Starting Neo4j failed: tried to access field org.neo4j.server.rest.repr.RepresentationFormat.mediaType from class org.neo4j.server.rest.repr.RepresentationFormatRepository
at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:67)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:234)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:96)
at org.neo4j.server.CommunityBootstrapper.start(CommunityBootstrapper.java:48)
at org.neo4j.server.CommunityBootstrapper.main(CommunityBootstrapper.java:35)
Caused by: java.lang.IllegalAccessError: tried to access field org.neo4j.server.rest.repr.RepresentationFormat.mediaType from class org.neo4j.server.rest.repr.RepresentationFormatRepository
at org.neo4j.server.rest.repr.RepresentationFormatRepository.<init>(RepresentationFormatRepository.java:46)
at org.neo4j.server.AbstractNeoServer.createDefaultInjectables(AbstractNeoServer.java:641)
at org.neo4j.server.AbstractNeoServer.configureWebServer(AbstractNeoServer.java:360)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:216)
... 3 more
Seems like some permission issue on the lib folder of the Neo4j installation directory.
Try to give full permission to the neo4j installation folder.
Would also suggest to use stable version and not the milestone version.
I could fix it. There was some problem with my embedded database. I tried to run the server with its default graph.db and it run successfully. Now I have to identify what's wrong with the embedded database with I created using import tool.