ServiceLoader didn't find any services registered under com.hazelcast.instance.NodeExtension

170 views
Skip to first unread message

anil kumar

unread,
Jan 4, 2021, 7:58:25 AM1/4/21
to Hazelcast
Hi,

Getting the below exception, while trying to create HazelcastInstance. 
Hazelcast version being used is 3.12.10.
Didn't get this issue while we were using 4.1
Any inputs in resolving this issue?

Caused by: com.hazelcast.core.HazelcastException: ServiceLoader didn't find any services registered under com.hazelcast.instance.NodeExtension
at com.hazelcast.instance.NodeExtensionFactory.create(NodeExtensionFactory.java:86) ~[hazelcast-enterprise-all-3.12.10.jar:?]
at com.hazelcast.instance.DefaultNodeContext.createNodeExtension(DefaultNodeContext.java:59) ~[hazelcast-enterprise-all-3.12.10.jar:?]
at com.hazelcast.instance.Node.<init>(Node.java:225) ~[hazelcast-enterprise-all-3.12.10.jar:?]
at com.hazelcast.instance.HazelcastInstanceImpl.createNode(HazelcastInstanceImpl.java:161) ~[hazelcast-enterprise-all-3.12.10.jar:?]
at com.hazelcast.instance.HazelcastInstanceImpl.<init>(HazelcastInstanceImpl.java:131) ~[hazelcast-enterprise-all-3.12.10.jar:?]
at com.hazelcast.instance.HazelcastInstanceFactory.constructHazelcastInstance(HazelcastInstanceFactory.java:203) ~[hazelcast-enterprise-all-3.12.10.jar:?]
at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:182) ~[hazelcast-enterprise-all-3.12.10.jar:?]
at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:132) ~[hazelcast-enterprise-all-3.12.10.jar:?]
at com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:57) ~[hazelcast-enterprise-all-3.12.10.jar:?]

Thanks,
Anil

anil kumar

unread,
Jan 6, 2021, 8:05:06 AM1/6/21
to Hazelcast
We have tried to debug this further, and please find our analysis below
  • we have hazelcast-enterprise-all jar imported into the database and all classes are loaded from database.  
  • Noticed that In hazelcast 'ServiceLoader' class, for loading the class 'com.hazelcast.instance.NodeExtension',  URLDefinition is being created from the custom classloader(given in our configuration while creating hazelcastInstance)
  • The url being created is of the form 'myjdbc://839304950:0/hazelcast-enterprise-all-3.12.10.jar!/META-INF/services/com.hazelcast.instance.NodeExtension'
  • In 3.12.10 version, ServiceLoader class is getting URL from classloader and converting it to URI(in collectFactoryUrls method) and storing it in ServiceLoader.URLDefinition as URI.
  • parse() method is trying to convert URI to URL(urlDefinition.uri.toURL()), but is failing with MalformedURLException(unknown protocol: myjdbc) while parsing the factory url 'myjdbc://839304950:0/hazelcast-enterprise-all-3.12.10.jar!/META-INF/services/com.hazelcast.instance.NodeExtension'
  • But the same is working fine in 4.1 as ServiceLoader.URLDefinition class has both URL and URI fields and hence conversion is not needed. It is loading the class successfully.  
Is this an issue in 3.12.10 ?
Can you let us know if there is a possible workaround to get past this issue?

Thanks,
Anil

Jaromir Hamala

unread,
Jan 6, 2021, 8:08:48 AM1/6/21
to Hazelcast
Hello Anil,

can share some details about your environment? Ideally a reproducer. If you cannot share this then just a simple description of your environment (application server? how is Hazelcast deployed?) will help.

Cheers,
Jaromir

anil kumar

unread,
Jan 6, 2021, 8:49:03 AM1/6/21
to Hazelcast
Hi Jaromir,

Thanks for the prompt response.

Application Server : tomcat
Hazelcast deployment mode : Embedded
For our framework to work, we load all the external and internal classes(jars) to the database and our classloader fetches them from the database.

Let us know if any other info is required.

Jaromir Hamala

unread,
Jan 6, 2021, 8:54:12 AM1/6/21
to Hazelcast
Do you have a custom classloader to load classes stored in a database? Or do you use an open source library for this?

Cheers,
Jaromir

anil kumar

unread,
Jan 6, 2021, 8:56:12 AM1/6/21
to Hazelcast
It is a custom classloader.

Thanks,
Anil

Jaromir Hamala

unread,
Jan 6, 2021, 8:57:48 AM1/6/21
to haze...@googlegroups.com
and I am assuming hazelcast.jar is stored in the DB too, is that right?

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/e1bbea0f-498f-4560-abc2-813cc661d65an%40googlegroups.com.

This message contains confidential information and is intended only for the individuals named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version. -Hazelcast

anil kumar

unread,
Jan 6, 2021, 8:58:37 AM1/6/21
to Hazelcast
Yes

Jaromir Hamala

unread,
Jan 6, 2021, 9:03:48 AM1/6/21
to haze...@googlegroups.com
and document your environment. I believe we should be able to backport the change from 4.x.

Cheers,
Jaromir


anil kumar

unread,
Jan 6, 2021, 9:12:32 AM1/6/21
to Hazelcast
I will create an issue.
Any ETA for the fix to be available in 3.12.x version?
Or is there any workaround that we can leverage to get past the issue for now?

Thanks,
Anil

Jaromir Hamala

unread,
Jan 6, 2021, 10:52:11 AM1/6/21
to Hazelcast
No ETA unfortunately. It has to be analyzed from a risk perspective - any regression in a patch release is costly.
The only workaround I can think of is to load Hazelcast by using a regular classloader. Or perhaps you could try to register a dummy URL handler for "myjdbc". That could possibly prevent the MalformedURLException(unknown protocol: myjdbc) exception.

Cheers,
Jaromir

anil kumar

unread,
Jan 20, 2021, 12:28:23 PM1/20/21
to Hazelcast
hi Jaromir,

Can you provide more details regarding the workaround 'register a dummy URL handle for myjdbc' ?

Thanks,
Anil

Reply all
Reply to author
Forward
0 new messages