You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Russell Bateman <ru...@windofkeltia.com> on 2017/08/18 23:49:09 UTC
ExceptionInInitializerError encountered during startup
Cassandra version 3.9, -unit version 3.1.3.2.
In my (first ever) unit test, I've coded:
@BeforeClass public static void initFakeCassandra() throws
InterruptedException, IOException, TTransportException
{
EmbeddedCassandraServerHelper.startEmbeddedCassandra( 20000L );
}
Execution crashes down inside at
at org.apache.cassandra.transport.Server.start(Server.java:128)
at java.util.Collections$SingletonSet.forEach(Collections.java:4767)
at
org.apache.cassandra.service.NativeTransportService.start(NativeTransportService.java:128)
at
org.apache.cassandra.service.CassandraDaemon.startNativeTransport(CassandraDaemon.java:649)
at
org.apache.cassandra.service.CassandraDaemon.start(CassandraDaemon.java:511)
at
org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:616)
at
org.cassandraunit.utils.EmbeddedCassandraServerHelper$1.run(EmbeddedCassandraServerHelper.java:129)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: name
at
io.netty.util.internal.logging.AbstractInternalLogger.<init>(AbstractInternalLogger.java:39)
at
io.netty.util.internal.logging.Slf4JLogger.<init>(Slf4JLogger.java:30)
at
io.netty.util.internal.logging.Slf4JLoggerFactory.newInstance(Slf4JLoggerFactory.java:73)
at
io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:84)
at
io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:77)
at io.netty.bootstrap.ServerBootstrap.<clinit>(ServerBootstrap.java:46)
... 10 more
I am following the tutorial at Baeldung. Not sure where to go from here.
Stackoverflow response
<https://stackoverflow.com/questions/33514745/cassandra-startup-failed-with-exception-exception-encountered-during-startup>
was not helpful to me, I probably don't know enough yet.
Thanks.
Re: ExceptionInInitializerError encountered during startup
Posted by Russell Bateman <ru...@windofkeltia.com>.
Reporting back...
I gave up and did this work in a stand-alone project where
/EmbeddedCass//andraServ//erHelper.startEmbeddedCassandra()/ works fine.
I think now that Cassandra's dependency upon /slf4j/ clashes with what
we've had to do in our greater product to regulate which version of
/slf4j/ is included by the myriad, disparate components (see error log
in original post). Maybe what we're doing, mostly, requiring 1.7.25 and
excluding (via Maven) any linked-in /slf4j/ from any of many components,
is getting us into trouble with Cassandra. You can't mix and match
/slf4j/ versions. There has been lots of hair-pulling over /slf4j/ as it
is and this is not a welcome development.
Thanks.
On 08/22/2017 12:34 PM, Russell Bateman wrote:
>
> Thanks, Myrle. This confirms what I've tried so far. The problem may
> be an assumed requirement, such as the YAML file and perhaps
> /log4j-embedded-cassandra.properties/. But, I'm supplying both of
> those. This has something to do with /slf4j/ logging, a logger that
> has no name when it goes to get it. It's unclear how it was supposed
> to get a name.
>
>
> On 08/22/2017 08:48 AM, Myrle Krantz wrote:
>> On Tue, Aug 22, 2017 at 4:21 PM, Russell Bateman<ru...@windofkeltia.com> wrote:
>>> As this was my first post to this forum, I wonder if someone would reply to
>>> it if only to prove to myself that I've not posted to /dev/null as it were
>>> even if there's no answer or the question is stupid, etc. (Note: I am
>>> getting other forum posts, but maybe what I've posted didn't reach the
>>> forum?)
>>>
>>> Profuse thanks,
>>>
>>> Russ
>> This will be my second post to this forum : o). We're using embedded
>> Cassandra in our component tests as a junit ExternalResource, together
>> with datastax. Here's some of what our start code looks like:
>> The original code can be found here:
>> https://github.com/mifosio/test/blob/develop/src/main/java/io/mifos/core/test/fixture/cassandra/CassandraInitializer.java
>>
>> An example yaml file with the properties requested here can be found:
>> https://github.com/mifosio/portfolio/blob/develop/service/src/main/resources/application.yml
>>
>> I use this hundreds of times a day and it works, but because our use
>> case is kind of special (multi-tenancy via keyspaces and multiple data
>> stores initialized as TestRules), you may have to noodle through what
>> we've done a bit to get your stuff working.
>>
>> Greets,
>> Myrle
>>
>> public final class CassandraInitializer {
>> public void initialize() throws Exception {
>>
>> Builder clusterBuilder = (new
>> Builder()).withClusterName(System.getProperty("cassandra.clusterName"));
>> ContactPointUtils.process(clusterBuilder,
>> System.getProperty("cassandra.contactPoints"));
>> this.cluster = clusterBuilder.build();
>>
>> this.setup();
>> }
>>
>>
>> private void setup() throws Exception {
>> if (!this.useExistingDB) {
>> this.startEmbeddedCassandra();
>> this.createKeyspaceSeshat();
>> }
>>
>> }
>>
>>
>> private void startEmbeddedCassandra() throws Exception {
>> EmbeddedCassandraServerHelper.startEmbeddedCassandra(TimeUnit.SECONDS.toMillis(30L));
>> }
>> }
>>
>>
>>> On 08/18/2017 05:49 PM, Russell Bateman wrote:
>>>
>>> Cassandra version 3.9, -unit version 3.1.3.2.
>>>
>>> In my (first ever) unit test, I've coded:
>>>
>>> @BeforeClass public static void initFakeCassandra() throws
>>> InterruptedException, IOException, TTransportException
>>> {
>>> EmbeddedCassandraServerHelper.startEmbeddedCassandra( 20000L );
>>> }
>>>
>>> Execution crashes down inside at
>>>
>>> at org.apache.cassandra.transport.Server.start(Server.java:128)
>>> at java.util.Collections$SingletonSet.forEach(Collections.java:4767)
>>> at
>>> org.apache.cassandra.service.NativeTransportService.start(NativeTransportService.java:128)
>>> at
>>> org.apache.cassandra.service.CassandraDaemon.startNativeTransport(CassandraDaemon.java:649)
>>> at
>>> org.apache.cassandra.service.CassandraDaemon.start(CassandraDaemon.java:511)
>>> at
>>> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:616)
>>> at
>>> org.cassandraunit.utils.EmbeddedCassandraServerHelper$1.run(EmbeddedCassandraServerHelper.java:129)
>>> at
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>> at java.lang.Thread.run(Thread.java:745)
>>> Caused by: java.lang.NullPointerException: name
>>> at
>>> io.netty.util.internal.logging.AbstractInternalLogger.<init>(AbstractInternalLogger.java:39)
>>> at
>>> io.netty.util.internal.logging.Slf4JLogger.<init>(Slf4JLogger.java:30)
>>> at
>>> io.netty.util.internal.logging.Slf4JLoggerFactory.newInstance(Slf4JLoggerFactory.java:73)
>>> at
>>> io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:84)
>>> at
>>> io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:77)
>>> at io.netty.bootstrap.ServerBootstrap.<clinit>(ServerBootstrap.java:46)
>>> ... 10 more
>>>
>>> I am following the tutorial at Baeldung. Not sure where to go from here.
>>> Stackoverflow response was not helpful to me, I probably don't know enough
>>> yet.
>>>
>>> Thanks.
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:user-unsubscribe@cassandra.apache.org
>> For additional commands, e-mail:user-help@cassandra.apache.org
>>
>
Re: ExceptionInInitializerError encountered during startup
Posted by Russell Bateman <ru...@windofkeltia.com>.
Thanks, Myrle. This confirms what I've tried so far. The problem may be
an assumed requirement, such as the YAML file and perhaps
/log4j-embedded-cassandra.properties/. But, I'm supplying both of those.
This has something to do with /slf4j/ logging, a logger that has no name
when it goes to get it. It's unclear how it was supposed to get a name.
On 08/22/2017 08:48 AM, Myrle Krantz wrote:
> On Tue, Aug 22, 2017 at 4:21 PM, Russell Bateman <ru...@windofkeltia.com> wrote:
>> As this was my first post to this forum, I wonder if someone would reply to
>> it if only to prove to myself that I've not posted to /dev/null as it were
>> even if there's no answer or the question is stupid, etc. (Note: I am
>> getting other forum posts, but maybe what I've posted didn't reach the
>> forum?)
>>
>> Profuse thanks,
>>
>> Russ
> This will be my second post to this forum : o). We're using embedded
> Cassandra in our component tests as a junit ExternalResource, together
> with datastax. Here's some of what our start code looks like:
> The original code can be found here:
> https://github.com/mifosio/test/blob/develop/src/main/java/io/mifos/core/test/fixture/cassandra/CassandraInitializer.java
>
> An example yaml file with the properties requested here can be found:
> https://github.com/mifosio/portfolio/blob/develop/service/src/main/resources/application.yml
>
> I use this hundreds of times a day and it works, but because our use
> case is kind of special (multi-tenancy via keyspaces and multiple data
> stores initialized as TestRules), you may have to noodle through what
> we've done a bit to get your stuff working.
>
> Greets,
> Myrle
>
> public final class CassandraInitializer {
> public void initialize() throws Exception {
>
> Builder clusterBuilder = (new
> Builder()).withClusterName(System.getProperty("cassandra.clusterName"));
> ContactPointUtils.process(clusterBuilder,
> System.getProperty("cassandra.contactPoints"));
> this.cluster = clusterBuilder.build();
>
> this.setup();
> }
>
>
> private void setup() throws Exception {
> if (!this.useExistingDB) {
> this.startEmbeddedCassandra();
> this.createKeyspaceSeshat();
> }
>
> }
>
>
> private void startEmbeddedCassandra() throws Exception {
> EmbeddedCassandraServerHelper.startEmbeddedCassandra(TimeUnit.SECONDS.toMillis(30L));
> }
> }
>
>
>> On 08/18/2017 05:49 PM, Russell Bateman wrote:
>>
>> Cassandra version 3.9, -unit version 3.1.3.2.
>>
>> In my (first ever) unit test, I've coded:
>>
>> @BeforeClass public static void initFakeCassandra() throws
>> InterruptedException, IOException, TTransportException
>> {
>> EmbeddedCassandraServerHelper.startEmbeddedCassandra( 20000L );
>> }
>>
>> Execution crashes down inside at
>>
>> at org.apache.cassandra.transport.Server.start(Server.java:128)
>> at java.util.Collections$SingletonSet.forEach(Collections.java:4767)
>> at
>> org.apache.cassandra.service.NativeTransportService.start(NativeTransportService.java:128)
>> at
>> org.apache.cassandra.service.CassandraDaemon.startNativeTransport(CassandraDaemon.java:649)
>> at
>> org.apache.cassandra.service.CassandraDaemon.start(CassandraDaemon.java:511)
>> at
>> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:616)
>> at
>> org.cassandraunit.utils.EmbeddedCassandraServerHelper$1.run(EmbeddedCassandraServerHelper.java:129)
>> at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>> at java.lang.Thread.run(Thread.java:745)
>> Caused by: java.lang.NullPointerException: name
>> at
>> io.netty.util.internal.logging.AbstractInternalLogger.<init>(AbstractInternalLogger.java:39)
>> at
>> io.netty.util.internal.logging.Slf4JLogger.<init>(Slf4JLogger.java:30)
>> at
>> io.netty.util.internal.logging.Slf4JLoggerFactory.newInstance(Slf4JLoggerFactory.java:73)
>> at
>> io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:84)
>> at
>> io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:77)
>> at io.netty.bootstrap.ServerBootstrap.<clinit>(ServerBootstrap.java:46)
>> ... 10 more
>>
>> I am following the tutorial at Baeldung. Not sure where to go from here.
>> Stackoverflow response was not helpful to me, I probably don't know enough
>> yet.
>>
>> Thanks.
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: user-help@cassandra.apache.org
>
Re: ExceptionInInitializerError encountered during startup
Posted by Myrle Krantz <my...@apache.org>.
On Tue, Aug 22, 2017 at 4:21 PM, Russell Bateman <ru...@windofkeltia.com> wrote:
> As this was my first post to this forum, I wonder if someone would reply to
> it if only to prove to myself that I've not posted to /dev/null as it were
> even if there's no answer or the question is stupid, etc. (Note: I am
> getting other forum posts, but maybe what I've posted didn't reach the
> forum?)
>
> Profuse thanks,
>
> Russ
This will be my second post to this forum : o). We're using embedded
Cassandra in our component tests as a junit ExternalResource, together
with datastax. Here's some of what our start code looks like:
The original code can be found here:
https://github.com/mifosio/test/blob/develop/src/main/java/io/mifos/core/test/fixture/cassandra/CassandraInitializer.java
An example yaml file with the properties requested here can be found:
https://github.com/mifosio/portfolio/blob/develop/service/src/main/resources/application.yml
I use this hundreds of times a day and it works, but because our use
case is kind of special (multi-tenancy via keyspaces and multiple data
stores initialized as TestRules), you may have to noodle through what
we've done a bit to get your stuff working.
Greets,
Myrle
public final class CassandraInitializer {
public void initialize() throws Exception {
Builder clusterBuilder = (new
Builder()).withClusterName(System.getProperty("cassandra.clusterName"));
ContactPointUtils.process(clusterBuilder,
System.getProperty("cassandra.contactPoints"));
this.cluster = clusterBuilder.build();
this.setup();
}
private void setup() throws Exception {
if (!this.useExistingDB) {
this.startEmbeddedCassandra();
this.createKeyspaceSeshat();
}
}
private void startEmbeddedCassandra() throws Exception {
EmbeddedCassandraServerHelper.startEmbeddedCassandra(TimeUnit.SECONDS.toMillis(30L));
}
}
> On 08/18/2017 05:49 PM, Russell Bateman wrote:
>
> Cassandra version 3.9, -unit version 3.1.3.2.
>
> In my (first ever) unit test, I've coded:
>
> @BeforeClass public static void initFakeCassandra() throws
> InterruptedException, IOException, TTransportException
> {
> EmbeddedCassandraServerHelper.startEmbeddedCassandra( 20000L );
> }
>
> Execution crashes down inside at
>
> at org.apache.cassandra.transport.Server.start(Server.java:128)
> at java.util.Collections$SingletonSet.forEach(Collections.java:4767)
> at
> org.apache.cassandra.service.NativeTransportService.start(NativeTransportService.java:128)
> at
> org.apache.cassandra.service.CassandraDaemon.startNativeTransport(CassandraDaemon.java:649)
> at
> org.apache.cassandra.service.CassandraDaemon.start(CassandraDaemon.java:511)
> at
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:616)
> at
> org.cassandraunit.utils.EmbeddedCassandraServerHelper$1.run(EmbeddedCassandraServerHelper.java:129)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException: name
> at
> io.netty.util.internal.logging.AbstractInternalLogger.<init>(AbstractInternalLogger.java:39)
> at
> io.netty.util.internal.logging.Slf4JLogger.<init>(Slf4JLogger.java:30)
> at
> io.netty.util.internal.logging.Slf4JLoggerFactory.newInstance(Slf4JLoggerFactory.java:73)
> at
> io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:84)
> at
> io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:77)
> at io.netty.bootstrap.ServerBootstrap.<clinit>(ServerBootstrap.java:46)
> ... 10 more
>
> I am following the tutorial at Baeldung. Not sure where to go from here.
> Stackoverflow response was not helpful to me, I probably don't know enough
> yet.
>
> Thanks.
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org
Re: ExceptionInInitializerError encountered during startup
Posted by Russell Bateman <ru...@windofkeltia.com>.
As this was my first post to this forum, I wonder if someone would reply
to it if only to prove to myself that I've not posted to //dev/null/ as
it were even if there's no answer or the question is stupid, etc. (Note:
I am getting other forum posts, but maybe what I've posted didn't reach
the forum?)
Profuse thanks,
Russ
On 08/18/2017 05:49 PM, Russell Bateman wrote:
>
> Cassandra version 3.9, -unit version 3.1.3.2.
>
> In my (first ever) unit test, I've coded:
>
> @BeforeClass public static void initFakeCassandra() throws
> InterruptedException, IOException, TTransportException
> {
> EmbeddedCassandraServerHelper.startEmbeddedCassandra( 20000L );
> }
>
> Execution crashes down inside at
>
> at org.apache.cassandra.transport.Server.start(Server.java:128)
> at java.util.Collections$SingletonSet.forEach(Collections.java:4767)
> at
> org.apache.cassandra.service.NativeTransportService.start(NativeTransportService.java:128)
> at
> org.apache.cassandra.service.CassandraDaemon.startNativeTransport(CassandraDaemon.java:649)
> at
> org.apache.cassandra.service.CassandraDaemon.start(CassandraDaemon.java:511)
> at
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:616)
> at
> org.cassandraunit.utils.EmbeddedCassandraServerHelper$1.run(EmbeddedCassandraServerHelper.java:129)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException: name
> at
> io.netty.util.internal.logging.AbstractInternalLogger.<init>(AbstractInternalLogger.java:39)
> at
> io.netty.util.internal.logging.Slf4JLogger.<init>(Slf4JLogger.java:30)
> at
> io.netty.util.internal.logging.Slf4JLoggerFactory.newInstance(Slf4JLoggerFactory.java:73)
> at
> io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:84)
> at
> io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:77)
> at
> io.netty.bootstrap.ServerBootstrap.<clinit>(ServerBootstrap.java:46)
> ... 10 more
>
> I am following the tutorial at Baeldung. Not sure where to go from
> here. Stackoverflow response
> <https://stackoverflow.com/questions/33514745/cassandra-startup-failed-with-exception-exception-encountered-during-startup>
> was not helpful to me, I probably don't know enough yet.
>
> Thanks.
>